org.osm2world.core.target.jogl
public abstract class AbstractPrimitiveShader extends AbstractShader
JOGLRendererVBOShader
.Modifier and Type | Field and Description |
---|---|
protected boolean |
renderOnlySemiTransparent
Render only objects that are semi transparent (see
Material.Transparency.TRUE ) |
protected boolean |
renderSemiTransparent
Render objects that are semi transparent (see
Material.Transparency.TRUE ) |
fragmentShader, gl, shaderProgram, vertexShader
Constructor and Description |
---|
AbstractPrimitiveShader(GL3 gl,
String name) |
Modifier and Type | Method and Description |
---|---|
abstract int |
getVertexBumpMapCoordID()
Returns the id to use by
JOGLRendererVBOShader to bind the vertex bumpmap coordinate attribute. |
abstract int |
getVertexNormalID()
Returns the id to use by
JOGLRendererVBOShader to bind the vertex normal attribute. |
abstract int |
getVertexPositionID()
Returns the id to use by
JOGLRendererVBOShader to bind the vertex position attribute. |
abstract int |
getVertexTangentID()
Returns the id to use by
JOGLRendererVBOShader to bind the vertex tangent attribute. |
abstract int |
getVertexTexCoordID(int i)
Returns the id to use by
JOGLRendererVBOShader to bind the vertex texture coordinate attribute. |
void |
glDisableVertexAttribArray(int index)
Disable a vertex attribute.
|
void |
glEnableVertexAttribArray(int index)
Enable a vertex attribute.
|
void |
glVertexAttribPointer(int index,
int size,
int type,
boolean normalized,
int stride,
long offset)
Setup the vertex attribute pointer.
|
boolean |
setMaterial(Material material,
JOGLTextureManager textureManager)
Prepare the shader to use the given material when rendering the primitives later.
|
void |
setRenderOnlySemiTransparent(boolean renderOnlySemiTransparent)
|
void |
setRenderSemiTransparent(boolean renderSemiTransparent)
|
disableShader, finalize, freeResources, getProgram, loadDefaults, useShader, validateShader
protected boolean renderSemiTransparent
Material.Transparency.TRUE
)protected boolean renderOnlySemiTransparent
Material.Transparency.TRUE
)public boolean setMaterial(Material material, JOGLTextureManager textureManager)
material
- the material to applytextureManager
- the texture manager to use if the material has texturestrue
if this shader wants to render primitives with the given material at all, false
otherwise.public void setRenderSemiTransparent(boolean renderSemiTransparent)
public void setRenderOnlySemiTransparent(boolean renderOnlySemiTransparent)
public abstract int getVertexPositionID()
JOGLRendererVBOShader
to bind the vertex position attribute.
May be -1 if the attribute is unused.public abstract int getVertexNormalID()
JOGLRendererVBOShader
to bind the vertex normal attribute.
May be -1 if the attribute is unused.public abstract int getVertexTexCoordID(int i)
JOGLRendererVBOShader
to bind the vertex texture coordinate attribute.
May be -1 if the attribute is unused.public abstract int getVertexBumpMapCoordID()
JOGLRendererVBOShader
to bind the vertex bumpmap coordinate attribute.
May be -1 if the attribute is unused.public abstract int getVertexTangentID()
JOGLRendererVBOShader
to bind the vertex tangent attribute.
May be -1 if the attribute is unused.public void glEnableVertexAttribArray(int index)
index
- the index of the attribute. Can safely be -1public void glDisableVertexAttribArray(int index)
index
- the index of the attribute. Can safely be -1public void glVertexAttribPointer(int index, int size, int type, boolean normalized, int stride, long offset)