Class AbstractFBOTextureRenderer

java.lang.Object
com.ardor3d.renderer.AbstractFBOTextureRenderer
All Implemented Interfaces:
TextureRenderer
Direct Known Subclasses:
JoglTextureRenderer

public abstract class AbstractFBOTextureRenderer extends Object implements TextureRenderer
  • Field Details

    • _enforcedStates

      protected final EnumMap<RenderState.StateType,RenderState> _enforcedStates
      List of states that override any set states on a spatial if not null.
    • _camera

      protected final Camera _camera
    • _backgroundColor

      protected final ColorRGBA _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

      protected IntBuffer _attachBuffer
    • _usingDepthRB

      protected boolean _usingDepthRB
    • _supportsDepthTexture

      protected final boolean _supportsDepthTexture
    • _supportsMultisample

      protected final boolean _supportsMultisample
    • _neededClip

      protected boolean _neededClip
    • _parentRenderer

      protected final Renderer _parentRenderer
  • Constructor Details

    • AbstractFBOTextureRenderer

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

    • getCamera

      public Camera getCamera()
      getCamera retrieves the camera this renderer is using.
      Specified by:
      getCamera in interface TextureRenderer
      Returns:
      the camera this renderer is using.
    • setBackgroundColor

      public void setBackgroundColor(ReadOnlyColorRGBA c)
      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 interface TextureRenderer
      Parameters:
      c - the color to set the background to.
    • getBackgroundColor

      public ReadOnlyColorRGBA getBackgroundColor()
      Description copied from interface: TextureRenderer
      getBackgroundColor retrieves the color used for the window background.
      Specified by:
      getBackgroundColor in interface TextureRenderer
      Returns:
      the background color that is currently set to the background.
    • render

      public void render(Spatial toDraw, Texture tex, int clear)
      Specified by:
      render in interface TextureRenderer
      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

      public void render(Scene toDraw, Texture tex, int clear)
      Specified by:
      render in interface TextureRenderer
      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

      public void render(List<? extends Spatial> toDraw, 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.
      Specified by:
      render in interface TextureRenderer
      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

      protected abstract void setupForSingleTexDraw(Texture tex)
    • takedownForSingleTexDraw

      protected abstract void takedownForSingleTexDraw(Texture tex)
    • 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

      protected void doDraw(Spatial spat)
    • doDraw

      protected void doDraw(List<? extends Spatial> toDraw)
    • doDraw

      protected void doDraw(Scene toDraw)
    • getWidth

      public int getWidth()
      Specified by:
      getWidth in interface TextureRenderer
    • getHeight

      public int getHeight()
      Specified by:
      getHeight in interface TextureRenderer
    • getParentRenderer

      public Renderer 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 interface TextureRenderer
      Parameters:
      multi - true if you plan to use this texture renderer to render different content to more than one texture.
    • enforceState

      public void enforceState(RenderState state)
      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 interface TextureRenderer
      Parameters:
      state - state to enforce
    • enforceStates

      public void enforceStates(EnumMap<RenderState.StateType,RenderState> states)
      Specified by:
      enforceStates in interface TextureRenderer
    • clearEnforcedState

      public void clearEnforcedState(RenderState.StateType type)
      Specified by:
      clearEnforcedState in interface TextureRenderer
      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 interface TextureRenderer