Fix uv animation speed unit of vrm-1.0

This commit is contained in:
Masataka SUMI
2022-09-22 21:17:14 +09:00
parent ac0b317da7
commit 5656214f72
2 changed files with 6 additions and 2 deletions

View File

@@ -152,7 +152,9 @@ namespace UniVRM10
const float invertY = -1f;
mtoon.UvAnimationScrollYSpeedFactor = context.UvAnimationScrollYSpeedFactor * invertY;
}
mtoon.UvAnimationRotationSpeedFactor = context.UvAnimationRotationSpeedFactor;
// Speed unit Conversion
const float rotationPerSecToRadianPerSec = Mathf.PI * 2f;
mtoon.UvAnimationRotationSpeedFactor = context.UvAnimationRotationSpeedFactor * rotationPerSecToRadianPerSec;
// Texture Transforms
var scale = context.TextureScale;

View File

@@ -224,7 +224,9 @@ namespace UniVRM10
var uvAnimSpeedRotation = mToon?.UvAnimationRotationSpeedFactor;
if (uvAnimSpeedRotation.HasValue)
{
yield return (MToon10Prop.UvAnimationRotationSpeedFactor.ToUnityShaderLabName(), uvAnimSpeedRotation.Value);
// Speed unit Conversion
const float radianPerSecToRotationPerSec = 1f / (Mathf.PI * 2f);
yield return (MToon10Prop.UvAnimationRotationSpeedFactor.ToUnityShaderLabName(), uvAnimSpeedRotation.Value * radianPerSecToRotationPerSec);
}
// UI