Class TerrainShader


  • public class TerrainShader
    extends Shader
    Class that represent a shader programm for the terrain shader pipeline
    Author:
    Darius Dinger
    • Constructor Detail

      • TerrainShader

        public TerrainShader()
    • Method Detail

      • addShaders

        protected void addShaders()
        Description copied from class: Shader
        Adding shaders to program
        Specified by:
        addShaders in class Shader
      • bindAttribs

        protected void bindAttribs()
        Description copied from class: Shader
        Binding all vbo attributes to shader attribute ("in" variable)
        Specified by:
        bindAttribs in class Shader
      • loadUniforms

        protected void loadUniforms()
        Description copied from class: Shader
        Loading uniform locations
        Specified by:
        loadUniforms in class Shader
      • 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 normal
        y - Y value of the plane normal
        z - Z value of the plane normal
        w - 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 chunk
        size - 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