Class JoglTextureRenderer

java.lang.Object
com.ardor3d.renderer.AbstractFBOTextureRenderer
com.ardor3d.renderer.jogl.JoglTextureRenderer
All Implemented Interfaces:
TextureRenderer

public class JoglTextureRenderer extends AbstractFBOTextureRenderer

This class is used by Ardor3D's JOGL implementation to render textures. Users should not create this class directly.

See Also:
  • Constructor Details

    • JoglTextureRenderer

      public JoglTextureRenderer(int width, int height, int depthBits, int samples, Renderer parentRenderer, ContextCapabilities caps)
  • Method Details

    • setupTexture

      public void setupTexture(Texture tex)
      setupTexture initializes a new Texture object for use with TextureRenderer. Generates a valid OpenGL texture id for this texture and initializes the data type for the texture.
      Parameters:
      tex - The texture to setup for use in Texture Rendering. This should be of type Texture2D or TextureCubeMap.
    • render

      public void render(Spatial spat, List<Texture> texs, int clear)
      Description copied from interface: TextureRenderer
      NOTE: If more than one texture is given, copy-texture is used regardless of card capabilities to decrease render time.
      Parameters:
      spat - the scene to render.
      texs - a list of Textures to render to. These should be of type Texture2D or TextureCubeMap. If the latter, its currentRTTFace will determine which cube face is drawn to.
      clear - which buffers to clear before rendering, if any.
      See Also:
    • render

      public void render(List<? extends Spatial> spat, List<Texture> texs, int clear)
      Description copied from interface: TextureRenderer
      NOTE: If more than one texture is given, copy-texture is used regardless of card capabilities to decrease render time.
      Parameters:
      spat - an array of Spatials to render.
      texs - a list of Textures to render to. These should be of type Texture2D or TextureCubeMap. If the latter, its currentRTTFace will determine which cube face is drawn to.
      clear - which buffers to clear before rendering, if any.
      See Also:
    • render

      public void render(Scene scene, List<Texture> texs, int clear)
      Description copied from interface: TextureRenderer
      NOTE: If more than one texture is given, copy-texture is used regardless of card capabilities to decrease render time.
      Parameters:
      scene - the scene to render.
      texs - a list of Textures to render to. These should be of type Texture2D or TextureCubeMap. If the latter, its currentRTTFace will determine which cube face is drawn to.
      clear - which buffers to clear before rendering, if any.
      See Also:
    • setupForSingleTexDraw

      protected void setupForSingleTexDraw(Texture tex)
      Specified by:
      setupForSingleTexDraw in class AbstractFBOTextureRenderer
    • takedownForSingleTexDraw

      protected void takedownForSingleTexDraw(Texture tex)
      Specified by:
      takedownForSingleTexDraw in class AbstractFBOTextureRenderer
    • setMSFBO

      protected void setMSFBO()
      Specified by:
      setMSFBO in class AbstractFBOTextureRenderer
    • blitMSFBO

      protected void blitMSFBO()
      Specified by:
      blitMSFBO in class AbstractFBOTextureRenderer
    • checkFBOComplete

      public static void checkFBOComplete(int fboID)
      Check the currently bound FBO status for completeness. The passed in fboID is for informational purposes only.
      Parameters:
      fboID - an id to use for log messages, particularly if there are any issues.
    • copyToTexture

      public void copyToTexture(Texture tex, int x, int y, int width, int height, int xoffset, int yoffset)
      Description copied from interface: TextureRenderer
      copyToTexture copies the current frame buffer contents to the given Texture. What is copied is based on the rttFormat of the texture object when it was setup. Note that the contents are copied with no scaling applied, so the texture must be big enough such that xoffset + width <= texture's width and yoffset + height <= texture's height.
      Parameters:
      tex - The Texture to copy into. This should be a Texture2D or TextureCubeMap. If the latter, its currentRTTFace will determine which cube face is drawn to.
      x - the x offset into the framebuffer
      y - the y offset into the framebuffer
      width - the width of the rectangle to read from the framebuffer and copy 1:1 to the texture
      height - the width of the rectangle to read from the framebuffer and copy 1:1 to the texture
      xoffset - the x offset into the texture to draw at
      yoffset - the y offset into the texture to draw at
    • clearBuffers

      protected void clearBuffers(int clear)
      Specified by:
      clearBuffers in class AbstractFBOTextureRenderer
    • activate

      protected void activate()
      Specified by:
      activate in class AbstractFBOTextureRenderer
    • deactivate

      protected void deactivate()
      Specified by:
      deactivate in class AbstractFBOTextureRenderer
    • cleanup

      public void cleanup()
      Description copied from interface: TextureRenderer
      Any wrapping up and cleaning up of TextureRenderer information is performed here.