Class EntityShader

java.lang.Object
engine.shaders.ShaderProgram
engine.shaders.EntityShader

public class EntityShader extends ShaderProgram
Extends the ShaderProgram and is responsible for handling the shaders for all 3D entities.
  • Constructor Details

    • EntityShader

      public EntityShader()
  • Method Details

    • bindAttributes

      protected void bindAttributes()
      Binds all Attributes found in the GLSL file.
      Specified by:
      bindAttributes in class ShaderProgram
    • getAllUniformLocations

      protected void getAllUniformLocations()
      Finds all uniform loactions in the GLSL file.
      Specified by:
      getAllUniformLocations in class ShaderProgram
    • 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

      public void loadViewMatrix(Camera camera)
      Loads the view matrix to the shader after creating it based on the camera.
      Parameters:
      camera -
    • loadLight

      public void loadLight(Light light)
      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 -