Merge branch 'develop'

This commit is contained in:
max 2021-02-18 19:15:55 +01:00
commit b65a968561
26 changed files with 4369 additions and 1487 deletions

View File

@ -1,5 +1,17 @@
# Change Log:
## 0.1.4
- Rootmotion option.
- Disabled meshes option.
- Mesh bounds.
- Fixed normal.
- Large mesh support.
- Interpolation.
- Lit shader with GUI.
## 0.1.3
## 0.1.2
- Complete rework of asset pipeline.

View File

@ -0,0 +1,191 @@
using UnityEditor;
using UnityEngine;
namespace TAO.VertexAnimation.Editor
{
public class LitGUI : ShaderGUI
{
private MaterialEditor materialEditor;
private MaterialProperty[] properties;
private bool foldoutBase = true;
private bool foldoutAnimation = true;
private bool foldoutOther = true;
override public void OnGUI(MaterialEditor materialEditor, MaterialProperty[] properties)
{
this.materialEditor = materialEditor;
this.properties = properties;
if (foldoutBase = EditorGUILayout.BeginFoldoutHeaderGroup(foldoutBase, "Base"))
{
BaseMapGUI();
NormalGUI();
MaskGUI();
EmissionGUI();
MaterialProperty tilingAndOffset = FindProperty("_TilingAndOffset", properties);
materialEditor.ShaderProperty(tilingAndOffset, MakeLabel(tilingAndOffset));
}
EditorGUILayout.EndFoldoutHeaderGroup();
if (foldoutAnimation = EditorGUILayout.BeginFoldoutHeaderGroup(foldoutAnimation, "Vertex Animation"))
{
VertexAnimationGUI();
}
EditorGUILayout.EndFoldoutHeaderGroup();
if (foldoutOther = EditorGUILayout.BeginFoldoutHeaderGroup(foldoutOther, "Other"))
{
OtherGUI();
}
EditorGUILayout.EndFoldoutHeaderGroup();
}
private void BaseMapGUI()
{
MaterialProperty map = FindProperty("_BaseMap", properties);
materialEditor.TexturePropertySingleLine(MakeLabel(map, "(RGB) Albedo, (A) Alpha."), map, FindProperty("_BaseColor", properties));
EditorGUI.indentLevel += 2;
MaterialProperty slider = FindProperty("_AlphaClipThreshhold", properties);
materialEditor.ShaderProperty(slider, MakeLabel(slider));
EditorGUI.indentLevel -= 2;
}
private void NormalGUI()
{
MaterialProperty map = FindProperty("_NormalMap", properties);
MaterialProperty strength = FindProperty("_NormalStrength", properties);
EditorGUI.BeginChangeCheck();
materialEditor.TexturePropertySingleLine(MakeLabel(map), map, map.textureValue ? strength : null);
if (EditorGUI.EndChangeCheck())
{
SetKeyword("USE_NORMALMAP_ON", map.textureValue);
}
}
private void MaskGUI()
{
MaterialProperty map = FindProperty("_MaskMap", properties);
materialEditor.TexturePropertySingleLine(MakeLabel(map, "(R) Metallic, (G) Occlusion, (B) Detail mask, (A) Smoothness."), map);
EditorGUI.indentLevel += 2;
MaterialProperty metalness = FindProperty("_Metalness", properties);
materialEditor.ShaderProperty(metalness, MakeLabel(metalness));
MaterialProperty smoothness = FindProperty("_Smoothness", properties);
materialEditor.ShaderProperty(smoothness, MakeLabel(smoothness));
EditorGUI.indentLevel -= 2;
}
private void EmissionGUI()
{
MaterialProperty map = FindProperty("_EmissionMap", properties);
EditorGUI.BeginChangeCheck();
materialEditor.TexturePropertySingleLine(MakeLabel(map), map, FindProperty("_EmissionColor", properties));
if (EditorGUI.EndChangeCheck())
{
SetKeyword("USE_EMISSIONMAP_ON", map.textureValue);
}
}
private void VertexAnimationGUI()
{
MaterialProperty map = FindProperty("_PositionMap", properties);
materialEditor.TexturePropertySingleLine(MakeLabel(map), map);
var mat = materialEditor.target as Material;
{
bool value = mat.IsKeywordEnabled("USE_INTERPOLATION_ON");
MaterialProperty useInterpolation = FindProperty("USE_INTERPOLATION", properties);
EditorGUI.BeginChangeCheck();
value = EditorGUILayout.Toggle(MakeLabel(useInterpolation, "For smooth animations."), mat.IsKeywordEnabled("USE_INTERPOLATION_ON"));
//materialEditor.ShaderProperty(useInterpolation, MakeLabel(useInterpolation, "For smooth animations."));
if (EditorGUI.EndChangeCheck())
{
SetKeyword("USE_INTERPOLATION_ON", value);
}
}
{
bool value = mat.IsKeywordEnabled("USE_NORMALA_ON");
MaterialProperty useNormalA = FindProperty("USE_NORMALA", properties);
EditorGUI.BeginChangeCheck();
value = EditorGUILayout.Toggle(MakeLabel(useNormalA, "Apply vertex normals saved in the alpha channel of the position map."), mat.IsKeywordEnabled("USE_NORMALA_ON"));
//materialEditor.ShaderProperty(normal, MakeLabel(useNormalA, "Apply vertex normals saved in the alpha channel of the position map."));
if (EditorGUI.EndChangeCheck())
{
SetKeyword("USE_NORMALA_ON", value);
}
}
{
bool value = mat.IsKeywordEnabled("VA_FLIP_UVS");
MaterialProperty flipUV = FindProperty("VA_FLIP_UVS", properties);
EditorGUI.BeginChangeCheck();
value = EditorGUILayout.Toggle(MakeLabel(flipUV, "Flip UVs."), mat.IsKeywordEnabled("VA_FLIP_UVS_ON"));
//materialEditor.ShaderProperty(useInterpolation, MakeLabel(useInterpolation, "For smooth animations."));
if (EditorGUI.EndChangeCheck())
{
SetKeyword("VA_FLIP_UVS_ON", value);
}
}
MaterialProperty maxFrames = FindProperty("_MaxFrames", properties);
materialEditor.ShaderProperty(maxFrames, MakeLabel(maxFrames, "This will be auto filled by the animation system."));
MaterialProperty animationData = FindProperty("_AnimationData", properties);
materialEditor.ShaderProperty(animationData, MakeLabel(animationData, "This will be auto filled by the animation system."));
}
private void OtherGUI()
{
materialEditor.RenderQueueField();
materialEditor.EnableInstancingField();
materialEditor.DoubleSidedGIField();
}
private void SetKeyword(string keyword, bool state)
{
if (state)
{
foreach (Material m in materialEditor.targets)
{
m.EnableKeyword(keyword);
}
}
else
{
foreach (Material m in materialEditor.targets)
{
m.DisableKeyword(keyword);
}
}
}
static readonly GUIContent staticLabel = new GUIContent();
static GUIContent MakeLabel(MaterialProperty property, string tooltip = null)
{
staticLabel.text = property.displayName;
staticLabel.tooltip = tooltip;
return staticLabel;
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: f1b095c3c32fa3d47be03ef0060cb3e6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -37,6 +37,7 @@ namespace TAO.VertexAnimation.Editor
private void BakeGUI()
{
EditorGUILayout.PropertyField(serializedObject.FindProperty("lodSettings").FindPropertyRelative("lodSettings"));
EditorGUILayout.PropertyField(serializedObject.FindProperty("applyAnimationBounds"));
EditorGUILayout.PropertyField(serializedObject.FindProperty("generateAnimationBook"));
using (new EditorGUILayout.HorizontalScope())
@ -45,6 +46,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

@ -1,7 +1,6 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.Linq;
namespace TAO.VertexAnimation.Editor
{
@ -19,9 +18,12 @@ namespace TAO.VertexAnimation.Editor
public bool includeInactive = false;
public LODSettings lodSettings = new LODSettings();
public bool applyAnimationBounds = true;
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;
@ -109,13 +111,24 @@ namespace TAO.VertexAnimation.Editor
{
AssetDatabaseUtils.RemoveChildAssets(this, new Object[2] { book, material });
foreach (var m in meshes)
Bounds bounds = new Bounds
{
AssetDatabase.AddObjectToAsset(m, this);
max = bakedData.maxBounds,
min = bakedData.minBounds
};
for (int i = 0; i < meshes.Length; i++)
{
if (applyAnimationBounds)
{
meshes[i].bounds = bounds;
}
meshes[i].Finalize();
AssetDatabase.AddObjectToAsset(meshes[i], this);
}
AssetDatabase.AddObjectToAsset(positionMap, this);
AssetDatabase.SaveAssets();
if (generatePrefab)
@ -139,20 +152,20 @@ namespace TAO.VertexAnimation.Editor
path = path.Remove(start, path.Length - start);
path += "/" + name + ".prefab";
// Get info.
NamingConventionUtils.PositionMapInfo info = bakedData.GetPositionMap.name.GetTextureInfo();
// Generate Material
if (!AssetDatabaseUtils.HasChildAsset(this, material))
{
material = AnimationMaterial.Create(name, materialShader);
material = AnimationMaterial.Create(name, materialShader, positionMap, useNormalA, useInterpolation, info.maxFrames);
AssetDatabase.AddObjectToAsset(material, this);
}
else
{
material.shader = materialShader;
material.Update(name, materialShader, positionMap, useNormalA, useInterpolation, info.maxFrames);
}
material.SetTexture("_PositionMap", positionMap);
material.SetInt("_MaxFrames", bakedData.maxFrames);
// Generate Prefab
prefab = AnimationPrefab.Create(path, name, meshes, material, lodSettings.GetTransitionSettings());
}

View File

@ -11,6 +11,8 @@ namespace TAO.VertexAnimation
public Mesh mesh;
public List<Texture2D> positionMaps;
public int maxFrames;
public Vector3 minBounds;
public Vector3 maxBounds;
// Returns main position map.
public Texture2D GetPositionMap
@ -53,12 +55,22 @@ namespace TAO.VertexAnimation
}
}
[System.Serializable]
public struct BakedAnimation
{
public Texture2D positionMap;
public Vector3 minBounds;
public Vector3 maxBounds;
}
public static BakedData Bake(this GameObject model, AnimationClip[] animationClips, bool applyRootMotion, int fps, int textureWidth)
{
BakedData bakedData = new BakedData()
{
mesh = null,
positionMaps = new List<Texture2D>()
positionMaps = new List<Texture2D>(),
minBounds = new Vector3(float.MaxValue, float.MaxValue, float.MaxValue),
maxBounds = new Vector3(float.MinValue, float.MinValue, float.MinValue)
};
// Calculate what our max frames/time is going to be.
@ -88,8 +100,16 @@ namespace TAO.VertexAnimation
bakedData.mesh = bd.mesh;
bakedData.positionMaps.AddRange(bd.positionMaps);
bakedData.maxFrames = maxFrames;
bakedData.minBounds = Vector3.Min(bakedData.minBounds, bd.minBounds);
bakedData.maxBounds = Vector3.Max(bakedData.maxBounds, bd.maxBounds);
}
bakedData.mesh.bounds = new Bounds()
{
max = bakedData.maxBounds,
min = bakedData.minBounds
};
return bakedData;
}
@ -113,21 +133,35 @@ namespace TAO.VertexAnimation
mesh.uv3 = mesh.BakePositionUVs(animationInfo);
BakedAnimation bakedAnimation = BakeAnimation(model, animationClip, animationInfo);
BakedData bakedData = new BakedData()
{
mesh = mesh,
positionMaps = new List<Texture2D>() { BakePositionMap(model, animationClip, animationInfo) },
maxFrames = animationInfo.maxFrames
positionMaps = new List<Texture2D>() { bakedAnimation.positionMap },
maxFrames = animationInfo.maxFrames,
minBounds = bakedAnimation.minBounds,
maxBounds = bakedAnimation.maxBounds
};
mesh.bounds = new Bounds()
{
max = bakedAnimation.maxBounds,
min = bakedAnimation.minBounds
};
return bakedData;
}
public static Texture2D BakePositionMap(this GameObject model, AnimationClip animationClip, AnimationInfo animationInfo)
public static BakedAnimation BakeAnimation(this GameObject model, AnimationClip animationClip, AnimationInfo animationInfo)
{
// Create positionMap Texture without MipMaps which is Linear and HDR to store values in a bigger range.
Texture2D positionMap = new Texture2D(animationInfo.textureWidth, animationInfo.textureHeight, TextureFormat.RGBAHalf, false, true);
// Keep track of min/max bounds.
Vector3 min = new Vector3(float.MaxValue, float.MaxValue, float.MaxValue);
Vector3 max = new Vector3(float.MinValue, float.MinValue, float.MinValue);
// Create instance to sample from.
GameObject inst = GameObject.Instantiate(model);
SkinnedMeshRenderer skinnedMeshRenderer = inst.GetComponent<SkinnedMeshRenderer>();
@ -139,7 +173,6 @@ namespace TAO.VertexAnimation
Mesh sampledMesh = new Mesh();
skinnedMeshRenderer.BakeMesh(sampledMesh);
sampledMesh.RecalculateBounds();
List<Vector3> verts = new List<Vector3>();
sampledMesh.GetVertices(verts);
@ -149,9 +182,12 @@ namespace TAO.VertexAnimation
int x = 0;
for (int v = 0; v < verts.Count; v++)
{
min = Vector3.Min(min, verts[v]);
max = Vector3.Max(max, verts[v]);
positionMap.SetPixel(x, y,
new Color(verts[v].x, verts[v].y, verts[v].z,
VectorUtils.Float3ToFloat(normals[v]))
VectorUtils.EncodeFloat3ToFloat1(normals[v]))
);
x++;
@ -170,7 +206,12 @@ namespace TAO.VertexAnimation
positionMap.filterMode = FilterMode.Point;
positionMap.Apply(false, true);
return positionMap;
return new BakedAnimation()
{
positionMap = positionMap,
minBounds = min,
maxBounds = max
};
}
public static Vector2[] BakePositionUVs(this Mesh mesh, AnimationInfo animationInfo)

View File

@ -14,5 +14,45 @@ namespace TAO.VertexAnimation
return material;
}
public static Material Create(string name, Shader shader, Texture2DArray positionMap, bool useNormalA, bool useInterpolation, int maxFrames)
{
Material material = Create(name, shader);
material.Update(name, shader, positionMap, useNormalA, useInterpolation, maxFrames);
return material;
}
public static void Update(this Material material, string name, Shader shader, Texture2DArray positionMap, bool useNormalA, bool useInterpolation, int maxFrames)
{
material.name = name;
if (material.shader != shader)
{
material.shader = shader;
}
material.SetTexture("_PositionMap", positionMap);
material.SetInt("_MaxFrames", 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");
}
}
}
}

View File

@ -5,7 +5,6 @@
using UnityEngine;
using System.Collections.Generic;
using System.Linq;
namespace TAO.VertexAnimation
{
@ -212,6 +211,20 @@ namespace TAO.VertexAnimation
// Actually combine and recalculate mesh.
Mesh skinnedMesh = new Mesh();
// Large mesh support.
int vertexCount = 0;
foreach (var ci in combineInstances)
{
vertexCount += ci.mesh.vertexCount;
}
if (vertexCount > 65535)
{
skinnedMesh.indexFormat = UnityEngine.Rendering.IndexFormat.UInt32;
}
// Combine meshes.
skinnedMesh.CombineMeshes(combineInstances.ToArray(), true, true);
skinnedMesh.RecalculateBounds();

View File

@ -11,7 +11,13 @@ namespace TAO.VertexAnimation
for (int lm = 0; lm < lodMeshes.Length; lm++)
{
lodMeshes[lm] = mesh.Copy();
lodMeshes[lm] = lodMeshes[lm].Simplify(quality[lm]);
// Only simplify when needed.
if (quality[lm] < 1.0f)
{
lodMeshes[lm] = lodMeshes[lm].Simplify(quality[lm]);
}
lodMeshes[lm].name = string.Format("{0}_LOD{1}", lodMeshes[lm].name, lm);
}

View File

@ -20,8 +20,8 @@ namespace TAO.VertexAnimation
// UVs (UV0, UV1, ..., UV7)
// Other...
public List<Vector3> vertices = new List<Vector3>(3);
public List<Vector3> normals = new List<Vector3>(3);
public Vector3[] vertices = new Vector3[3];
public Vector3[] normals = new Vector3[3];
public Dictionary<int, List<Vector2>> uvs = new Dictionary<int, List<Vector2>>();
public float Perimeter()
@ -46,7 +46,7 @@ namespace TAO.VertexAnimation
float distance = Mathf.Infinity;
int closestVertex = -1;
for (int v = 0; v < vertices.Count; v++)
for (int v = 0; v < vertices.Length; v++)
{
if (vertices[v] != vertex)
{
@ -83,7 +83,7 @@ namespace TAO.VertexAnimation
if (sourceTriangle != this)
{
Vector3 sourceVertex = sourceTriangle.vertices[sourceVertexIndex];
int index = vertices.IndexOf(sourceVertex);
int index = System.Array.IndexOf(vertices, sourceVertex);
if (index != -1)
{
@ -155,10 +155,10 @@ namespace TAO.VertexAnimation
public static List<Triangle> ToTriangles(this Mesh mesh)
{
List<Triangle> triangles = new List<Triangle>();
List<Vector3> verts = new List<Vector3>(mesh.vertices);
List<Vector3> normals = new List<Vector3>(mesh.normals);
List<int> tris = new List<int>(mesh.triangles);
Vector3[] verts = mesh.vertices;
Vector3[] normals = mesh.normals;
int[] tris = mesh.triangles;
Dictionary<int, List<Vector2>> uvs = new Dictionary<int, List<Vector2>>();
for (int u = 0; u < 8; u++)
@ -172,18 +172,18 @@ namespace TAO.VertexAnimation
}
}
for (int t = 0; t < tris.Count; t += 3)
for (int t = 0; t < tris.Length; t += 3)
{
Triangle tri = new Triangle();
tri.vertices.Add(verts[tris[t + 0]]);
tri.vertices.Add(verts[tris[t + 1]]);
tri.vertices.Add(verts[tris[t + 2]]);
tri.normals.Add(normals[tris[t + 0]]);
tri.normals.Add(normals[tris[t + 1]]);
tri.normals.Add(normals[tris[t + 2]]);
tri.vertices[0] = verts[tris[t + 0]];
tri.vertices[1] = verts[tris[t + 1]];
tri.vertices[2] = verts[tris[t + 2]];
tri.normals[0] = normals[tris[t + 0]];
tri.normals[1] = normals[tris[t + 1]];
tri.normals[2] = normals[tris[t + 2]];
foreach (var uv in uvs)
{
if (tri.uvs.TryGetValue(uv.Key, out List<Vector2> coordinates))
@ -215,14 +215,14 @@ namespace TAO.VertexAnimation
mesh.Clear();
List<Vector3> vertices = new List<Vector3>(triangles.Count * 3);
List<int> tris = new List<int>(triangles.Count * 3);
List<Vector3> normals = new List<Vector3>(triangles.Count * 3);
List<int> tris = new List<int>(triangles.Count * 3);
Dictionary<int, List<Vector2>> uvs = new Dictionary<int, List<Vector2>>();
int skipped = 0;
for (int t = 0; t < triangles.Count; t++)
{
for (int v = 0; v < triangles[t].vertices.Count; v++)
for (int v = 0; v < triangles[t].vertices.Length; v++)
{
// Check for existing matching vert.
int vIndex = vertices.IndexOf(triangles[t].vertices[v]);
@ -261,7 +261,13 @@ namespace TAO.VertexAnimation
tris.Add(t * 3 + v - skipped);
}
}
// Large mesh support.
if (vertices.Count > 65535)
{
mesh.indexFormat = UnityEngine.Rendering.IndexFormat.UInt32;
}
mesh.vertices = vertices.ToArray();
mesh.normals = normals.ToArray();
@ -269,7 +275,7 @@ namespace TAO.VertexAnimation
{
mesh.SetUVs(uv.Key, uv.Value);
}
mesh.triangles = tris.ToArray();
mesh.Optimize();

View File

@ -4,6 +4,7 @@ namespace TAO.VertexAnimation
{
public static class MeshUtils
{
// Copy a mesh and it's properties.
public static Mesh Copy(this Mesh mesh)
{
Mesh copy = new Mesh
@ -15,6 +16,7 @@ namespace TAO.VertexAnimation
normals = mesh.normals,
tangents = mesh.tangents,
colors = mesh.colors,
bounds = mesh.bounds,
uv = mesh.uv,
uv2 = mesh.uv2,
uv3 = mesh.uv3,
@ -25,9 +27,14 @@ namespace TAO.VertexAnimation
uv8 = mesh.uv8
};
copy.RecalculateBounds();
return copy;
}
// Optimize the mesh and upload the mesh data, makes the mesh no longer readable.
public static void Finalize(this Mesh mesh)
{
mesh.Optimize();
mesh.UploadMeshData(true);
}
}
}

View File

@ -4,9 +4,11 @@ namespace TAO.VertexAnimation
{
public static class VectorUtils
{
#region Custom Packing
// Encode.
public static Vector2 Float3ToFloat2(this Vector3 f3)
{
Vector3 rotation = Vector3.Normalize(new Vector3(f3.x, 0, f3.z));
Vector3 rotation = Vector3.Normalize(new Vector3(f3.x, 0, f3.y));
Vector2 f2 = new Vector2();
f2.x = Mathf.Acos(Vector3.Dot(rotation, new Vector3(1, 0, 0))) * Mathf.Sign(f3.z);
@ -30,5 +32,94 @@ namespace TAO.VertexAnimation
{
return Float2ToFloat(Float3ToFloat2(f3));
}
// Decode.
public static Vector2 FloatToFloat2(float f1)
{
f1 *= 256;
Vector2 f2;
f2.x = (f1 % 16) / 15;
f2.y = ((f1 / 256) * 16);
f2.y = Mathf.Floor(f2.y) / 15;
return f2;
}
public static Vector3 Float2ToFloat3(Vector2 f2)
{
float dist = 1 - Mathf.Abs((f2.y - 0.5f) * 2);
float temp = (f2.x * (Mathf.PI * 2)) - Mathf.PI;
Vector3 f3;
f3.x = Mathf.Sin(temp + (Mathf.PI * 2)) * dist;
f3.z = Mathf.Cos((temp - Mathf.PI) + (Mathf.PI * 2)) * dist;
f3.y = (f2.y - 0.5f) * -2;
f3 = f3.normalized;
return f3;
}
public static Vector3 FloatToFloat3(float f1)
{
return Float2ToFloat3(FloatToFloat2(f1));
}
#endregion
#region Houdini Style Packing
// Encode.
public static float EncodeFloat3ToFloat1(Vector3 f3)
{
float f1;
float z = Mathf.Sqrt(f3.z * 8 + 8);
float y = (f3.y / z + 0.5f) * 31;
float x = Mathf.Floor((f3.x / z + 0.5f) * 31) * 32;
f1 = (x + y) / 1023;
return f1;
}
// Decode.
public static Vector2 DecodeFloat1ToFloat2(float f1)
{
Vector2 f2;
f1 *= 1024;
f2.x = Mathf.Floor(f1 / 32.0f) / 31.5f;
f2.y = (f1 - (Mathf.Floor(f1 / 32.0f) * 32.0f)) / 31.5f;
return f2;
}
public static Vector3 DecodeFloat2ToFloat3(Vector2 f2)
{
Vector3 f3;
f2 *= 4;
f2.x -= 2;
f2.y -= 2;
float f2dot = Vector3.Dot(f2, f2);
f3.x = Mathf.Sqrt(1 - (f2dot / 4.0f)) * f2.x;
f3.y = Mathf.Sqrt(1 - (f2dot / 4.0f)) * f2.y;
f3.z = 1 - (f2dot / 2.0f);
//f3.x = Mathf.Clamp(f3.x, -1.0f, 1.0f);
//f3.y = Mathf.Clamp(f3.x, -1.0f, 1.0f);
//f3.z = Mathf.Clamp(f3.x, -1.0f, 1.0f);
f3 = Vector3.ClampMagnitude(f3, 1);
return f3;
}
public static Vector3 DecodeFloat1ToFloat3(float f1)
{
return DecodeFloat2ToFloat3(DecodeFloat1ToFloat2(f1));
}
#endregion
}
}

View File

@ -15,8 +15,7 @@ namespace TAO.VertexAnimation
public struct VA_AnimatorComponent : IComponentData
{
public int animationIndex;
// TODO: Animation blending.
//public int animationIndexSchedule;
public int animationIndexNext;
public float animationTime;
public BlobAssetReference<VA_AnimationLibraryData> animationLibrary;
}
@ -38,7 +37,7 @@ namespace TAO.VertexAnimation
VA_AnimatorComponent animatorComponent = new VA_AnimatorComponent
{
animationIndex = 0,
//animationIndexSchedule = -1,
animationIndexNext = -1,
animationTime = 0,
animationLibrary = animLib
};

View File

@ -1,6 +1,7 @@
using Unity.Entities;
using Unity.Transforms;
using Unity.Mathematics;
using UnityEngine.Animations;
namespace TAO.VertexAnimation
{
@ -21,14 +22,31 @@ namespace TAO.VertexAnimation
// Get the animation lib data.
ref VA_AnimationLibraryData animationsRef = ref ac.animationLibrary.Value;
// Lerp animations.
// Set animation for lerp.
int animationIndexNext = ac.animationIndexNext;
if (ac.animationIndexNext < 0)
{
animationIndexNext = ac.animationIndex;
}
// Calculate next frame time for lerp.
float animationTimeNext = ac.animationTime + (1.0f / animationsRef.animations[animationIndexNext].maxFrames);
if (animationTimeNext > animationsRef.animations[animationIndexNext].duration)
{
// Set time. Using the difference to smooth out animations when looping.
animationTimeNext -= ac.animationTime;
}
// Set material data.
animationData[child] = new VA_AnimationDataComponent
{
Value = new float4
{
x = ac.animationTime,
y = VA_AnimationLibraryUtils.GetAnimationMapIndex(ref animationsRef, ac.animationIndex),
z = VA_AnimationLibraryUtils.GetColorMapIndex(ref animationsRef, ac.animationIndex),
w = 0
z = animationTimeNext,
w = VA_AnimationLibraryUtils.GetAnimationMapIndex(ref animationsRef, animationIndexNext)
}
};
}

File diff suppressed because it is too large Load Diff

View File

@ -6,62 +6,17 @@
#define V_TWO_PI 6.28318530718f
#define V_HALF_PI 1.57079632679f
void EncodeFloat3ToFloat1_float(float3 f3, out float f1)
{
float z = sqrt(f3.z * 8 + 8);
float y = (f3.y / z + 0.5f) * 31;
float x = floor((f3.x / z + 0.5f) * 31) * 32;
f1 = (x + y) / 1023;
}
void DecodeFloat1ToFloat2_float(float f1, out float2 f2)
{
f1 *= 1024;
f2.x = floor(f1 / 32.0) / 31.5;
f2.y = (f1 - (floor(f1 / 32.0) * 32.0)) / 31.5;
}
void DecodeFloat2ToFloat3_float(float f2, out float3 f3)
{
f2 *= 4;
f2 -= 2;
float f2dot = dot(f2, f2);
f3.xy = sqrt(1 - (f2dot / 4.0)) * f2;
f3.z = 1 - (f2dot / 2.0);
f3 = clamp(f3, -1.0, 1.0);
}
void DecodeFloat1ToFloat3_float(float f1, out float3 f3)
{
float2 f2;
DecodeFloat1ToFloat2_float(f1, f2);
DecodeFloat2ToFloat3_float(f2, f3);
}
// Ref:
// https://answers.unity.com/questions/733677/cg-shader-float3-to-float-packunpack-functions.html
// http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/
void Encode2Float3ToFloat1_float(float3 f3, out float f1)
{
f1 = (dot(round((f3) * 255), float3(65536, 256, 1)));
}
void Decode2Float1ToFloat3_float(float f1, out float3 f3)
{
f3 = (frac((f1) / float3(16777216, 65536, 256)));
}
// Custom
// Custom Packing.
// Encode float3 to 0..1 float.
void Float3ToFloat2_float(float3 f3, out float2 f2)
{
//float3 rotation = normalize(float3(f3.x, 0, f3.y));
float3 rotation = normalize(float3(f3.x, 0, f3.z));
f2.x = acos (dot(rotation, float3(1, 0, 0))) * sign(f3.z);
f2.x = acos(dot(rotation, float3(1, 0, 0))) * sign(f3.z);
f2.x = ((f2.x / V_PI) + 1) * 0.5f;
f2.y = acos(f3.y) / V_PI;
f2.y = acos(f3.y) / V_PI;
f2 *= 15;
f2.x = round(f2.x);
@ -94,12 +49,12 @@ void Float2ToFloat3_float(float2 f2, out float3 f3)
{
float dist = 1 - abs((f2.y - 0.5f) * 2);
float temp = (f2.x * V_TWO_PI) - V_PI;
f3.x = sin(temp + V_TWO_PI) * dist;
f3.z = cos((temp - V_PI) + V_TWO_PI) * dist;
f3.y = (f2.y - 0.5f) * -2;
f3 = normalize(f3);
}
@ -110,4 +65,53 @@ void FloatToFloat3_float(float f1, out float3 f3)
Float2ToFloat3_float(f2, f3);
}
// Houdini Style Packing.
// Encode.
void EncodeFloat3ToFloat1_float(float3 f3, out float f1)
{
float z = sqrt(f3.z * 8 + 8);
float y = (f3.y / z + 0.5f) * 31;
float x = floor((f3.x / z + 0.5f) * 31) * 32;
f1 = (x + y) / 1023;
}
// Decode.
void DecodeFloat1ToFloat2_float(float f1, out float2 f2)
{
f1 *= 1024;
f2.x = floor(f1 / 32.0) / 31.5;
f2.y = (f1 - (floor(f1 / 32.0) * 32.0)) / 31.5;
}
void DecodeFloat2ToFloat3_float(float2 f2, out float3 f3)
{
f2 *= 4;
f2 -= 2;
float f2dot = dot(f2, f2);
f3.xy = sqrt(1 - (f2dot / 4.0)) * f2;
f3.z = 1 - (f2dot / 2.0);
f3 = clamp(f3, -1.0, 1.0);
}
void DecodeFloat1ToFloat3_float(float f1, out float3 f3)
{
float2 f2;
DecodeFloat1ToFloat2_float(f1, f2);
DecodeFloat2ToFloat3_float(f2, f3);
}
// Test Packing.
// Ref:
// https://answers.unity.com/questions/733677/cg-shader-float3-to-float-packunpack-functions.html
// http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/
void Encode2Float3ToFloat1_float(float3 f3, out float f1)
{
f1 = (dot(round((f3) * 255), float3(65536, 256, 1)));
}
void Decode2Float1ToFloat3_float(float f1, out float3 f3)
{
f3 = (frac((f1) / float3(16777216, 65536, 256)));
}
#endif

View File

@ -25,7 +25,7 @@ float2 VA_UV_float(float2 uv, int maxFrames, float time)
}
void VA_float(float2 uv, SamplerState texSampler, Texture2D positionMap, float time, int maxFrames,
out float3 position, out float3 alpha)
out float3 position, out float alpha)
{
float2 uvPosition = VA_UV_float(uv, maxFrames, time);
@ -39,7 +39,7 @@ void VA_float(float2 uv, SamplerState texSampler, Texture2D positionMap, float t
}
void VA_ARRAY_float(float2 uv, SamplerState texSampler, Texture2DArray positionMap, float positionMapIndex, float time, int maxFrames,
out float3 position, out float3 alpha)
out float3 position, out float alpha)
{
float2 uvPosition = VA_UV_float(uv, maxFrames, time);

View File

@ -196,7 +196,7 @@
"m_Id": "b89a68670a6642e19ae1063415132848"
},
{
"m_Id": "68e1750097114f2d9801fda29c1a4a1a"
"m_Id": "55359b5ca883410595a9cc7689b25421"
}
],
"synonyms": [],
@ -340,6 +340,21 @@
"m_StageCapability": 3
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "55359b5ca883410595a9cc7689b25421",
"m_Id": 2,
"m_DisplayName": "Alpha",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Alpha",
"m_StageCapability": 3,
"m_Value": 0.0,
"m_DefaultValue": 0.0,
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.PropertyNode",
@ -374,33 +389,6 @@
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
"m_ObjectId": "68e1750097114f2d9801fda29c1a4a1a",
"m_Id": 2,
"m_DisplayName": "Alpha",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Alpha",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [
"X",
"Y",
"Z"
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot",
@ -463,7 +451,7 @@
"m_Id": "f08b7a93deeb46548e0a57309906d22a"
},
{
"m_Id": "f3afc10b499a42c4bbcd332b713c9635"
"m_Id": "fe7d42cad1e74435a269788bd8805aab"
}
],
"synonyms": [],
@ -759,33 +747,6 @@
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
"m_ObjectId": "f3afc10b499a42c4bbcd332b713c9635",
"m_Id": 10,
"m_DisplayName": "alpha",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "alpha",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [
"X",
"Y",
"Z"
]
}
{
"m_SGVersion": 1,
"m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty",
@ -809,6 +770,21 @@
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "fe7d42cad1e74435a269788bd8805aab",
"m_Id": 10,
"m_DisplayName": "alpha",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "alpha",
"m_StageCapability": 3,
"m_Value": 0.0,
"m_DefaultValue": 0.0,
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Texture2DMaterialSlot",

View File

@ -216,7 +216,7 @@
"m_Id": "b89a68670a6642e19ae1063415132848"
},
{
"m_Id": "7106fc4a9e6e4a0a8bdd678ceb7f4f1c"
"m_Id": "5c5241600e5b40d998b82d09856f71a9"
}
],
"synonyms": [],
@ -356,29 +356,17 @@
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
"m_ObjectId": "7106fc4a9e6e4a0a8bdd678ceb7f4f1c",
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "5c5241600e5b40d998b82d09856f71a9",
"m_Id": 2,
"m_DisplayName": "Alpha",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Alpha",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [
"X",
"Y",
"Z"
]
"m_Value": 0.0,
"m_DefaultValue": 0.0,
"m_Labels": []
}
{
@ -405,6 +393,21 @@
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "7fcf2701605d41ac92b93ad9bffa69f0",
"m_Id": 10,
"m_DisplayName": "alpha",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "alpha",
"m_StageCapability": 3,
"m_Value": 0.0,
"m_DefaultValue": 0.0,
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.CustomFunctionNode",
@ -446,7 +449,7 @@
"m_Id": "c2b10d98649f477bb79b359db258f55a"
},
{
"m_Id": "c1454b74eac5469eb14d403b66a8283a"
"m_Id": "7fcf2701605d41ac92b93ad9bffa69f0"
}
],
"synonyms": [],
@ -663,33 +666,6 @@
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
"m_ObjectId": "c1454b74eac5469eb14d403b66a8283a",
"m_Id": 10,
"m_DisplayName": "alpha",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "alpha",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [
"X",
"Y",
"Z"
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",

View File

@ -194,7 +194,7 @@
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": -803.0,
"x": -762.0,
"y": 38.0,
"width": 115.0,
"height": 34.0
@ -251,8 +251,8 @@
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": -669.0,
"y": -1.0,
"x": -628.0,
"y": -2.0,
"width": 142.0,
"height": 94.0
}

View File

@ -14,6 +14,12 @@ MonoBehaviour:
m_EditorClassIdentifier:
animationBooks:
- {fileID: 5308917091715319043, guid: f4349667ca4312e4baf669e11f247ba7, type: 2}
animationData: []
animationData:
- frames: 20
maxFrames: 32
animationMapIndex: 0
colorMapIndex: -1
frameTime: 0.5
duration: 0.59375
loadedAnimationsPreview:
- {fileID: 5516028983296890367, guid: f4349667ca4312e4baf669e11f247ba7, type: 2}
- {fileID: -6703287855718520189, guid: f4349667ca4312e4baf669e11f247ba7, type: 2}

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1944857198683160307
--- !u!1 &4534186675853176511
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
@ -8,45 +8,45 @@ GameObject:
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6514153653571186485}
- component: {fileID: 803962761371482591}
- component: {fileID: 2431942093374529607}
- component: {fileID: 2637317989238468324}
- component: {fileID: 2030271958008155644}
- component: {fileID: 2082090542424554337}
m_Layer: 0
m_Name: Veribot_LOD2
m_Name: Veribot_LOD0
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &6514153653571186485
--- !u!4 &2637317989238468324
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1944857198683160307}
m_GameObject: {fileID: 4534186675853176511}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1666385414219319198}
m_RootOrder: 2
m_Father: {fileID: 6853163039303404304}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &803962761371482591
--- !u!33 &2030271958008155644
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1944857198683160307}
m_Mesh: {fileID: -5651794666926306711, guid: f4349667ca4312e4baf669e11f247ba7, type: 2}
--- !u!23 &2431942093374529607
m_GameObject: {fileID: 4534186675853176511}
m_Mesh: {fileID: 5941489778017322075, guid: f4349667ca4312e4baf669e11f247ba7, type: 2}
--- !u!23 &2082090542424554337
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1944857198683160307}
m_GameObject: {fileID: 4534186675853176511}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
@ -81,7 +81,7 @@ MeshRenderer:
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!1 &2210095915256706779
--- !u!1 &5964708316112597629
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
@ -89,10 +89,91 @@ GameObject:
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1666385414219319198}
- component: {fileID: 3014358166701230583}
- component: {fileID: 5102846420399720395}
- component: {fileID: 9172311366730364808}
- component: {fileID: 1323372131127862203}
- component: {fileID: 4833308058096186705}
- component: {fileID: 7603375518817447113}
m_Layer: 0
m_Name: Veribot_LOD2
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1323372131127862203
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5964708316112597629}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 6853163039303404304}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &4833308058096186705
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5964708316112597629}
m_Mesh: {fileID: -2778213634165482431, guid: f4349667ca4312e4baf669e11f247ba7, type: 2}
--- !u!23 &7603375518817447113
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5964708316112597629}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 5433514719563564357, guid: f4349667ca4312e4baf669e11f247ba7, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!1 &6237684819455752789
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6853163039303404304}
- component: {fileID: 7056653554868356473}
- component: {fileID: 1075111289751587653}
- component: {fileID: 3995250710027893510}
m_Layer: 0
m_Name: Veribot
m_TagString: Untagged
@ -100,30 +181,30 @@ GameObject:
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1666385414219319198
--- !u!4 &6853163039303404304
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2210095915256706779}
m_GameObject: {fileID: 6237684819455752789}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 7828031797234836074}
- {fileID: 4649975423443728707}
- {fileID: 6514153653571186485}
- {fileID: 2637317989238468324}
- {fileID: 626963313162696141}
- {fileID: 1323372131127862203}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!205 &3014358166701230583
--- !u!205 &7056653554868356473
LODGroup:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2210095915256706779}
m_GameObject: {fileID: 6237684819455752789}
serializedVersion: 2
m_LocalReferencePoint: {x: -0.043716908, y: 2.8345191, z: -0.0000009536743}
m_Size: 7.4401426
@ -134,42 +215,42 @@ LODGroup:
- screenRelativeHeight: 0.4
fadeTransitionWidth: 0
renderers:
- renderer: {fileID: 6115450259708655599}
- renderer: {fileID: 2082090542424554337}
- screenRelativeHeight: 0.15
fadeTransitionWidth: 0
renderers:
- renderer: {fileID: 5571438271965211502}
- renderer: {fileID: 390364405863016416}
- screenRelativeHeight: 0.01
fadeTransitionWidth: 0
renderers:
- renderer: {fileID: 2431942093374529607}
- renderer: {fileID: 7603375518817447113}
m_Enabled: 1
--- !u!114 &5102846420399720395
--- !u!114 &1075111289751587653
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2210095915256706779}
m_GameObject: {fileID: 6237684819455752789}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 29deecb09ead9e74aa32f9d265f1e7ef, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &9172311366730364808
--- !u!114 &3995250710027893510
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2210095915256706779}
m_GameObject: {fileID: 6237684819455752789}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ea7d7495833204790ba1d3a8755397f8, type: 3}
m_Name:
m_EditorClassIdentifier:
ConversionMode: 0
--- !u!1 &2542630112312447719
--- !u!1 &7742355509012012649
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
@ -177,9 +258,9 @@ GameObject:
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4649975423443728707}
- component: {fileID: 4758633568681129272}
- component: {fileID: 5571438271965211502}
- component: {fileID: 626963313162696141}
- component: {fileID: 734495524141906358}
- component: {fileID: 390364405863016416}
m_Layer: 0
m_Name: Veribot_LOD1
m_TagString: Untagged
@ -187,116 +268,35 @@ GameObject:
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4649975423443728707
--- !u!4 &626963313162696141
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2542630112312447719}
m_GameObject: {fileID: 7742355509012012649}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1666385414219319198}
m_Father: {fileID: 6853163039303404304}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &4758633568681129272
--- !u!33 &734495524141906358
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2542630112312447719}
m_Mesh: {fileID: -7654014277350004107, guid: f4349667ca4312e4baf669e11f247ba7, type: 2}
--- !u!23 &5571438271965211502
m_GameObject: {fileID: 7742355509012012649}
m_Mesh: {fileID: -1039374256406497124, guid: f4349667ca4312e4baf669e11f247ba7, type: 2}
--- !u!23 &390364405863016416
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2542630112312447719}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 5433514719563564357, guid: f4349667ca4312e4baf669e11f247ba7, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!1 &8563534283793424945
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7828031797234836074}
- component: {fileID: 6059481542880133490}
- component: {fileID: 6115450259708655599}
m_Layer: 0
m_Name: Veribot_LOD0
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7828031797234836074
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8563534283793424945}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1666385414219319198}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &6059481542880133490
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8563534283793424945}
m_Mesh: {fileID: -6062113467416022269, guid: f4349667ca4312e4baf669e11f247ba7, type: 2}
--- !u!23 &6115450259708655599
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8563534283793424945}
m_GameObject: {fileID: 7742355509012012649}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1

View File

@ -295,7 +295,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 45, y: -66.7, z: -45}
--- !u!1 &400565279
GameObject:
@ -591,6 +591,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
animationLibrary: {fileID: 11400000, guid: 721fbe09d2910a949925c6b1ed810323, type: 2}
debugMode: 1
--- !u!4 &1040945604
Transform:
m_ObjectHideFlags: 0
@ -603,7 +604,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1368237060
PrefabInstance:
@ -729,7 +730,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
sampleSystem: 1
animationAsset: {fileID: -4216135972955369862, guid: f4349667ca4312e4baf669e11f247ba7, type: 2}
animationAsset: {fileID: 3778935671602017550, guid: f4349667ca4312e4baf669e11f247ba7, type: 2}
--- !u!4 &1442963402
Transform:
m_ObjectHideFlags: 0
@ -742,7 +743,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1442963403
MonoBehaviour:
@ -790,7 +791,7 @@ Transform:
- {fileID: 973670068}
- {fileID: 2110778248}
m_Father: {fileID: 0}
m_RootOrder: 4
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1919409176
GameObject:
@ -874,7 +875,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 33, y: -50, z: 0}
--- !u!114 &1919409180
MonoBehaviour:

View File

@ -4,3 +4,7 @@ This package borrows code/assets from various different sources, including:
- Author: [nonlly](https://sketchfab.com/nonlly)
- Source: [Sketchfab](https://skfb.ly/6QYR6)
- License: [Creative Commons Attribution](http://creativecommons.org/licenses/by/4.0/)
### SideFx/Houdini (Vector encoding/decoding)
- Source: [Sketchfab](https://github.com/sideeffects/SideFXLabs/blob/Development/unity/shaders/URP/Editor/Shaders/VAT_Utilies.hlsl)
- License: [LICENSE](https://github.com/sideeffects/SideFXLabs/blob/Development/LICENSE.md)

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: bc1ccacb918e10a43bc1d707ec935205
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: