Class MorphComposite
Namespace: ValveResourceFormat.Renderer
Assembly: Renderer.dll
Combines morph target deformations for one mesh into its rect of the .
public class MorphCompositeInheritance
Remarks
The rect is the size of the morph set, laid out row by row at its width. Both of the atlas' fields hold it: position/speed is accumulated into the left one and normal/wrinkle into the right, matching Valve's compositor. Every active morph adds its weighted deltas on top of the others'.
Constructors
MorphComposite(RendererContext, Morph)
Initializes the morph composite for the given morph data, uploading the atlas and building the vertex buffer.
public MorphComposite(RendererContext renderContext, Morph morph)Parameters
renderContext RendererContext
Renderer context for loading textures.
morph Morph
Morph data describing the morph targets and atlas layout.
Properties
AtlasX
Left edge of the rect within an atlas field, valid when .
public int AtlasX { get; }Property Value
AtlasY
Bottom edge of the rect within an atlas field, valid when .
public int AtlasY { get; }Property Value
Height
Height of the morph set in texels.
public int Height { get; }Property Value
IsPlaced
Whether the composite has a rect in the atlas, which it gets the first time it renders.
public bool IsPlaced { get; }Property Value
Width
Width of the morph set in texels, which is also the row stride vertices are laid out at.
public int Width { get; }Property Value
Methods
Clear()
Deactivates every morph, so the next draw leaves the rect empty and the mesh in its bind pose.
public void Clear()Delete()
Deletes the composite's vertex buffer. Its rect is given up through .
public void Delete()SetMorphValue(int, float)
Sets the blend weight for the specified morph target and marks it as active or inactive.
public void SetMorphValue(int morphId, float value)Parameters
morphId int
Morph target identifier.
value float
Blend weight to apply.

