org.xith3d.render
Class TextureRenderTarget

java.lang.Object
  extended by org.xith3d.render.TextureRenderTarget
All Implemented Interfaces:
RenderTarget

public class TextureRenderTarget
extends java.lang.Object
implements RenderTarget

This type of RenderTarget is used for render-to-texture. Apply it to a RenderPass to bring it into effect.


Constructor Summary
TextureRenderTarget(GroupNode group, Texture texture)
           
TextureRenderTarget(GroupNode group, Texture texture, boolean pixelReadbackEnabled)
           
TextureRenderTarget(GroupNode group, Texture texture, org.openmali.vecmath2.Colorf backgroundColor)
           
TextureRenderTarget(GroupNode group, Texture texture, org.openmali.vecmath2.Colorf backgroundColor, boolean pixelReadbackEnabled)
           
 
Method Summary
protected  void finalize()
          
 void freeOpenGLResources(Canvas3D canvas)
          This method frees OpenGL resources (names) for all Nodes in the traversal of this Node(-Group).
 void freeOpenGLResources(CanvasPeer canvasPeer)
          This method frees OpenGL resources (names) for all Nodes in the traversal of this Node(-Group).
 org.openmali.vecmath2.Colorf getBackgroundColor()
           
 GroupNode getGroup()
          
 SceneGraphOpenGLReferences getOpenGLReferences()
           
 Texture getTexture()
           
 boolean isBackgroundRenderingEnabled()
          If this is true, the background is rendered into the RenderTarget.
 boolean isPixelReadbackEnabled()
          Enables or disables pixel readback from the GL to local pixel data.
 void setBackgroundColor(org.openmali.vecmath2.Colorf color)
          Sets the color, the texture is to be cleared before the Renderer renders to it.
 void setBackgroundRenderingEnabled(boolean enabled)
          If this is true, the background is rendered into the RenderTarget.
 void setGroup(GroupNode group)
          Sets the Group to be rendered to this RenderTarget.
 void setPixelReadbackEnabled(boolean enabled)
          Enables or disables pixel readback from the GL to local pixel data.
 void setTexture(Texture texture)
          Sets the assotiated Texture instance.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextureRenderTarget

public TextureRenderTarget(GroupNode group,
                           Texture texture,
                           org.openmali.vecmath2.Colorf backgroundColor,
                           boolean pixelReadbackEnabled)

TextureRenderTarget

public TextureRenderTarget(GroupNode group,
                           Texture texture,
                           boolean pixelReadbackEnabled)

TextureRenderTarget

public TextureRenderTarget(GroupNode group,
                           Texture texture,
                           org.openmali.vecmath2.Colorf backgroundColor)

TextureRenderTarget

public TextureRenderTarget(GroupNode group,
                           Texture texture)
Method Detail

getOpenGLReferences

public final SceneGraphOpenGLReferences getOpenGLReferences()

setGroup

public void setGroup(GroupNode group)
Sets the Group to be rendered to this RenderTarget.


getGroup

public final GroupNode getGroup()

Specified by:
getGroup in interface RenderTarget
Returns:
the GroupNode to be rendered to this target.

setTexture

public void setTexture(Texture texture)
Sets the assotiated Texture instance.


getTexture

public final Texture getTexture()
Returns:
the assotiated Texture instance.

setBackgroundColor

public void setBackgroundColor(org.openmali.vecmath2.Colorf color)
Sets the color, the texture is to be cleared before the Renderer renders to it. Set this to null to do no clearing.


getBackgroundColor

public final org.openmali.vecmath2.Colorf getBackgroundColor()
Returns:
the color, the texture is to be cleared before the Renderer renders to it. This is null to do no clearing.

setBackgroundRenderingEnabled

public void setBackgroundRenderingEnabled(boolean enabled)
If this is true, the background is rendered into the RenderTarget.

Specified by:
setBackgroundRenderingEnabled in interface RenderTarget

isBackgroundRenderingEnabled

public final boolean isBackgroundRenderingEnabled()
If this is true, the background is rendered into the RenderTarget.

Specified by:
isBackgroundRenderingEnabled in interface RenderTarget

setPixelReadbackEnabled

public void setPixelReadbackEnabled(boolean enabled)
Enables or disables pixel readback from the GL to local pixel data. This will fail, if the used texture is not an instance of Texture2D.

Parameters:
enabled -

isPixelReadbackEnabled

public final boolean isPixelReadbackEnabled()
Enables or disables pixel readback from the GL to local pixel data.

Returns:
Enables or disables pixel readback from the GL to local pixel data.

freeOpenGLResources

public void freeOpenGLResources(CanvasPeer canvasPeer)
This method frees OpenGL resources (names) for all Nodes in the traversal of this Node(-Group).

Specified by:
freeOpenGLResources in interface RenderTarget

freeOpenGLResources

public final void freeOpenGLResources(Canvas3D canvas)
This method frees OpenGL resources (names) for all Nodes in the traversal of this Node(-Group).

Specified by:
freeOpenGLResources in interface RenderTarget

finalize

protected void finalize()

Overrides:
finalize in class java.lang.Object