Class RenderState


  • public class RenderState
    extends Object
    The RenderState is owned by RegionRenderer. It holds rendering state data like PMVMatrix4f, viewport, but also the current static color.
    • Method Detail

      • id

        public final int id()
      • isShaderProgramInUse

        public final boolean isShaderProgramInUse()
        Return whether the current ShaderProgram is in use.
      • setShaderProgram

        public final boolean setShaderProgram​(GL2ES2 gl,
                                              ShaderProgram spNext)
        Sets the current ShaderProgram and enables it. If the given ShaderProgram is not the current, method returns true, otherwise false.
        Parameters:
        gl -
        spNext - the next current ShaderProgram to 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 current PMVMatrix4f.
      • 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)
      • setClipFrustum

        public final void setClipFrustum​(com.jogamp.math.geom.Frustum clipFrustum)
        Set the optional clipping Frustum, 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 clipping Frustum or 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 - TODO
        data -
        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.
      • detachFrom

        public final boolean detachFrom​(GL2ES2 gl)