Package WildMagic.LibGraphics.Effects
Class SimpleBumpMapEffect
- java.lang.Object
-
- WildMagic.LibGraphics.ObjectSystem.GraphicsObject
-
- WildMagic.LibGraphics.Effects.Effect
-
- WildMagic.LibGraphics.Effects.ShaderEffect
-
- WildMagic.LibGraphics.Effects.SimpleBumpMapEffect
-
- All Implemented Interfaces:
java.io.Serializable
,NameIdInterface
,StreamInterface
public class SimpleBumpMapEffect extends ShaderEffect implements StreamInterface, java.io.Serializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Vector3f
m_kLightDirection
The light direction vector for the bump map effect.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 SimpleBumpMapEffect()
Streaming constructorSimpleBumpMapEffect(java.lang.String acBaseName, java.lang.String acNormalName, Vector3f rkLightDirection)
Creates a new BumpMapEffect.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
ComputeLightVectors(Triangles pkMesh)
Computes the LightVectors for the Triangle meshprotected boolean
ComputeTangent(Vector3f rkPos0, Vector2f rkTCoord0, Vector3f rkPos1, Vector2f rkTCoord1, Vector3f rkPos2, Vector2f rkTCoord2, Vector3f rkTangent)
Compute a tangent at the vertex P0.void
dispose()
Delete data members:int
GetDiskUsed(StreamVersion rkVersion)
Returns the size of this object and it's children on disk for the current StreamVersion parameter.Vector3f
GetLightDirection()
Returns the light direction vectorvoid
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
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
SetLightDirection(Vector3f rkLightDirection)
Sets the light direction-
Methods inherited from class WildMagic.LibGraphics.Effects.ShaderEffect
GetAllObjectsByName, GetBlending, GetCProgram, GetObjectByID, GetObjectByName, GetPassQuantity, GetPProgram, GetSamplerInformation, GetTexture, GetTexture, GetTextureQuantity, GetVProgram, LoadPrograms, LoadResources, OnLoadPrograms, OnReleasePrograms, ReleasePrograms, ReleaseResources, RestoreGlobalState, SetCProgram, SetDefaultAlphaState, SetGlobalState, SetPassQuantity, SetPShader, SetVShader
-
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
-
m_kLightDirection
protected Vector3f m_kLightDirection
The light direction vector for the bump map effect.
-
-
Constructor Detail
-
SimpleBumpMapEffect
public SimpleBumpMapEffect()
Streaming constructor
-
SimpleBumpMapEffect
public SimpleBumpMapEffect(java.lang.String acBaseName, java.lang.String acNormalName, Vector3f rkLightDirection)
Creates a new BumpMapEffect.- Parameters:
acBaseName
- the base texture nameacNormalName
- the normal map texture namerkLightDirection
- the current light direction vector.
-
-
Method Detail
-
ComputeLightVectors
public void ComputeLightVectors(Triangles pkMesh)
Computes the LightVectors for the Triangle mesh- Parameters:
pkMesh
-
-
dispose
public void dispose()
Delete data members:- Overrides:
dispose
in classShaderEffect
-
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 classShaderEffect
- Parameters:
rkVersion
- the current version of the Stream file being created.- Returns:
- the size of this object on disk.
-
GetLightDirection
public Vector3f GetLightDirection()
Returns the light direction vector- Returns:
- the light direction vector
-
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 classShaderEffect
- 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 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.
-
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 classShaderEffect
- 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.
-
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 it's children.
-
SetLightDirection
public void SetLightDirection(Vector3f rkLightDirection)
Sets the light direction- Parameters:
rkLightDirection
- the light direction vector
-
ComputeTangent
protected boolean ComputeTangent(Vector3f rkPos0, Vector2f rkTCoord0, Vector3f rkPos1, Vector2f rkTCoord1, Vector3f rkPos2, Vector2f rkTCoord2, Vector3f rkTangent)
Compute a tangent at the vertex P0. The triangle is counterclockwise ordered,. - Parameters:
rkPos0
- triangle Position 0rkTCoord0
- triangle Texture Coordinate 0rkPos1
- triangle Position 1rkTCoord1
- triangle Texture Coordinate 1rkPos2
- triangle Position 2rkTCoord2
- triangle Texture Coordinate 2rkTangent
- the returned tangent vector- Returns:
- true on sucess, false on failure.
-
-