Package WildMagic.LibGraphics.Shaders
Class Program
- java.lang.Object
-
- WildMagic.LibGraphics.ObjectSystem.GraphicsObject
-
- WildMagic.LibGraphics.SceneGraph.Spatial
-
- WildMagic.LibGraphics.Rendering.Bindable
-
- WildMagic.LibGraphics.Shaders.Program
-
- All Implemented Interfaces:
java.io.Serializable
,NameIdInterface
,StreamInterface
public class Program extends Bindable implements StreamInterface, java.io.Serializable
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class WildMagic.LibGraphics.Rendering.Bindable
Bindable.Info
-
Nested classes/interfaces inherited from class WildMagic.LibGraphics.SceneGraph.Spatial
Spatial.CullingMode
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
m_bCompiled
Flag indicating if the program is compiled or not.private boolean
m_bParsed
Flag indicating if the program was parsed or not.private int
m_iProgramID
The shader ID for compiling programs.private int
m_iShaderID
The shader ID for compiling programs.private java.lang.String
m_kProgramText
The program as a text string.private java.lang.String
m_kProgramType
The type of program, from file extension.private java.util.Vector<RendererConstant>
m_kRendererConstants
The renderer constants required by the shader program.private java.util.Vector<SamplerInformation>
m_kSamplerInformation
Information about the sampler units required by a shader program.private java.util.Vector<UserConstant>
m_kUserConstants
The user constants required by the shader program.protected static java.lang.String
ms_kColor0Str
protected static java.lang.String
ms_kColor1Str
protected static java.lang.String
ms_kColorStr
protected static java.lang.String
ms_kEOL
protected static java.lang.String
ms_kInStr
protected static java.lang.String
ms_kNormalStr
protected static java.lang.String
ms_kPositionStr
protected static java.lang.String
ms_kSampler1DStr
For use by the constructor for loading and parsing a shader program.protected static java.lang.String
ms_kSampler2DStr
protected static java.lang.String
ms_kSampler3DStr
protected static java.lang.String
ms_kSamplerCubeStr
protected static java.lang.String
ms_kSamplerProjStr
protected static java.lang.String
ms_kTexCoordStr
protected static java.lang.String
ms_kTexUnitString
protected static java.lang.String
ms_kUserString
static int
PIXEL
private static long
serialVersionUID
static int
VERTEX
-
Fields inherited from class WildMagic.LibGraphics.Rendering.Bindable
m_bShared, m_kInfoArray
-
Fields inherited from class WildMagic.LibGraphics.SceneGraph.Spatial
Culling, Local, m_iStartEffect, m_kEffects, m_kGlobalStates, m_kLights, m_pkParent, World, WorldBound, WorldBoundIsCurrent, WorldIsCurrent
-
-
Constructor Summary
Constructors Constructor Description Program()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
AddRendererConstant(RendererConstant kRC)
Access to renderer constants.void
AddSamplerInformation(SamplerInformation kSI)
Access to Sampler Information.void
AddUserConstant(UserConstant kUC)
Access to user constants.int
GetDiskUsed(StreamVersion rkVersion)
Returns the size of this object and it's children on disk for the current StreamVersion parameter.int
GetProgramID()
java.lang.String
GetProgramText()
Return the program text.java.lang.String
GetProgramType()
Return the program type string, its extension.RendererConstant
GetRC(int i)
Access to renderer constants.RendererConstant
GetRC(RendererConstant.Type eType)
Access to renderer constants.int
GetRCQuantity()
Access to renderer constants.int
GetShaderID()
SamplerInformation
GetSI(int i)
Access to samplers.SamplerInformation
GetSI(java.lang.String rkName)
Access to samplers.int
GetSIQuantity()
Access to samplers.UserConstant
GetUC(int i)
Access to user constants.UserConstant
GetUC(java.lang.String rkName)
Access to user constants.int
GetUCQuantity()
Access to user constants.boolean
IsCompiled()
boolean
IsParsed()
void
Link(Stream rkStream, Stream.Link pkLink)
Copies this objects children objects from the input Stream's HashTable, based on the LinkID of the child stored in the pkLink parameter.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.boolean
Register(Stream rkStream)
Registers this object with the input Stream parameter.void
Remove()
Delete memory.void
Reset()
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
SetCompiled(boolean bFlag)
void
SetParsed()
void
SetProgramID(int iID)
void
SetProgramText(java.lang.String kText)
Set the program text.void
SetProgramType(java.lang.String kType)
Return the program type string, its extension.void
SetShaderID(int iID)
-
Methods inherited from class WildMagic.LibGraphics.Rendering.Bindable
GetIdentifier, GetIdentifier, GetInfoQuantity, GetShared, GetVisibleSet, IsReload, IsReload, OnLoad, OnRelease, Release, Reload, Reload, SetShared, UpdateState, UpdateWorldBound
-
Methods inherited from class WildMagic.LibGraphics.SceneGraph.Spatial
AttachEffect, AttachGlobalState, AttachLight, DetachAllEffects, DetachAllGlobalStates, DetachAllLights, DetachEffect, DetachGlobalState, DetachLight, dispose, GetAllObjectsByName, GetEffect, GetEffectQuantity, GetGlobalState, GetGlobalState, GetGlobalStateQuantity, GetLight, GetLightQuantity, GetObjectByID, GetObjectByName, GetParent, GetStartEffect, OnGetVisibleSet, PopState, PropagateBoundToRoot, PropagateStateFromRoot, PushState, SetParent, SetStartEffect, UpdateBS, UpdateGS, UpdateGS, UpdateRS, UpdateRS, UpdateWorldData
-
Methods inherited from class WildMagic.LibGraphics.ObjectSystem.GraphicsObject
GetID, GetName, GetNextID, GetObjectByIDBase, GetObjectByNameBase, SetName
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
VERTEX
public static int VERTEX
-
PIXEL
public static int PIXEL
-
m_kProgramType
private java.lang.String m_kProgramType
The type of program, from file extension.
-
m_kProgramText
private java.lang.String m_kProgramText
The program as a text string.
-
m_bCompiled
private boolean m_bCompiled
Flag indicating if the program is compiled or not.
-
m_bParsed
private boolean m_bParsed
Flag indicating if the program was parsed or not.
-
m_iShaderID
private int m_iShaderID
The shader ID for compiling programs.
-
m_iProgramID
private int m_iProgramID
The shader ID for compiling programs.
-
m_kRendererConstants
private java.util.Vector<RendererConstant> m_kRendererConstants
The renderer constants required by the shader program.
-
m_kUserConstants
private java.util.Vector<UserConstant> m_kUserConstants
The user constants required by the shader program. These are set by the applications as needed.
-
m_kSamplerInformation
private java.util.Vector<SamplerInformation> m_kSamplerInformation
Information about the sampler units required by a shader program.
-
ms_kSampler1DStr
protected static final java.lang.String ms_kSampler1DStr
For use by the constructor for loading and parsing a shader program.
-
ms_kSampler2DStr
protected static final java.lang.String ms_kSampler2DStr
-
ms_kSampler3DStr
protected static final java.lang.String ms_kSampler3DStr
-
ms_kSamplerCubeStr
protected static final java.lang.String ms_kSamplerCubeStr
-
ms_kSamplerProjStr
protected static final java.lang.String ms_kSamplerProjStr
-
ms_kPositionStr
protected static final java.lang.String ms_kPositionStr
-
ms_kNormalStr
protected static final java.lang.String ms_kNormalStr
-
ms_kColorStr
protected static final java.lang.String ms_kColorStr
-
ms_kColor0Str
protected static final java.lang.String ms_kColor0Str
-
ms_kColor1Str
protected static final java.lang.String ms_kColor1Str
-
ms_kTexCoordStr
protected static final java.lang.String ms_kTexCoordStr
-
ms_kInStr
protected static final java.lang.String ms_kInStr
-
ms_kEOL
protected static final java.lang.String ms_kEOL
-
ms_kTexUnitString
protected static final java.lang.String ms_kTexUnitString
-
ms_kUserString
protected static final java.lang.String ms_kUserString
-
-
Method Detail
-
AddRendererConstant
public void AddRendererConstant(RendererConstant kRC)
Access to renderer constants.- Parameters:
kRC
-
-
AddSamplerInformation
public void AddSamplerInformation(SamplerInformation kSI)
Access to Sampler Information.- Parameters:
kSI
-
-
AddUserConstant
public void AddUserConstant(UserConstant kUC)
Access to user constants.- Parameters:
kUC
-
-
GetDiskUsed
public int GetDiskUsed(StreamVersion rkVersion)
Returns the size of this object and it's children on disk for the current StreamVersion parameter.- Specified by:
GetDiskUsed
in interfaceStreamInterface
- Overrides:
GetDiskUsed
in classSpatial
- Parameters:
rkVersion
- the current version of the Stream file being created.- Returns:
- the size of this object on disk.
-
GetProgramID
public int GetProgramID()
-
GetProgramText
public final java.lang.String GetProgramText()
Return the program text.- Returns:
- the program text.
-
GetProgramType
public final java.lang.String GetProgramType()
Return the program type string, its extension.- Returns:
- the program type.
-
GetRC
public RendererConstant GetRC(int i)
Access to renderer constants.- Parameters:
i
- RendererConstant to return.- Returns:
- RendererConstant at position i.
-
GetRC
public RendererConstant GetRC(RendererConstant.Type eType)
Access to renderer constants.- Parameters:
eType
- type of RendererConstant to return.- Returns:
- RendererConstant matching input type.
-
GetRCQuantity
public final int GetRCQuantity()
Access to renderer constants.- Returns:
- number of renderer constants.
-
GetShaderID
public int GetShaderID()
-
GetSI
public SamplerInformation GetSI(int i)
Access to samplers.- Parameters:
i
- sampler to return- Returns:
- Sampler at position i.
-
GetSI
public SamplerInformation GetSI(java.lang.String rkName)
Access to samplers.- Parameters:
rkName
- name of sampler to return- Returns:
- Sampler with input name.
-
GetSIQuantity
public final int GetSIQuantity()
Access to samplers.- Returns:
- number of samplers.
-
GetUC
public UserConstant GetUC(int i)
Access to user constants.- Parameters:
i
- UserConstant to return.- Returns:
- UserConstant at position i.
-
GetUC
public UserConstant GetUC(java.lang.String rkName)
Access to user constants.- Parameters:
rkName
- name of the UserConstant to return.- Returns:
- UserConstant with the input name.
-
GetUCQuantity
public final int GetUCQuantity()
Access to user constants.- Returns:
- number of use constants.
-
IsCompiled
public boolean IsCompiled()
-
IsParsed
public boolean IsParsed()
-
Link
public void Link(Stream rkStream, Stream.Link pkLink)
Copies this objects children objects from the input Stream's HashTable, based on the LinkID of the child stored in the pkLink parameter.- Specified by:
Link
in interfaceStreamInterface
- Overrides:
Link
in classSpatial
- Parameters:
rkStream
- the Stream where the child objects are stored.pkLink
- the Link class from which the child object IDs are read.
-
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 classSpatial
- 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.
-
Register
public boolean Register(Stream rkStream)
Registers this object with the input Stream parameter. All objects streamed to disk are registered with the Stream so that a unique list of objects is maintained.- Specified by:
Register
in interfaceStreamInterface
- Overrides:
Register
in classSpatial
- Parameters:
rkStream
- the Stream where the child objects are stored.- Returns:
- true if this object is registered, false if the object has already been registered.
-
Reset
public void Reset()
-
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 classSpatial
- 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 classSpatial
- Parameters:
acTitle
- the header for this object in the StringTree.- Returns:
- StringTree containing a String-based representation of this object and it's children.
-
SetCompiled
public void SetCompiled(boolean bFlag)
-
SetParsed
public void SetParsed()
-
SetProgramID
public void SetProgramID(int iID)
-
SetProgramText
public final void SetProgramText(java.lang.String kText)
Set the program text. param the program text.
-
SetProgramType
public final void SetProgramType(java.lang.String kType)
Return the program type string, its extension.
-
SetShaderID
public void SetShaderID(int iID)
-
-