|
j3d.org Aviatrix3D | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.j3d.aviatrix3d.SceneGraphObject
org.j3d.aviatrix3d.NodeComponent
org.j3d.aviatrix3d.Texture
org.j3d.aviatrix3d.OffscreenTexture2D
Describes the texture that is rendered to an offscreen buffer, using OpenGL pBuffers.
Since the format information is provided as part of the GLCapabilities instance, there is no need for it to be passed into the constructor like the other texture types do.
This implementation is somewhat shaky right now as the documentation on how to use the GLPbuffer class is very poor. The class may change drastically once we really work out what is going on.
Since an offscreen rendering process has a completely different set of viewing parameters to the main scene, we have to include almost everything here as well. A complete viewing environment must be set up to deal with the texture rendering.
For repainting updates, the logic is as-follows. On the first time this
Field Summary |
Fields inherited from class org.j3d.aviatrix3d.NodeComponent |
liveCount |
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject |
alive, updateHandler, WRITE_TIMING_MSG |
Constructor Summary | |
OffscreenTexture2D(net.java.games.jogl.GLCapabilities caps,
int width,
int height)
Constructs an offscreen texture that fits the given setup. |
Method Summary | |
protected void |
checkForCyclicChild(SceneGraphObject parent)
Check to see if this node is the same reference as the passed node that is a parent of this node. |
int |
getBoundaryModeS()
Get the current boundary handling for the S parameter. |
net.java.games.jogl.GLPbuffer |
getBuffer(java.lang.Object obj)
Get the currently registered pBuffer for the given key object. |
void |
getClearColor(float[] col)
Set the background colour that this surface should be cleared to before the drawing step. |
net.java.games.jogl.GLCapabilities |
getGLSetup()
Get the requested buffer setup that describes this offscreen texture. |
int |
getHeight()
Get the height of the texture in pixels. |
Scene |
getRenderedScene()
Get the root of the currently rendered scene. |
boolean |
isRepaintRequired()
Get the current state of the repainting enabled flag. |
void |
registerBuffer(java.lang.Object obj,
net.java.games.jogl.GLPbuffer buffer)
Register a pBuffer for a given key object. |
void |
renderState(net.java.games.jogl.GL gl,
net.java.games.jogl.GLU glu)
Issue ogl commands needed for this component |
void |
restoreState(net.java.games.jogl.GL gl,
net.java.games.jogl.GLU glu)
Restore all openGL state to the given drawable |
void |
setBoundaryModeS(int mode)
Set the boundary handling for the S parameter. |
void |
setClearColor(float r,
float g,
float b,
float a)
Set the background colour that this surface should be cleared to before the drawing step. |
void |
setImages(int mipMapMode,
int format,
TextureComponent[] srcImages,
int num)
Set the images for this texture, overridden to provide an empty implementation as this is handled by the pBuffer directly. |
protected void |
setLive(boolean state)
Notification that this object is live now. |
void |
setRenderedScene(Scene scene)
Set the collection of geometry that should be rendered to this texture. |
void |
setRepaintRequired(boolean enable)
Set this texture as requiring a repaint for the next frame. |
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, getAnisotropicFilterDegree, getAnisotropicFilterMode, getFormat, getMagFilter, getMinFilter, getTextureType, getWidth, setAnisotropicFilterDegree, setAnisotropicFilterMode, setMagFilter, setMinFilter |
Methods inherited from class org.j3d.aviatrix3d.NodeComponent |
addParent, getParents, hasChanged, numParents, removeParent |
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject |
checkForCyclicParent, dataChanged, getUserData, isLive, setUpdateHandler, setUserData |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.j3d.aviatrix3d.OffscreenTextureSource |
getWidth |
Constructor Detail |
public OffscreenTexture2D(net.java.games.jogl.GLCapabilities caps, int width, int height)
Method Detail |
public void setImages(int mipMapMode, int format, TextureComponent[] srcImages, int num) throws InvalidWriteTimingException
setImages
in class Texture
mipMapMode
- Flag stating the type of texture mode to useformat
- Image format to use for grayscale imagessrcImages
- The image data to use, single for base levelnum
- The valid number of images to use from the array
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener callback methodprotected void checkForCyclicChild(SceneGraphObject parent) throws CyclicSceneGraphStructureException
checkForCyclicChild
in class SceneGraphObject
parent
- The reference to check against this class
CyclicSceneGraphStructureException
- Equal parent and childpublic void renderState(net.java.games.jogl.GL gl, net.java.games.jogl.GLU glu)
renderState
in class NodeComponent
gl
- The gl context to draw withglu
- The utility context to draw withpublic void restoreState(net.java.games.jogl.GL gl, net.java.games.jogl.GLU glu)
restoreState
in class NodeComponent
gl
- The gl context to draw withglu
- The utility context to draw withprotected void setLive(boolean state)
setLive
in class SceneGraphObject
state
- true if this should be marked as live nowpublic void setBoundaryModeS(int mode) throws InvalidWriteTimingException
setBoundaryModeS
in class Texture
mode
- The new mode.
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener callback methodpublic int getBoundaryModeS()
getBoundaryModeS
in class Texture
public int getHeight()
getHeight
in interface OffscreenTextureSource
public net.java.games.jogl.GLCapabilities getGLSetup()
getGLSetup
in interface OffscreenTextureSource
public void setRenderedScene(Scene scene) throws CyclicSceneGraphStructureException
scene
- The new scene instance to use or null
CyclicSceneGraphStructureException
- Equal parent and childpublic Scene getRenderedScene()
getRenderedScene
in interface OffscreenTextureSource
public net.java.games.jogl.GLPbuffer getBuffer(java.lang.Object obj)
getBuffer
in interface OffscreenTextureSource
obj
- The key used to register the buffer with
public void registerBuffer(java.lang.Object obj, net.java.games.jogl.GLPbuffer buffer)
registerBuffer
in interface OffscreenTextureSource
obj
- The key used to register the buffer withbuffer
- The buffer instance to use here.public void unregisterBuffer(java.lang.Object obj)
unregisterBuffer
in interface OffscreenTextureSource
obj
- The key used to register the buffer withpublic void setRepaintRequired(boolean enable)
enable
- true to have this repaint the next framepublic boolean isRepaintRequired()
isRepaintRequired
in interface OffscreenTextureSource
public void setClearColor(float r, float g, float b, float a)
r
- The red component of the background clear colourg
- The green component of the background clear colourb
- The blue component of the background clear coloura
- The alpha component of the background clear colourpublic void getClearColor(float[] col)
getClearColor
in interface OffscreenTextureSource
col
- An array of at least length 4 to copy values into
|
j3d.org Aviatrix3D | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |