DQ skinning for Unity
Dual Quaternion skinning implementation with bulging compensation
|
Replaces Unity's default linear skinning with DQ skinning More...
Public Member Functions | |
void | SetViewFrustrumCulling (bool viewFrustrumculling) |
Enable or disable view frustrum culling. When moving the bones manually to test the script, bounding box does not update (it is pre-calculated based on available animations), which may lead to improper culling. More... | |
bool | GetViewFrustrumCulling () |
Returns current state of view frustrum culling. More... | |
float[] | GetBlendShapeWeights () |
Returns an array of currently applied blend shape weights. Default range is 0-100. It is possible to apply negative weights or exceeding 100. More... | |
void | SetBlendShapeWeights (float[] weights) |
Applies blend shape weights from the given array. Default range is 0-100. It is possible to apply negative weights or exceeding 100. More... | |
void | SetBlendShapeWeight (int index, float weight) |
Set weight for the blend shape with given index. Default range is 0-100. It is possible to apply negative weights or exceeding 100. More... | |
float | GetBlendShapeWeight (int index) |
Returns currently applied weight for the blend shape with given index. Default range is 0-100. It is possible to apply negative weights or exceeding 100. More... | |
void | UpdatePerVertexCompensationCoef () |
If the value of boneOrientationVector was changed while DualQuaternionSkinner is active (started == true), UpdatePerVertexCompensationCoef() must be called in order for the change to take effect. More... | |
Public Attributes | |
Vector3 | boneOrientationVector = Vector3.up |
Bone orientation is required for bulge-compensation. Do not set directly, use custom editor instead. More... | |
float | bulgeCompensation = 0 |
Adjusts the amount of bulge-compensation. More... | |
ComputeShader | shaderComputeBoneDQ |
ComputeShader | shaderDQBlend |
ComputeShader | shaderApplyMorph |
Properties | |
bool | started = false [get] |
Indicates whether DualQuaternionSkinner is currently active. More... | |
Mesh | mesh [get] |
UnityEngine.Mesh that is currently being rendered. More... | |
Replaces Unity's default linear skinning with DQ skinning
Add this component to a GameObject that has SkinnedMeshRenderer attached.
Do not remove SkinnedMeshRenderer component!
Make sure that all materials of the animated object are using shader "MadCake/Material/Standard hacked for DQ skinning"
Definition at line 11 of file DualQuaternionSkinner.cs.
float DualQuaternionSkinner.GetBlendShapeWeight | ( | int | index | ) |
Returns currently applied weight for the blend shape with given index.
Default range is 0-100.
It is possible to apply negative weights or exceeding 100.
index | Index of the blend shape |
Definition at line 269 of file DualQuaternionSkinner.cs.
float [] DualQuaternionSkinner.GetBlendShapeWeights | ( | ) |
Returns an array of currently applied blend shape weights.
Default range is 0-100.
It is possible to apply negative weights or exceeding 100.
Definition at line 201 of file DualQuaternionSkinner.cs.
bool DualQuaternionSkinner.GetViewFrustrumCulling | ( | ) |
Returns current state of view frustrum culling.
Definition at line 182 of file DualQuaternionSkinner.cs.
void DualQuaternionSkinner.SetBlendShapeWeight | ( | int | index, |
float | weight | ||
) |
Set weight for the blend shape with given index.
Default range is 0-100.
It is possible to apply negative weights or exceeding 100.
index | Index of the blend shape |
weight | Weight to be applied |
Definition at line 244 of file DualQuaternionSkinner.cs.
void DualQuaternionSkinner.SetBlendShapeWeights | ( | float[] | weights | ) |
Applies blend shape weights from the given array.
Default range is 0-100.
It is possible to apply negative weights or exceeding 100.
weights | An array of weights to be applied |
Definition at line 218 of file DualQuaternionSkinner.cs.
void DualQuaternionSkinner.SetViewFrustrumCulling | ( | bool | viewFrustrumculling | ) |
Enable or disable view frustrum culling.
When moving the bones manually to test the script, bounding box does not update (it is pre-calculated based on available animations), which may lead to improper culling.
Definition at line 167 of file DualQuaternionSkinner.cs.
void DualQuaternionSkinner.UpdatePerVertexCompensationCoef | ( | ) |
If the value of boneOrientationVector was changed while DualQuaternionSkinner is active (started == true), UpdatePerVertexCompensationCoef() must be called in order for the change to take effect.
Definition at line 306 of file DualQuaternionSkinner.cs.
Vector3 DualQuaternionSkinner.boneOrientationVector = Vector3.up |
Bone orientation is required for bulge-compensation.
Do not set directly, use custom editor instead.
Definition at line 17 of file DualQuaternionSkinner.cs.
float DualQuaternionSkinner.bulgeCompensation = 0 |
Adjusts the amount of bulge-compensation.
Definition at line 66 of file DualQuaternionSkinner.cs.
|
get |
UnityEngine.Mesh that is currently being rendered.
Definition at line 290 of file DualQuaternionSkinner.cs.
|
get |
Indicates whether DualQuaternionSkinner is currently active.
Definition at line 75 of file DualQuaternionSkinner.cs.