Interpolation

Smooth animations :)
This commit is contained in:
max
2021-02-09 17:21:42 +01:00
parent c928f6daae
commit f7fc4434d5
6 changed files with 2898 additions and 599 deletions

View File

@ -45,6 +45,9 @@ namespace TAO.VertexAnimation.Editor
EditorGUILayout.PropertyField(serializedObject.FindProperty("materialShader"), new GUIContent(""));
}
EditorGUILayout.PropertyField(serializedObject.FindProperty("useNormalA"), new GUIContent("Use Normal (A)"));
EditorGUILayout.PropertyField(serializedObject.FindProperty("useInterpolation"));
if (GUILayout.Button("Bake", GUILayout.Height(32)))
{
modelBaker.Bake();

View File

@ -22,6 +22,8 @@ namespace TAO.VertexAnimation.Editor
public bool generateAnimationBook = true;
public bool generatePrefab = true;
public Shader materialShader = null;
public bool useInterpolation = true;
public bool useNormalA = true;
// Output.
public GameObject prefab = null;
@ -153,6 +155,24 @@ namespace TAO.VertexAnimation.Editor
material.SetTexture("_PositionMap", positionMap);
material.SetInt("_MaxFrames", bakedData.maxFrames);
if (useNormalA)
{
material.EnableKeyword("USE_NORMALA_ON");
}
else
{
material.DisableKeyword("USE_NORMALA_ON");
}
if(useInterpolation)
{
material.EnableKeyword("USE_INTERPOLATION_ON");
}
else
{
material.DisableKeyword("USE_INTERPOLATION_ON");
}
// Generate Prefab
prefab = AnimationPrefab.Create(path, name, meshes, material, lodSettings.GetTransitionSettings());
}