Aviatrix3D
2.1.0

org.j3d.aviatrix3d
Class MRTTexture2D

java.lang.Object
  extended by org.j3d.aviatrix3d.SceneGraphObject
      extended by org.j3d.aviatrix3d.NodeComponent
          extended by org.j3d.aviatrix3d.Texture
              extended by org.j3d.aviatrix3d.MRTTexture2D
All Implemented Interfaces:
java.lang.Comparable, DeletableRenderable, ObjectRenderable, OffscreenRenderTargetRenderable, Renderable, TransparentObjectRenderable, TransparentRenderable
Direct Known Subclasses:
MRTOffscreenTexture2D

public class MRTTexture2D
extends Texture
implements OffscreenRenderTargetRenderable

A single render target child of a MRTOffscreenTexture2D node.

Due to the requirements for OpenGL 2.0, this will only work with frame buffer objects and not Pbuffers.

This texture is not directly instantiatable as it is a child of the multiple render targets. It wraps a single render target for use later on by other pieces of geometry or shaders.

Internationalisation Resource Names

Version:
$Revision: 2.10 $
Author:
Justin Couch

Field Summary
protected  BufferSetupData bufferData
          Capabilities setup for this renderer
protected  int height
          The height of the main texture.
 
Fields inherited from class org.j3d.aviatrix3d.Texture
ANISOTROPIC_MODE_NONE, ANISOTROPIC_MODE_SINGLE, anisotropicDegree, anisotropicMode, BM_CLAMP, BM_CLAMP_TO_BOUNDARY, BM_CLAMP_TO_EDGE, BM_MIRRORED_REPEAT, BM_WRAP, borderColor, boundaryModeS, COMPARE_FUNCTION_GEQUAL, COMPARE_FUNCTION_LEQUAL, COMPARE_MODE_NONE, COMPARE_MODE_R2TEX, compareFunction, compareMode, depthComponentMode, format, FORMAT_ALPHA, FORMAT_DEPTH_COMPONENT, FORMAT_INTENSITY, FORMAT_INTENSITY_ALPHA, FORMAT_LUMINANCE, FORMAT_LUMINANCE_ALPHA, FORMAT_RGB, FORMAT_RGBA, GENERATE_MIPMAP, GENERATE_MIPMAP_DONT_CARE, GENERATE_MIPMAP_FASTEST, GENERATE_MIPMAP_HINT, GENERATE_MIPMAP_NICEST, generateMipMap, generateMipMapHint, imageChanged, magFilter, MAGFILTER_BASE_LEVEL_LINEAR, MAGFILTER_BASE_LEVEL_POINT, MAGFILTER_FASTEST, MAGFILTER_LINEAR_DETAIL, MAGFILTER_LINEAR_DETAIL_ALPHA, MAGFILTER_LINEAR_DETAIL_RGB, MAGFILTER_NICEST, minFilter, MINFILTER_BASE_LEVEL_LINEAR, MINFILTER_BASE_LEVEL_POINT, MINFILTER_FASTEST, MINFILTER_MULTI_LEVEL_LINEAR, MINFILTER_MULTI_LEVEL_POINT, MINFILTER_NICEST, mipMapMode, MODE_BASE_LEVEL, MODE_MIPMAP, numSources, priority, sources, stateChanged, textureIdMap, textureType, UPDATE_BUFFER_ALL, UPDATE_BUFFER_LAST, UPDATE_DISCARD_OVERWRITES, updateManagers, updateStrategy, width
 
Fields inherited from class org.j3d.aviatrix3d.NodeComponent
lastParent, liveCount, parentList
 
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject
alive, LISTENER_SET_TIMING_ERR_PROP, updateHandler
 
Method Summary
 int compareTo(Texture tex)
          Compares this object with the specified object for order.
 boolean equals(Texture tex)
          Compares this object with the specified object to check for equivalence.
 int getBoundaryModeT()
          Get the current boundary handling for the S parameter.
 OffscreenBufferDescriptor getBuffer(java.lang.Object obj)
          Get the currently registered pBuffer for the given key object.
 BufferSetupData getBufferSetup()
          Get the requested buffer setup that describes this offscreen buffer.
 int getHeight()
          Get the height of the texture in pixels.
 int getRenderTargetIndex()
          Request the index of this texture in the render target list.
 boolean isChildRenderTarget()
          Check to see if this is a child render target of a parent multiple render target offscreen buffer.
 void postRender(javax.media.opengl.GL gl)
          Restore all openGL state to the given drawable
 void registerBuffer(java.lang.Object obj, OffscreenBufferDescriptor buffer)
          Register a pBuffer for a given key object.
 void render(javax.media.opengl.GL gl)
          Issue ogl commands needed for this component
 void setBoundaryModeT(int mode)
          Set the boundary handling for the T parameter.
 void setSources(int mipMapMode, int format, TextureSource[] texSources, int num)
          Set the images for this texture, overridden to provide an empty implementation as this is handled by the FBO directly.
 void unregisterBuffer(java.lang.Object obj)
          Remove an already registered pBuffer for a given key object.
 
Methods inherited from class org.j3d.aviatrix3d.Texture
cleanup, compareTo, equals, getAnisotropicFilterDegree, getAnisotropicFilterMode, getBorderColor, getBoundaryModeS, getCompareFunction, getCompareMode, getDepthFormat, getFormat, getGenerateMipMap, getGenerateMipMapHint, getMagFilter, getMinFilter, getPriority, getTextureType, getUpdateStrategy, getWidth, hasTransparency, setAnisotropicFilterDegree, setAnisotropicFilterMode, setBorderColor, setBoundaryModeS, setCompareFunction, setCompareMode, setDepthFormat, setGenerateMipMap, setGenerateMipMapHint, setLive, setMagFilter, setMinFilter, setPriority, setUpdateHandler, setUpdateStrategy
 
Methods inherited from class org.j3d.aviatrix3d.NodeComponent
addParent, getParents, numParents, removeParent
 
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject
checkForCyclicChild, checkForCyclicParent, dataChanged, getAppUpdateWriteTimingMessage, getBoundsWriteTimingMessage, getDataWriteTimingMessage, getUserData, isLive, setUserData
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.j3d.aviatrix3d.rendering.OffscreenRenderTargetRenderable
getWidth
 
Methods inherited from interface org.j3d.aviatrix3d.rendering.Renderable
equals
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

height

protected int height
The height of the main texture.


bufferData

protected BufferSetupData bufferData
Capabilities setup for this renderer

Method Detail

setSources

public void setSources(int mipMapMode,
                       int format,
                       TextureSource[] texSources,
                       int num)
                throws InvalidWriteTimingException
Set the images for this texture, overridden to provide an empty implementation as this is handled by the FBO directly.

Overrides:
setSources in class Texture
Parameters:
mipMapMode - Flag stating the type of texture mode to use
format - Image format to use for grayscale images
texSources - The source data to use, single for base level
num - The valid number of images to use from the array
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the NodeUpdateListener callback method

compareTo

public int compareTo(Texture tex)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. Derived instances should override this to add texture-specific extensions.

Overrides:
compareTo in class Texture
Parameters:
tex - The texture instance to be compared
Returns:
-1, 0 or 1 depending on order

equals

public boolean equals(Texture tex)
Compares this object with the specified object to check for equivalence.

Overrides:
equals in class Texture
Parameters:
tex - The texture instance to be compared
Returns:
true if the objects represent identical values

getHeight

public int getHeight()
Get the height of the texture in pixels. If no image is set, this returns -1.

Specified by:
getHeight in interface OffscreenRenderTargetRenderable
Returns:
a number >= -1

isChildRenderTarget

public boolean isChildRenderTarget()
Check to see if this is a child render target of a parent multiple render target offscreen buffer. Returns true if it is.

Specified by:
isChildRenderTarget in interface OffscreenRenderTargetRenderable
Returns:
true if this is a child, false if the parent

getBufferSetup

public BufferSetupData getBufferSetup()
Get the requested buffer setup that describes this offscreen buffer. Only called once when the buffer is first constructed.

Specified by:
getBufferSetup in interface OffscreenRenderTargetRenderable
Returns:
The requested capabilities of the buffer that needs to be created

getBuffer

public OffscreenBufferDescriptor getBuffer(java.lang.Object obj)
Get the currently registered pBuffer for the given key object. If there is no buffer registered for the current context, return null.

Specified by:
getBuffer in interface OffscreenRenderTargetRenderable
Parameters:
obj - The key used to register the buffer with
Returns:
buffer The buffer instance to use here.

registerBuffer

public void registerBuffer(java.lang.Object obj,
                           OffscreenBufferDescriptor buffer)
Register a pBuffer for a given key object.

Specified by:
registerBuffer in interface OffscreenRenderTargetRenderable
Parameters:
obj - The key used to register the buffer with
buffer - The buffer instance to use here.

unregisterBuffer

public void unregisterBuffer(java.lang.Object obj)
Remove an already registered pBuffer for a given key object.

Specified by:
unregisterBuffer in interface OffscreenRenderTargetRenderable
Parameters:
obj - The key used to register the buffer with

render

public void render(javax.media.opengl.GL gl)
Issue ogl commands needed for this component

Specified by:
render in interface ObjectRenderable
Parameters:
gl - The gl context to draw with

postRender

public void postRender(javax.media.opengl.GL gl)
Restore all openGL state to the given drawable

Specified by:
postRender in interface ObjectRenderable
Parameters:
gl - The gl context to draw with

getRenderTargetIndex

public int getRenderTargetIndex()
Request the index of this texture in the render target list. This texture is never used for the primary buffer, so the index will always be greater than one.

Returns:
a number greater than one

setBoundaryModeT

public void setBoundaryModeT(int mode)
                      throws InvalidWriteTimingException
Set the boundary handling for the T parameter.

Parameters:
mode - The new mode.
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the NodeUpdateListener data changed callback method

getBoundaryModeT

public int getBoundaryModeT()
Get the current boundary handling for the S parameter.

Returns:
The current mode.

Aviatrix3D
2.1.0

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