Package de.coreengine.rendering.programs
Class TerrainShader
- java.lang.Object
-
- de.coreengine.rendering.programs.Shader
-
- de.coreengine.rendering.programs.TerrainShader
-
public class TerrainShader extends Shader
Class that represent a shader programm for the terrain shader pipeline- Author:
- Darius Dinger
-
-
Field Summary
-
Fields inherited from class de.coreengine.rendering.programs.Shader
SHADERS_LOCATION
-
-
Constructor Summary
Constructors Constructor Description TerrainShader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddShaders()Adding shaders to programprotected voidbindAttribs()Binding all vbo attributes to shader attribute ("in" variable)protected voidloadUniforms()Loading uniform locationsvoidsetCameraPosition(javax.vecmath.Vector3f camPos)Setting camera position used for tesselationvoidsetChunkData(javax.vecmath.Vector2f offset, float size)Loading the position/offset and size of the next chunk into the shadervoidsetClipPlane(float x, float y, float z, float w)Setting clip plane for next terrainvoidsetTerrainConfig(TerrainConfig config)Loading a whole terrain configuration into the shadervoidsetTerrainTransform(javax.vecmath.Matrix4f transMat)Loading the transformation matrix of the terrain into the shadervoidsetViewProjectionMatrix(javax.vecmath.Matrix4f vpMat)Setting view projection matrix to use-
Methods inherited from class de.coreengine.rendering.programs.Shader
addShader, bindAttribute, bindTexture, bindTextureUnit, getUniformLocation, setUniform, setUniform, setUniform, setUniform, setUniform, setUniform, setUniform, setUniform, setUniformArray1f, setUniformArray1i, setUniformArray2f, setUniformArray3f, start, stop
-
-
-
-
Method Detail
-
addShaders
protected void addShaders()
Description copied from class:ShaderAdding shaders to program- Specified by:
addShadersin classShader
-
bindAttribs
protected void bindAttribs()
Description copied from class:ShaderBinding all vbo attributes to shader attribute ("in" variable)- Specified by:
bindAttribsin classShader
-
loadUniforms
protected void loadUniforms()
Description copied from class:ShaderLoading uniform locations- Specified by:
loadUniformsin classShader
-
setTerrainConfig
public void setTerrainConfig(TerrainConfig config)
Loading a whole terrain configuration into the shader- Parameters:
config- Config for the next terrain
-
setClipPlane
public void setClipPlane(float x, float y, float z, float w)Setting clip plane for next terrain- Parameters:
x- X value of the plane normaly- Y value of the plane normalz- Z value of the plane normalw- Distance of the plane normal
-
setTerrainTransform
public void setTerrainTransform(javax.vecmath.Matrix4f transMat)
Loading the transformation matrix of the terrain into the shader- Parameters:
transMat- Terrains transformation matrix
-
setChunkData
public void setChunkData(javax.vecmath.Vector2f offset, float size)Loading the position/offset and size of the next chunk into the shader- Parameters:
offset- Offset for the next chunksize- Size of the next chunks
-
setViewProjectionMatrix
public void setViewProjectionMatrix(javax.vecmath.Matrix4f vpMat)
Setting view projection matrix to use- Parameters:
vpMat- New view projection matrix
-
setCameraPosition
public void setCameraPosition(javax.vecmath.Vector3f camPos)
Setting camera position used for tesselation- Parameters:
camPos- Camera position to use
-
-