Package de.coreengine.rendering.programs
Class DeferredShader
- java.lang.Object
-
- de.coreengine.rendering.programs.Shader
-
- de.coreengine.rendering.programs.DeferredShader
-
public class DeferredShader extends Shader
Representing the shader for the deferred light rendering with a gbuffer- Author:
- Darius Dinger
-
-
Field Summary
-
Fields inherited from class de.coreengine.rendering.programs.Shader
SHADERS_LOCATION
-
-
Constructor Summary
Constructors Constructor Description DeferredShader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddShaders()Adding shaders to programprotected voidbindAttribs()Binding all vbo attributes to shader attribute ("in" variable)protected voidloadUniforms()Loading uniform locationsvoidsetCameraPosition(javax.vecmath.Vector3f camPos)Setting the position, the specular light calculation is using for calculating the reflectionsvoidsetGBuffer(GBuffer gBuffer)Setting gBuffer maps to render lights into in the next framevoidsetLightSources(List<PointLight> pointLights, List<SpotLight> spotLights, List<AmbientLight> ambientLights, List<DirectionalLight> directionalLights)Setting light sources for the next framevoidsetShadowLight(ShadowLight light)Set shadow light to render shadows from in next frame-
Methods inherited from class de.coreengine.rendering.programs.Shader
addShader, bindAttribute, bindTexture, bindTextureUnit, getUniformLocation, setUniform, setUniform, setUniform, setUniform, setUniform, setUniform, setUniform, setUniform, setUniformArray1f, setUniformArray1i, setUniformArray2f, setUniformArray3f, start, stop
-
-
-
-
Method Detail
-
addShaders
protected void addShaders()
Description copied from class:ShaderAdding shaders to program- Specified by:
addShadersin classShader
-
bindAttribs
protected void bindAttribs()
Description copied from class:ShaderBinding all vbo attributes to shader attribute ("in" variable)- Specified by:
bindAttribsin classShader
-
loadUniforms
protected void loadUniforms()
Description copied from class:ShaderLoading uniform locations- Specified by:
loadUniformsin classShader
-
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 lightsspotLights- To render spot lightsambientLights- To render ambient lightsdirectionalLights- To render directional lights
-
-