Class JoglPbufferTextureRenderer

java.lang.Object
com.ardor3d.renderer.AbstractPbufferTextureRenderer
com.ardor3d.renderer.jogl.JoglPbufferTextureRenderer
All Implemented Interfaces:
TextureRenderer

public class JoglPbufferTextureRenderer extends AbstractPbufferTextureRenderer

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

N.B: This class can't work without a complete implementation of GLOffscreenAutoDrawable.PBuffer, which is currently missing from JOGL
See Also:
  • Field Details

    • _capsUtil

      protected CapsUtil _capsUtil
    • _parentContext

      public static com.jogamp.opengl.GLContext _parentContext
    • _directNioBuffersSet

      protected DirectNioBuffersSet _directNioBuffersSet
  • Constructor Details

  • Method Details

    • setupTexture

      public void setupTexture(Texture tex)
      setupTexture initializes a new Texture object for use with TextureRenderer. Generates a valid gl texture id for this texture and inits 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, Texture tex, int clear)
      Parameters:
      spat - the scene to render.
      tex - the Texture to render to. This should be a 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, Texture tex, 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.
      tex - the Texture to render to. This should be a 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, Texture tex, int clear)
      Parameters:
      scene - the scene to render.
      tex - the Texture to render to. This should be a 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(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:
    • 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 AbstractPbufferTextureRenderer
    • cleanup

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

      public void setMultipleTargets(boolean force)
      Description copied from interface: TextureRenderer
      Set up this textureRenderer for use with multiple targets. If you are going to use this texture renderer to render to more than one texture, call this with true.
      Parameters:
      force - true if you plan to use this texture renderer to render different content to more than one texture.