Class ShadowFrameBuffer

java.lang.Object
org.oscim.renderer.light.ShadowFrameBuffer

public class ShadowFrameBuffer extends Object
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

    Constructors
    Modifier
    Constructor
    Description
    protected
    ShadowFrameBuffer(int width, int height)
    Initialises the frame buffer and shadow map of a certain size.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Binds the frame buffer as the current render target.
    protected void
    Deletes the frame buffer and shadow map texture when the game closes.
    protected int
     
    protected void
    Unbinds the frame buffer, setting the default frame buffer as the current render target.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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.