java.lang.Object
de.grogra.glsl.OpenGLState
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
-
Field Summary
Modifier and TypeFieldDescriptionstatic final char
static final char
static final int[]
boolean
static final char
static final char
ShaderCollection buffers all compiled Shaders used to simulate scene-shaders (like different Phong combinations, RGBAShader ...) and light-Shaders (like Spot-Light, SunSkyLight ...)static final char
static final char
boolean
static final int
protected static final int
static final int
static final char
static final char
int
static final char
static final char
protected static final int
int
static final int
static final char
static final char
Vector of LightPos-objects.int[]
int
boolean
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
static final int
static final int
static final int
static final char
static final char
static final char
static final char
static final int
int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cleanUp
(boolean javaonly) void
disable
(char state) void
enable
(char state) int
float
int
int
int
javax.media.opengl.GL
getGL()
int
boolean
getState
(char state) boolean
void
void
initLineCache
(GLDisplay disp) void
initSize
(int width, int height) void
boolean
void
long
popClock()
void
long
printClock
(String pre) void
void
void
setActiveProgram
(int program) void
setAssumeTranspMaterials
(boolean assumeTranspMaterials) void
void
setDepthMask
(boolean maskEnable) void
setFaceCullingMode
(int faceCulling) void
setFBO
(int fboNo) void
setGL
(javax.media.opengl.GL glcontext) void
setMatrixMode
(int matrixMode) void
void
setShaderConfSwitch
(int shaderConfSwitch) void
setState
(char state) Set the GL-Statemachine to the state given.void
setupBGPowerDensity
(float powerDensity) void
setupBGShader
(Shader shader) void
void
void
testFBO()
boolean
boolean
testGLError
(String prefix) float[]
toGLMatrix3f
(Matrix3f mat) double[]
void
void
-
Field Details
-
debugDrawn
public boolean debugDrawn -
currentPassName
-
renderPass
public int renderPass -
width
public int width -
height
public int height -
occlusionQuery
public int[] occlusionQuery -
SM_Manager
-
VBO_Manager
-
defLight
-
lineCache
-
staticObjects
-
deferredSolidRenderable
-
deferredToolRenderable
-
deferredLabelRenderable
-
deferredTranspRenderable
-
volume
-
lights
Vector of LightPos-objects. Is filled by the first renderpass with lights from the scenegraph, including there transformation. -
csc
ShaderCollection buffers all compiled Shaders used to simulate scene-shaders (like different Phong combinations, RGBAShader ...) and light-Shaders (like Spot-Light, SunSkyLight ...) -
RT_NORM_POS_SHINE
protected static final int RT_NORM_POS_SHINE- See Also:
-
RT_DIFF_SPEC
protected static final int RT_DIFF_SPEC- See Also:
-
RT_EMIS_FREE
protected static final int RT_EMIS_FREE- See Also:
-
RT_TRANSP_SPECTRANSP
protected static final int RT_TRANSP_SPECTRANSP- See Also:
-
RT_FIRSTHDR
protected static final int RT_FIRSTHDR- See Also:
-
RT_SECONDHDR
protected static final int RT_SECONDHDR- See Also:
-
DEFERRED_FBO
protected static final int DEFERRED_FBO- See Also:
-
HDR_FBO
protected static final int HDR_FBO- See Also:
-
SHADOWMAP_FBO
protected static final int SHADOWMAP_FBO- See Also:
-
attachPoints
public static final int[] attachPoints -
ALPHA_TEST
public static final char ALPHA_TEST- See Also:
-
STENCIL_TEST
public static final char STENCIL_TEST- See Also:
-
DEPTH_TEST
public static final char DEPTH_TEST- See Also:
-
LIGHTING
public static final char LIGHTING- See Also:
-
TEXTURE_2D
public static final char TEXTURE_2D- See Also:
-
BLEND
public static final char BLEND- See Also:
-
CULLING
public static final char CULLING- See Also:
-
FREE2
public static final char FREE2- See Also:
-
ALPHA_TEST_BIT
public static final char ALPHA_TEST_BIT- See Also:
-
STENCIL_TEST_BIT
public static final char STENCIL_TEST_BIT- See Also:
-
DEPTH_TEST_BIT
public static final char DEPTH_TEST_BIT- See Also:
-
LIGHTING_BIT
public static final char LIGHTING_BIT- See Also:
-
TEXTURE_2D_BIT
public static final char TEXTURE_2D_BIT- See Also:
-
BLEND_BIT
public static final char BLEND_BIT- See Also:
-
CULLING_BIT
public static final char CULLING_BIT- See Also:
-
FREE2_BIT
public static final char FREE2_BIT- See Also:
-
skyCube
-
skyDiffuseCube
-
BGFound
public boolean BGFound -
floatRT
public int floatRT -
DEFAULT_MATERIAL
public static final int DEFAULT_MATERIAL- See Also:
-
SKY_MATERIAL
public static final int SKY_MATERIAL- See Also:
-
SKY_REFLECTION_MATERIAL
public static final int SKY_REFLECTION_MATERIAL- See Also:
-
TRANSP_DEPTH_ONLY_MATERIAL
public static final int TRANSP_DEPTH_ONLY_MATERIAL- See Also:
-
DEPTH_PEELIG_MATERIAL
public static final int DEPTH_PEELIG_MATERIAL- See Also:
-
INFINITY_PLANE_MATERIAL
public static final int INFINITY_PLANE_MATERIAL- See Also:
-
SKY_PREVIEW_MATERIAL
public static final int SKY_PREVIEW_MATERIAL- See Also:
-
resetCache
public boolean resetCache -
frustumCullingTester
-
-
Constructor Details
-
OpenGLState
public OpenGLState()
-
-
Method Details
-
getShapeManager
-
presentDebugScreen
-
initSize
public void initSize(int width, int height) -
initLineCache
-
info
-
warning
-
setGL
public void setGL(javax.media.opengl.GL glcontext) -
getGL
public javax.media.opengl.GL getGL() -
getActiveShader
public int getActiveShader() -
setActiveProgram
public void setActiveProgram(int program) -
enable
public void enable(char state) -
disable
public void disable(char state) -
getState
public boolean getState(char state) -
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.
-
setMatrixMode
public void setMatrixMode(int matrixMode) -
setDepthMask
public void setDepthMask(boolean maskEnable) -
setFBO
public void setFBO(int fboNo) -
setFaceCullingMode
public void setFaceCullingMode(int faceCulling) -
getFaceCullingMode
public int getFaceCullingMode() -
toGLMatrix4
- Parameters:
m
-- Returns:
- a one dimensional array containing the data of m ordered such that it may be used in OpenGL-Methods.
-
toGLMatrix3f
- Parameters:
mat
-- Returns:
-
loadMatrixd
-
cleanUp
public void cleanUp(boolean javaonly) -
setupBGShader
-
getBGShader
-
setupBGPowerDensity
public void setupBGPowerDensity(float powerDensity) -
getBgPowerDensity
public float getBgPowerDensity() -
switchFloatRT
public void switchFloatRT() -
getFloatRT
public int getFloatRT() -
getFloatRTLast
public int getFloatRTLast() -
setShaderConfSwitch
public void setShaderConfSwitch(int shaderConfSwitch) -
testFBO
public void testFBO() -
testGLError
public boolean testGLError() -
testGLError
-
startClock
public void startClock() -
printClock
-
popClock
public long popClock() -
getGraphStamp
public int getGraphStamp() -
hasGraphChanged
public boolean hasGraphChanged() -
isAssumeTranspMaterials
public boolean isAssumeTranspMaterials() -
setAssumeTranspMaterials
public void setAssumeTranspMaterials(boolean assumeTranspMaterials) -
updateTransformations
-
getWorldToView
-
getInvWorldToView
-
getViewToClip
-
getInvViewToClip
-
printGPUMemoryUsage
-
invalidateCache
public void invalidateCache() -
getDeferredShadingFBO
- Returns:
- the deferredShadingFBO
-
getHDRFBO
- Returns:
- the HDRFBO
-
getAlphaFBO
- Returns:
- the alphaFBO
-
getShadowFBO
- Returns:
- the shadowFBO
-
getDualDepthFBO
- Returns:
- the dualDepthFBO
-
getCubeFBO
- Returns:
- the cubeFBO
-
getDepthRB
- Returns:
- the depthRB
-
getPeelingFarDepthTRT
- Returns:
- the peelingFarDepthTRT
-
getPeelingRB
- Returns:
- the peelingRB
-
getPeelingNearDepthTRT
- Returns:
- the peelingNearDepthTRT
-
setDeferredShadingDepthTRT
-
getDeferredShadingDepthTRT
-
getFboManager
- Returns:
- the fboManager
-
setPoint
-
printPoints
public void printPoints()
-