Package WildMagic.LibGraphics.Effects
Class GoochEffect
- java.lang.Object
-
- WildMagic.LibGraphics.ObjectSystem.GraphicsObject
-
- WildMagic.LibGraphics.Effects.Effect
-
- WildMagic.LibGraphics.Effects.ShaderEffect
-
- WildMagic.LibGraphics.Effects.GoochEffect
-
- All Implemented Interfaces:
java.io.Serializable
,NameIdInterface
,StreamInterface
public class GoochEffect extends ShaderEffect implements StreamInterface, java.io.Serializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected float[]
m_afLightPosition
The light pos is stored at index 0, 1, 2.(package private) ZBufferState
m_spkSaveZState
Saved and modified z-buffer state.(package private) ZBufferState
m_spkZState
Saved and modified z-buffer state.private static long
serialVersionUID
-
Fields inherited from class WildMagic.LibGraphics.Effects.ShaderEffect
m_iPassQuantity, m_kAlphaState, m_kCompiledPrograms, m_kPShader, m_kVShader
-
-
Constructor Summary
Constructors Constructor Description GoochEffect()
Creates an GoochEffect, with default initialization.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
Delete memoryint
GetDiskUsed(StreamVersion rkVersion)
Returns the size of this object and its children on disk for the current StreamVersion parameter.Vector3f
GetLightPosition()
Parameters for the vertex programvoid
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.void
OnLoadPrograms(int iPass, Program pkVProgram, Program pkPProgram, Program pkCProgram)
Set the user-defined constants to use local storage.void
RestoreGlobalState(int iPass, Renderer pkRenderer, boolean bPrimaryEffect)
Restore default rendering state.void
Save(Stream rkStream)
Write this object and all it's children to the Stream.StringTree
SaveStrings(java.lang.String acTitle)
Write this object into a StringTree for the scene-graph visualization.void
SetGlobalState(int iPass, Renderer pkRenderer, boolean bPrimaryEffect)
Override default rendering state to change the z-buffer comparison test.void
SetLightPosition(Vector3f rkLightPosition)
Parameters for the vertex program-
Methods inherited from class WildMagic.LibGraphics.Effects.ShaderEffect
GetAllObjectsByName, GetBlending, GetCProgram, GetObjectByID, GetObjectByName, GetPassQuantity, GetPProgram, GetSamplerInformation, GetTexture, GetTexture, GetTextureQuantity, GetVProgram, Link, LoadPrograms, LoadResources, OnReleasePrograms, Register, ReleasePrograms, ReleaseResources, SetCProgram, SetDefaultAlphaState, SetPassQuantity, SetPShader, SetVShader
-
Methods inherited from class WildMagic.LibGraphics.ObjectSystem.GraphicsObject
GetID, GetName, GetNextID, GetObjectByIDBase, GetObjectByNameBase, SetName
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface WildMagic.LibGraphics.ObjectSystem.StreamInterface
Link, Register
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
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.
-
-
Method Detail
-
dispose
public void dispose()
Delete memory- Overrides:
dispose
in classShaderEffect
-
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 interfaceStreamInterface
- Overrides:
GetDiskUsed
in classShaderEffect
- 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 interfaceStreamInterface
- Overrides:
Load
in classShaderEffect
- 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 classShaderEffect
- Parameters:
iPass
-pkVProgram
- the VertexProgram for this EffectpkPProgram
- the PixelProgram for this Effect
-
RestoreGlobalState
public void RestoreGlobalState(int iPass, Renderer pkRenderer, boolean bPrimaryEffect)
Restore default rendering state.- Overrides:
RestoreGlobalState
in classShaderEffect
- Parameters:
iPass
- the ith rendering passpkRenderer
- the Rendering objectbPrimaryEffect
- primary or secondary
-
Save
public void Save(Stream rkStream)
Write this object and all it's children to the Stream.- Specified by:
Save
in interfaceStreamInterface
- Overrides:
Save
in classShaderEffect
- 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 interfaceStreamInterface
- Overrides:
SaveStrings
in classShaderEffect
- 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 classShaderEffect
- Parameters:
iPass
- the ith rendering passpkRenderer
- the Rendering objectbPrimaryEffect
- primary or secondary
-
SetLightPosition
public void SetLightPosition(Vector3f rkLightPosition)
Parameters for the vertex program- Parameters:
rkLightPosition
- position of the 'light' that shades the object.
-
-