Package com.ardor3d.renderer.jogl
Class JoglPbufferTextureRenderer
java.lang.Object
com.ardor3d.renderer.AbstractPbufferTextureRenderer
com.ardor3d.renderer.jogl.JoglPbufferTextureRenderer
- All Implemented Interfaces:
TextureRenderer
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 Summary
Modifier and TypeFieldDescriptionprotected CapsUtil
protected DirectNioBuffersSet
static com.jogamp.opengl.GLContext
Fields inherited from class com.ardor3d.renderer.AbstractPbufferTextureRenderer
_active, _backgroundColor, _bgColorDirty, _camera, _enforcedStates, _height, _oldContext, _parentRenderer, _settings, _useDirectRender, _width
-
Constructor Summary
ConstructorDescriptionJoglPbufferTextureRenderer
(DisplaySettings settings, Renderer parentRenderer, ContextCapabilities caps) -
Method Summary
Modifier and TypeMethodDescriptionvoid
cleanup()
Any wrapping up and cleaning up of TextureRenderer information is performed here.protected void
clearBuffers
(int clear) void
copyToTexture
(Texture tex, int x, int y, int width, int height, int xoffset, int yoffset) copyToTexture
copies the current frame buffer contents to the given Texture.void
void
NOTE: If more than one texture is given, copy-texture is used regardless of card capabilities to decrease render time.void
void
NOTE: If more than one texture is given, copy-texture is used regardless of card capabilities to decrease render time.void
NOTE: If more than one texture is given, copy-texture is used regardless of card capabilities to decrease render time.void
NOTE: If more than one texture is given, copy-texture is used regardless of card capabilities to decrease render time.void
setMultipleTargets
(boolean force) Set up this textureRenderer for use with multiple targets.void
setupTexture
(Texture tex) setupTexture
initializes a new Texture object for use with TextureRenderer.Methods inherited from class com.ardor3d.renderer.AbstractPbufferTextureRenderer
clearEnforcedState, clearEnforcedStates, doDraw, doDraw, doDraw, enforceState, enforceStates, getBackgroundColor, getCamera, getHeight, getWidth, setBackgroundColor, switchCameraIn, switchCameraOut
-
Field Details
-
_capsUtil
-
_parentContext
public static com.jogamp.opengl.GLContext _parentContext -
_directNioBuffersSet
-
-
Constructor Details
-
JoglPbufferTextureRenderer
public JoglPbufferTextureRenderer(DisplaySettings settings, Renderer parentRenderer, ContextCapabilities caps)
-
-
Method Details
-
setupTexture
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
- 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
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
- 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
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
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
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 framebuffery
- the y offset into the framebufferwidth
- the width of the rectangle to read from the framebuffer and copy 1:1 to the textureheight
- the width of the rectangle to read from the framebuffer and copy 1:1 to the texturexoffset
- the x offset into the texture to draw atyoffset
- the y offset into the texture to draw at
-
clearBuffers
protected void clearBuffers(int clear) - Specified by:
clearBuffers
in classAbstractPbufferTextureRenderer
-
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.
-