Package com.ardor3d.renderer
Class AbstractFBOTextureRenderer
java.lang.Object
com.ardor3d.renderer.AbstractFBOTextureRenderer
- All Implemented Interfaces:
TextureRenderer
- Direct Known Subclasses:
JoglTextureRenderer
-
Field Summary
Modifier and TypeFieldDescriptionprotected int
protected IntBuffer
protected final ColorRGBA
protected final Camera
protected int
protected int
protected final EnumMap
<RenderState.StateType, RenderState> List of states that override any set states on a spatial if not null.protected int
protected int
protected int
protected int
protected int
protected boolean
protected final Renderer
protected int
protected final boolean
protected final boolean
protected boolean
protected int
-
Constructor Summary
ConstructorDescriptionAbstractFBOTextureRenderer
(int width, int height, int depthBits, int samples, Renderer parentRenderer, ContextCapabilities caps) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
activate()
protected abstract void
protected abstract void
clearBuffers
(int clear) void
void
Clear all enforced states on this texture renderer.protected abstract void
protected void
protected void
protected void
void
enforceState
(RenderState state) Enforce a particular state whenever this texture renderer is used.void
getBackgroundColor
retrieves the color used for the window background.getCamera
retrieves the camera this renderer is using.int
int
getWidth()
void
void
void
NOTE: If more than one texture is given, copy-texture is used regardless of card capabilities to decrease render time.void
setBackgroundColor
sets the color of window.protected abstract void
setMSFBO()
void
setMultipleTargets
(boolean multi) Set up this textureRenderer for use with multiple targets.protected abstract void
protected void
switchCameraIn
(int clear) protected void
protected abstract void
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.ardor3d.renderer.TextureRenderer
cleanup, copyToTexture, render, render, render, setupTexture
-
Field Details
-
_enforcedStates
List of states that override any set states on a spatial if not null. -
_camera
-
_backgroundColor
-
_active
protected int _active -
_fboID
protected int _fboID -
_depthRBID
protected int _depthRBID -
_msfboID
protected int _msfboID -
_msdepthRBID
protected int _msdepthRBID -
_mscolorRBID
protected int _mscolorRBID -
_width
protected int _width -
_height
protected int _height -
_samples
protected int _samples -
_depthBits
protected int _depthBits -
_attachBuffer
-
_usingDepthRB
protected boolean _usingDepthRB -
_supportsDepthTexture
protected final boolean _supportsDepthTexture -
_supportsMultisample
protected final boolean _supportsMultisample -
_neededClip
protected boolean _neededClip -
_parentRenderer
-
-
Constructor Details
-
AbstractFBOTextureRenderer
public AbstractFBOTextureRenderer(int width, int height, int depthBits, int samples, Renderer parentRenderer, ContextCapabilities caps)
-
-
Method Details
-
getCamera
getCamera
retrieves the camera this renderer is using.- Specified by:
getCamera
in interfaceTextureRenderer
- Returns:
- the camera this renderer is using.
-
setBackgroundColor
Description copied from interface:TextureRenderer
setBackgroundColor
sets the color of window. This color will be shown for any pixel that is not set via typical rendering operations.- Specified by:
setBackgroundColor
in interfaceTextureRenderer
- Parameters:
c
- the color to set the background to.
-
getBackgroundColor
Description copied from interface:TextureRenderer
getBackgroundColor
retrieves the color used for the window background.- Specified by:
getBackgroundColor
in interfaceTextureRenderer
- Returns:
- the background color that is currently set to the background.
-
render
- Specified by:
render
in interfaceTextureRenderer
- Parameters:
toDraw
- 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
- Specified by:
render
in interfaceTextureRenderer
- Parameters:
toDraw
- 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.- Specified by:
render
in interfaceTextureRenderer
- Parameters:
toDraw
- 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:
-
activate
protected abstract void activate() -
setupForSingleTexDraw
-
takedownForSingleTexDraw
-
setMSFBO
protected abstract void setMSFBO() -
blitMSFBO
protected abstract void blitMSFBO() -
deactivate
protected abstract void deactivate() -
switchCameraIn
protected void switchCameraIn(int clear) -
clearBuffers
protected abstract void clearBuffers(int clear) -
switchCameraOut
protected void switchCameraOut() -
doDraw
-
doDraw
-
doDraw
-
getWidth
public int getWidth()- Specified by:
getWidth
in interfaceTextureRenderer
-
getHeight
public int getHeight()- Specified by:
getHeight
in interfaceTextureRenderer
-
getParentRenderer
-
setMultipleTargets
public void setMultipleTargets(boolean multi) 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.- Specified by:
setMultipleTargets
in interfaceTextureRenderer
- Parameters:
multi
- true if you plan to use this texture renderer to render different content to more than one texture.
-
enforceState
Description copied from interface:TextureRenderer
Enforce a particular state whenever this texture renderer is used. In other words, the given state will override any state of the same type set on a scene object rendered with this texture renderer.- Specified by:
enforceState
in interfaceTextureRenderer
- Parameters:
state
- state to enforce
-
enforceStates
- Specified by:
enforceStates
in interfaceTextureRenderer
-
clearEnforcedState
- Specified by:
clearEnforcedState
in interfaceTextureRenderer
- Parameters:
type
- state type to clear
-
clearEnforcedStates
public void clearEnforcedStates()Description copied from interface:TextureRenderer
Clear all enforced states on this texture renderer.- Specified by:
clearEnforcedStates
in interfaceTextureRenderer
-