Aviatrix3D
2.1.0

org.j3d.aviatrix3d.rendering
Interface TextureRenderable

All Superinterfaces:
java.lang.Comparable, ComponentRenderable, Renderable, TransparentRenderable
All Known Implementing Classes:
TextureUnit

public interface TextureRenderable
extends ComponentRenderable, TransparentRenderable

Extended version of the ComponentRenderable interface that provides additional handling for textures.

Textures can come in several diffferent forms and this interface provides a way to map between the holding TextureUnit class and the rendering/culling stage with addtional information about the form of the contained texture without needing to pull apart the TextureUnit itself.

Working with offscreen buffers such as Pbuffers and Frame Buffer Objects requires some cooperation between these interfaces and the rendering pipeline. The pipeline requires rendering the offscreen buffer in a separate rendering pass to the use(s) of that buffer. The rendering pass parent is the OffscreenBufferRenderable. The user of that buffer is this interface. When this interface is about to be rendered, some buffers require an explicit binding operation to be performed. Which buffer is used is dependent on how the scene is constructed and how rendering proceeds, so a level of abstraction is needed to separate the specifics of the buffer and the usage of it. To do so is the work of the OffscreenBufferDescriptor. When a buffer is created, that is registered with the parent renderable. When a buffer is used, it is fetched from this interface.

Version:
$Revision: 1.6 $
Author:
Justin Couch

Method Summary
 void activateTexture(javax.media.opengl.GL gl, java.lang.Object externalData)
          Activate the texture now.
 void deactivateTexture(javax.media.opengl.GL gl, java.lang.Object externalData)
          Deactivate the texture now so that it is no longer a valid rendering target.
 OffscreenBufferDescriptor getBuffer(javax.media.opengl.GLContext context)
          Fetch the underlying source buffer for the offscreen rendering that relates to this particular texture.
 OffscreenCullable getOffscreenSource()
          Fetch the offscreen texture source that this renderable holds on to.
 boolean isOffscreenBuffer()
          Check to see if this is an offscreen buffer that is separately rendered rather than using explicit image data.
 boolean isOffscreenSource()
          Check to see if the contained texture is an offscreen renderable such as OffscreenTexture2D or MRTOffscreenTexture2D that contains a subscene graph to be rendered.
 
Methods inherited from interface org.j3d.aviatrix3d.rendering.ComponentRenderable
postRender, render
 
Methods inherited from interface org.j3d.aviatrix3d.rendering.TransparentRenderable
hasTransparency
 
Methods inherited from interface org.j3d.aviatrix3d.rendering.Renderable
equals
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

activateTexture

void activateTexture(javax.media.opengl.GL gl,
                     java.lang.Object externalData)
Activate the texture now. This will be called before the render() method and is used to perform any enabling functionality for the given renderable.

Parameters:
gl - The GL context to render with
externalData - Some implementation-specific external data to aid in the rendering

deactivateTexture

void deactivateTexture(javax.media.opengl.GL gl,
                       java.lang.Object externalData)
Deactivate the texture now so that it is no longer a valid rendering target.

Parameters:
gl - The GL context to render with
externalData - Some implementation-specific external data to aid in the rendering

isOffscreenSource

boolean isOffscreenSource()
Check to see if the contained texture is an offscreen renderable such as OffscreenTexture2D or MRTOffscreenTexture2D that contains a subscene graph to be rendered. If is is, then the getOffscreenSource() method will return the contained cullable.

Returns:
true if the texture contains an offscreen source

getOffscreenSource

OffscreenCullable getOffscreenSource()
Fetch the offscreen texture source that this renderable holds on to.

Returns:
The contained offscreen texture or null if none

isOffscreenBuffer

boolean isOffscreenBuffer()
Check to see if this is an offscreen buffer that is separately rendered rather than using explicit image data. Offscreen buffers do not necessarily contain a sub scene graph. The isOffscreenSource() method is used to determine that.

Returns:
true if this represents an offscreen buffer of some sort

getBuffer

OffscreenBufferDescriptor getBuffer(javax.media.opengl.GLContext context)
Fetch the underlying source buffer for the offscreen rendering that relates to this particular texture. The buffer descriptor would be fetched from the matching offscreen texture source that was registered below this class.

Parameters:
context - The containing context to find the matching buffer for
Returns:
A buffer descriptor for that context, or null if none found

Aviatrix3D
2.1.0

Latest Info from http://aviatrix3d.j3d.org/
Copyright © 2003 - 2009 j3d.org