Class GoochEffect

    • Field Detail

      • m_spkSaveZState

        ZBufferState m_spkSaveZState
        Saved and modified z-buffer state.
      • m_spkZState

        ZBufferState m_spkZState
        Saved and modified z-buffer state.
      • m_afLightPosition

        protected float[] m_afLightPosition
        The light pos is stored at index 0, 1, 2. The other value is unused.
    • Constructor Detail

      • GoochEffect

        public GoochEffect()
        Creates an GoochEffect, with default initialization. Pair with WireframeBehindEffect to get silhouette edges, too.
    • Method Detail

      • GetDiskUsed

        public int GetDiskUsed​(StreamVersion rkVersion)
        Returns the size of this object and its children on disk for the current StreamVersion parameter.
        Specified by:
        GetDiskUsed in interface StreamInterface
        Overrides:
        GetDiskUsed in class ShaderEffect
        Parameters:
        rkVersion - the current version of the Stream file being created.
        Returns:
        the size of this object on disk.
      • GetLightPosition

        public Vector3f GetLightPosition()
        Parameters for the vertex program
        Returns:
        the light position.
      • Load

        public void Load​(Stream rkStream,
                         Stream.Link pkLink)
        Loads this object from the input parameter rkStream, using the input Stream.Link to store the IDs of children objects of this object for linking after all objects are loaded from the Stream.
        Specified by:
        Load in interface StreamInterface
        Overrides:
        Load in class ShaderEffect
        Parameters:
        rkStream - the Stream from which this object is being read.
        pkLink - the Link class for storing the IDs of this object's children objects.
      • OnLoadPrograms

        public void OnLoadPrograms​(int iPass,
                                   Program pkVProgram,
                                   Program pkPProgram,
                                   Program pkCProgram)
        Set the user-defined constants to use local storage.
        Overrides:
        OnLoadPrograms in class ShaderEffect
        Parameters:
        iPass -
        pkVProgram - the VertexProgram for this Effect
        pkPProgram - the PixelProgram for this Effect
      • RestoreGlobalState

        public void RestoreGlobalState​(int iPass,
                                       Renderer pkRenderer,
                                       boolean bPrimaryEffect)
        Restore default rendering state.
        Overrides:
        RestoreGlobalState in class ShaderEffect
        Parameters:
        iPass - the ith rendering pass
        pkRenderer - the Rendering object
        bPrimaryEffect - primary or secondary
      • Save

        public void Save​(Stream rkStream)
        Write this object and all it's children to the Stream.
        Specified by:
        Save in interface StreamInterface
        Overrides:
        Save in class ShaderEffect
        Parameters:
        rkStream - the Stream where the child objects are stored.
      • SaveStrings

        public StringTree SaveStrings​(java.lang.String acTitle)
        Write this object into a StringTree for the scene-graph visualization.
        Specified by:
        SaveStrings in interface StreamInterface
        Overrides:
        SaveStrings in class ShaderEffect
        Parameters:
        acTitle - the header for this object in the StringTree.
        Returns:
        StringTree containing a String-based representation of this object and its children.
      • SetGlobalState

        public void SetGlobalState​(int iPass,
                                   Renderer pkRenderer,
                                   boolean bPrimaryEffect)
        Override default rendering state to change the z-buffer comparison test.
        Overrides:
        SetGlobalState in class ShaderEffect
        Parameters:
        iPass - the ith rendering pass
        pkRenderer - the Rendering object
        bPrimaryEffect - primary or secondary
      • SetLightPosition

        public void SetLightPosition​(Vector3f rkLightPosition)
        Parameters for the vertex program
        Parameters:
        rkLightPosition - position of the 'light' that shades the object.