From beaaa2467879b477904240b725352fd359251723 Mon Sep 17 00:00:00 2001 From: "Hyunseok Yang (YG)" Date: Wed, 8 May 2024 08:03:33 +0900 Subject: [PATCH 01/17] Add spllit option when it parse pose, point or color in SDF format - StringSplitOptions.RemoveEmptyEntries --- Assets/Scripts/Tools/SDF/Implement/Implement.Visual.cs | 4 ++-- Assets/Scripts/Tools/SDF/Parser/Color.cs | 2 +- Assets/Scripts/Tools/SDF/Parser/Entity.cs | 2 +- Assets/Scripts/Tools/SDF/Parser/Pose.cs | 2 +- Assets/Scripts/Tools/SDF/Parser/Quaternion.cs | 2 +- Assets/Scripts/Tools/SDF/Parser/SensorTypes.cs | 2 +- Assets/Scripts/Tools/SDF/Parser/Vector.cs | 4 ++-- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Assets/Scripts/Tools/SDF/Implement/Implement.Visual.cs b/Assets/Scripts/Tools/SDF/Implement/Implement.Visual.cs index f2748154..5fa3f0c5 100644 --- a/Assets/Scripts/Tools/SDF/Implement/Implement.Visual.cs +++ b/Assets/Scripts/Tools/SDF/Implement/Implement.Visual.cs @@ -149,7 +149,7 @@ private static void ApplyOgreVertexColour(in OgreMaterial.Pass pass, UE.Material { var specular = pass.properties["specular"].Trim(); - var tmp = specular.Split(' '); + var tmp = specular.Split(' ', StringSplitOptions.RemoveEmptyEntries); if (tmp.Length == 5) { var shininess = Convert.ToSingle(tmp[4]); @@ -267,7 +267,7 @@ private static void ApplyOgreMaterial(in OgreMaterial.Material ogreMaterial, UE. { var pass = passEntry.Value; - // UE.Debug.Log($"Technique: {technique.passes.IndexOf(pass)}"); + // UE.Debug.Log($"Technique: {technique.passes.Count}"); // foreach (var kvp in pass.properties) // { // UE.Debug.Log($" Pass: {kvp.Key}: {kvp.Value}"); diff --git a/Assets/Scripts/Tools/SDF/Parser/Color.cs b/Assets/Scripts/Tools/SDF/Parser/Color.cs index c72d3a1d..bc8d7411 100644 --- a/Assets/Scripts/Tools/SDF/Parser/Color.cs +++ b/Assets/Scripts/Tools/SDF/Parser/Color.cs @@ -22,7 +22,7 @@ public void FromString(string value) value = value.Trim(); - var tmp = value.Split(' '); + var tmp = value.Split(' ', StringSplitOptions.RemoveEmptyEntries); if (tmp.Length < 3) return; diff --git a/Assets/Scripts/Tools/SDF/Parser/Entity.cs b/Assets/Scripts/Tools/SDF/Parser/Entity.cs index 6cb0e054..4ac25f15 100644 --- a/Assets/Scripts/Tools/SDF/Parser/Entity.cs +++ b/Assets/Scripts/Tools/SDF/Parser/Entity.cs @@ -229,7 +229,7 @@ private void ParsePose() // x y z roll pitch yaw value = value.Trim().Replace(" ", " ").Replace(" ", " ").Replace(" ", " "); - var poseStr = value.Split(' '); + var poseStr = value.Split(' ', StringSplitOptions.RemoveEmptyEntries); try { diff --git a/Assets/Scripts/Tools/SDF/Parser/Pose.cs b/Assets/Scripts/Tools/SDF/Parser/Pose.cs index 1d6aec58..7f159cd5 100644 --- a/Assets/Scripts/Tools/SDF/Parser/Pose.cs +++ b/Assets/Scripts/Tools/SDF/Parser/Pose.cs @@ -76,7 +76,7 @@ public void FromString(in string value) return; } - var tmp = value.Trim().Split(' '); + var tmp = value.Trim().Split(' ', System.StringSplitOptions.RemoveEmptyEntries); if (tmp.Length == 6) { _pos.Set(tmp[0], tmp[1], tmp[2]); diff --git a/Assets/Scripts/Tools/SDF/Parser/Quaternion.cs b/Assets/Scripts/Tools/SDF/Parser/Quaternion.cs index afb3d623..62582012 100644 --- a/Assets/Scripts/Tools/SDF/Parser/Quaternion.cs +++ b/Assets/Scripts/Tools/SDF/Parser/Quaternion.cs @@ -257,7 +257,7 @@ public void FromString(in string value) return; } - var tmp = value.Trim().Split(' '); + var tmp = value.Trim().Split(' ', StringSplitOptions.RemoveEmptyEntries); if (tmp.Length == 3) { diff --git a/Assets/Scripts/Tools/SDF/Parser/SensorTypes.cs b/Assets/Scripts/Tools/SDF/Parser/SensorTypes.cs index dceeb876..3b0cf9d4 100644 --- a/Assets/Scripts/Tools/SDF/Parser/SensorTypes.cs +++ b/Assets/Scripts/Tools/SDF/Parser/SensorTypes.cs @@ -87,7 +87,7 @@ public void ParsePose(in string poseString, in string relativeTo = "") if (!string.IsNullOrEmpty(poseString)) { // x y z roll pitch yaw - var poseInfo = poseString.Split(' '); + var poseInfo = poseString.Split(' ', System.StringSplitOptions.RemoveEmptyEntries); pose.Pos.Set(poseInfo[0], poseInfo[1], poseInfo[2]); pose.Rot.Set(poseInfo[3], poseInfo[4], poseInfo[5]); diff --git a/Assets/Scripts/Tools/SDF/Parser/Vector.cs b/Assets/Scripts/Tools/SDF/Parser/Vector.cs index 0c2b5cf2..866b9793 100644 --- a/Assets/Scripts/Tools/SDF/Parser/Vector.cs +++ b/Assets/Scripts/Tools/SDF/Parser/Vector.cs @@ -92,7 +92,7 @@ public void FromString(in string value) return; } - var tmp = value.Trim().Split(' '); + var tmp = value.Trim().Split(' ', StringSplitOptions.RemoveEmptyEntries); if (tmp.Length == 2) { Set(tmp[0], tmp[1]); @@ -173,7 +173,7 @@ public void Set(in string x, in string y, in string z) return; } - var tmp = value.Trim().Split(' '); + var tmp = value.Trim().Split(' ', StringSplitOptions.RemoveEmptyEntries); if (tmp.Length == 3) { Set(tmp[0], tmp[1], tmp[2]); From f790c18db9282fe908d2834b9e7f5b7a644f26cb Mon Sep 17 00:00:00 2001 From: "Hyunseok Yang (YG)" Date: Wed, 8 May 2024 08:46:03 +0900 Subject: [PATCH 02/17] add protetion code for null shape in SDF.Import.Collision --- .../Tools/SDF/Import/Import.Collision.cs | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/Assets/Scripts/Tools/SDF/Import/Import.Collision.cs b/Assets/Scripts/Tools/SDF/Import/Import.Collision.cs index 5de7025d..6671c73f 100644 --- a/Assets/Scripts/Tools/SDF/Import/Import.Collision.cs +++ b/Assets/Scripts/Tools/SDF/Import/Import.Collision.cs @@ -44,23 +44,26 @@ protected override void AfterImportCollision(in SDF.Collision collision, in Syst Implement.Collision.Make(geometryObject); var shape = collision.GetGeometry().GetShape(); - var shapeType = shape.GetType(); + if (shape != null) + { + var shapeType = shape.GetType(); - var existingMeshCollider = geometryObject.GetComponent(); + var existingMeshCollider = geometryObject.GetComponent(); - if (shapeType.Equals(typeof(Plane))) - { - collisionObject.layer = Implement.Collision.PlaneLayerIndex; - existingMeshCollider.convex = false; - } - else - { - if (EnhanceCollisionPerformance(shapeType, shape, existingMeshCollider)) + if (shapeType.Equals(typeof(Plane))) + { + collisionObject.layer = Implement.Collision.PlaneLayerIndex; + existingMeshCollider.convex = false; + } + else { - var meshColliders = geometryObject.GetComponentsInChildren(); - for (var index = 0; index < meshColliders.Length; index++) + if (EnhanceCollisionPerformance(shapeType, shape, existingMeshCollider)) { - UE.GameObject.Destroy(meshColliders[index]); + var meshColliders = geometryObject.GetComponentsInChildren(); + for (var index = 0; index < meshColliders.Length; index++) + { + UE.GameObject.Destroy(meshColliders[index]); + } } } } From b73c056d3af9a0aabac58e794b0d00f3a92271b8 Mon Sep 17 00:00:00 2001 From: "Hyunseok Yang (YG)" Date: Wed, 8 May 2024 10:49:03 +0900 Subject: [PATCH 03/17] Fix OgerMaterial Parser - possible to have multiple pass in technique --- Assets/Scripts/Tools/SDF/Util/OgreMaterial.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Assets/Scripts/Tools/SDF/Util/OgreMaterial.cs b/Assets/Scripts/Tools/SDF/Util/OgreMaterial.cs index fec2b3ee..e69f3143 100644 --- a/Assets/Scripts/Tools/SDF/Util/OgreMaterial.cs +++ b/Assets/Scripts/Tools/SDF/Util/OgreMaterial.cs @@ -112,7 +112,7 @@ public static Material Parse(string filePath, string targetMaterialName) } else if (key == "technique" && propertyLevel == PropertyLevel.MATERIAL) { - var techName = (parts.Length > 1) ? parts[1] : string.Empty; + var techName = (string.IsNullOrEmpty(value))? (key + material.techniques.Count) : value; material.techniques[techName] = new Technique(); targetTechName = techName; @@ -125,13 +125,14 @@ public static Material Parse(string filePath, string targetMaterialName) // Debug.Log(key + " => " + value); if (material.techniques.Count == 0) { - // Debug.Log("!! Missing technique"); + Debug.LogWarning("!! Missing technique"); break; } - var passName = (parts.Length > 1) ? parts[1] : string.Empty; - var targetTechnique = material.techniques[targetTechName]; + + var passName = (string.IsNullOrEmpty(value))? (key + targetTechnique.passes.Count) : value; + if (!targetTechnique.passes.ContainsKey(passName)) targetTechnique.passes[passName] = new Pass(); @@ -144,11 +145,11 @@ public static Material Parse(string filePath, string targetMaterialName) { if (material.techniques[targetTechName].passes.Count == 0) { - // Debug.Log("!! Missing pass"); + Debug.LogWarning("!! Missing pass"); break; } - var textureUnitName = (parts.Length > 1) ? parts[1] : string.Empty; + var textureUnitName = (parts.Length > 1) ? value : string.Empty; var targetPass = material.techniques[targetTechName].passes[targetPassName]; From babb6fef42f4744fa8d87a7b8002f5274706c7e6 Mon Sep 17 00:00:00 2001 From: "Hyunseok Yang (YG)" Date: Wed, 8 May 2024 14:31:44 +0900 Subject: [PATCH 04/17] Modify SDF.Import.ImportVisuals() - Change sequence of importing - Visual -> Geometry -> Plugins -> AfterVisual -> Material Modify SDF.Import.AfterImportVisual() - AddRenderes Modify Implement.Geometry() - remove adding MeshRender --- .../SDF/Implement/Implement.Collision.cs | 1 + .../Tools/SDF/Implement/Implement.Geometry.cs | 4 --- .../Scripts/Tools/SDF/Import/Import.Base.cs | 4 +-- .../Tools/SDF/Import/Import.Material.cs | 2 +- .../Scripts/Tools/SDF/Import/Import.Visual.cs | 35 +++++++++++++++---- 5 files changed, 33 insertions(+), 13 deletions(-) diff --git a/Assets/Scripts/Tools/SDF/Implement/Implement.Collision.cs b/Assets/Scripts/Tools/SDF/Implement/Implement.Collision.cs index 2017c0e6..5f98f948 100644 --- a/Assets/Scripts/Tools/SDF/Implement/Implement.Collision.cs +++ b/Assets/Scripts/Tools/SDF/Implement/Implement.Collision.cs @@ -98,6 +98,7 @@ private static void RemoveRenderers(UE.MeshFilter[] meshFilters) { foreach (var meshFilter in meshFilters) { + UE.Debug.LogWarning($"{meshFilter.name} meshFilter should not exist"); var meshRenderer = meshFilter.GetComponent(); if (meshRenderer != null) { diff --git a/Assets/Scripts/Tools/SDF/Implement/Implement.Geometry.cs b/Assets/Scripts/Tools/SDF/Implement/Implement.Geometry.cs index c6d47a5d..b7dfb9ae 100644 --- a/Assets/Scripts/Tools/SDF/Implement/Implement.Geometry.cs +++ b/Assets/Scripts/Tools/SDF/Implement/Implement.Geometry.cs @@ -105,10 +105,6 @@ public static void GenerateMeshObject(in SDF.ShapeType shape, in UE.GameObject t var meshFilter = createdObject.AddComponent(); meshFilter.sharedMesh = mesh; - - var meshRenderer = createdObject.AddComponent(); - meshRenderer.sharedMaterial = SDF2Unity.Material.Create(mesh.name); - meshRenderer.allowOcclusionWhenDynamic = true; } createdObject.transform.SetParent(targetParentObject.transform, false); diff --git a/Assets/Scripts/Tools/SDF/Import/Import.Base.cs b/Assets/Scripts/Tools/SDF/Import/Import.Base.cs index a1f27ca9..65a9ac95 100644 --- a/Assets/Scripts/Tools/SDF/Import/Import.Base.cs +++ b/Assets/Scripts/Tools/SDF/Import/Import.Base.cs @@ -25,11 +25,11 @@ private void ImportVisuals(IReadOnlyList items, in Object parentObject) ImportGeometry(item.GetGeometry(), createdObject); - ImportMaterial(item.GetMaterial(), createdObject); - ImportPlugins(item.GetPlugins(), createdObject); AfterImportVisual(item, createdObject); + + ImportMaterial(item.GetMaterial(), createdObject); } } diff --git a/Assets/Scripts/Tools/SDF/Import/Import.Material.cs b/Assets/Scripts/Tools/SDF/Import/Import.Material.cs index 0fb234f4..16b495f5 100644 --- a/Assets/Scripts/Tools/SDF/Import/Import.Material.cs +++ b/Assets/Scripts/Tools/SDF/Import/Import.Material.cs @@ -28,7 +28,7 @@ protected override void ImportMaterial(in SDF.Material sdfMaterial, in System.Ob { if (sdfMaterial.ambient != null) { - UE.Debug.Log(material.name + ": ambient is not support. " + SDF2Unity.Color(sdfMaterial.ambient)); + UE.Debug.Log(material.name + ": ambient is not support. " + SDF2Unity.Color(sdfMaterial.ambient)); } if (sdfMaterial.diffuse != null) diff --git a/Assets/Scripts/Tools/SDF/Import/Import.Visual.cs b/Assets/Scripts/Tools/SDF/Import/Import.Visual.cs index adefa746..e17031cf 100644 --- a/Assets/Scripts/Tools/SDF/Import/Import.Visual.cs +++ b/Assets/Scripts/Tools/SDF/Import/Import.Visual.cs @@ -52,12 +52,9 @@ protected override void AfterImportVisual(in SDF.Visual visual, in System.Object return; } - // remove all colliders - var colliders = visualObject.GetComponentsInChildren(); - foreach (var collider in colliders) - { - UE.GameObject.Destroy(collider); - } + RemoveColliders(visualObject); + + AddRenderes(visualObject); if (EnableOptimization) { @@ -80,6 +77,32 @@ protected override void AfterImportVisual(in SDF.Visual visual, in System.Object SceneVisibilityManager.instance.DisablePicking(visualObject, true); #endif } + + private void RemoveColliders(UE.GameObject targetObject) + { + var colliders = targetObject.GetComponentsInChildren(); + foreach (var collider in colliders) + { + UE.Debug.LogWarning($"{collider.name} Collider should not exit. There was collider"); + UE.GameObject.Destroy(collider); + } + } + + private void AddRenderes(UE.GameObject targetObject) + { + var meshFilters = targetObject.GetComponentsInChildren(); + foreach (var meshFilter in meshFilters) + { + var meshRenderer = meshFilter.gameObject.GetComponent(); + if (meshRenderer == null) + { + meshRenderer = meshFilter.gameObject.AddComponent(); + meshRenderer.materials = new UE.Material[] { SDF2Unity.Material.Create(meshFilter.name + "_material") }; + meshRenderer.allowOcclusionWhenDynamic = true; + meshRenderer.receiveShadows = true; + } + } + } } } } \ No newline at end of file From 8251a1c3ff950565f2c840bd237d45591cbb25a4 Mon Sep 17 00:00:00 2001 From: "Hyunseok Yang (YG)" Date: Wed, 8 May 2024 15:10:56 +0900 Subject: [PATCH 05/17] Change method name in SDF.Import.Base - StartImport() -> Start() --- Assets/Scripts/Main.cs | 4 ++-- Assets/Scripts/Tools/SDF/Import/Import.Base.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Assets/Scripts/Main.cs b/Assets/Scripts/Main.cs index 3a602883..0fdb2ee7 100644 --- a/Assets/Scripts/Main.cs +++ b/Assets/Scripts/Main.cs @@ -364,7 +364,7 @@ private IEnumerator LoadModel(string modelPath, string modelFileName) // Debug.Log("Parsed: " + item.Key + ", " + item.Value.Item1 + ", " + item.Value.Item2); model.Name = GetClonedModelName(model.Name); - yield return StartCoroutine(_sdfLoader.StartImport(model)); + yield return StartCoroutine(_sdfLoader.Start(model)); var targetObject = _worldRoot.transform.Find(model.Name); @@ -393,7 +393,7 @@ private IEnumerator LoadWorld() _sdfLoader.SetRootLights(_lightsRoot); _sdfLoader.SetRootRoads(_roadsRoot); - yield return _sdfLoader.StartImport(world); + yield return _sdfLoader.Start(world); // for GUI _followingList?.UpdateList(); diff --git a/Assets/Scripts/Tools/SDF/Import/Import.Base.cs b/Assets/Scripts/Tools/SDF/Import/Import.Base.cs index 65a9ac95..661d53dc 100644 --- a/Assets/Scripts/Tools/SDF/Import/Import.Base.cs +++ b/Assets/Scripts/Tools/SDF/Import/Import.Base.cs @@ -128,7 +128,7 @@ protected void ImportLights(IReadOnlyList items) } } - public IEnumerator StartImport(World world) + public IEnumerator Start(World world) { // Console.WriteLine("Import Models({0})/Links/Joints", world.GetModels().Count); jointObjectList.Clear(); @@ -148,7 +148,7 @@ public IEnumerator StartImport(World world) ImportActors(world.GetActors()); } - public IEnumerator StartImport(Model model) + public IEnumerator Start(Model model) { jointObjectList.Clear(); var tempModels = new List() { model }; From 023302c5f2e5408c54d8e45dd7019b53f6bb4bf5 Mon Sep 17 00:00:00 2001 From: "Hyunseok Yang (YG)" Date: Wed, 8 May 2024 15:24:34 +0900 Subject: [PATCH 06/17] Modify log printing condition in SDF.Implement.Collision --- Assets/Scripts/Tools/SDF/Implement/Implement.Collision.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/Scripts/Tools/SDF/Implement/Implement.Collision.cs b/Assets/Scripts/Tools/SDF/Implement/Implement.Collision.cs index 5f98f948..c7a2c9b3 100644 --- a/Assets/Scripts/Tools/SDF/Implement/Implement.Collision.cs +++ b/Assets/Scripts/Tools/SDF/Implement/Implement.Collision.cs @@ -98,10 +98,10 @@ private static void RemoveRenderers(UE.MeshFilter[] meshFilters) { foreach (var meshFilter in meshFilters) { - UE.Debug.LogWarning($"{meshFilter.name} meshFilter should not exist"); var meshRenderer = meshFilter.GetComponent(); if (meshRenderer != null) { + UE.Debug.LogWarning($"{meshFilter.name} MeshRenderer should not exist"); UE.GameObject.Destroy(meshRenderer); } UE.GameObject.Destroy(meshFilter); From b434c1700c1603a191ac0819d211daba12e88daa Mon Sep 17 00:00:00 2001 From: "Hyunseok Yang (YG)" Date: Wed, 8 May 2024 15:25:25 +0900 Subject: [PATCH 07/17] Separate Implement Material class Move the functionality related to Ogre in SDF.Implement.Visual into Implement.Material --- .../SDF/Implement/Implement.Material.Ogre.cs | 196 ++++++++++++++++ .../Implement/Implement.Material.Ogre.cs.meta | 11 + .../Tools/SDF/Implement/Implement.Material.cs | 63 +++++ .../SDF/Implement/Implement.Material.cs.meta | 11 + .../Tools/SDF/Implement/Implement.Road.cs | 2 +- .../Tools/SDF/Implement/Implement.Visual.cs | 217 ------------------ .../Tools/SDF/Import/Import.Material.cs | 2 +- 7 files changed, 283 insertions(+), 219 deletions(-) create mode 100644 Assets/Scripts/Tools/SDF/Implement/Implement.Material.Ogre.cs create mode 100644 Assets/Scripts/Tools/SDF/Implement/Implement.Material.Ogre.cs.meta create mode 100644 Assets/Scripts/Tools/SDF/Implement/Implement.Material.cs create mode 100644 Assets/Scripts/Tools/SDF/Implement/Implement.Material.cs.meta diff --git a/Assets/Scripts/Tools/SDF/Implement/Implement.Material.Ogre.cs b/Assets/Scripts/Tools/SDF/Implement/Implement.Material.Ogre.cs new file mode 100644 index 00000000..d793dcdf --- /dev/null +++ b/Assets/Scripts/Tools/SDF/Implement/Implement.Material.Ogre.cs @@ -0,0 +1,196 @@ +/* + * Copyright (c) 2020 LG Electronics Inc. + * + * SPDX-License-Identifier: MIT + */ + +using System.Collections.Generic; +using System.IO; +using System; +using UE = UnityEngine; + +namespace SDF +{ + namespace Implement + { + public partial class Material + { + public static class Ogre + { + private static string FindFile(in List uris, in string targetFileName) + { + var ext = Path.GetExtension(targetFileName); + + foreach (var currentDir in uris) + { + var subdirectoryEntries = Directory.GetDirectories(currentDir); + var subDirectories = new List(); + subDirectories.AddRange(subdirectoryEntries); + subDirectories.Insert(0, currentDir); + foreach (var subdirectory in subDirectories) + { + var fileEntries = Directory.GetFiles(subdirectory, "*" + ext); + foreach (var fileName in fileEntries) + { + if (fileName.EndsWith(targetFileName)) + return fileName; + } + } + } + + return string.Empty; + } + + + private static void ApplyVertexColour(in OgreMaterial.Pass pass, UE.Material material) + { + if (pass.properties.ContainsKey("diffuse")) + { + var diffuse = pass.properties["diffuse"].Trim(); + SDF2Unity.Material.SetBaseColor(material, SDF2Unity.Color(diffuse)); + } + + if (pass.properties.ContainsKey("emissive")) + { + var emissive = pass.properties["emissive"].Trim(); + SDF2Unity.Material.SetEmission(material, SDF2Unity.Color(emissive)); + } + + if (pass.properties.ContainsKey("specular")) + { + var specular = pass.properties["specular"].Trim(); + + var tmp = specular.Split(' ', StringSplitOptions.RemoveEmptyEntries); + if (tmp.Length == 5) + { + var shininess = Convert.ToSingle(tmp[4]); + // ObsoleteProperties in Simple lit + material.SetFloat("_Shininess", shininess); + + specular = string.Join(" ", tmp, 0, 4); + } + else if (tmp.Length == 4) + { + var alpha = Convert.ToSingle(tmp[3]); + if (alpha > 1) + { + material.SetFloat("_Shininess", alpha); + var r = Convert.ToSingle(tmp[0]); + var g = Convert.ToSingle(tmp[1]); + var b = Convert.ToSingle(tmp[2]); + tmp[3] = Convert.ToString((r + g + b) / 3f); + } + + specular = string.Join(" ", tmp, 0, 4); + } + + SDF2Unity.Material.SetSpecular(material, SDF2Unity.Color(specular)); + } + } + + private static void ApplyTextureUnits(in OgreMaterial.Pass pass, UE.Material material, in List uris) + { + foreach (var textureunitEntry in pass.textureUnits) + { + var textureunit = textureunitEntry.Value; + + // UE.Debug.Log($" TextureUnit: {textureunitEntry.Key}"); + // foreach (var kvp in textureunit.properties) + // { + // UE.Debug.Log($" TextureUnit: {kvp.Key} -> {kvp.Value}"); + // } + var textureUnitProps = textureunit.properties; + + if (!textureUnitProps.ContainsKey("texture")) + { + continue; + } + + var textureFileName = textureUnitProps["texture"]; + var textureFilePath = FindFile(uris, textureFileName); + + // UE.Debug.Log(textureFilePath + ", " + textureFileName); + if (string.IsNullOrEmpty(textureFilePath)) + { + continue; + } + + var texture = MeshLoader.GetTexture(textureFilePath); + if (texture != null) + { + if (textureUnitProps.ContainsKey("filtering")) + { + var textureFiltering = textureUnitProps["filtering"]; + // to make upper in First character + switch (textureFiltering) + { + case "bilinear": + texture.filterMode = UE.FilterMode.Bilinear; + break; + case "trilinear": + case "anisotropic": + texture.filterMode = UE.FilterMode.Trilinear; + break; + case "none": + default: + texture.filterMode = UE.FilterMode.Point; + break; + } + } + + if (textureUnitProps.ContainsKey("max_anisotropy")) + { + var textureAnisotropy = textureUnitProps["max_anisotropy"]; + texture.anisoLevel = Convert.ToInt32(textureAnisotropy); + } + + if (textureUnitProps.ContainsKey("scale")) + { + var scaleSet = textureUnitProps["scale"]; + var tileScale = SDF2Unity.Scale(scaleSet); + + // TODO: Check texture tile scaling + tileScale.x = 1 / tileScale.x; + tileScale.y = 1 / tileScale.y; + + material.SetTextureScale("_BaseMap", tileScale); + } + + material.SetTexture("_BaseMap", texture); + } + + return; + } + } + + public static void ApplyMaterial(in OgreMaterial.Material ogreMaterial, UE.Material material, in List uris) + { + if (ogreMaterial.hasReceiveShadows) + { + material.SetFloat("_ReceiveShadows", ogreMaterial.receiveShadows ? 1f : 0); + } + + foreach (var techEntry in ogreMaterial.techniques) + { + var technique = techEntry.Value; + + foreach (var passEntry in technique.passes) + { + var pass = passEntry.Value; + + // UE.Debug.Log($"Passes in Technique: {technique.passes.Count}"); + // foreach (var kvp in pass.properties) + // { + // UE.Debug.Log($" Pass: {kvp.Key}: {kvp.Value}"); + // } + + ApplyVertexColour(pass, material); + + ApplyTextureUnits(pass, material, uris); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Tools/SDF/Implement/Implement.Material.Ogre.cs.meta b/Assets/Scripts/Tools/SDF/Implement/Implement.Material.Ogre.cs.meta new file mode 100644 index 00000000..7664b00d --- /dev/null +++ b/Assets/Scripts/Tools/SDF/Implement/Implement.Material.Ogre.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c6eeee00d5f3338f5bb6dda50e025939 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/SDF/Implement/Implement.Material.cs b/Assets/Scripts/Tools/SDF/Implement/Implement.Material.cs new file mode 100644 index 00000000..e01fb801 --- /dev/null +++ b/Assets/Scripts/Tools/SDF/Implement/Implement.Material.cs @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2020 LG Electronics Inc. + * + * SPDX-License-Identifier: MIT + */ + +using System.Collections.Generic; +using System.Linq; +using System.IO; +using UE = UnityEngine; +using Debug = UnityEngine.Debug; + +namespace SDF +{ + namespace Implement + { + public partial class Material + { + public static void ApplyScript(in SDF.Material.Script script, UE.Material targetMaterial) + { + var targetMaterialName = script.name; + var texturesPath = new List(); + var targetMaterialFilepath = string.Empty; + + foreach (var uri in script.uri) + { + // Debug.Log(uri); + if (uri.EndsWith(".material") && File.Exists(uri)) + { + targetMaterialFilepath = uri; + var targetDir = Directory.GetParent(uri).Parent.ToString(); + texturesPath.Add(targetDir); + } + // find *.material file in folder + else if (Directory.Exists(uri)) + { + var files = Directory.GetFiles(uri); + foreach (var file in files) + { + if (file.EndsWith(".material")) + { + targetMaterialFilepath = file; + // Console.Write(file); + } + } + + texturesPath.Add(uri); + } + } + + if (string.IsNullOrEmpty(targetMaterialFilepath) == false) + { + var ogreMaterial = OgreMaterial.Parse(targetMaterialFilepath, targetMaterialName); + if (ogreMaterial != null) + { + // UE.Debug.Log($"Found: '{ogreMaterial.name}' material, techniques: {ogreMaterial.techniques.Count}"); + Ogre.ApplyMaterial(ogreMaterial, targetMaterial, texturesPath); + } + } + } + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Tools/SDF/Implement/Implement.Material.cs.meta b/Assets/Scripts/Tools/SDF/Implement/Implement.Material.cs.meta new file mode 100644 index 00000000..2a988851 --- /dev/null +++ b/Assets/Scripts/Tools/SDF/Implement/Implement.Material.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 37c885daf92efdbeead9f3826575840b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/SDF/Implement/Implement.Road.cs b/Assets/Scripts/Tools/SDF/Implement/Implement.Road.cs index eeb3e718..c5c48b05 100644 --- a/Assets/Scripts/Tools/SDF/Implement/Implement.Road.cs +++ b/Assets/Scripts/Tools/SDF/Implement/Implement.Road.cs @@ -44,7 +44,7 @@ public static UE.GameObject Generate(in SDF.World.Road road) var material = SDF2Unity.Material.Create(road.Name + "_Material"); - SDF.Implement.Visual.ApplyMaterial(road.material.script, material); + SDF.Implement.Material.ApplyScript(road.material.script, material); var roadGenerator = newRoadObject.AddComponent(); roadGenerator.SdfMaterial = road.material; diff --git a/Assets/Scripts/Tools/SDF/Implement/Implement.Visual.cs b/Assets/Scripts/Tools/SDF/Implement/Implement.Visual.cs index 5fa3f0c5..588ab48e 100644 --- a/Assets/Scripts/Tools/SDF/Implement/Implement.Visual.cs +++ b/Assets/Scripts/Tools/SDF/Implement/Implement.Visual.cs @@ -7,7 +7,6 @@ using System.Collections.Generic; using System.Linq; using System.IO; -using System; using UE = UnityEngine; using Debug = UnityEngine.Debug; @@ -106,222 +105,6 @@ var optimizationTarget OptimizeMesh(optimizationTarget); } } - - private static string FindFile(in List uris, in string targetFileName) - { - var ext = Path.GetExtension(targetFileName); - - foreach (var currentDir in uris) - { - var subdirectoryEntries = Directory.GetDirectories(currentDir); - var subDirectories = new List(); - subDirectories.AddRange(subdirectoryEntries); - subDirectories.Insert(0, currentDir); - foreach (var subdirectory in subDirectories) - { - var fileEntries = Directory.GetFiles(subdirectory, "*" + ext); - foreach (var fileName in fileEntries) - { - if (fileName.EndsWith(targetFileName)) - return fileName; - } - } - } - - return string.Empty; - } - - private static void ApplyOgreVertexColour(in OgreMaterial.Pass pass, UE.Material material) - { - if (pass.properties.ContainsKey("diffuse")) - { - var diffuse = pass.properties["diffuse"].Trim(); - SDF2Unity.Material.SetBaseColor(material, SDF2Unity.Color(diffuse)); - } - - if (pass.properties.ContainsKey("emissive")) - { - var emissive = pass.properties["emissive"].Trim(); - SDF2Unity.Material.SetEmission(material, SDF2Unity.Color(emissive)); - } - - if (pass.properties.ContainsKey("specular")) - { - var specular = pass.properties["specular"].Trim(); - - var tmp = specular.Split(' ', StringSplitOptions.RemoveEmptyEntries); - if (tmp.Length == 5) - { - var shininess = Convert.ToSingle(tmp[4]); - // ObsoleteProperties in Simple lit - material.SetFloat("_Shininess", shininess); - - specular = string.Join(" ", tmp, 0, 4); - } - else if (tmp.Length == 4) - { - var alpha = Convert.ToSingle(tmp[3]); - if (alpha > 1) - { - material.SetFloat("_Shininess", alpha); - var r = Convert.ToSingle(tmp[0]); - var g = Convert.ToSingle(tmp[1]); - var b = Convert.ToSingle(tmp[2]); - tmp[3] = Convert.ToString((r + g + b) / 3f); - } - - specular = string.Join(" ", tmp, 0, 4); - } - - SDF2Unity.Material.SetSpecular(material, SDF2Unity.Color(specular)); - } - } - - private static void ApplyOgreTextureUnits(in OgreMaterial.Pass pass, UE.Material material, in List uris) - { - foreach (var textureunitEntry in pass.textureUnits) - { - var textureunit = textureunitEntry.Value; - - // UE.Debug.Log($" TextureUnit: {pass.textureUnits.IndexOf(textureunit)}"); - // foreach (var kvp in textureunit.properties) - // { - // UE.Debug.Log($" TextureUnit: {kvp.Key} -> {kvp.Value}"); - // } - var textureUnitProps = textureunit.properties; - - if (!textureUnitProps.ContainsKey("texture")) - { - continue; - } - - var textureFileName = textureUnitProps["texture"]; - var textureFilePath = FindFile(uris, textureFileName); - - // UE.Debug.Log(textureFilePath + ", " + textureFileName); - if (string.IsNullOrEmpty(textureFilePath)) - { - continue; - } - - var texture = MeshLoader.GetTexture(textureFilePath); - if (texture != null) - { - if (textureUnitProps.ContainsKey("filtering")) - { - var textureFiltering = textureUnitProps["filtering"]; - // to make upper in First character - switch (textureFiltering) - { - case "bilinear": - texture.filterMode = UE.FilterMode.Bilinear; - break; - case "trilinear": - case "anisotropic": - texture.filterMode = UE.FilterMode.Trilinear; - break; - case "none": - default: - texture.filterMode = UE.FilterMode.Point; - break; - } - } - - if (textureUnitProps.ContainsKey("max_anisotropy")) - { - var textureAnisotropy = textureUnitProps["max_anisotropy"]; - texture.anisoLevel = Convert.ToInt32(textureAnisotropy); - } - - if (textureUnitProps.ContainsKey("scale")) - { - var scaleSet = textureUnitProps["scale"]; - var tileScale = SDF2Unity.Scale(scaleSet); - - // TODO: Check texture tile scaling - tileScale.x = 1 / tileScale.x; - tileScale.y = 1 / tileScale.y; - - material.SetTextureScale("_BaseMap", tileScale); - } - - material.SetTexture("_BaseMap", texture); - } - - return; - } - } - - private static void ApplyOgreMaterial(in OgreMaterial.Material ogreMaterial, UE.Material material, in List uris) - { - if (ogreMaterial.hasReceiveShadows) - { - material.SetFloat("_ReceiveShadows", ogreMaterial.receiveShadows ? 1f : 0); - } - - foreach (var techEntry in ogreMaterial.techniques) - { - var technique = techEntry.Value; - - foreach (var passEntry in technique.passes) - { - var pass = passEntry.Value; - - // UE.Debug.Log($"Technique: {technique.passes.Count}"); - // foreach (var kvp in pass.properties) - // { - // UE.Debug.Log($" Pass: {kvp.Key}: {kvp.Value}"); - // } - - ApplyOgreVertexColour(pass, material); - - ApplyOgreTextureUnits(pass, material, uris); - } - } - } - - public static void ApplyMaterial(in SDF.Material.Script script, UE.Material targetMaterial) - { - var targetMaterialName = script.name; - var texturesPath = new List(); - var targetMaterialFilepath = string.Empty; - - foreach (var uri in script.uri) - { - // Debug.Log(uri); - if (uri.EndsWith(".material") && File.Exists(uri)) - { - targetMaterialFilepath = uri; - var targetDir = Directory.GetParent(uri).Parent.ToString(); - texturesPath.Add(targetDir); - } - // find *.material file in folder - else if (Directory.Exists(uri)) - { - var files = Directory.GetFiles(uri); - foreach (var file in files) - { - if (file.EndsWith(".material")) - { - targetMaterialFilepath = file; - // Console.Write(file); - } - } - - texturesPath.Add(uri); - } - } - - if (string.IsNullOrEmpty(targetMaterialFilepath) == false) - { - var ogreMaterial = OgreMaterial.Parse(targetMaterialFilepath, targetMaterialName); - if (ogreMaterial != null) - { - // UE.Debug.Log($"Found: '{ogreMaterial.name}' material, techniques: {ogreMaterial.techniques.Count}"); - ApplyOgreMaterial(ogreMaterial, targetMaterial, texturesPath); - } - } - } } } } \ No newline at end of file diff --git a/Assets/Scripts/Tools/SDF/Import/Import.Material.cs b/Assets/Scripts/Tools/SDF/Import/Import.Material.cs index 16b495f5..f5da1d2b 100644 --- a/Assets/Scripts/Tools/SDF/Import/Import.Material.cs +++ b/Assets/Scripts/Tools/SDF/Import/Import.Material.cs @@ -52,7 +52,7 @@ protected override void ImportMaterial(in SDF.Material sdfMaterial, in System.Ob { // Name of material from an installed script file. // This will override the color element if the script exists. - Implement.Visual.ApplyMaterial(sdfMaterial.script, material); + Implement.Material.ApplyScript(sdfMaterial.script, material); if (sdfMaterial.script.name.ToLower().Contains("tree")) { From bd0ee6dc7681efc71793d2eb026a92110fe0f201 Mon Sep 17 00:00:00 2001 From: "Hyunseok Yang (YG)" Date: Wed, 8 May 2024 17:02:14 +0900 Subject: [PATCH 08/17] Move applying material in Import.Material into Implement.Material --- .../Tools/SDF/Implement/Implement.Material.cs | 40 +++++++++++++++++++ .../Tools/SDF/Import/Import.Material.cs | 37 +---------------- 2 files changed, 41 insertions(+), 36 deletions(-) diff --git a/Assets/Scripts/Tools/SDF/Implement/Implement.Material.cs b/Assets/Scripts/Tools/SDF/Implement/Implement.Material.cs index e01fb801..869b427e 100644 --- a/Assets/Scripts/Tools/SDF/Implement/Implement.Material.cs +++ b/Assets/Scripts/Tools/SDF/Implement/Implement.Material.cs @@ -16,6 +16,46 @@ namespace Implement { public partial class Material { + public static void Apply(in SDF.Material sdfMaterial, UE.Renderer renderer) + { + foreach (var material in renderer.materials) + { + if (sdfMaterial.ambient != null) + { + UE.Debug.Log(material.name + ": ambient is not support. " + SDF2Unity.Color(sdfMaterial.ambient)); + } + + if (sdfMaterial.diffuse != null) + { + SDF2Unity.Material.SetBaseColor(material, SDF2Unity.Color(sdfMaterial.diffuse)); + } + + if (sdfMaterial.emissive != null) + { + SDF2Unity.Material.SetEmission(material, SDF2Unity.Color(sdfMaterial.emissive)); + } + + if (sdfMaterial.specular != null) + { + SDF2Unity.Material.SetSpecular(material, SDF2Unity.Color(sdfMaterial.specular)); + // UE.Debug.Log("ImportMaterial HasColorSpecular " + material.GetColor("_SpecColor")); + } + + // apply material script + if (sdfMaterial.script != null) + { + // Name of material from an installed script file. + // This will override the color element if the script exists. + ApplyScript(sdfMaterial.script, material); + + if (sdfMaterial.script.name.ToLower().Contains("tree")) + { + SDF2Unity.Material.ConvertToSpeedTree(material); + } + } + } + } + public static void ApplyScript(in SDF.Material.Script script, UE.Material targetMaterial) { var targetMaterialName = script.name; diff --git a/Assets/Scripts/Tools/SDF/Import/Import.Material.cs b/Assets/Scripts/Tools/SDF/Import/Import.Material.cs index f5da1d2b..14a3d03a 100644 --- a/Assets/Scripts/Tools/SDF/Import/Import.Material.cs +++ b/Assets/Scripts/Tools/SDF/Import/Import.Material.cs @@ -24,42 +24,7 @@ protected override void ImportMaterial(in SDF.Material sdfMaterial, in System.Ob var meshRenderers = targetObject.GetComponentsInChildren(true); foreach (var renderer in meshRenderers) { - foreach (var material in renderer.materials) - { - if (sdfMaterial.ambient != null) - { - UE.Debug.Log(material.name + ": ambient is not support. " + SDF2Unity.Color(sdfMaterial.ambient)); - } - - if (sdfMaterial.diffuse != null) - { - SDF2Unity.Material.SetBaseColor(material, SDF2Unity.Color(sdfMaterial.diffuse)); - } - - if (sdfMaterial.emissive != null) - { - SDF2Unity.Material.SetEmission(material, SDF2Unity.Color(sdfMaterial.emissive)); - } - - if (sdfMaterial.specular != null) - { - SDF2Unity.Material.SetSpecular(material, SDF2Unity.Color(sdfMaterial.specular)); - // UE.Debug.Log("ImportMaterial HasColorSpecular " + material.GetColor("_SpecColor")); - } - - // apply material script - if (sdfMaterial.script != null) - { - // Name of material from an installed script file. - // This will override the color element if the script exists. - Implement.Material.ApplyScript(sdfMaterial.script, material); - - if (sdfMaterial.script.name.ToLower().Contains("tree")) - { - SDF2Unity.Material.ConvertToSpeedTree(material); - } - } - } + Implement.Material.Apply(sdfMaterial, renderer); // Turn off high-loading features in renderer as a performance tunig renderer.lightProbeUsage = UnityEngine.Rendering.LightProbeUsage.Off; From 9b2a45859b49040dcb440147afa87ababcc90f4d Mon Sep 17 00:00:00 2001 From: "Hyunseok Yang (YG)" Date: Wed, 8 May 2024 17:30:44 +0900 Subject: [PATCH 09/17] Refactroing Implement.Material.Ogre --- .../SDF/Implement/Implement.Material.Ogre.cs | 126 ++++++++++-------- 1 file changed, 70 insertions(+), 56 deletions(-) diff --git a/Assets/Scripts/Tools/SDF/Implement/Implement.Material.Ogre.cs b/Assets/Scripts/Tools/SDF/Implement/Implement.Material.Ogre.cs index d793dcdf..5e59309f 100644 --- a/Assets/Scripts/Tools/SDF/Implement/Implement.Material.Ogre.cs +++ b/Assets/Scripts/Tools/SDF/Implement/Implement.Material.Ogre.cs @@ -42,23 +42,23 @@ private static string FindFile(in List uris, in string targetFileName) } - private static void ApplyVertexColour(in OgreMaterial.Pass pass, UE.Material material) + private static void ApplyVertexColour(in Dictionary passProperties, UE.Material material) { - if (pass.properties.ContainsKey("diffuse")) + if (passProperties.ContainsKey("diffuse")) { - var diffuse = pass.properties["diffuse"].Trim(); + var diffuse = passProperties["diffuse"].Trim(); SDF2Unity.Material.SetBaseColor(material, SDF2Unity.Color(diffuse)); } - if (pass.properties.ContainsKey("emissive")) + if (passProperties.ContainsKey("emissive")) { - var emissive = pass.properties["emissive"].Trim(); + var emissive = passProperties["emissive"].Trim(); SDF2Unity.Material.SetEmission(material, SDF2Unity.Color(emissive)); } - if (pass.properties.ContainsKey("specular")) + if (passProperties.ContainsKey("specular")) { - var specular = pass.properties["specular"].Trim(); + var specular = passProperties["specular"].Trim(); var tmp = specular.Split(' ', StringSplitOptions.RemoveEmptyEntries); if (tmp.Length == 5) @@ -88,11 +88,68 @@ private static void ApplyVertexColour(in OgreMaterial.Pass pass, UE.Material mat } } - private static void ApplyTextureUnits(in OgreMaterial.Pass pass, UE.Material material, in List uris) + private static void ApplyTexture( + in string path, + in Dictionary props, + UE.Material material) { - foreach (var textureunitEntry in pass.textureUnits) + var texture = MeshLoader.GetTexture(path); + if (texture != null) { - var textureunit = textureunitEntry.Value; + if (props.ContainsKey("filtering")) + { + var textureFiltering = props["filtering"]; + // to make upper in First character + switch (textureFiltering) + { + case "bilinear": + texture.filterMode = UE.FilterMode.Bilinear; + break; + case "trilinear": + case "anisotropic": + texture.filterMode = UE.FilterMode.Trilinear; + break; + case "none": + default: + texture.filterMode = UE.FilterMode.Point; + break; + } + } + + if (props.ContainsKey("max_anisotropy")) + { + var textureAnisotropy = props["max_anisotropy"]; + texture.anisoLevel = Convert.ToInt32(textureAnisotropy); + } + + if (props.ContainsKey("scale")) + { + var scaleSet = props["scale"]; + var tileScale = SDF2Unity.Scale(scaleSet); + + // TODO: Check texture tile scaling + tileScale.x = 1 / tileScale.x; + tileScale.y = 1 / tileScale.y; + + material.SetTextureScale("_BaseMap", tileScale); + } + + material.SetTexture("_BaseMap", texture); + } + else + { + UE.Debug.LogWarning($"Wrong texture path: {path}"); + } + } + + private static void ApplyTextureUnits( + in Dictionary textrueUnits, + UE.Material material, + in List uris) + { + foreach (var textureUnitEntry in textrueUnits) + { + var textureunit = textureUnitEntry.Value; // UE.Debug.Log($" TextureUnit: {textureunitEntry.Key}"); // foreach (var kvp in textureunit.properties) @@ -115,50 +172,7 @@ private static void ApplyTextureUnits(in OgreMaterial.Pass pass, UE.Material mat continue; } - var texture = MeshLoader.GetTexture(textureFilePath); - if (texture != null) - { - if (textureUnitProps.ContainsKey("filtering")) - { - var textureFiltering = textureUnitProps["filtering"]; - // to make upper in First character - switch (textureFiltering) - { - case "bilinear": - texture.filterMode = UE.FilterMode.Bilinear; - break; - case "trilinear": - case "anisotropic": - texture.filterMode = UE.FilterMode.Trilinear; - break; - case "none": - default: - texture.filterMode = UE.FilterMode.Point; - break; - } - } - - if (textureUnitProps.ContainsKey("max_anisotropy")) - { - var textureAnisotropy = textureUnitProps["max_anisotropy"]; - texture.anisoLevel = Convert.ToInt32(textureAnisotropy); - } - - if (textureUnitProps.ContainsKey("scale")) - { - var scaleSet = textureUnitProps["scale"]; - var tileScale = SDF2Unity.Scale(scaleSet); - - // TODO: Check texture tile scaling - tileScale.x = 1 / tileScale.x; - tileScale.y = 1 / tileScale.y; - - material.SetTextureScale("_BaseMap", tileScale); - } - - material.SetTexture("_BaseMap", texture); - } - + ApplyTexture(textureFilePath, textureUnitProps, material); return; } } @@ -184,9 +198,9 @@ public static void ApplyMaterial(in OgreMaterial.Material ogreMaterial, UE.Mater // UE.Debug.Log($" Pass: {kvp.Key}: {kvp.Value}"); // } - ApplyVertexColour(pass, material); + ApplyVertexColour(pass.properties, material); - ApplyTextureUnits(pass, material, uris); + ApplyTextureUnits(pass.textureUnits, material, uris); } } } From f35f8a3bee2337bef7d96588ae8544ce3d5358e4 Mon Sep 17 00:00:00 2001 From: "Hyunseok Yang (YG)" Date: Fri, 10 May 2024 16:43:18 +0900 Subject: [PATCH 10/17] Modify SDF.Implemenet.Material - Support multiple material --- .../SDF/Implement/Implement.Material.Ogre.cs | 58 +++++++++++++++++- .../Tools/SDF/Implement/Implement.Material.cs | 59 +++++++++++++------ .../Tools/SDF/Implement/Implement.Road.cs | 2 +- 3 files changed, 96 insertions(+), 23 deletions(-) diff --git a/Assets/Scripts/Tools/SDF/Implement/Implement.Material.Ogre.cs b/Assets/Scripts/Tools/SDF/Implement/Implement.Material.Ogre.cs index 5e59309f..4cbdd957 100644 --- a/Assets/Scripts/Tools/SDF/Implement/Implement.Material.Ogre.cs +++ b/Assets/Scripts/Tools/SDF/Implement/Implement.Material.Ogre.cs @@ -127,6 +127,8 @@ private static void ApplyTexture( var scaleSet = props["scale"]; var tileScale = SDF2Unity.Scale(scaleSet); + // UE.Debug.Log(tileScale); + // TODO: Check texture tile scaling tileScale.x = 1 / tileScale.x; tileScale.y = 1 / tileScale.y; @@ -177,13 +179,59 @@ private static void ApplyTextureUnits( } } - public static void ApplyMaterial(in OgreMaterial.Material ogreMaterial, UE.Material material, in List uris) + private static UE.Material[] ResizeMaterials(in OgreMaterial.Material ogreMaterial, in UE.Material[] baseMaterials) + { + var requiredMaterialCount = 0; + foreach (var techEntry in ogreMaterial.techniques) + { + var technique = techEntry.Value; + requiredMaterialCount += technique.passes.Count; + } + // UE.Debug.LogWarning($"requiredMaterialCount: {requiredMaterialCount}"); + + // resizing materials + UE.Material[] materials = null; + if (baseMaterials.Length < requiredMaterialCount) + { + var prevMaterials = (UE.Material[])baseMaterials.Clone(); + var lastMaterial = prevMaterials[prevMaterials.Length - 1]; + + materials = new UE.Material[requiredMaterialCount]; + for (var i = 0; i < prevMaterials.Length; i++) + { + materials[i] = prevMaterials[i]; + } + for (var i = prevMaterials.Length - 1; i < requiredMaterialCount; i++) + { + materials[i] = new UE.Material(lastMaterial); + } + + // UE.Debug.Log("Resizing materials " + materials.Length); + } + else + { + materials = baseMaterials; + } + + return materials; + } + + public static UE.Material[] ApplyMaterial( + in OgreMaterial.Material ogreMaterial, + UE.Material[] baseMaterials, + in List texturePathURIs) { + var materials = ResizeMaterials(ogreMaterial, baseMaterials); + if (ogreMaterial.hasReceiveShadows) { - material.SetFloat("_ReceiveShadows", ogreMaterial.receiveShadows ? 1f : 0); + foreach (var material in materials) + { + material.SetFloat("_ReceiveShadows", ogreMaterial.receiveShadows ? 1f : 0); + } } + var materialIndex = 0; foreach (var techEntry in ogreMaterial.techniques) { var technique = techEntry.Value; @@ -198,11 +246,15 @@ public static void ApplyMaterial(in OgreMaterial.Material ogreMaterial, UE.Mater // UE.Debug.Log($" Pass: {kvp.Key}: {kvp.Value}"); // } + var material = materials[materialIndex++]; + ApplyVertexColour(pass.properties, material); - ApplyTextureUnits(pass.textureUnits, material, uris); + ApplyTextureUnits(pass.textureUnits, material, texturePathURIs); } } + + return materials; } } } diff --git a/Assets/Scripts/Tools/SDF/Implement/Implement.Material.cs b/Assets/Scripts/Tools/SDF/Implement/Implement.Material.cs index 869b427e..f6f124b9 100644 --- a/Assets/Scripts/Tools/SDF/Implement/Implement.Material.cs +++ b/Assets/Scripts/Tools/SDF/Implement/Implement.Material.cs @@ -40,15 +40,19 @@ public static void Apply(in SDF.Material sdfMaterial, UE.Renderer renderer) SDF2Unity.Material.SetSpecular(material, SDF2Unity.Color(sdfMaterial.specular)); // UE.Debug.Log("ImportMaterial HasColorSpecular " + material.GetColor("_SpecColor")); } + } - // apply material script - if (sdfMaterial.script != null) - { - // Name of material from an installed script file. - // This will override the color element if the script exists. - ApplyScript(sdfMaterial.script, material); + // apply material script + if (sdfMaterial.script != null) + { + // Name of material from an installed script file. + // This will override the color element if the script exists. + var scriptAppliedMaterials = ApplyScript(sdfMaterial.script, renderer.materials); + renderer.materials = scriptAppliedMaterials; - if (sdfMaterial.script.name.ToLower().Contains("tree")) + if (sdfMaterial.script.name.ToLower().Contains("tree")) + { + foreach (var material in renderer.materials) { SDF2Unity.Material.ConvertToSpeedTree(material); } @@ -56,13 +60,38 @@ public static void Apply(in SDF.Material sdfMaterial, UE.Renderer renderer) } } - public static void ApplyScript(in SDF.Material.Script script, UE.Material targetMaterial) + public static UE.Material ApplyScript(in SDF.Material.Script script, in UE.Material baseMasterial) + { + var materials = ApplyScript(script, new UE.Material[] { baseMasterial }); + return materials[0]; + } + + public static UE.Material[] ApplyScript(in SDF.Material.Script script, in UE.Material[] baseMaterials) { var targetMaterialName = script.name; - var texturesPath = new List(); + var targetMaterialFilepath = FindMaterialFilepathAndUpdateURIs(script.uri, out var texturesPath); + + var outputMaterials = baseMaterials; + + if (string.IsNullOrEmpty(targetMaterialFilepath) == false) + { + var ogreMaterial = OgreMaterial.Parse(targetMaterialFilepath, targetMaterialName); + if (ogreMaterial != null) + { + // UE.Debug.Log($"Found: '{ogreMaterial.name}' material, techniques: {ogreMaterial.techniques.Count}"); + outputMaterials = Ogre.ApplyMaterial(ogreMaterial, baseMaterials, texturesPath); + } + } + + return outputMaterials; + } + + private static string FindMaterialFilepathAndUpdateURIs(in List scriptUris, out List texturesPath) + { + texturesPath = new List(); var targetMaterialFilepath = string.Empty; - foreach (var uri in script.uri) + foreach (var uri in scriptUris) { // Debug.Log(uri); if (uri.EndsWith(".material") && File.Exists(uri)) @@ -88,15 +117,7 @@ public static void ApplyScript(in SDF.Material.Script script, UE.Material target } } - if (string.IsNullOrEmpty(targetMaterialFilepath) == false) - { - var ogreMaterial = OgreMaterial.Parse(targetMaterialFilepath, targetMaterialName); - if (ogreMaterial != null) - { - // UE.Debug.Log($"Found: '{ogreMaterial.name}' material, techniques: {ogreMaterial.techniques.Count}"); - Ogre.ApplyMaterial(ogreMaterial, targetMaterial, texturesPath); - } - } + return targetMaterialFilepath; } } } diff --git a/Assets/Scripts/Tools/SDF/Implement/Implement.Road.cs b/Assets/Scripts/Tools/SDF/Implement/Implement.Road.cs index c5c48b05..81d89ed5 100644 --- a/Assets/Scripts/Tools/SDF/Implement/Implement.Road.cs +++ b/Assets/Scripts/Tools/SDF/Implement/Implement.Road.cs @@ -44,7 +44,7 @@ public static UE.GameObject Generate(in SDF.World.Road road) var material = SDF2Unity.Material.Create(road.Name + "_Material"); - SDF.Implement.Material.ApplyScript(road.material.script, material); + material = Material.ApplyScript(road.material.script, material); var roadGenerator = newRoadObject.AddComponent(); roadGenerator.SdfMaterial = road.material; From 0bff11664c21c0dd22cc9d86ec6a5c7f32a7d2a0 Mon Sep 17 00:00:00 2001 From: "Hyunseok Yang (YG)" Date: Fri, 10 May 2024 17:03:38 +0900 Subject: [PATCH 11/17] Modify SDF.Implement.Material.Ogre - Enable scene_blend->alpha_blend attribute --- .../Tools/SDF/Implement/Implement.Material.Ogre.cs | 9 +++++++++ Assets/Scripts/Tools/SDF/Util/SDF2Unity.Material.cs | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/Tools/SDF/Implement/Implement.Material.Ogre.cs b/Assets/Scripts/Tools/SDF/Implement/Implement.Material.Ogre.cs index 4cbdd957..35b4211d 100644 --- a/Assets/Scripts/Tools/SDF/Implement/Implement.Material.Ogre.cs +++ b/Assets/Scripts/Tools/SDF/Implement/Implement.Material.Ogre.cs @@ -86,6 +86,15 @@ private static void ApplyVertexColour(in Dictionary passProperti SDF2Unity.Material.SetSpecular(material, SDF2Unity.Color(specular)); } + + if (passProperties.ContainsKey("scene_blend")) + { + var sceneBlend = passProperties["scene_blend"].Trim(); + if (sceneBlend == "alpha_blend") + { + SDF2Unity.Material.SetTransparent(material); + } + } } private static void ApplyTexture( diff --git a/Assets/Scripts/Tools/SDF/Util/SDF2Unity.Material.cs b/Assets/Scripts/Tools/SDF/Util/SDF2Unity.Material.cs index aa33682f..3951d75a 100644 --- a/Assets/Scripts/Tools/SDF/Util/SDF2Unity.Material.cs +++ b/Assets/Scripts/Tools/SDF/Util/SDF2Unity.Material.cs @@ -48,7 +48,7 @@ public static UE.Material Create(in string materialName = "") return newMaterial; } - private static void SetTransparent(UE.Material target) + public static void SetTransparent(UE.Material target) { target.SetOverrideTag("RenderType", "Transparent"); target.SetFloat("_Surface", 1); // set to transparent @@ -62,7 +62,7 @@ private static void SetTransparent(UE.Material target) target.renderQueue = (int)RenderQueue.Transparent; } - private static void SetOpaque(UE.Material target) + public static void SetOpaque(UE.Material target) { target.SetOverrideTag("RenderType", "Opaque"); target.SetFloat("_Surface", 0); // set to opaque From faf0b0e69b540b19fe2fdbe24fc66908ebe0cda1 Mon Sep 17 00:00:00 2001 From: "Hyunseok Yang (YG)" Date: Fri, 10 May 2024 17:34:14 +0900 Subject: [PATCH 12/17] Add SDF2Unity function - Point(SDF.Vector2) Apply SDF2Unity.Point in CreatePolylines --- Assets/Scripts/Tools/Mesh/ProceduralMesh.cs | 4 ++-- Assets/Scripts/Tools/SDF/Util/SDF2Unity.cs | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/Tools/Mesh/ProceduralMesh.cs b/Assets/Scripts/Tools/Mesh/ProceduralMesh.cs index 4526c3a4..e4e3ca5d 100644 --- a/Assets/Scripts/Tools/Mesh/ProceduralMesh.cs +++ b/Assets/Scripts/Tools/Mesh/ProceduralMesh.cs @@ -726,7 +726,7 @@ public static Mesh CreatePolylines(in SDF.Polylines polylines) { foreach (var point in polylines[0].point) { - pointsToTriangulate.Add(new Vector2((float)point.Y, (float)point.X)); + pointsToTriangulate.Add(SDF2Unity.Point(point)); } } @@ -740,7 +740,7 @@ public static Mesh CreatePolylines(in SDF.Polylines polylines) var points = new List(); foreach (var point in polylines[i].point) { - points.Add(new Vector2((float)point.Y, (float)point.X)); + points.Add(SDF2Unity.Point(point)); } constrainedEdgePoints.Add(points); } diff --git a/Assets/Scripts/Tools/SDF/Util/SDF2Unity.cs b/Assets/Scripts/Tools/SDF/Util/SDF2Unity.cs index 5e5e2088..769b6cf6 100644 --- a/Assets/Scripts/Tools/SDF/Util/SDF2Unity.cs +++ b/Assets/Scripts/Tools/SDF/Util/SDF2Unity.cs @@ -93,6 +93,11 @@ public static Vector3 Scale(in double x, in double y, in double z) return scaleVector; } + public static Vector2 Point(in SDF.Vector2 value) + { + return new Vector2((float)value.Y, (float)value.X); + } + public static Vector3 Normal(in SDF.Vector3 value) { return Position(value); From 73d54181e487521b75b9a701f588437a4761292d Mon Sep 17 00:00:00 2001 From: "Hyunseok Yang (YG)" Date: Fri, 10 May 2024 18:35:37 +0900 Subject: [PATCH 13/17] add new function in SDF2Unity - Size(SDF.Vector2) --- Assets/Scripts/Tools/SDF/Implement/Implement.Geometry.cs | 3 ++- Assets/Scripts/Tools/SDF/Util/SDF2Unity.cs | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/Tools/SDF/Implement/Implement.Geometry.cs b/Assets/Scripts/Tools/SDF/Implement/Implement.Geometry.cs index b7dfb9ae..5c2d8e31 100644 --- a/Assets/Scripts/Tools/SDF/Implement/Implement.Geometry.cs +++ b/Assets/Scripts/Tools/SDF/Implement/Implement.Geometry.cs @@ -84,7 +84,8 @@ public static void GenerateMeshObject(in SDF.ShapeType shape, in UE.GameObject t { var plane = shape as SDF.Plane; var normal = SDF2Unity.Normal(plane.normal); - mesh = ProceduralMesh.CreatePlane((float)plane.size.X, (float)plane.size.Y, normal); + var size = SDF2Unity.Size(plane.size); + mesh = ProceduralMesh.CreatePlane(size.x, size.y, normal); } else if (shape is SDF.Polylines) { diff --git a/Assets/Scripts/Tools/SDF/Util/SDF2Unity.cs b/Assets/Scripts/Tools/SDF/Util/SDF2Unity.cs index 769b6cf6..f56c7e94 100644 --- a/Assets/Scripts/Tools/SDF/Util/SDF2Unity.cs +++ b/Assets/Scripts/Tools/SDF/Util/SDF2Unity.cs @@ -93,6 +93,11 @@ public static Vector3 Scale(in double x, in double y, in double z) return scaleVector; } + public static Vector2 Size(in SDF.Vector2 value) + { + return new Vector2((float)value.X, (float)value.Y); + } + public static Vector2 Point(in SDF.Vector2 value) { return new Vector2((float)value.Y, (float)value.X); From e185f0d6140146abd12bf6d678bb1b5fa8b8941a Mon Sep 17 00:00:00 2001 From: "Hyunseok Yang (YG)" Date: Sat, 11 May 2024 07:16:52 +0900 Subject: [PATCH 14/17] Upgrade Unity editor version -> 2022.3.28f1 (LTS) --- ProjectSettings/ProjectVersion.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt index 9efb20c7..d971767b 100644 --- a/ProjectSettings/ProjectVersion.txt +++ b/ProjectSettings/ProjectVersion.txt @@ -1,2 +1,2 @@ -m_EditorVersion: 2022.3.27f1 -m_EditorVersionWithRevision: 2022.3.27f1 (73effa14754f) +m_EditorVersion: 2022.3.28f1 +m_EditorVersionWithRevision: 2022.3.28f1 (6bae5ce6b222) From 5db1716b32e933ebe6ee1d1d43f95c2ffbc82f25 Mon Sep 17 00:00:00 2001 From: "Hyunseok Yang (YG)" Date: Sat, 11 May 2024 07:23:11 +0900 Subject: [PATCH 15/17] Fix UV in ProceduralMehs.CreatePlane() function - swap U & V --- Assets/Scripts/Tools/Mesh/ProceduralMesh.cs | 4 +++- Assets/Scripts/Tools/SDF/Implement/Implement.Material.Ogre.cs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/Tools/Mesh/ProceduralMesh.cs b/Assets/Scripts/Tools/Mesh/ProceduralMesh.cs index e4e3ca5d..21755cba 100644 --- a/Assets/Scripts/Tools/Mesh/ProceduralMesh.cs +++ b/Assets/Scripts/Tools/Mesh/ProceduralMesh.cs @@ -528,7 +528,9 @@ public static Mesh CreateSphere(in float radius = 1f, int nbLong = 24, int nbLat { for (var u = 0; u < resX; u++) { - uvs[u + v * resX] = new Vector2((float)u / (resX - 1), (float)v / (resZ - 1)); + var U = (float)u / (resX - 1); + var V = (float)v / (resZ - 1); + uvs[u + v * resX] = new Vector2(V, U); } } #endregion diff --git a/Assets/Scripts/Tools/SDF/Implement/Implement.Material.Ogre.cs b/Assets/Scripts/Tools/SDF/Implement/Implement.Material.Ogre.cs index 35b4211d..2193e522 100644 --- a/Assets/Scripts/Tools/SDF/Implement/Implement.Material.Ogre.cs +++ b/Assets/Scripts/Tools/SDF/Implement/Implement.Material.Ogre.cs @@ -100,7 +100,7 @@ private static void ApplyVertexColour(in Dictionary passProperti private static void ApplyTexture( in string path, in Dictionary props, - UE.Material material) + UE.Material material) { var texture = MeshLoader.GetTexture(path); if (texture != null) From 6ee22a2bcc6b3b2973d99263a9da56254b8eb763 Mon Sep 17 00:00:00 2001 From: "Hyunseok Yang (YG)" Date: Sat, 11 May 2024 09:39:48 +0900 Subject: [PATCH 16/17] Replace tab to space when parsing pose/vector/Quaternion/color in SDF format --- Assets/Scripts/Tools/SDF/Implement/Implement.Material.Ogre.cs | 2 +- Assets/Scripts/Tools/SDF/Parser/Color.cs | 2 +- Assets/Scripts/Tools/SDF/Parser/Entity.cs | 2 +- Assets/Scripts/Tools/SDF/Parser/Pose.cs | 2 +- Assets/Scripts/Tools/SDF/Parser/Quaternion.cs | 2 +- Assets/Scripts/Tools/SDF/Parser/SensorTypes.cs | 2 +- Assets/Scripts/Tools/SDF/Parser/Vector.cs | 4 ++-- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Assets/Scripts/Tools/SDF/Implement/Implement.Material.Ogre.cs b/Assets/Scripts/Tools/SDF/Implement/Implement.Material.Ogre.cs index 2193e522..ca35abf8 100644 --- a/Assets/Scripts/Tools/SDF/Implement/Implement.Material.Ogre.cs +++ b/Assets/Scripts/Tools/SDF/Implement/Implement.Material.Ogre.cs @@ -60,7 +60,7 @@ private static void ApplyVertexColour(in Dictionary passProperti { var specular = passProperties["specular"].Trim(); - var tmp = specular.Split(' ', StringSplitOptions.RemoveEmptyEntries); + var tmp = specular.Replace('\t', ' ').Split(' ', StringSplitOptions.RemoveEmptyEntries); if (tmp.Length == 5) { var shininess = Convert.ToSingle(tmp[4]); diff --git a/Assets/Scripts/Tools/SDF/Parser/Color.cs b/Assets/Scripts/Tools/SDF/Parser/Color.cs index bc8d7411..28559be7 100644 --- a/Assets/Scripts/Tools/SDF/Parser/Color.cs +++ b/Assets/Scripts/Tools/SDF/Parser/Color.cs @@ -22,7 +22,7 @@ public void FromString(string value) value = value.Trim(); - var tmp = value.Split(' ', StringSplitOptions.RemoveEmptyEntries); + var tmp = value.Replace('\t', ' ').Split(' ', StringSplitOptions.RemoveEmptyEntries); if (tmp.Length < 3) return; diff --git a/Assets/Scripts/Tools/SDF/Parser/Entity.cs b/Assets/Scripts/Tools/SDF/Parser/Entity.cs index 4ac25f15..0cbfe7c1 100644 --- a/Assets/Scripts/Tools/SDF/Parser/Entity.cs +++ b/Assets/Scripts/Tools/SDF/Parser/Entity.cs @@ -229,7 +229,7 @@ private void ParsePose() // x y z roll pitch yaw value = value.Trim().Replace(" ", " ").Replace(" ", " ").Replace(" ", " "); - var poseStr = value.Split(' ', StringSplitOptions.RemoveEmptyEntries); + var poseStr = value.Replace('\t', ' ').Split(' ', StringSplitOptions.RemoveEmptyEntries); try { diff --git a/Assets/Scripts/Tools/SDF/Parser/Pose.cs b/Assets/Scripts/Tools/SDF/Parser/Pose.cs index 7f159cd5..5b52c406 100644 --- a/Assets/Scripts/Tools/SDF/Parser/Pose.cs +++ b/Assets/Scripts/Tools/SDF/Parser/Pose.cs @@ -76,7 +76,7 @@ public void FromString(in string value) return; } - var tmp = value.Trim().Split(' ', System.StringSplitOptions.RemoveEmptyEntries); + var tmp = value.Trim().Replace('\t', ' ').Split(' ', System.StringSplitOptions.RemoveEmptyEntries); if (tmp.Length == 6) { _pos.Set(tmp[0], tmp[1], tmp[2]); diff --git a/Assets/Scripts/Tools/SDF/Parser/Quaternion.cs b/Assets/Scripts/Tools/SDF/Parser/Quaternion.cs index 62582012..d259cab2 100644 --- a/Assets/Scripts/Tools/SDF/Parser/Quaternion.cs +++ b/Assets/Scripts/Tools/SDF/Parser/Quaternion.cs @@ -257,7 +257,7 @@ public void FromString(in string value) return; } - var tmp = value.Trim().Split(' ', StringSplitOptions.RemoveEmptyEntries); + var tmp = value.Trim().Replace('\t', ' ').Split(' ', StringSplitOptions.RemoveEmptyEntries); if (tmp.Length == 3) { diff --git a/Assets/Scripts/Tools/SDF/Parser/SensorTypes.cs b/Assets/Scripts/Tools/SDF/Parser/SensorTypes.cs index 3b0cf9d4..0938158c 100644 --- a/Assets/Scripts/Tools/SDF/Parser/SensorTypes.cs +++ b/Assets/Scripts/Tools/SDF/Parser/SensorTypes.cs @@ -87,7 +87,7 @@ public void ParsePose(in string poseString, in string relativeTo = "") if (!string.IsNullOrEmpty(poseString)) { // x y z roll pitch yaw - var poseInfo = poseString.Split(' ', System.StringSplitOptions.RemoveEmptyEntries); + var poseInfo = poseString.Replace('\t', ' ').Split(' ', System.StringSplitOptions.RemoveEmptyEntries); pose.Pos.Set(poseInfo[0], poseInfo[1], poseInfo[2]); pose.Rot.Set(poseInfo[3], poseInfo[4], poseInfo[5]); diff --git a/Assets/Scripts/Tools/SDF/Parser/Vector.cs b/Assets/Scripts/Tools/SDF/Parser/Vector.cs index 866b9793..9296c955 100644 --- a/Assets/Scripts/Tools/SDF/Parser/Vector.cs +++ b/Assets/Scripts/Tools/SDF/Parser/Vector.cs @@ -92,7 +92,7 @@ public void FromString(in string value) return; } - var tmp = value.Trim().Split(' ', StringSplitOptions.RemoveEmptyEntries); + var tmp = value.Trim().Replace('\t', ' ').Split(' ', StringSplitOptions.RemoveEmptyEntries); if (tmp.Length == 2) { Set(tmp[0], tmp[1]); @@ -173,7 +173,7 @@ public void Set(in string x, in string y, in string z) return; } - var tmp = value.Trim().Split(' ', StringSplitOptions.RemoveEmptyEntries); + var tmp = value.Trim().Replace('\t', ' ').Split(' ', StringSplitOptions.RemoveEmptyEntries); if (tmp.Length == 3) { Set(tmp[0], tmp[1], tmp[2]); From b439b963734c0d0d18fffda1f86f3273863cf935 Mon Sep 17 00:00:00 2001 From: "Hyunseok Yang (YG)" Date: Sat, 11 May 2024 10:31:02 +0900 Subject: [PATCH 17/17] Update app version info in Project settings : 4.5.2 -> 4.5.3 --- ProjectSettings/ProjectSettings.asset | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 866bb0b0..35edbf39 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -139,7 +139,7 @@ PlayerSettings: loadStoreDebugModeEnabled: 0 visionOSBundleVersion: 1.0 tvOSBundleVersion: 1.0 - bundleVersion: 4.5.2 + bundleVersion: 4.5.3 preloadedAssets: [] metroInputSource: 0 wsaTransparentSwapchain: 0