Package engine.shaders
Class EntityShader
java.lang.Object
engine.shaders.ShaderProgram
engine.shaders.EntityShader
Extends the ShaderProgram and is responsible for handling the shaders for all 3D entities.
-
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
-
EntityShader
public EntityShader()
-
-
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
-
loadTransformationMatrix
public void loadTransformationMatrix(org.joml.Matrix4f matrix) Loads the transformation matrix to the shader.- Parameters:
matrix
-
-
loadProjectionMatrix
public void loadProjectionMatrix(org.joml.Matrix4f projection) Loads the projection matrix to the shader.- Parameters:
projection
-
-
loadViewMatrix
Loads the view matrix to the shader after creating it based on the camera.- Parameters:
camera
-
-
loadLight
Loads the light to the shader - mainly its position and color.- Parameters:
light
-
-
loadShineVariables
public void loadShineVariables(float shineDamper, float reflectivity) Loads the shine and reflection variables to the shader.- Parameters:
shineDamper
-reflectivity
-
-
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
-
-