Package org.oscim.renderer.light
Class ShadowFrameBuffer
java.lang.Object
org.oscim.renderer.light.ShadowFrameBuffer
The frame buffer for the shadow pass. This class sets up the depth texture
which can be rendered to during the shadow render pass, producing a shadow
map.
See ThinMatrix on Youtube: https://youtu.be/o6zDfDkOFIc
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedShadowFrameBuffer(int width, int height) Initialises the frame buffer and shadow map of a certain size. -
Method Summary
Modifier and TypeMethodDescriptionvoidBinds the frame buffer as the current render target.protected voidcleanUp()Deletes the frame buffer and shadow map texture when the game closes.protected intprotected voidUnbinds the frame buffer, setting the default frame buffer as the current render target.
-
Constructor Details
-
ShadowFrameBuffer
protected ShadowFrameBuffer(int width, int height) Initialises the frame buffer and shadow map of a certain size.- Parameters:
width- - the width of the shadow map in pixels.height- - the height of the shadow map in pixels.
-
-
Method Details
-
cleanUp
protected void cleanUp()Deletes the frame buffer and shadow map texture when the game closes. -
unbindFrameBuffer
protected void unbindFrameBuffer()Unbinds the frame buffer, setting the default frame buffer as the current render target. -
getShadowMap
protected int getShadowMap()- Returns:
- The ID of the shadow map texture.
-
bindFrameBuffer
public void bindFrameBuffer()Binds the frame buffer as the current render target.
-