de.grogra.imp3d.glsl
Class OpenGLState
java.lang.Object
de.grogra.imp3d.glsl.OpenGLState
public class OpenGLState
- extends java.lang.Object
OpenGLState stores all relevant information about the used OpenGL Context.
This includes active shaders, FBOs and the state of tests like the alpha test,
the z-test. It also stores the state of culling and blending. This is done
to prevent unnecessary state changes. This class also gives access to the used FBOs
through an instance of the GLSLFBOManager
class. It stores all data shared
by the different classes of OpenGL (Proteus).
- Author:
- Konni Hartmann
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ALPHA_TEST
public static final char ALPHA_TEST
- See Also:
- Constant Field Values
ALPHA_TEST_BIT
public static final char ALPHA_TEST_BIT
- See Also:
- Constant Field Values
attachPoints
public static final int[] attachPoints
BGFound
public boolean BGFound
BLEND
public static final char BLEND
- See Also:
- Constant Field Values
BLEND_BIT
public static final char BLEND_BIT
- See Also:
- Constant Field Values
csc
public CachedShaderCollection csc
- ShaderCollection buffers all compiled Shaders used to simulate
scene-shaders (like different Phong combinations, RGBAShader ...) and
light-Shaders (like Spot-Light, SunSkyLight ...)
CULLING
public static final char CULLING
- See Also:
- Constant Field Values
CULLING_BIT
public static final char CULLING_BIT
- See Also:
- Constant Field Values
currentPassName
public java.lang.String currentPassName
debugDrawn
public boolean debugDrawn
DEFAULT_MATERIAL
public static final int DEFAULT_MATERIAL
- See Also:
- Constant Field Values
DEFERRED_FBO
protected static final int DEFERRED_FBO
- See Also:
- Constant Field Values
deferredLabelRenderable
public DrawableContainer deferredLabelRenderable
deferredSolidRenderable
public DrawableContainer deferredSolidRenderable
deferredToolRenderable
public DrawableContainer deferredToolRenderable
deferredTranspRenderable
public DrawableContainer deferredTranspRenderable
defLight
public java.util.Vector<LightPos> defLight
DEPTH_PEELIG_MATERIAL
public static final int DEPTH_PEELIG_MATERIAL
- See Also:
- Constant Field Values
DEPTH_TEST
public static final char DEPTH_TEST
- See Also:
- Constant Field Values
DEPTH_TEST_BIT
public static final char DEPTH_TEST_BIT
- See Also:
- Constant Field Values
floatRT
public int floatRT
FREE2
public static final char FREE2
- See Also:
- Constant Field Values
FREE2_BIT
public static final char FREE2_BIT
- See Also:
- Constant Field Values
frustumCullingTester
public FrustumCullingTester frustumCullingTester
HDR_FBO
protected static final int HDR_FBO
- See Also:
- Constant Field Values
height
public int height
INFINITY_PLANE_MATERIAL
public static final int INFINITY_PLANE_MATERIAL
- See Also:
- Constant Field Values
LIGHTING
public static final char LIGHTING
- See Also:
- Constant Field Values
LIGHTING_BIT
public static final char LIGHTING_BIT
- See Also:
- Constant Field Values
lights
public java.util.Vector<LightPos> lights
- Vector of LightPos-objects. Is filled by the first renderpass with lights
from the scenegraph, including there transformation.
lineCache
public LineSegmentizationCache lineCache
occlusionQuery
public int[] occlusionQuery
renderPass
public int renderPass
resetCache
public boolean resetCache
RT_DIFF_SPEC
protected static final int RT_DIFF_SPEC
- See Also:
- Constant Field Values
RT_EMIS_FREE
protected static final int RT_EMIS_FREE
- See Also:
- Constant Field Values
RT_FIRSTHDR
protected static final int RT_FIRSTHDR
- See Also:
- Constant Field Values
RT_NORM_POS_SHINE
protected static final int RT_NORM_POS_SHINE
- See Also:
- Constant Field Values
RT_SECONDHDR
protected static final int RT_SECONDHDR
- See Also:
- Constant Field Values
RT_TRANSP_SPECTRANSP
protected static final int RT_TRANSP_SPECTRANSP
- See Also:
- Constant Field Values
SHADOWMAP_FBO
protected static final int SHADOWMAP_FBO
- See Also:
- Constant Field Values
SKY_MATERIAL
public static final int SKY_MATERIAL
- See Also:
- Constant Field Values
SKY_PREVIEW_MATERIAL
public static final int SKY_PREVIEW_MATERIAL
- See Also:
- Constant Field Values
SKY_REFLECTION_MATERIAL
public static final int SKY_REFLECTION_MATERIAL
- See Also:
- Constant Field Values
skyCube
public GLSLSkyCube skyCube
skyDiffuseCube
public GLSLSkyCube skyDiffuseCube
SM_Manager
public ShadowMapCollection SM_Manager
staticObjects
public java.util.Vector<GLSLOpenGLObject> staticObjects
STENCIL_TEST
public static final char STENCIL_TEST
- See Also:
- Constant Field Values
STENCIL_TEST_BIT
public static final char STENCIL_TEST_BIT
- See Also:
- Constant Field Values
TEXTURE_2D
public static final char TEXTURE_2D
- See Also:
- Constant Field Values
TEXTURE_2D_BIT
public static final char TEXTURE_2D_BIT
- See Also:
- Constant Field Values
TRANSP_DEPTH_ONLY_MATERIAL
public static final int TRANSP_DEPTH_ONLY_MATERIAL
- See Also:
- Constant Field Values
VBO_Manager
public VBOManager VBO_Manager
volume
public GLSLVolumeBuilder volume
width
public int width
OpenGLState
public OpenGLState()
cleanUp
public void cleanUp(boolean javaonly)
disable
public void disable(char state)
enable
public void enable(char state)
getActiveShader
public int getActiveShader()
getAlphaFBO
public FrameBufferObject getAlphaFBO()
- Returns:
- the alphaFBO
getBgPowerDensity
public float getBgPowerDensity()
getBGShader
public Shader getBGShader()
getCubeFBO
public FrameBufferObject getCubeFBO()
- Returns:
- the cubeFBO
getDeferredShadingDepthTRT
public TextureRenderTarget getDeferredShadingDepthTRT()
getDeferredShadingFBO
public FrameBufferObject getDeferredShadingFBO()
- Returns:
- the deferredShadingFBO
getDepthRB
public RenderBuffer getDepthRB()
- Returns:
- the depthRB
getDualDepthFBO
public FrameBufferObject getDualDepthFBO()
- Returns:
- the dualDepthFBO
getFaceCullingMode
public int getFaceCullingMode()
getFboManager
public GLSLFBOManager getFboManager()
- Returns:
- the fboManager
getFloatRT
public int getFloatRT()
getFloatRTLast
public int getFloatRTLast()
getGL
public javax.media.opengl.GL getGL()
getGraphStamp
public int getGraphStamp()
getHDRFBO
public FrameBufferObject getHDRFBO()
- Returns:
- the HDRFBO
getInvViewToClip
public Matrix4d getInvViewToClip()
getInvWorldToView
public Matrix4d getInvWorldToView()
getPeelingFarDepthTRT
public TextureRenderTarget getPeelingFarDepthTRT()
- Returns:
- the peelingFarDepthTRT
getPeelingNearDepthTRT
public TextureRenderTarget getPeelingNearDepthTRT()
- Returns:
- the peelingNearDepthTRT
getPeelingRB
public RenderBuffer getPeelingRB()
- Returns:
- the peelingRB
getShadowFBO
public FrameBufferObject getShadowFBO()
- Returns:
- the shadowFBO
getShapeManager
public RenderableCollection getShapeManager()
getState
public boolean getState(char state)
getViewToClip
public Matrix4d getViewToClip()
getWorldToView
public Matrix4d getWorldToView()
hasGraphChanged
public boolean hasGraphChanged()
info
public void info(java.lang.String txt)
initLineCache
public void initLineCache(GLDisplay disp)
initSize
public void initSize(int width,
int height)
invalidateCache
public void invalidateCache()
isAssumeTranspMaterials
public boolean isAssumeTranspMaterials()
loadMatrixd
public void loadMatrixd(Matrix4d m)
popClock
public long popClock()
presentDebugScreen
public void presentDebugScreen(GLSLDisplay disp)
printClock
public long printClock(java.lang.String pre)
printGPUMemoryUsage
public void printGPUMemoryUsage(GLSLDisplay disp)
printPoints
public void printPoints()
setActiveProgram
public void setActiveProgram(int program)
setAssumeTranspMaterials
public void setAssumeTranspMaterials(boolean assumeTranspMaterials)
setDeferredShadingDepthTRT
public void setDeferredShadingDepthTRT(TextureRenderTarget dsDTRT)
setDepthMask
public void setDepthMask(boolean maskEnable)
setFaceCullingMode
public void setFaceCullingMode(int faceCulling)
setFBO
public void setFBO(int fboNo)
setGL
public void setGL(javax.media.opengl.GL glcontext)
setMatrixMode
public void setMatrixMode(int matrixMode)
setPoint
public void setPoint(Vector3f v,
int i)
setShaderConfSwitch
public void setShaderConfSwitch(int shaderConfSwitch)
setState
public void setState(char state)
- Set the GL-Statemachine to the state given.
- Parameters:
state
- The State to be set. Each Bit corresponds to a certain Parameter.
setupBGPowerDensity
public void setupBGPowerDensity(float powerDensity)
setupBGShader
public void setupBGShader(Shader shader)
startClock
public void startClock()
switchFloatRT
public void switchFloatRT()
testFBO
public void testFBO()
testGLError
public boolean testGLError()
testGLError
public boolean testGLError(java.lang.String prefix)
toGLMatrix3f
public float[] toGLMatrix3f(Matrix3f mat)
- Parameters:
mat
-
- Returns:
toGLMatrix4
public double[] toGLMatrix4(Matrix4d m)
- Parameters:
m
-
- Returns:
- a one dimensional array containing the data of m
ordered such that it may be used in OpenGL-Methods.
updateTransformations
public void updateTransformations(GLSLDisplay disp)
warning
public void warning(java.lang.String txt)