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 booleanm_bCompiledFlag indicating if the program is compiled or not.private booleanm_bParsedFlag indicating if the program was parsed or not.private intm_iProgramIDThe shader ID for compiling programs.private intm_iShaderIDThe shader ID for compiling programs.private java.lang.Stringm_kProgramTextThe program as a text string.private java.lang.Stringm_kProgramTypeThe type of program, from file extension.private java.util.Vector<RendererConstant>m_kRendererConstantsThe renderer constants required by the shader program.private java.util.Vector<SamplerInformation>m_kSamplerInformationInformation about the sampler units required by a shader program.private java.util.Vector<UserConstant>m_kUserConstantsThe user constants required by the shader program.protected static java.lang.Stringms_kColor0Strprotected static java.lang.Stringms_kColor1Strprotected static java.lang.Stringms_kColorStrprotected static java.lang.Stringms_kEOLprotected static java.lang.Stringms_kInStrprotected static java.lang.Stringms_kNormalStrprotected static java.lang.Stringms_kPositionStrprotected static java.lang.Stringms_kSampler1DStrFor use by the constructor for loading and parsing a shader program.protected static java.lang.Stringms_kSampler2DStrprotected static java.lang.Stringms_kSampler3DStrprotected static java.lang.Stringms_kSamplerCubeStrprotected static java.lang.Stringms_kSamplerProjStrprotected static java.lang.Stringms_kTexCoordStrprotected static java.lang.Stringms_kTexUnitStringprotected static java.lang.Stringms_kUserStringstatic intPIXELprivate static longserialVersionUIDstatic intVERTEX-
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 voidAddRendererConstant(RendererConstant kRC)Access to renderer constants.voidAddSamplerInformation(SamplerInformation kSI)Access to Sampler Information.voidAddUserConstant(UserConstant kUC)Access to user constants.intGetDiskUsed(StreamVersion rkVersion)Returns the size of this object and it's children on disk for the current StreamVersion parameter.intGetProgramID()java.lang.StringGetProgramText()Return the program text.java.lang.StringGetProgramType()Return the program type string, its extension.RendererConstantGetRC(int i)Access to renderer constants.RendererConstantGetRC(RendererConstant.Type eType)Access to renderer constants.intGetRCQuantity()Access to renderer constants.intGetShaderID()SamplerInformationGetSI(int i)Access to samplers.SamplerInformationGetSI(java.lang.String rkName)Access to samplers.intGetSIQuantity()Access to samplers.UserConstantGetUC(int i)Access to user constants.UserConstantGetUC(java.lang.String rkName)Access to user constants.intGetUCQuantity()Access to user constants.booleanIsCompiled()booleanIsParsed()voidLink(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.voidLoad(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.booleanRegister(Stream rkStream)Registers this object with the input Stream parameter.voidRemove()Delete memory.voidReset()voidSave(Stream rkStream)Write this object and all it's children to the Stream.StringTreeSaveStrings(java.lang.String acTitle)Write this object into a StringTree for the scene-graph visualization.voidSetCompiled(boolean bFlag)voidSetParsed()voidSetProgramID(int iID)voidSetProgramText(java.lang.String kText)Set the program text.voidSetProgramType(java.lang.String kType)Return the program type string, its extension.voidSetShaderID(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:
GetDiskUsedin interfaceStreamInterface- Overrides:
GetDiskUsedin 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:
Linkin interfaceStreamInterface- Overrides:
Linkin 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:
Loadin interfaceStreamInterface- Overrides:
Loadin 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:
Registerin interfaceStreamInterface- Overrides:
Registerin 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:
Savein interfaceStreamInterface- Overrides:
Savein 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:
SaveStringsin interfaceStreamInterface- Overrides:
SaveStringsin 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)
-
-