Package com.jogamp.graph.curve.opengl
Class RenderState
- java.lang.Object
-
- com.jogamp.graph.curve.opengl.RenderState
-
public class RenderState extends Object
The RenderState is owned byRegionRenderer. It holds rendering state data likePMVMatrix4f, viewport, but also the currentstatic color.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRenderState.ProgramLocal
-
Field Summary
Fields Modifier and Type Field Description static intBITHINT_BLENDING_ENABLEDBitfield hint,if setstating enabledGL.GL_BLEND, otherwise disabled.static intBITHINT_GLOBAL_DEPTH_TEST_ENABLEDBitfield hint,if setstating globally enabledGL.GL_DEPTH_TEST, otherwise disabled.static intDEBUG_LINESTRIP
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RenderStateattachTo(GL2ES2 gl)voidclearDebugBits(int mask)voidclearHintBits(int mask)booleandebugBitsSet(int mask)booleandetachFrom(GL2ES2 gl)intgetAAQuality()Returns pass2 AA-quality rendering value for Graph Region AArender-modes:Region.VBAA_RENDERING_BIT.com.jogamp.math.geom.FrustumgetClipFrustum()Returns the optional Mv-premultiplied clippingFrustumor null if unused.com.jogamp.math.Vec4fgetColorStatic(com.jogamp.math.Vec4f rgbaColor)intgetDebugBits()intgetHintBits()com.jogamp.math.util.PMVMatrix4fgetMatrix()Borrow the currentPMVMatrix4f.static RenderStategetRenderState(GL2ES2 gl)intgetSampleCount()Returns pass2 AA sample count for Graph Region AArender-modes:#VBAA_RENDERING_BITorRegion.MSAA_RENDERING_BIT.ShaderProgramgetShaderProgram()Return the currentShaderProgramfloatgetWeight()booleanhintBitsSet(int mask)intid()booleanisShaderProgramInUse()Return whether the currentShaderProgramisin use.static booleanisWeightValid(float v)intsetAAQuality(int v)Sets pass2 AA-quality rendering value clipped to the range [Region.MIN_AA_QUALITY..Region.MAX_AA_QUALITY] for Graph Region AArender-modes:Region.VBAA_RENDERING_BIT.voidsetClipFrustum(com.jogamp.math.geom.Frustum clipFrustum)Set the optional clippingFrustum, which shall be pre-multiplied with the Mv-matrix or null to disable.voidsetColorStatic(float r, float g, float b, float a)voidsetColorStatic(com.jogamp.math.Vec4f rgbaColor)voidsetDebugBits(int mask)voidsetHintBits(int mask)intsetSampleCount(int v)Sets pass2 AA sample count clipped to the range [Region.MIN_AA_SAMPLE_COUNT..Region.MAX_AA_SAMPLE_COUNT] for Graph Region AArender-modes:#VBAA_RENDERING_BITorRegion.MSAA_RENDERING_BIT.booleansetShaderProgram(GL2ES2 gl, ShaderProgram spNext)Sets the currentShaderProgramand enables it.voidsetWeight(float v)StringtoString()booleanupdateAttributeLoc(GL2ES2 gl, boolean updateLocation, GLArrayDataWrapper data, boolean throwOnError)booleanupdateUniformDataLoc(GL2ES2 gl, boolean updateLocation, boolean updateData, GLUniformData data, boolean throwOnError)booleanupdateUniformLoc(GL2ES2 gl, boolean updateLocation, GLUniformData data, boolean throwOnError)
-
-
-
Field Detail
-
BITHINT_BLENDING_ENABLED
public static final int BITHINT_BLENDING_ENABLED
Bitfield hint,if setstating enabledGL.GL_BLEND, otherwise disabled.Shall be set via
setHintBits(int)and cleared viaclearHintBits(int).If set,
GLRegion's draw-methodwill set the properblend-functionand the clear-color to transparent-black in case ofmultipassFBO rendering.Shall be set by custom code, e.g. via
RegionRenderer's enable and disableRegionRenderer.GLCallbackas done inRegionRenderer.defaultBlendEnableandRegionRenderer.defaultBlendDisable.- See Also:
- Constant Field Values
-
BITHINT_GLOBAL_DEPTH_TEST_ENABLED
public static final int BITHINT_GLOBAL_DEPTH_TEST_ENABLED
Bitfield hint,if setstating globally enabledGL.GL_DEPTH_TEST, otherwise disabled.Shall be set via
setHintBits(int)and cleared viaclearHintBits(int).GLRegion's draw-methodmay toggle depth test, and reset it's state according to this hint.Shall be set by custom code, e.g. after
RenderStateorRegionRendererconstruction.- See Also:
- Constant Field Values
-
DEBUG_LINESTRIP
public static final int DEBUG_LINESTRIP
- See Also:
- Constant Field Values
-
-
Method Detail
-
getRenderState
public static final RenderState getRenderState(GL2ES2 gl)
-
id
public final int id()
-
getShaderProgram
public final ShaderProgram getShaderProgram()
Return the currentShaderProgram
-
isShaderProgramInUse
public final boolean isShaderProgramInUse()
Return whether the currentShaderProgramisin use.
-
setShaderProgram
public final boolean setShaderProgram(GL2ES2 gl, ShaderProgram spNext)
Sets the currentShaderProgramand enables it. If the givenShaderProgramis notthe current, method returns true, otherwise false.- Parameters:
gl-spNext- the next currentShaderProgramto be set and enabled- Returns:
- true if a new shader program is being used and hence external uniform-data and -location, as well as the attribute-location must be updated, otherwise false.
-
getMatrix
public final com.jogamp.math.util.PMVMatrix4f getMatrix()
Borrow the currentPMVMatrix4f.
-
isWeightValid
public static boolean isWeightValid(float v)
-
getWeight
public final float getWeight()
-
setWeight
public final void setWeight(float v)
-
getColorStatic
public final com.jogamp.math.Vec4f getColorStatic(com.jogamp.math.Vec4f rgbaColor)
-
setColorStatic
public final void setColorStatic(com.jogamp.math.Vec4f rgbaColor)
-
setColorStatic
public final void setColorStatic(float r, float g, float b, float a)
-
setAAQuality
public final int setAAQuality(int v)
Sets pass2 AA-quality rendering value clipped to the range [Region.MIN_AA_QUALITY..Region.MAX_AA_QUALITY] for Graph Region AArender-modes:Region.VBAA_RENDERING_BIT.
-
getAAQuality
public final int getAAQuality()
Returns pass2 AA-quality rendering value for Graph Region AArender-modes:Region.VBAA_RENDERING_BIT.
-
setSampleCount
public final int setSampleCount(int v)
Sets pass2 AA sample count clipped to the range [Region.MIN_AA_SAMPLE_COUNT..Region.MAX_AA_SAMPLE_COUNT] for Graph Region AArender-modes:#VBAA_RENDERING_BITorRegion.MSAA_RENDERING_BIT.
-
getSampleCount
public final int getSampleCount()
Returns pass2 AA sample count for Graph Region AArender-modes:#VBAA_RENDERING_BITorRegion.MSAA_RENDERING_BIT.
-
setClipFrustum
public final void setClipFrustum(com.jogamp.math.geom.Frustum clipFrustum)
Set the optional clippingFrustum, which shall be pre-multiplied with the Mv-matrix or null to disable.
-
getClipFrustum
public final com.jogamp.math.geom.Frustum getClipFrustum()
Returns the optional Mv-premultiplied clippingFrustumor null if unused.
-
getHintBits
public final int getHintBits()
-
hintBitsSet
public final boolean hintBitsSet(int mask)
-
setHintBits
public final void setHintBits(int mask)
-
clearHintBits
public final void clearHintBits(int mask)
-
getDebugBits
public final int getDebugBits()
-
debugBitsSet
public final boolean debugBitsSet(int mask)
-
setDebugBits
public final void setDebugBits(int mask)
-
clearDebugBits
public final void clearDebugBits(int mask)
-
updateUniformLoc
public final boolean updateUniformLoc(GL2ES2 gl, boolean updateLocation, GLUniformData data, boolean throwOnError)
- Parameters:
gl-updateLocation-data-throwOnError- TODO- Returns:
- true if no error occured, i.e. all locations found, otherwise false.
-
updateUniformDataLoc
public final boolean updateUniformDataLoc(GL2ES2 gl, boolean updateLocation, boolean updateData, GLUniformData data, boolean throwOnError)
- Parameters:
gl-updateLocation-updateData- TODOdata-throwOnError- TODO- Returns:
- true if no error occured, i.e. all locations found, otherwise false.
-
updateAttributeLoc
public final boolean updateAttributeLoc(GL2ES2 gl, boolean updateLocation, GLArrayDataWrapper data, boolean throwOnError)
- Parameters:
gl-data-throwOnError- TODO- Returns:
- true if no error occured, i.e. all locations found, otherwise false.
-
attachTo
public final RenderState attachTo(GL2ES2 gl)
-
detachFrom
public final boolean detachFrom(GL2ES2 gl)
-
-