diff --git a/AlembicImporter/Assets/Packaging.cs b/AlembicImporter/Assets/Packaging.cs index be6d93131..5e38e4c45 100644 --- a/AlembicImporter/Assets/Packaging.cs +++ b/AlembicImporter/Assets/Packaging.cs @@ -10,41 +10,15 @@ public class AlembicImporterPackaging { - [MenuItem("Assets/UTJ/AlembicImporter/Make Packages")] + [MenuItem("Assets/Make AlembicImporter.unitypackage")] public static void MakePackage_Alembic() - { - MakePackage_AlembicImporter(); - MakePackage_AlembicExporter(); - } - - public static void MakePackage_AlembicImporter() { string[] files = new string[] { -"Assets/UTJ/AlembicImporter", -"Assets/UTJ/TextureWriter", -"Assets/UTJ/Plugins/x86/AlembicImporter.dll", -"Assets/UTJ/Plugins/x86_64/AlembicImporter.dll", -"Assets/UTJ/Plugins/x86/TextureWriter.dll", -"Assets/UTJ/Plugins/x86_64/TextureWriter.dll", -"Assets/StreamingAssets/UTJ/AlembicImporter", -"Assets/StreamingAssets/AlembicData/Example.abc", +"Assets/UTJ", +"Assets/StreamingAssets/UTJ", }; AssetDatabase.ExportPackage(files, "AlembicImporter.unitypackage", ExportPackageOptions.Recurse); } - - public static void MakePackage_AlembicExporter() - { - string[] files = new string[] - { -"Assets/UTJ/AlembicExporter", -"Assets/UTJ/Plugins/x86/AlembicExporter.dll", -"Assets/UTJ/Plugins/x86_64/AlembicExporter.dll", -"Assets/UTJ/AlembicExporterExample", -"Assets/StreamingAssets/UTJ/AlembicImporter", - }; - AssetDatabase.ExportPackage(files, "AlembicExporter.unitypackage", ExportPackageOptions.Recurse); - } - } #endif // UNITY_EDITOR diff --git a/AlembicImporter/Assets/UTJ/AlembicExporter/Scripts/AlembicExporter.cs b/AlembicImporter/Assets/UTJ/AlembicExporter/Scripts/AlembicExporter.cs index 5a07a6d1a..e5a744f01 100644 --- a/AlembicImporter/Assets/UTJ/AlembicExporter/Scripts/AlembicExporter.cs +++ b/AlembicImporter/Assets/UTJ/AlembicExporter/Scripts/AlembicExporter.cs @@ -273,7 +273,7 @@ public override void Capture() if (m_target == null) { return; } // create buffer - int count_max = m_target.maxParticles; + int count_max = m_target.main.maxParticles; if (m_buf_particles == null) { m_buf_particles = new ParticleSystem.Particle[count_max]; diff --git a/AlembicImporter/Assets/UTJ/AlembicExporterExample/Scripts/ParticleEngine.cs b/AlembicImporter/Assets/UTJ/AlembicExporterExample/Scripts/ParticleEngine.cs index fcb035a00..c426afa63 100644 --- a/AlembicImporter/Assets/UTJ/AlembicExporterExample/Scripts/ParticleEngine.cs +++ b/AlembicImporter/Assets/UTJ/AlembicExporterExample/Scripts/ParticleEngine.cs @@ -81,7 +81,7 @@ void InitializeSimulation() m_csparams = new CSParams[1]; } { - UnityEngine.Random.seed = 0; + UnityEngine.Random.InitState(0); var tmp = new peParticle[m_particle_count]; for (int i = 0; i < tmp.Length; ++i) { diff --git a/AlembicImporter/Assets/UTJ/AlembicImporter/Editor/AlembicMaterialEditor.cs b/AlembicImporter/Assets/UTJ/AlembicImporter/Editor/AlembicMaterialEditor.cs deleted file mode 100644 index ad8b3d16b..000000000 --- a/AlembicImporter/Assets/UTJ/AlembicImporter/Editor/AlembicMaterialEditor.cs +++ /dev/null @@ -1,115 +0,0 @@ -using System; -using System.IO; -using UnityEngine; -using UnityEditor; - -namespace UTJ.Alembic -{ - class AlembicMaterialEditor : EditorWindow - { - string xmlPath = ""; - string materialFolder = ""; - GameObject assetRoot = null; - - //[MenuItem ("Assets/UTJ/Import Alembic Materials")] - public static void ShowWindow() - { - EditorWindow.GetWindow (typeof(AlembicMaterialEditor)); - } - - Rect NewControlRect(bool hasLabel, float height, float hpad, float vpad) - { - Rect r = EditorGUILayout.GetControlRect(hasLabel, height + vpad); - - r.x += hpad; - r.width -= 2 * hpad; - r.y += vpad; - r.height -= vpad; - - return r; - } - - string MakeDataRelativePath(string path) - { - if (path.Length > 0) - { - Uri baseUri = new Uri(Application.dataPath + "/"); - return baseUri.MakeRelativeUri(new Uri(path)).ToString(); - } - else - { - return path; - } - } - - public void OnGUI() - { - float hp = 5; - float vp = 5; - float hs = 5; - float rh = 16; - float lw; - float fw; - float bw; - Rect r; - - // Material assignment file controls - r = NewControlRect(true, rh, hp, vp); - lw = r.width * 0.33f; - - EditorGUI.PrefixLabel(new Rect(r.x, r.y, lw, r.height), new GUIContent("Assignments File")); - - bw = 26; - fw = r.width - lw - bw - 2 * hs; - xmlPath = EditorGUI.TextField(new Rect(r.x + lw + hs, r.y, fw, r.height), xmlPath); - if (GUI.Button(new Rect(r.x + lw + hs + fw + hs, r.y, bw, r.height), "...")) - { - string startFolder = (xmlPath.Length > 0 ? Path.GetDirectoryName(xmlPath) : Application.dataPath); - xmlPath = MakeDataRelativePath(EditorUtility.OpenFilePanel("Select Material Assignment File", startFolder, "xml")); - - if (xmlPath.Length > 0) - { - materialFolder = Path.GetDirectoryName(xmlPath); - } - } - - // Material folder controls - r = NewControlRect(true, rh, hp, vp); - lw = r.width * 0.33f; - - EditorGUI.PrefixLabel(new Rect(r.x, r.y, lw, r.height), new GUIContent("Materials Folder")); - - bw = 26; - fw = r.width - lw - bw - 2 * hs; - materialFolder = EditorGUI.TextField(new Rect(r.x + lw + hs, r.y, fw, r.height), materialFolder); - if (GUI.Button(new Rect(r.x + lw + hs + fw + hs, r.y, bw, r.height), "...")) - { - string startFolder = (materialFolder.Length > 0 ? materialFolder : Application.dataPath); - materialFolder = MakeDataRelativePath(EditorUtility.OpenFolderPanel("Select Materials Folder", startFolder, "")); - } - - // Target asset node controls - r = NewControlRect(true, rh, hp, vp); - lw = r.width * 0.33f; - - EditorGUI.PrefixLabel(new Rect(r.x, r.y, lw, r.height), new GUIContent("Asset Root")); - - fw = r.width - lw - hs; - assetRoot = (GameObject) EditorGUI.ObjectField(new Rect(r.x + lw + hs, r.y, fw, r.height), assetRoot, typeof(GameObject), true); - - // Action buttons - r = NewControlRect(false, rh, hp, vp); - bw = 0.5f * (r.width - hs); - - if (GUI.Button(new Rect(r.x, r.y, bw, r.height), "Import")) - { - AlembicMaterial.Import(Application.dataPath + "/" + xmlPath, assetRoot, "Assets/" + materialFolder); //relMatFolder); - } - - if (GUI.Button(new Rect(r.x + bw + hs, r.y, bw, r.height), "Export")) - { - AlembicMaterial.Export(Application.dataPath + "/" + xmlPath, assetRoot); - } - } - } -} diff --git a/AlembicImporter/Assets/UTJ/AlembicImporter/Editor/AlembicMaterialEditor.cs.meta b/AlembicImporter/Assets/UTJ/AlembicImporter/Editor/AlembicMaterialEditor.cs.meta deleted file mode 100644 index 12f028f00..000000000 --- a/AlembicImporter/Assets/UTJ/AlembicImporter/Editor/AlembicMaterialEditor.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 8cc08d60eea84244fb1308007c4cba2a -timeCreated: 1453551415 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/AlembicImporter/Assets/UTJ/AlembicImporter/Editor/AlembicPointsRendererEditor.cs b/AlembicImporter/Assets/UTJ/AlembicImporter/Editor/AlembicPointsRendererEditor.cs deleted file mode 100644 index 0cbf5df63..000000000 --- a/AlembicImporter/Assets/UTJ/AlembicImporter/Editor/AlembicPointsRendererEditor.cs +++ /dev/null @@ -1,21 +0,0 @@ -using UnityEditor; -using UnityEngine; - -namespace UTJ.Alembic -{ - [CustomEditor(typeof(AlembicPointsRenderer))] - public class AlembicPointsRendererEditor : Editor - { - public override void OnInspectorGUI() - { - DrawDefaultInspector(); - - var t = target as AlembicPointsRenderer; - if (GUILayout.Button("Apply Material")) - { - t.RefleshMaterials(); - } - - } - } -} diff --git a/AlembicImporter/Assets/UTJ/AlembicImporter/Editor/AlembicPointsRendererEditor.cs.meta b/AlembicImporter/Assets/UTJ/AlembicImporter/Editor/AlembicPointsRendererEditor.cs.meta deleted file mode 100644 index 1d059b82b..000000000 --- a/AlembicImporter/Assets/UTJ/AlembicImporter/Editor/AlembicPointsRendererEditor.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 0f67bd068db2267449db05aeee7f2a38 -timeCreated: 1453551415 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/AlembicImporter/Assets/UTJ/AlembicImporter/Materials.meta b/AlembicImporter/Assets/UTJ/AlembicImporter/Materials.meta deleted file mode 100644 index 7b5c86acd..000000000 --- a/AlembicImporter/Assets/UTJ/AlembicImporter/Materials.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: f9ed7a79ceac8fa45846c95705478068 -folderAsset: yes -timeCreated: 1453551413 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/AlembicImporter/Assets/UTJ/AlembicImporter/Materials/AlembicPointsDefault.mat b/AlembicImporter/Assets/UTJ/AlembicImporter/Materials/AlembicPointsDefault.mat deleted file mode 100644 index 4c2878de7..000000000 Binary files a/AlembicImporter/Assets/UTJ/AlembicImporter/Materials/AlembicPointsDefault.mat and /dev/null differ diff --git a/AlembicImporter/Assets/UTJ/AlembicImporter/Materials/AlembicPointsDefault.mat.meta b/AlembicImporter/Assets/UTJ/AlembicImporter/Materials/AlembicPointsDefault.mat.meta deleted file mode 100644 index bce08c297..000000000 --- a/AlembicImporter/Assets/UTJ/AlembicImporter/Materials/AlembicPointsDefault.mat.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 5dfafd6734133bb4b9012fba0eadd4af -timeCreated: 1453551422 -licenseType: Pro -NativeFormatImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/AlembicImporter/Assets/UTJ/AlembicImporter/Scripts/AlembicPointsCloud.cs b/AlembicImporter/Assets/UTJ/AlembicImporter/Scripts/AlembicPointsCloud.cs index 7cb759915..b8736f185 100644 --- a/AlembicImporter/Assets/UTJ/AlembicImporter/Scripts/AlembicPointsCloud.cs +++ b/AlembicImporter/Assets/UTJ/AlembicImporter/Scripts/AlembicPointsCloud.cs @@ -4,7 +4,6 @@ namespace UTJ.Alembic { [ExecuteInEditMode] - [RequireComponent(typeof(AlembicPointsRenderer))] public class AlembicPointsCloud : MonoBehaviour { // members @@ -31,13 +30,6 @@ public ulong[] abcIDs void Reset() { - // add renderer - var c = gameObject.GetComponent(); - if (c == null) - { - c = gameObject.AddComponent(); - } - } } diff --git a/AlembicImporter/Assets/UTJ/AlembicImporter/Scripts/AlembicPointsRenderer.cs b/AlembicImporter/Assets/UTJ/AlembicImporter/Scripts/AlembicPointsRenderer.cs deleted file mode 100644 index 8037c8e99..000000000 --- a/AlembicImporter/Assets/UTJ/AlembicImporter/Scripts/AlembicPointsRenderer.cs +++ /dev/null @@ -1,405 +0,0 @@ -using System.Collections.Generic; -using System.Runtime.InteropServices; -using UnityEngine; -#if UNITY_EDITOR -using UnityEditor; -#endif - -namespace UTJ.Alembic -{ - [ExecuteInEditMode] - [AddComponentMenu("UTJ/Alembic/Points Renderer")] - [RequireComponent(typeof(AlembicPointsCloud))] - public class AlembicPointsRenderer : MonoBehaviour - { - const int TextureWidth = 2048; - - public bool m_makeChildRenderers = true; - public Mesh m_mesh; - public Material[] m_materials; - public bool m_cast_shadow = false; - public bool m_receive_shadow = false; - public float m_count_rate = 1.0f; - public Vector3 m_model_scale = Vector3.one; - public Vector3 m_trans_scale = Vector3.one; -#if UNITY_EDITOR - public bool m_show_bounds = false; -#endif - - int m_instances_par_batch; - int m_layer; - Mesh m_expanded_mesh; - Bounds m_bounds; - List> m_actual_materials; - [HideInInspector][SerializeField] - - RenderTexture m_texPositions; - RenderTexture m_texVelocities; - RenderTexture m_texIDs; - - #region static - - public static int ceildiv(int v, int d) - { - return v / d + (v % d == 0 ? 0 : 1); - } - - public static Vector3 mul(Vector3 a, Vector3 b) - { - return new Vector3(a.x * b.x, a.y * b.y, a.z * b.z); - } - - static RenderTexture CreateDataTexture(int w, int h, RenderTextureFormat f) - { - RenderTexture r = new RenderTexture(w, h, 0, f); - r.filterMode = FilterMode.Point; - r.useMipMap = false; - r.autoGenerateMips = false; - r.Create(); - return r; - } - - public const int MaxVertices = 65000; // Mesh's limitation - - public static Mesh CreateExpandedMesh(Mesh mesh, int required_instances, out int instances_par_batch) - { - Vector3[] vertices_base = mesh.vertices; - Vector3[] normals_base = (mesh.normals == null || mesh.normals.Length == 0) ? null : mesh.normals; - Vector4[] tangents_base = (mesh.tangents == null || mesh.tangents.Length == 0) ? null : mesh.tangents; - Vector2[] uv_base = (mesh.uv == null || mesh.uv.Length == 0) ? null : mesh.uv; - Color[] colors_base = (mesh.colors == null || mesh.colors.Length == 0) ? null : mesh.colors; - int[] indices_base = (mesh.triangles == null || mesh.triangles.Length == 0) ? null : mesh.triangles; - instances_par_batch = Mathf.Min(MaxVertices / mesh.vertexCount, required_instances); - - Vector3[] vertices = new Vector3[vertices_base.Length * instances_par_batch]; - Vector2[] idata = new Vector2[vertices_base.Length * instances_par_batch]; - Vector3[] normals = normals_base == null ? null : new Vector3[normals_base.Length * instances_par_batch]; - Vector4[] tangents = tangents_base == null ? null : new Vector4[tangents_base.Length * instances_par_batch]; - Vector2[] uv = uv_base == null ? null : new Vector2[uv_base.Length * instances_par_batch]; - Color[] colors = colors_base == null ? null : new Color[colors_base.Length * instances_par_batch]; - int[] indices = indices_base == null ? null : new int[indices_base.Length * instances_par_batch]; - - for (int ii = 0; ii < instances_par_batch; ++ii) - { - for (int vi = 0; vi < vertices_base.Length; ++vi) - { - int i = ii * vertices_base.Length + vi; - vertices[i] = vertices_base[vi]; - idata[i] = new Vector2((float)ii, (float)vi); - } - if (normals != null) - { - for (int vi = 0; vi < normals_base.Length; ++vi) - { - int i = ii * normals_base.Length + vi; - normals[i] = normals_base[vi]; - } - } - if (tangents != null) - { - for (int vi = 0; vi < tangents_base.Length; ++vi) - { - int i = ii * tangents_base.Length + vi; - tangents[i] = tangents_base[vi]; - } - } - if (uv != null) - { - for (int vi = 0; vi < uv_base.Length; ++vi) - { - int i = ii * uv_base.Length + vi; - uv[i] = uv_base[vi]; - } - } - if (colors != null) - { - for (int vi = 0; vi < colors_base.Length; ++vi) - { - int i = ii * colors_base.Length + vi; - colors[i] = colors_base[vi]; - } - } - if (indices != null) - { - for (int vi = 0; vi < indices_base.Length; ++vi) - { - int i = ii * indices_base.Length + vi; - indices[i] = ii * vertices_base.Length + indices_base[vi]; - } - } - - } - Mesh ret = new Mesh(); - ret.vertices = vertices; - ret.normals = normals; - ret.tangents = tangents; - ret.uv = uv; - ret.colors = colors; - ret.uv2 = idata; - ret.triangles = indices; - return ret; - } - - #endregion - - Material CloneMaterial(Material src, int nth) - { - Material m = new Material(src); - m.SetInt("_BatchBegin", nth * m_instances_par_batch); - m.SetTexture("_PositionBuffer", m_texPositions); - m.SetTexture("_VelocityBuffer", m_texVelocities); - m.SetTexture("_IDBuffer", m_texIDs); - - // fix rendering order for transparent objects - if (m.renderQueue >= 3000) - { - m.renderQueue = m.renderQueue + (nth + 1); - } - return m; - } - - public void RefleshMaterials() - { - m_actual_materials = null; - Flush(); - } - - public void Flush() - { - if (m_mesh == null) - { - Debug.LogWarning("AlembicPointsRenderer: mesh is not assigned"); - return; - } - if (m_materials == null || m_materials.Length == 0 || (m_materials.Length == 1 && m_materials[0] == null)) - { - Debug.LogWarning("AlembicPointsRenderer: material is not assigned"); - return; - } - - var pointsCloud = GetComponent(); - int max_instances = pointsCloud.m_peakVertexCount; - int instance_count = pointsCloud.m_count; - m_bounds.center = mul(pointsCloud.m_boundsCenter, m_trans_scale); - m_bounds.extents = mul(pointsCloud.m_boundsExtents, m_trans_scale); - - if (instance_count == 0) { return; } // nothing to draw - - // update data texture - if (m_texPositions == null || !m_texPositions.IsCreated()) - { - int height = ceildiv(max_instances, TextureWidth); - m_texPositions = CreateDataTexture(TextureWidth, height, RenderTextureFormat.ARGBFloat); - m_texVelocities = CreateDataTexture(TextureWidth, height, RenderTextureFormat.ARGBFloat); - m_texIDs = CreateDataTexture(TextureWidth, height, RenderTextureFormat.RFloat); - } - - var ps = Marshal.UnsafeAddrOfPinnedArrayElement(pointsCloud.m_abcPositions, 0); - var ids = Marshal.UnsafeAddrOfPinnedArrayElement(pointsCloud.m_abcIDs, 0); - - TextureWriter.Write(m_texPositions, ps, pointsCloud.m_count, TextureWriter.tDataFormat.Float3); - TextureWriter.Write(m_texIDs, ids, pointsCloud.m_count, TextureWriter.tDataFormat.LInt); - - // update expanded mesh - if (m_expanded_mesh != null) - { - // destroy existing expanded mesh if mesh is replaced - if (m_expanded_mesh.name != m_mesh.name + "_expanded") - { - m_expanded_mesh = null; - } - } - if (m_expanded_mesh == null) - { - m_expanded_mesh = CreateExpandedMesh(m_mesh, max_instances, out m_instances_par_batch); - m_expanded_mesh.UploadMeshData(true); - m_expanded_mesh.name = m_mesh.name + "_expanded"; - } - - if (m_actual_materials == null) - { - m_actual_materials = new List>(); - while (m_actual_materials.Count < m_materials.Length) - { - m_actual_materials.Add(new List()); - } - } - - var trans = GetComponent(); - m_expanded_mesh.bounds = m_bounds; - m_count_rate = Mathf.Max(m_count_rate, 0.0f); - instance_count = Mathf.Min((int)(instance_count * m_count_rate), (int)(max_instances * m_count_rate)); - int batch_count = ceildiv(instance_count, m_instances_par_batch); - - // clone materials if needed - for (int i = 0; i < m_actual_materials.Count; ++i) - { - var materials = m_actual_materials[i]; - while (materials.Count < batch_count) - { - Material m = CloneMaterial(m_materials[i], materials.Count); - materials.Add(m); - } - } - - // update materials - var worldToLocalMatrix = trans.localToWorldMatrix; - for (int i = 0; i < m_actual_materials.Count; ++i) - { - var materials = m_actual_materials[i]; - for (int j = 0; j < materials.Count; ++j) - { - var m = materials[j]; - m.SetInt("_BatchBegin", j * m_instances_par_batch); - m.SetTexture("_PositionBuffer", m_texPositions); - m.SetTexture("_VelocityBuffer", m_texVelocities); - m.SetTexture("_IDBuffer", m_texIDs); - - m.SetInt("_NumInstances", instance_count); - m.SetVector("_CountRate", new Vector4(m_count_rate, 1.0f / m_count_rate, 0.0f, 0.0f)); - m.SetVector("_ModelScale", m_model_scale); - m.SetVector("_TransScale", m_trans_scale); - m.SetMatrix("_Transform", worldToLocalMatrix); - } - } - - - var childRenderers = transform.GetComponentsInChildren(); - - if (m_makeChildRenderers) - { - // create child renderers if needed - int missing = m_materials.Length; - if (childRenderers != null) - missing -= childRenderers.Length; - if (missing > 0) - { - for( int i =0; i < missing; i++) - MakeChildRenderer(childRenderers.Length + i); - childRenderers = transform.GetComponentsInChildren(); - } - - // assign materials to child renderers - for (int i = 0; i < m_actual_materials.Count; ++i) - { - var materials = m_actual_materials[i]; - materials.RemoveRange(batch_count, materials.Count - batch_count); - childRenderers[i].sharedMaterials = materials.ToArray(); - } - - // update mesh in child renderers if m_mesh is replaced - for (int i = 0; i < childRenderers.Length; ++i) - { - var mesh_filter = childRenderers[i].GetComponent(); - if (mesh_filter.sharedMesh != m_expanded_mesh) - { - mesh_filter.sharedMesh = m_expanded_mesh; - } - } - } - else - { - // clear child renderers - if (childRenderers != null) - { - foreach (var child in childRenderers) - { - if (child != null) - { - DestroyImmediate(child.gameObject); - } - } - childRenderers = null; - } - - // issue draw calls - int layer = gameObject.layer; - Matrix4x4 matrix = Matrix4x4.identity; - m_actual_materials.ForEach(a => - { - for (int i = 0; i < batch_count; ++i) - { - Graphics.DrawMesh(m_expanded_mesh, matrix, a[i], layer, null, 0, null, m_cast_shadow, m_receive_shadow); - } - }); - } - } - - MeshRenderer MakeChildRenderer(int i) - { - var child = new GameObject(); - var transform = child.GetComponent(); - var filter = child.AddComponent(); - var renderer = child.AddComponent(); - - child.name = "MeshRenderer[" + i + "]"; - transform.SetParent(GetComponent()); - filter.sharedMesh = m_expanded_mesh; - return renderer; - } - - void ReleaseGPUResoureces() - { - if (m_actual_materials != null) - { - m_actual_materials.ForEach(a => { a.Clear(); }); - } - if (m_texPositions != null) - { - m_texPositions.Release(); - m_texPositions = null; - } - if (m_texVelocities != null) - { - m_texVelocities.Release(); - m_texVelocities = null; - } - if (m_texIDs != null) - { - m_texIDs.Release(); - m_texIDs = null; - } - m_bounds = new Bounds(); - } - -#if UNITY_EDITOR - void Reset() - { - // IcoSphere.asset - m_mesh = AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath("b63f02850eb90a641b0e2db0da7e9e74")); - m_materials = new Material[1] { - // AlembicPointsDefault.mat - AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath("5dfafd6734133bb4b9012fba0eadd4af")) - }; - ReleaseGPUResoureces(); - } - - void OnValidate() - { - ReleaseGPUResoureces(); - } -#endif - - void OnDisable() - { - ReleaseGPUResoureces(); - } - - void LateUpdate() - { - Flush(); - } - -#if UNITY_EDITOR - void OnDrawGizmos() - { - if (m_show_bounds) - { - Gizmos.matrix = GetComponent().localToWorldMatrix; - Gizmos.color = Color.yellow; - Gizmos.DrawWireCube(m_bounds.center, m_bounds.extents); - } - } -#endif - } -} diff --git a/AlembicImporter/Assets/UTJ/AlembicImporter/Scripts/AlembicPointsRenderer.cs.meta b/AlembicImporter/Assets/UTJ/AlembicImporter/Scripts/AlembicPointsRenderer.cs.meta deleted file mode 100644 index 6053c8038..000000000 --- a/AlembicImporter/Assets/UTJ/AlembicImporter/Scripts/AlembicPointsRenderer.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 2a49efada2a04f24f877f6e98f961486 -timeCreated: 1453551415 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/AlembicImporter/Assets/UTJ/AlembicImporter/Shaders.meta b/AlembicImporter/Assets/UTJ/AlembicImporter/Shaders.meta deleted file mode 100644 index 400f72a29..000000000 --- a/AlembicImporter/Assets/UTJ/AlembicImporter/Shaders.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 7b992db1f8d2f974eb46332f4775fe9a -folderAsset: yes -timeCreated: 1453551412 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/AlembicImporter/Assets/UTJ/AlembicImporter/Shaders/AICommon.cginc b/AlembicImporter/Assets/UTJ/AlembicImporter/Shaders/AICommon.cginc deleted file mode 100644 index e06c78fef..000000000 --- a/AlembicImporter/Assets/UTJ/AlembicImporter/Shaders/AICommon.cginc +++ /dev/null @@ -1,84 +0,0 @@ -#ifndef AICommon_h -#define AICommon_h - -#include "UnityCG.cginc" - -#if defined(SHADER_API_D3D11) || defined(SHADER_API_OPENGL) -float4 _DrawData; // [0]: begin_index, [1]: index_count, [2]: is_normal_indexed, [3]: is_uv_indexed - -Texture2D _Indices; -Texture2D _Vertices; -Texture2D _Normals; -Texture2D _UVs; -Texture2D _Velocities; -#endif - - -struct Input { - float2 uv_MainTex; -}; - - -void vert_texturemesh(inout appdata_full v, out Input o) -{ - UNITY_INITIALIZE_OUTPUT(Input,o); - - int begin_index = _DrawData[0]; - int index_count = _DrawData[1]; - int vertex_count = _DrawData[2]; - int iheight = index_count >> 10; - int vheight = vertex_count >> 10; - - int ii1 = begin_index + (int)v.texcoord.x; - if(ii1 > index_count) { - v.vertex = 0.0; - return; - } - - int2 ii2 = int2( ii1 & 0x3ff, ii1 >> 10 ); // assume texture width is 1024 - int vi1 = _Indices[ii2]; - int2 vi2 = int2( vi1 & 0x3ff, vi1 >> 10 ); // - - v.vertex = float4( - _Vertices[vi2 * int2(3,1) + int2(0,0)], - _Vertices[vi2 * int2(3,1) + int2(1,0)], - _Vertices[vi2 * int2(3,1) + int2(2,0)], - 1.0 ); - -#ifdef HAS_UVS -#ifdef IS_UV_INDEXED - v.texcoord.xy = float4( - _UVs[vi2 * int2(2,1) + int2(0,0)], - _UVs[vi2 * int2(2,1) + int2(1,0)] ); -#else // IS_UV_INDEXED - v.texcoord.xy = float4( - _UVs[ii2 * int2(2,1) + int2(0,0)], - _UVs[ii2 * int2(2,1) + int2(1,0)] ); -#endif // IS_UV_INDEXED -#endif // HAS_UVS - -#ifdef HAS_NORMALS -#ifdef IS_NORMAL_INDEXED - v.normal = float3( - _Normals[vi2 * int2(3,1) + int2(0,0)], - _Normals[vi2 * int2(3,1) + int2(1,0)], - _Normals[vi2 * int2(3,1) + int2(2,0)] ); -#else // IS_NORMAL_INDEXED - v.normal = float3( - _Normals[ii2 * int2(3,1) + int2(0,0)], - _Normals[ii2 * int2(3,1) + int2(1,0)], - _Normals[ii2 * int2(3,1) + int2(2,0)] ); -#endif // IS_NORMAL_INDEXED -#endif // HAS_NORMALS - -#ifdef HAS_VELOCITIES - float3 velocity = float3( - _Velocities[vi2 * int2(3,1) + int2(0,0)], - _Velocities[vi2 * int2(3,1) + int2(1,0)], - _Velocities[vi2 * int2(3,1) + int2(2,0)] ); -#endif - - o.uv_MainTex = v.texcoord.xy; -} - -#endif // AICommon_h diff --git a/AlembicImporter/Assets/UTJ/AlembicImporter/Shaders/AICommon.cginc.meta b/AlembicImporter/Assets/UTJ/AlembicImporter/Shaders/AICommon.cginc.meta deleted file mode 100644 index 4685c6103..000000000 --- a/AlembicImporter/Assets/UTJ/AlembicImporter/Shaders/AICommon.cginc.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 59041ee192f55ff4da3a98f4598d3fcd -timeCreated: 1453551419 -licenseType: Pro -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/AlembicImporter/Assets/UTJ/AlembicImporter/Shaders/AIStandard.shader b/AlembicImporter/Assets/UTJ/AlembicImporter/Shaders/AIStandard.shader deleted file mode 100644 index 5a33c32cf..000000000 --- a/AlembicImporter/Assets/UTJ/AlembicImporter/Shaders/AIStandard.shader +++ /dev/null @@ -1,44 +0,0 @@ -Shader "Hidden/Alembic/Standard" { -Properties { - _Color ("Color", Color) = (1,1,1,1) - _MainTex ("Albedo (RGB)", 2D) = "white" {} - _Glossiness ("Smoothness", Range(0,1)) = 0.5 - _Metallic ("Metallic", Range(0,1)) = 0.0 -} -SubShader { - Tags { "RenderType"="Opaque" "Queue"="Geometry" } - -CGPROGRAM -//#pragma multi_compile ___ HAS_UVS -//#pragma multi_compile ___ IS_UV_INDEXED -//#pragma multi_compile ___ HAS_NORMALS -//#pragma multi_compile ___ IS_NORMAL_INDEXED -//#pragma multi_compile ___ HAS_VELOCITIES - - -#pragma target 5.0 -#pragma only_renderers d3d11 opengl - -#pragma surface surf Standard fullforwardshadows vertex:vert_texturemesh addshadow -#include "AICommon.cginc" - -sampler2D _MainTex; -sampler2D _NormalMap; -sampler2D _EmissionMap; -sampler2D _SpecularMap; -sampler2D _GrossMap; -half _Glossiness; -half _Metallic; -fixed4 _Color; - -void surf(Input IN, inout SurfaceOutputStandard o) -{ - fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; - o.Albedo = c.rgb; - o.Metallic = _Metallic; - o.Smoothness = _Glossiness; - o.Alpha = c.a; -} -ENDCG -} -} diff --git a/AlembicImporter/Assets/UTJ/AlembicImporter/Shaders/AIStandard.shader.meta b/AlembicImporter/Assets/UTJ/AlembicImporter/Shaders/AIStandard.shader.meta deleted file mode 100644 index 4710146e6..000000000 --- a/AlembicImporter/Assets/UTJ/AlembicImporter/Shaders/AIStandard.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 3d1a9a01cd538db45965fe72020a1c6c -timeCreated: 1453551420 -licenseType: Pro -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/AlembicImporter/Assets/UTJ/AlembicImporter/Shaders/AlembicPointsInstancing.shader b/AlembicImporter/Assets/UTJ/AlembicImporter/Shaders/AlembicPointsInstancing.shader deleted file mode 100644 index fd3effa4d..000000000 --- a/AlembicImporter/Assets/UTJ/AlembicImporter/Shaders/AlembicPointsInstancing.shader +++ /dev/null @@ -1,75 +0,0 @@ -Shader "UTJ/Alembic/PointsInstancing" { -Properties { - [Toggle(APPLY_TRANSFORM)] _ApplyTransform("Apply Transform", Int) = 1 - _Color ("Color", Color) = (1,1,1,1) - _MainTex ("Albedo (RGB)", 2D) = "white" {} - _Glossiness("Smoothness", Range(0,1)) = 0.5 - _Metallic("Metallic", Range(0,1)) = 0.0 - _Emission("Emission", Color) = (0,0,0,0) -} -SubShader{ - Tags { "RenderType" = "Opaque" "Queue" = "Geometry+1" } - -CGPROGRAM -#pragma target 3.0 -#pragma surface surf Standard fullforwardshadows vertex:vert addshadow -#pragma multi_compile ___ APPLY_TRANSFORM - -#include "UnityCG.cginc" -#include "PseudoInstancing.cginc" - -sampler2D _MainTex; -sampler2D _NormalMap; -sampler2D _EmissionMap; -sampler2D _SpecularMap; -sampler2D _GrossMap; -half _Glossiness; -half _Metallic; -half4 _Color; -half4 _Emission; -float4x4 _Transform; - -struct Input { - float2 uv_MainTex; -}; - - -void ApplyInstanceTransform(int instance_id, inout float4 vertex) -{ - if(instance_id >= GetNumInstances()) { - vertex.xyz *= 0.0; - return; - } - vertex.xyz *= GetModelScale(); - vertex.xyz += GetInstanceTranslation(instance_id) * GetTransScale(); -} - -void vert(inout appdata_full I, out Input O) -{ - UNITY_INITIALIZE_OUTPUT(Input, O); - - int iid = GetInstanceID(I.texcoord1.x); - ApplyInstanceTransform(iid, I.vertex); -#if APPLY_TRANSFORM - I.vertex = mul(_Transform, I.vertex); - I.normal = normalize(mul(_Transform, float4(I.normal, 0.0)).xyz); -#endif - - O.uv_MainTex = float4(I.texcoord.xy, 0.0, 0.0); -} - -void surf(Input I, inout SurfaceOutputStandard O) -{ - fixed4 c = tex2D(_MainTex, I.uv_MainTex.xy) * _Color; - O.Albedo = c.rgb; - O.Metallic = _Metallic; - O.Smoothness = _Glossiness; - O.Alpha = c.a; - O.Emission += _Emission; -} - -ENDCG -} - -FallBack Off -} diff --git a/AlembicImporter/Assets/UTJ/AlembicImporter/Shaders/AlembicPointsInstancing.shader.meta b/AlembicImporter/Assets/UTJ/AlembicImporter/Shaders/AlembicPointsInstancing.shader.meta deleted file mode 100644 index c8c488376..000000000 --- a/AlembicImporter/Assets/UTJ/AlembicImporter/Shaders/AlembicPointsInstancing.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 98ce4354cd3fc8b408706a0565ab14a0 -timeCreated: 1453551422 -licenseType: Pro -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/AlembicImporter/Assets/UTJ/AlembicImporter/Shaders/DataViz.shader b/AlembicImporter/Assets/UTJ/AlembicImporter/Shaders/DataViz.shader deleted file mode 100644 index d85cf69fc..000000000 --- a/AlembicImporter/Assets/UTJ/AlembicImporter/Shaders/DataViz.shader +++ /dev/null @@ -1,121 +0,0 @@ -Shader "Utility/DataViz" { - Properties { - [Enum(N,0,UV,1,T,2,Color,3)] _Data ("Data", Float) = 0 - [Enum(Object,0,World,1,Camera,2)] _Space ("Space", Float) = 0 - _RemapVectorMin ("Remap Vector Min", Float) = -1 - _RemapVectorMax ("Remap Vector Max", Float) = 1 - [Enum(UV0,0,UV1,1,UV2,2,UV3,3)] _UVSet ("UV Set", Float) = 0 - } - SubShader { - Pass { - CGPROGRAM - #pragma vertex vshd - #pragma fragment fshd - #pragma target 3.0 - - #include "UnityCG.cginc" - - struct VSHDout { - float4 position : SV_POSITION; - float4 data : TEXCOORD0; - }; - - uniform float _Data; - uniform float _Space; - uniform float _UVSet; - uniform float _RemapVectorMin; - uniform float _RemapVectorMax; - - VSHDout vshd(appdata_full i) { - VSHDout o; - - o.position = mul(UNITY_MATRIX_MVP, i.vertex); - - if (_Data == 0) - { - // Normal - float3 N; - if (_Space == 0) - { - // Object - N = i.normal; - } - else if (_Space == 1) - { - // World - N = UnityObjectToWorldNormal(i.normal.xyz); - } - else - { - // Camera - N = normalize(UNITY_MATRIX_MV[0].xyz * i.normal.x + UNITY_MATRIX_MV[1].xyz * i.normal.y + UNITY_MATRIX_MV[2].xyz * i.normal.z); - } - o.data.xyz = _RemapVectorMin + ((N + 1.0f) / 2.0) * (_RemapVectorMax - _RemapVectorMin); - o.data.a = 1.0f; - } - else if (_Data == 1) - { - // UVs - if (_UVSet == 0) - { - o.data.xy = i.texcoord.xy; - } - else if (_UVSet == 1) - { - o.data.xy = i.texcoord1.xy; - } - else if (_UVSet == 2) - { - o.data.xy = i.texcoord2.xy; - } - else if (_UVSet == 3) - { - o.data.xy = i.texcoord3.xy; - } - else - { - o.data.x = 0.0f; - o.data.y = 0.0f; - } - o.data.z = 0.0f; - o.data.a = 1.0f; - } - else if (_Data == 2) - { - // Tangents - float3 T; - if (_Space == 0) - { - // Object - T = i.tangent; - } - else if (_Space == 1) - { - // World - T = UnityObjectToWorldDir(i.tangent.xyz); - } - else - { - // Camera - T = normalize(mul((float3x3)UNITY_MATRIX_MV, i.tangent.xyz)); - } - o.data.xyz = _RemapVectorMin + ((T + 1.0f) / 2.0) * (_RemapVectorMax - _RemapVectorMin); - o.data.a = 1.0f; - } - else - { - // Colors - o.data = i.color; - } - - return o; - } - - float4 fshd(VSHDout i) : SV_Target { - return i.data; - } - ENDCG - } - } - FallBack Off -} diff --git a/AlembicImporter/Assets/UTJ/AlembicImporter/Shaders/DataViz.shader.meta b/AlembicImporter/Assets/UTJ/AlembicImporter/Shaders/DataViz.shader.meta deleted file mode 100644 index 0f41ed62f..000000000 --- a/AlembicImporter/Assets/UTJ/AlembicImporter/Shaders/DataViz.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 01ef499cae015ff47ba092b8be9b5a49 -timeCreated: 1453551419 -licenseType: Pro -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/AlembicImporter/Assets/UTJ/AlembicImporter/Shaders/PseudoInstancing.cginc b/AlembicImporter/Assets/UTJ/AlembicImporter/Shaders/PseudoInstancing.cginc deleted file mode 100644 index 6a12d8f53..000000000 --- a/AlembicImporter/Assets/UTJ/AlembicImporter/Shaders/PseudoInstancing.cginc +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef PseudoInstancing_h -#define PseudoInstancing_h - -int _NumInstances; -float4 _ModelScale; -float4 _TransScale; -int _BatchBegin; - -sampler2D _PositionBuffer; -sampler2D _VelocityBuffer; -sampler2D _IDBuffer; -float4 _PositionBuffer_TexelSize; -float4 _CountRate; // x: count rate, y: 1.0 / count rate - - -int GetNumInstances() { return _NumInstances; } -float3 GetModelScale() { return _ModelScale.xyz; } -float3 GetTransScale() { return _TransScale.xyz; } -float GetInstanceID(float i) { return i + _BatchBegin; } - -float4 InstanceTexcoord(float i) -{ - i = i * _CountRate.y; - float2 coord = float2( - fmod(i, _PositionBuffer_TexelSize.z) + 0.5, - floor(i / _PositionBuffer_TexelSize.z) + 0.5); - return float4(_PositionBuffer_TexelSize.xy * coord, 0.0, 0.0); -} - -float3 GetInstanceTranslation(float i) { return tex2Dlod(_PositionBuffer, InstanceTexcoord(i)).xyz; } -float3 GetInstanceVelocity(float i) { return tex2Dlod(_VelocityBuffer, InstanceTexcoord(i)).xyz; } -float GetObjectID(float i) { return tex2Dlod(_IDBuffer, InstanceTexcoord(i)).x; } - -#endif // PseudoInstancing_h - diff --git a/AlembicImporter/Assets/UTJ/AlembicImporter/Shaders/PseudoInstancing.cginc.meta b/AlembicImporter/Assets/UTJ/AlembicImporter/Shaders/PseudoInstancing.cginc.meta deleted file mode 100644 index 0f3451e33..000000000 --- a/AlembicImporter/Assets/UTJ/AlembicImporter/Shaders/PseudoInstancing.cginc.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 862693a2d12448f4eae8eff644d7f4c9 -timeCreated: 1453551419 -licenseType: Pro -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/AlembicImporter/Assets/UTJ/AlembicImporterExample.meta b/AlembicImporter/Assets/UTJ/AlembicImporterExample.meta deleted file mode 100644 index e0d311f2d..000000000 --- a/AlembicImporter/Assets/UTJ/AlembicImporterExample.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: e69d0b291c7c819468c5507588530b9e -folderAsset: yes -timeCreated: 1434378245 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/AlembicImporter/Assets/UTJ/AlembicImporterExample/TestImport.unity b/AlembicImporter/Assets/UTJ/AlembicImporterExample/TestImport.unity deleted file mode 100644 index a0c290df1..000000000 Binary files a/AlembicImporter/Assets/UTJ/AlembicImporterExample/TestImport.unity and /dev/null differ diff --git a/AlembicImporter/Assets/UTJ/AlembicImporterExample/TestImport.unity.meta b/AlembicImporter/Assets/UTJ/AlembicImporterExample/TestImport.unity.meta deleted file mode 100644 index 60f7467d5..000000000 --- a/AlembicImporter/Assets/UTJ/AlembicImporterExample/TestImport.unity.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 57c7dba094b4b6f42b30723f18758fff -timeCreated: 1453551967 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/AlembicImporter/Assets/UTJ/Plugins/x86/TextureWriter.dll.meta b/AlembicImporter/Assets/UTJ/Plugins/x86/TextureWriter.dll.meta deleted file mode 100644 index d068e46e0..000000000 --- a/AlembicImporter/Assets/UTJ/Plugins/x86/TextureWriter.dll.meta +++ /dev/null @@ -1,67 +0,0 @@ -fileFormatVersion: 2 -guid: c1b32885670253847925da5ebf15ec45 -timeCreated: 1454786940 -licenseType: Pro -PluginImporter: - serializedVersion: 1 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - isOverridable: 0 - platformData: - Any: - enabled: 1 - settings: - Exclude Editor: 0 - Exclude Linux: 0 - Exclude Linux64: 1 - Exclude LinuxUniversal: 0 - Exclude OSXIntel: 0 - Exclude OSXIntel64: 1 - Exclude OSXUniversal: 1 - Exclude Win: 0 - Exclude Win64: 1 - Editor: - enabled: 1 - settings: - CPU: x86 - DefaultValueInitialized: true - OS: Windows - Linux: - enabled: 1 - settings: - CPU: x86 - Linux64: - enabled: 0 - settings: - CPU: None - LinuxUniversal: - enabled: 1 - settings: - CPU: x86 - OSXIntel: - enabled: 1 - settings: - CPU: AnyCPU - OSXIntel64: - enabled: 0 - settings: - CPU: None - OSXUniversal: - enabled: 0 - settings: - CPU: x86 - Win: - enabled: 1 - settings: - CPU: AnyCPU - Win64: - enabled: 0 - settings: - CPU: None - data: - enabled: 0 - settings: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/AlembicImporter/Assets/UTJ/Plugins/x86_64/TextureWriter.dll.meta b/AlembicImporter/Assets/UTJ/Plugins/x86_64/TextureWriter.dll.meta deleted file mode 100644 index 674cda0ce..000000000 --- a/AlembicImporter/Assets/UTJ/Plugins/x86_64/TextureWriter.dll.meta +++ /dev/null @@ -1,64 +0,0 @@ -fileFormatVersion: 2 -guid: 311e89ab5f4e4be4abcf130387dd31ce -timeCreated: 1454786354 -licenseType: Pro -PluginImporter: - serializedVersion: 1 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - isOverridable: 0 - platformData: - Any: - enabled: 1 - settings: - Exclude Editor: 0 - Exclude Linux: 1 - Exclude Linux64: 0 - Exclude LinuxUniversal: 1 - Exclude OSXIntel: 1 - Exclude OSXIntel64: 0 - Exclude OSXUniversal: 1 - Exclude Win: 1 - Exclude Win64: 0 - Editor: - enabled: 1 - settings: - CPU: x86_64 - DefaultValueInitialized: true - OS: Windows - Linux: - enabled: 0 - settings: - CPU: None - Linux64: - enabled: 1 - settings: - CPU: x86_64 - LinuxUniversal: - enabled: 0 - settings: - CPU: x86_64 - OSXIntel: - enabled: 0 - settings: - CPU: None - OSXIntel64: - enabled: 1 - settings: - CPU: AnyCPU - OSXUniversal: - enabled: 0 - settings: - CPU: x86_64 - Win: - enabled: 0 - settings: - CPU: None - Win64: - enabled: 1 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/AlembicImporter/Assets/UTJ/TextureWriter.meta b/AlembicImporter/Assets/UTJ/TextureWriter.meta deleted file mode 100644 index ff46d5a1d..000000000 --- a/AlembicImporter/Assets/UTJ/TextureWriter.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 5d5ea13789c9fea48bd81901c274d254 -folderAsset: yes -timeCreated: 1453644968 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/AlembicImporter/Assets/UTJ/TextureWriter/TextureWriter.cs b/AlembicImporter/Assets/UTJ/TextureWriter/TextureWriter.cs deleted file mode 100644 index 48a0cd39b..000000000 --- a/AlembicImporter/Assets/UTJ/TextureWriter/TextureWriter.cs +++ /dev/null @@ -1,103 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.InteropServices; -using System.Runtime.CompilerServices; -using System.Reflection; -using UnityEngine; -#if UNITY_EDITOR -using UnityEditor; -#endif - -namespace UTJ -{ - public class TextureWriter - { - public enum tTextureFormat - { - Unknown, - ARGB32, - ARGB2101010, - RHalf, - RGHalf, - ARGBHalf, - RFloat, - RGFloat, - ARGBFloat, - RInt, - RGInt, - ARGBInt, - }; - - public enum tDataFormat - { - Unknown, - Half, - Half2, - Half3, - Half4, - Float, - Float2, - Float3, - Float4, - Int, - Int2, - Int3, - Int4, - LInt, // 64bit int - }; - - - public static tTextureFormat GetTextureFormat(RenderTexture v) - { - switch (v.format) - { - case RenderTextureFormat.ARGB32: return tTextureFormat.ARGB32; - case RenderTextureFormat.RHalf: return tTextureFormat.RHalf; - case RenderTextureFormat.RGHalf: return tTextureFormat.RGHalf; - case RenderTextureFormat.ARGBHalf: return tTextureFormat.ARGBHalf; - case RenderTextureFormat.RFloat: return tTextureFormat.RFloat; - case RenderTextureFormat.RGFloat: return tTextureFormat.RGFloat; - case RenderTextureFormat.ARGBFloat: return tTextureFormat.ARGBFloat; - case RenderTextureFormat.RInt: return tTextureFormat.RInt; - case RenderTextureFormat.RGInt: return tTextureFormat.RGInt; - case RenderTextureFormat.ARGBInt: return tTextureFormat.ARGBInt; - } - return tTextureFormat.Unknown; - } - - public static tTextureFormat GetTextureFormat(Texture2D v) - { - switch (v.format) - { - case TextureFormat.ARGB32: return tTextureFormat.ARGB32; - case TextureFormat.RHalf: return tTextureFormat.RHalf; - case TextureFormat.RGHalf: return tTextureFormat.RGHalf; - case TextureFormat.RGBAHalf: return tTextureFormat.ARGBHalf; - case TextureFormat.RFloat: return tTextureFormat.RFloat; - case TextureFormat.RGFloat: return tTextureFormat.RGFloat; - case TextureFormat.RGBAFloat: return tTextureFormat.ARGBFloat; - } - return tTextureFormat.Unknown; - } - - [DllImport("TextureWriter")] - private static extern int tWriteTexture( - IntPtr dst_tex, int dst_width, int dst_height, tTextureFormat dst_fmt, - IntPtr src, int src_num, tDataFormat src_fmt); - - public static bool Write(RenderTexture dst_tex, IntPtr src, int src_num, tDataFormat src_fmt) - { - return tWriteTexture( - dst_tex.GetNativeTexturePtr(), dst_tex.width, dst_tex.height, - GetTextureFormat(dst_tex), src, src_num, src_fmt) != 0; - } - - public static bool Write(Texture2D dst_tex, IntPtr src, int src_num, tDataFormat src_fmt) - { - return tWriteTexture( - dst_tex.GetNativeTexturePtr(), dst_tex.width, dst_tex.height, - GetTextureFormat(dst_tex), src, src_num, src_fmt) != 0; - } - } -} \ No newline at end of file diff --git a/AlembicImporter/Assets/UTJ/TextureWriter/TextureWriter.cs.meta b/AlembicImporter/Assets/UTJ/TextureWriter/TextureWriter.cs.meta deleted file mode 100644 index 53bea5fb1..000000000 --- a/AlembicImporter/Assets/UTJ/TextureWriter/TextureWriter.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 88aa5e4a4d1e4ca4690973460ff49f28 -timeCreated: 1453644970 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Plugin/Tools/TextureWriter.vcxproj b/Plugin/Tools/TextureWriter.vcxproj index 5c7cc2f96..c833ed343 100644 --- a/Plugin/Tools/TextureWriter.vcxproj +++ b/Plugin/Tools/TextureWriter.vcxproj @@ -130,7 +130,8 @@ - xcopy /Yq $(TargetPath) $(SolutionDir)..\AlembicImporter\Assets\UTJ\Plugins\x86_64\ + + Use @@ -148,7 +149,8 @@ - xcopy /Yq $(TargetPath) $(SolutionDir)..\AlembicImporter\Assets\UTJ\Plugins\x86_64\ + + Use @@ -219,8 +221,8 @@ true - xcopy /Yq $(TargetPath) $(SolutionDir)Bin\x86\ -xcopy /Yq $(TargetPath) $(SolutionDir)..\AlembicImporter\Assets\UTJ\Plugins\x86\ + + @@ -260,8 +262,8 @@ xcopy /Yq $(TargetPath) $(SolutionDir)..\AlembicImporter\Assets\UTJ\Plugins\x86\ tImpl;tSupportD3D11;tSupportD3D9;tSupportOpenGL;GLEW_STATIC;%(PreprocessorDefinitions) - xcopy /Yq $(TargetPath) $(SolutionDir)Bin\x86\ -xcopy /Yq $(TargetPath) $(SolutionDir)..\AlembicImporter\Assets\UTJ\Plugins\x86\ + +