Package engine.shaders
Class TerrainShader
java.lang.Object
engine.shaders.ShaderProgram
engine.shaders.TerrainShader
Extends the ShaderProgram and is responsible for handling the shaders for all terrain objects.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Binds all Attributes found in the GLSL file.protected void
Finds all uniform loactions in the GLSL file.void
Loads the light to the shader - mainly its position and color.void
loadProjectionMatrix
(org.joml.Matrix4f projection) Loads the projection matrix to the shader.void
loadShineVariables
(float shineDamper, float reflectivity) Loads the shine and reflection variables to the shader.void
loadSkyColor
(float r, float g, float b) Loads the sky color to the shader - based on colors set in master renderer.void
loadTransformationMatrix
(org.joml.Matrix4f matrix) Loads the transformation matrix to the shader.void
loadViewMatrix
(Camera camera) Loads the view matrix to the shader after creating it based on the camera.Methods inherited from class engine.shaders.ShaderProgram
bindAttribute, cleanUp, getUniformLocation, load2DVector, loadBoolean, loadFloat, loadMatrix, loadVector, start, stop
-
Constructor Details
-
TerrainShader
public TerrainShader()
-
-
Method Details
-
bindAttributes
protected void bindAttributes()Binds all Attributes found in the GLSL file.- Specified by:
bindAttributes
in classShaderProgram
-
getAllUniformLocations
protected void getAllUniformLocations()Finds all uniform loactions in the GLSL file.- Specified by:
getAllUniformLocations
in classShaderProgram
-
loadSkyColor
public void loadSkyColor(float r, float g, float b) Loads the sky color to the shader - based on colors set in master renderer.- Parameters:
r
-g
-b
-
-
loadShineVariables
public void loadShineVariables(float shineDamper, float reflectivity) Loads the shine and reflection variables to the shader.- Parameters:
shineDamper
-reflectivity
-
-
loadTransformationMatrix
public void loadTransformationMatrix(org.joml.Matrix4f matrix) Loads the transformation matrix to the shader.- Parameters:
matrix
-
-
loadLight
Loads the light to the shader - mainly its position and color.- Parameters:
light
-
-
loadViewMatrix
Loads the view matrix to the shader after creating it based on the camera.- Parameters:
camera
-
-
loadProjectionMatrix
public void loadProjectionMatrix(org.joml.Matrix4f projection) Loads the projection matrix to the shader.- Parameters:
projection
-
-