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 void
addShaders()
Adding shaders to programprotected void
bindAttribs()
Binding all vbo attributes to shader attribute ("in" variable)protected void
loadUniforms()
Loading uniform locationsvoid
setCameraPosition(javax.vecmath.Vector3f camPos)
Setting camera position used for tesselationvoid
setChunkData(javax.vecmath.Vector2f offset, float size)
Loading the position/offset and size of the next chunk into the shadervoid
setClipPlane(float x, float y, float z, float w)
Setting clip plane for next terrainvoid
setTerrainConfig(TerrainConfig config)
Loading a whole terrain configuration into the shadervoid
setTerrainTransform(javax.vecmath.Matrix4f transMat)
Loading the transformation matrix of the terrain into the shadervoid
setViewProjectionMatrix(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:Shader
Adding shaders to program- Specified by:
addShaders
in classShader
-
bindAttribs
protected void bindAttribs()
Description copied from class:Shader
Binding all vbo attributes to shader attribute ("in" variable)- Specified by:
bindAttribs
in classShader
-
loadUniforms
protected void loadUniforms()
Description copied from class:Shader
Loading uniform locations- Specified by:
loadUniforms
in 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
-
-