Class DeferredShader


  • public class DeferredShader
    extends Shader
    Representing the shader for the deferred light rendering with a gbuffer
    Author:
    Darius Dinger
    • Constructor Detail

      • DeferredShader

        public DeferredShader()
    • 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
      • setCameraPosition

        public void setCameraPosition​(javax.vecmath.Vector3f camPos)
        Setting the position, the specular light calculation is using for calculating the reflections
        Parameters:
        camPos - Position of the camera/player
      • setGBuffer

        public void setGBuffer​(GBuffer gBuffer)
        Setting gBuffer maps to render lights into in the next frame
        Parameters:
        gBuffer - GBuffer to get maps from
      • setShadowLight

        public void setShadowLight​(ShadowLight light)
        Set shadow light to render shadows from in next frame
        Parameters:
        light - Next shadow light
      • setLightSources

        public void setLightSources​(List<PointLight> pointLights,
                                    List<SpotLight> spotLights,
                                    List<AmbientLight> ambientLights,
                                    List<DirectionalLight> directionalLights)
        Setting light sources for the next frame
        Parameters:
        pointLights - To render point lights
        spotLights - To render spot lights
        ambientLights - To render ambient lights
        directionalLights - To render directional lights