From 6b159f8ffe749195a6fd7896c4502afac3b73e73 Mon Sep 17 00:00:00 2001 From: David Lively Date: Tue, 23 Sep 2025 13:47:38 -0500 Subject: [PATCH 1/7] First commit --- .../Runtime/src/TilesetMaterialProperties.cpp | 4 + .../Runtime/src/TilesetMaterialProperties.h | 7 ++ .../src/UnityPrepareRendererResources.cpp | 74 +++++++++---------- 3 files changed, 48 insertions(+), 37 deletions(-) diff --git a/native~/Runtime/src/TilesetMaterialProperties.cpp b/native~/Runtime/src/TilesetMaterialProperties.cpp index 0eb7deaf..f9136163 100644 --- a/native~/Runtime/src/TilesetMaterialProperties.cpp +++ b/native~/Runtime/src/TilesetMaterialProperties.cpp @@ -82,6 +82,8 @@ const std::string "_overlayTextureCoordinateIndex_"; const std::string TilesetMaterialProperties::_overlayTranslationAndScalePrefix = "_overlayTranslationAndScale_"; +const std::string TilesetMaterialProperties::_computeFlatNormalsName = + "_computeFlatNormals"; #pragma endregion @@ -132,6 +134,8 @@ TilesetMaterialProperties::TilesetMaterialProperties() Shader::PropertyToID(System::String(_normalMapTextureRotationName))), _occlusionTextureRotationID( Shader::PropertyToID(System::String(_occlusionTextureRotationName))), + _computeFlatNormalsID( + Shader::PropertyToID(System::String(_computeFlatNormalsName))), _overlayTextureCoordinateIndexIDs(), _overlayTextureIDs(), _overlayTranslationAndScaleIDs() {} diff --git a/native~/Runtime/src/TilesetMaterialProperties.h b/native~/Runtime/src/TilesetMaterialProperties.h index f8533465..632f69f6 100644 --- a/native~/Runtime/src/TilesetMaterialProperties.h +++ b/native~/Runtime/src/TilesetMaterialProperties.h @@ -85,6 +85,9 @@ class TilesetMaterialProperties { const int32_t getOcclusionTextureRotationID() const noexcept { return this->_occlusionTextureRotationID; } + const int32_t getComputeFlatNormalsID() const noexcept { + return this->_computeFlatNormalsID; + } const std::optional getOverlayTextureCoordinateIndexID(const std::string& key) const noexcept; @@ -128,6 +131,8 @@ class TilesetMaterialProperties { int32_t _normalMapTextureRotationID; int32_t _occlusionTextureRotationID; + int32_t _computeFlatNormalsID; + std::unordered_map _overlayTextureCoordinateIndexIDs; std::unordered_map _overlayTextureIDs; std::unordered_map _overlayTranslationAndScaleIDs; @@ -166,6 +171,8 @@ class TilesetMaterialProperties { static const std::string _overlayTexturePrefix; static const std::string _overlayTextureCoordinateIndexPrefix; static const std::string _overlayTranslationAndScalePrefix; + + static const std::string _computeFlatNormalsName; }; } // namespace CesiumForUnityNative diff --git a/native~/Runtime/src/UnityPrepareRendererResources.cpp b/native~/Runtime/src/UnityPrepareRendererResources.cpp index 453b08d6..30ba3c32 100644 --- a/native~/Runtime/src/UnityPrepareRendererResources.cpp +++ b/native~/Runtime/src/UnityPrepareRendererResources.cpp @@ -101,34 +101,34 @@ std::vector generateIndices(const int32_t count) { return syntheticIndexBuffer; } -template -void computeFlatNormals( - uint8_t* pWritePos, - size_t stride, - TIndex* indices, - int32_t indexCount, - const AccessorView& positionView) { - - for (int i = 0; i < indexCount; i += 3) { - - TIndex i0 = indices[i]; - TIndex i1 = indices[i + 1]; - TIndex i2 = indices[i + 2]; - - const glm::vec3& v0 = - *reinterpret_cast(&positionView[i0]); - const glm::vec3& v1 = - *reinterpret_cast(&positionView[i1]); - const glm::vec3& v2 = - *reinterpret_cast(&positionView[i2]); - - glm::vec3 normal = glm::normalize(glm::cross(v1 - v0, v2 - v0)); - for (int j = 0; j < 3; j++) { - *reinterpret_cast(pWritePos) = normal; - pWritePos += stride; - } - } -} +// template +// void computeFlatNormals( +// uint8_t* pWritePos, +// size_t stride, +// TIndex* indices, +// int32_t indexCount, +// const AccessorView& positionView) { +// +// for (int i = 0; i < indexCount; i += 3) { +// +// TIndex i0 = indices[i]; +// TIndex i1 = indices[i + 1]; +// TIndex i2 = indices[i + 2]; +// +// const glm::vec3& v0 = +// *reinterpret_cast(&positionView[i0]); +// const glm::vec3& v1 = +// *reinterpret_cast(&positionView[i1]); +// const glm::vec3& v2 = +// *reinterpret_cast(&positionView[i2]); +// +// glm::vec3 normal = glm::normalize(glm::cross(v1 - v0, v2 - v0)); +// for (int j = 0; j < 3; j++) { +// *reinterpret_cast(pWritePos) = normal; +// pWritePos += stride; +// } +// } +// } namespace { @@ -757,14 +757,14 @@ void loadPrimitive( } if (duplicateVertices) { - if (computeFlatNormals) { - ::computeFlatNormals( - pWritePos + normalByteOffset, - stride, - indices, - indexCount, - positionView); - } + // if (computeFlatNormals) { + // ::computeFlatNormals( + // pWritePos + normalByteOffset, + // stride, + // indices, + // indexCount, + // positionView); + // } for (int64_t i = 0; i < vertexCount; ++i) { TIndex vertexIndex = indices[i]; *reinterpret_cast(pWritePos) = positionView[vertexIndex]; @@ -849,7 +849,7 @@ void loadPrimitive( pBufferStart + colorByteOffset, stride, static_cast(vertexCount), - computeFlatNormals, + duplicateVertices, indices}); } From 3b83b52909e48b8eecf8af103d87ef17676af7ba Mon Sep 17 00:00:00 2001 From: David Lively Date: Thu, 25 Sep 2025 11:37:56 -0500 Subject: [PATCH 2/7] Added a few things to gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index af8e1747..3d928c3d 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,6 @@ libCesiumForUnityNative-*.so.meta libCesiumForUnityNative-*.dylib libCesiumForUnityNative-*.dylib.meta Documentation~/Reference/ +bin.meta +obj.meta + From 0fbb57b0c8d9655e54d7f6fe65265c51bd8b81a1 Mon Sep 17 00:00:00 2001 From: David Lively Date: Thu, 25 Sep 2025 14:05:08 -0500 Subject: [PATCH 3/7] Added caching for temporary normals when generating tangents. --- .../CesiumDefaultTilesetShader.shadergraph | 1668 +++++++++++++++-- .../src/UnityPrepareRendererResources.cpp | 88 +- .../src/UnityPrepareRendererResources.h | 34 +- 3 files changed, 1557 insertions(+), 233 deletions(-) diff --git a/Runtime/Resources/CesiumDefaultTilesetShader.shadergraph b/Runtime/Resources/CesiumDefaultTilesetShader.shadergraph index 2dc62129..f74c4564 100644 --- a/Runtime/Resources/CesiumDefaultTilesetShader.shadergraph +++ b/Runtime/Resources/CesiumDefaultTilesetShader.shadergraph @@ -113,6 +113,9 @@ }, { "m_Id": "c369ad6ca064434fbb046fb6d2bca6a4" + }, + { + "m_Id": "6cb1312b5f6141b9ba8b8f67370dbf8f" } ], "m_Keywords": [], @@ -452,6 +455,39 @@ }, { "m_Id": "5fef7f4d4afb4fa9a428dfc4eb653dc5" + }, + { + "m_Id": "c86d6ff811944260a0a178bd87667660" + }, + { + "m_Id": "a45a227e5fc24030b7373e4822cb23a5" + }, + { + "m_Id": "16187569ba8647619aeff7c78cd44bf0" + }, + { + "m_Id": "26b50b73d7584d738ec741528e3919d2" + }, + { + "m_Id": "a4e96b8e69b44e7f9214b41558530c06" + }, + { + "m_Id": "cd790485106e402fa8d831c299674502" + }, + { + "m_Id": "1e024566d590460c9716e8bcdcba2ece" + }, + { + "m_Id": "54089ffc784c48d8aa0a8a5eca7a846a" + }, + { + "m_Id": "873faf653391473781711c89bc29e2f5" + }, + { + "m_Id": "868a96f538664302a00f6880cbb29ca8" + }, + { + "m_Id": "17ca69882cb74acebe447d1023d2c4f8" } ], "m_GroupDatas": [ @@ -475,6 +511,9 @@ }, { "m_Id": "17fca4c4bf154cdfb4da09cd13cad27c" + }, + { + "m_Id": "f7e5f5a0f03449efa9830a4491cf162f" } ], "m_StickyNoteDatas": [ @@ -694,6 +733,20 @@ "m_SlotId": 1 } }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "17ca69882cb74acebe447d1023d2c4f8" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "868a96f538664302a00f6880cbb29ca8" + }, + "m_SlotId": 2 + } + }, { "m_OutputSlot": { "m_Node": { @@ -722,6 +775,20 @@ "m_SlotId": 1843696189 } }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "1e024566d590460c9716e8bcdcba2ece" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "54089ffc784c48d8aa0a8a5eca7a846a" + }, + "m_SlotId": 1 + } + }, { "m_OutputSlot": { "m_Node": { @@ -820,6 +887,34 @@ "m_SlotId": -1177420189 } }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "26b50b73d7584d738ec741528e3919d2" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "17ca69882cb74acebe447d1023d2c4f8" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "26b50b73d7584d738ec741528e3919d2" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "e5ca7bb83a9d4a5b99c6b17e8aa77844" + }, + "m_SlotId": 0 + } + }, { "m_OutputSlot": { "m_Node": { @@ -1030,6 +1125,20 @@ "m_SlotId": 2 } }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "54089ffc784c48d8aa0a8a5eca7a846a" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "873faf653391473781711c89bc29e2f5" + }, + "m_SlotId": 0 + } + }, { "m_OutputSlot": { "m_Node": { @@ -1137,7 +1246,7 @@ }, "m_InputSlot": { "m_Node": { - "m_Id": "e5ca7bb83a9d4a5b99c6b17e8aa77844" + "m_Id": "26b50b73d7584d738ec741528e3919d2" }, "m_SlotId": 0 } @@ -1310,6 +1419,20 @@ "m_SlotId": 2 } }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "868a96f538664302a00f6880cbb29ca8" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "16187569ba8647619aeff7c78cd44bf0" + }, + "m_SlotId": 0 + } + }, { "m_OutputSlot": { "m_Node": { @@ -1324,6 +1447,20 @@ "m_SlotId": 2 } }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "873faf653391473781711c89bc29e2f5" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "868a96f538664302a00f6880cbb29ca8" + }, + "m_SlotId": 1 + } + }, { "m_OutputSlot": { "m_Node": { @@ -1562,6 +1699,48 @@ "m_SlotId": -1906785015 } }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "a45a227e5fc24030b7373e4822cb23a5" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "868a96f538664302a00f6880cbb29ca8" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "a4e96b8e69b44e7f9214b41558530c06" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "1e024566d590460c9716e8bcdcba2ece" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "a4e96b8e69b44e7f9214b41558530c06" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "cd790485106e402fa8d831c299674502" + }, + "m_SlotId": 0 + } + }, { "m_OutputSlot": { "m_Node": { @@ -1585,7 +1764,7 @@ }, "m_InputSlot": { "m_Node": { - "m_Id": "3a08d0a60405435fa92432d670b09f6d" + "m_Id": "c86d6ff811944260a0a178bd87667660" }, "m_SlotId": 0 } @@ -1856,6 +2035,20 @@ "m_SlotId": 0 } }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "c86d6ff811944260a0a178bd87667660" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "3a08d0a60405435fa92432d670b09f6d" + }, + "m_SlotId": 0 + } + }, { "m_OutputSlot": { "m_Node": { @@ -1870,6 +2063,20 @@ "m_SlotId": -590019148 } }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "cd790485106e402fa8d831c299674502" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "54089ffc784c48d8aa0a8a5eca7a846a" + }, + "m_SlotId": 0 + } + }, { "m_OutputSlot": { "m_Node": { @@ -2163,6 +2370,9 @@ { "m_Id": "3a08d0a60405435fa92432d670b09f6d" }, + { + "m_Id": "16187569ba8647619aeff7c78cd44bf0" + }, { "m_Id": "2eacb23513544fc097cb3007f3134d97" }, @@ -2205,6 +2415,7 @@ "m_OutputNode": { "m_Id": "" }, + "m_SubDatas": [], "m_ActiveTargets": [ { "m_Id": "b775f4bce7404108b3fedfee711c3cef" @@ -2261,6 +2472,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -2307,6 +2519,7 @@ ], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -2338,6 +2551,29 @@ "m_Labels": [] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "0345a43c2c8f4eac90eb7f4108bff2d2", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [] +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", @@ -2436,6 +2672,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -2564,6 +2801,7 @@ ], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -2770,6 +3008,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -2865,6 +3104,7 @@ ], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -2886,6 +3126,30 @@ "m_Labels": [] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "0dd2d0b033d04d11a56641e96fc3eb61", + "m_Id": 1, + "m_DisplayName": "", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", @@ -2964,10 +3228,10 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": 1017.9999389648438, - "y": 551.5999755859375, - "width": 291.60015869140627, - "height": 168.4000244140625 + "x": 678.0000610351563, + "y": 586.0, + "width": 291.0, + "height": 167.0 } }, "m_Slots": [ @@ -2990,6 +3254,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -3087,6 +3352,7 @@ ], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -3160,13 +3426,15 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] }, "m_TextureType": 0, "m_NormalMapSpace": 0, - "m_EnableGlobalMipBias": true + "m_EnableGlobalMipBias": true, + "m_MipSamplingMode": 0 } { @@ -3219,6 +3487,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -3255,10 +3524,10 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": 766.0, - "y": 115.2000503540039, - "width": 233.19989013671876, - "height": 35.19995880126953 + "x": 463.00006103515627, + "y": 145.9999542236328, + "width": 232.99993896484376, + "height": 33.99998474121094 } }, "m_Slots": [ @@ -3269,6 +3538,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -3319,6 +3589,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -3355,6 +3626,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -3369,45 +3641,103 @@ { "m_SGVersion": 0, - "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", - "m_ObjectId": "16ed5c2aefda4053b8943d68ad332161", + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "1617b92e449d4875832609f993ad55bd", "m_Id": 0, - "m_DisplayName": "Alpha", - "m_SlotType": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, "m_Hidden": false, - "m_ShaderOutputName": "Alpha", - "m_StageCapability": 2, - "m_Value": 1.0, - "m_DefaultValue": 1.0, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, "m_Labels": [] } { "m_SGVersion": 0, - "m_Type": "UnityEditor.ShaderGraph.PropertyNode", - "m_ObjectId": "171f138992d14201a550dd21c8f8db95", + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "16187569ba8647619aeff7c78cd44bf0", "m_Group": { - "m_Id": "69cd55544d0c4d0398f9591b9fbe134d" + "m_Id": "" }, - "m_Name": "Property", + "m_Name": "SurfaceDescription.NormalWS", "m_DrawState": { "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": -1027.2000732421875, - "y": 1750.800048828125, - "width": 222.79998779296876, - "height": 35.2000732421875 + "x": 2805.0, + "y": 813.9999389648438, + "width": 200.0, + "height": 41.00006103515625 } }, "m_Slots": [ { - "m_Id": "8c3a5695e25b45bc8f396fab870ea916" + "m_Id": "d33958b64eee481cba013a159a037553" } ], "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.NormalWS" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "16ed5c2aefda4053b8943d68ad332161", + "m_Id": 0, + "m_DisplayName": "Alpha", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Alpha", + "m_StageCapability": 2, + "m_Value": 1.0, + "m_DefaultValue": 1.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "171f138992d14201a550dd21c8f8db95", + "m_Group": { + "m_Id": "69cd55544d0c4d0398f9591b9fbe134d" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1027.2000732421875, + "y": 1750.800048828125, + "width": 222.79998779296876, + "height": 35.2000732421875 + } + }, + "m_Slots": [ + { + "m_Id": "8c3a5695e25b45bc8f396fab870ea916" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -3457,6 +3787,55 @@ "m_Labels": [] } +{ + "m_SGVersion": 2, + "m_Type": "UnityEditor.ShaderGraph.TransformNode", + "m_ObjectId": "17ca69882cb74acebe447d1023d2c4f8", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Transform", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 2191.0, + "y": 353.0000305175781, + "width": 211.0, + "height": 157.0 + } + }, + "m_Slots": [ + { + "m_Id": "7223713d8434430b88305717a077e3d4" + }, + { + "m_Id": "7adee16ed2d44efba1c5e2f5ad976014" + } + ], + "synonyms": [ + "world", + "tangent", + "object", + "view", + "screen", + "convert" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Conversion": { + "from": 3, + "to": 2 + }, + "m_ConversionType": 2, + "m_Normalize": true +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", @@ -3487,8 +3866,8 @@ "m_ObjectId": "17fca4c4bf154cdfb4da09cd13cad27c", "m_Title": "Clipping", "m_Position": { - "x": 515.9998779296875, - "y": 493.2000732421875 + "x": 176.0, + "y": 527.0 } } @@ -3531,6 +3910,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -3687,6 +4067,7 @@ ], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -3726,10 +4107,10 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": 768.39990234375, - "y": -74.79998779296875, - "width": 235.2000732421875, - "height": 35.19995880126953 + "x": 465.00006103515627, + "y": -44.00001907348633, + "width": 234.99993896484376, + "height": 33.99998474121094 } }, "m_Slots": [ @@ -3740,6 +4121,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -3749,6 +4131,44 @@ } } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DDXNode", + "m_ObjectId": "1e024566d590460c9716e8bcdcba2ece", + "m_Group": { + "m_Id": "f7e5f5a0f03449efa9830a4491cf162f" + }, + "m_Name": "DDX", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 1732.9998779296875, + "y": -15.000000953674317, + "width": 132.0001220703125, + "height": 93.99998474121094 + } + }, + "m_Slots": [ + { + "m_Id": "3832ae7f3bbe4a4f80e65deaacab2104" + }, + { + "m_Id": "d9a4f4f3136d44dabc16a4720d580cc3" + } + ], + "synonyms": [ + "derivative" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", @@ -3843,7 +4263,7 @@ "m_Type": "UnityEditor.Rendering.BuiltIn.ShaderGraph.BuiltInLitSubTarget", "m_ObjectId": "20740110e1fb46628c47c4b4d310a9d0", "m_WorkflowMode": 1, - "m_NormalDropOffSpace": 0 + "m_NormalDropOffSpace": 2 } { @@ -3872,6 +4292,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -3928,13 +4349,15 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] }, "m_TextureType": 0, "m_NormalMapSpace": 0, - "m_EnableGlobalMipBias": true + "m_EnableGlobalMipBias": true, + "m_MipSamplingMode": 0 } { @@ -3952,6 +4375,30 @@ "m_Labels": [] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "22d571d16d7048cf982e26d2190ab6fd", + "m_Id": 1, + "m_DisplayName": "True", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "True", + "m_StageCapability": 3, + "m_Value": { + "x": 1.0, + "y": 1.0, + "z": 1.0, + "w": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.SplitNode", @@ -3992,6 +4439,7 @@ ], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -4077,10 +4525,10 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": 753.6000366210938, - "y": -176.0, - "width": 252.39984130859376, - "height": 35.20001220703125 + "x": 450.9999694824219, + "y": -145.0000457763672, + "width": 252.00009155273438, + "height": 33.999977111816409 } }, "m_Slots": [ @@ -4091,6 +4539,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -4100,6 +4549,42 @@ } } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.RedirectNodeData", + "m_ObjectId": "26b50b73d7584d738ec741528e3919d2", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Redirect Node", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 2087.0, + "y": 1002.0, + "width": 56.0, + "height": 24.0 + } + }, + "m_Slots": [ + { + "m_Id": "7f67489942b0433baa7d1789d4aa3914" + }, + { + "m_Id": "0dd2d0b033d04d11a56641e96fc3eb61" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + { "m_SGVersion": 1, "m_Type": "UnityEditor.ShaderGraph.Internal.Vector4ShaderProperty", @@ -4115,6 +4600,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -4157,6 +4643,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -4169,6 +4656,20 @@ } } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BooleanMaterialSlot", + "m_ObjectId": "2935a7606408494db10a33c7ad8b11ef", + "m_Id": 0, + "m_DisplayName": "Predicate", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Predicate", + "m_StageCapability": 3, + "m_Value": false, + "m_DefaultValue": false +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", @@ -4199,6 +4700,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -4243,6 +4745,29 @@ ] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "2c5e6032210744f3a9846a47e3f8b7da", + "m_Id": 2, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [] +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.StickyNoteData", @@ -4290,7 +4815,7 @@ "m_StageCapability": 3, "m_BareResource": false, "m_Texture": { - "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", + "m_SerializedTexture": "", "m_Guid": "" }, "m_DefaultType": 0 @@ -4361,6 +4886,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -4405,6 +4931,7 @@ ], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -4475,10 +5002,10 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": 541.199951171875, - "y": 776.7999877929688, - "width": 120.0, - "height": 150.0001220703125 + "x": 201.0000762939453, + "y": 810.9998779296875, + "width": 120.00001525878906, + "height": 149.0 } }, "m_Slots": [ @@ -4503,6 +5030,7 @@ ], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -4597,6 +5125,7 @@ ], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -4633,6 +5162,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -4685,6 +5215,7 @@ ], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -4791,6 +5322,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -4813,12 +5345,13 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, "m_Hidden": false, "m_Value": { - "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", + "m_SerializedTexture": "", "m_Guid": "" }, "isMainTexture": false, @@ -4827,6 +5360,30 @@ "m_DefaultType": 1 } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "3832ae7f3bbe4a4f80e65deaacab2104", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", @@ -4889,13 +5446,15 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] }, "m_TextureType": 0, "m_NormalMapSpace": 0, - "m_EnableGlobalMipBias": true + "m_EnableGlobalMipBias": true, + "m_MipSamplingMode": 0 } { @@ -4910,10 +5469,10 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": 748.800048828125, - "y": 15.19998550415039, - "width": 250.79998779296876, - "height": 35.2000617980957 + "x": 445.9999084472656, + "y": 45.99993133544922, + "width": 250.00009155273438, + "height": 33.99998474121094 } }, "m_Slots": [ @@ -4924,6 +5483,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -4980,6 +5540,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -5068,10 +5629,10 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": 753.9999389648438, - "y": 229.99996948242188, - "width": 252.4000244140625, - "height": 35.2000732421875 + "x": 450.9999694824219, + "y": 260.9999084472656, + "width": 252.00009155273438, + "height": 34.000091552734378 } }, "m_Slots": [ @@ -5082,6 +5643,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -5226,6 +5788,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -5248,6 +5811,30 @@ "m_Labels": [] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "3f6433de9dc74c0fb4778dd84f00be9c", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", @@ -5295,6 +5882,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -5316,10 +5904,10 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": 1533.2000732421875, - "y": 551.5999755859375, - "width": 208.800048828125, - "height": 279.20001220703127 + "x": 1192.9998779296875, + "y": 586.0, + "width": 208.0001220703125, + "height": 277.9998779296875 } }, "m_Slots": [ @@ -5337,6 +5925,7 @@ ], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -5419,6 +6008,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -5441,6 +6031,30 @@ "m_Labels": [] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "4414fcd211ab4608919304f20b76243c", + "m_Id": 2, + "m_DisplayName": "False", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "False", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", @@ -5468,7 +6082,7 @@ "m_StageCapability": 2, "m_BareResource": false, "m_Texture": { - "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", + "m_SerializedTexture": "", "m_Guid": "" }, "m_DefaultType": 0 @@ -5607,6 +6221,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -5628,12 +6243,13 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, "m_Hidden": false, "m_Value": { - "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", + "m_SerializedTexture": "", "m_Guid": "" }, "isMainTexture": false, @@ -5753,13 +6369,15 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] }, "m_TextureType": 0, "m_NormalMapSpace": 0, - "m_EnableGlobalMipBias": true + "m_EnableGlobalMipBias": true, + "m_MipSamplingMode": 0 } { @@ -5851,12 +6469,13 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, "m_Hidden": false, "m_Value": { - "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", + "m_SerializedTexture": "", "m_Guid": "" }, "isMainTexture": false, @@ -5902,6 +6521,7 @@ ], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -5949,6 +6569,7 @@ ], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -6056,6 +6677,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -6094,37 +6716,79 @@ "m_Id": "3fdf27bb0900409384b2cc2ef6742f83" }, { - "m_Id": "9125307428094928b81be972995472d4" + "m_Id": "9125307428094928b81be972995472d4" + }, + { + "m_Id": "3afadf4d35b047c1bbce3b534fcdc90c" + }, + { + "m_Id": "cde4014783234d6ea0e8d977430344b0" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedSubGraph": "{\n \"subGraph\": {\n \"fileID\": -5475051401550479605,\n \"guid\": \"e2571e5c45e5e114394039d5a21142b4\",\n \"type\": 3\n }\n}", + "m_PropertyGuids": [ + "46edf5f2-65e9-41ef-b450-1fefbac39c42", + "b5d09db8-58ca-4050-a66b-c79edd6b1fe5", + "c49efae1-02c1-4f2e-be33-24b1e29d21d7", + "f978864a-d6d1-4932-9fb0-c4db87afc2fa" + ], + "m_PropertyIds": [ + -1434385643, + -1906785015, + -306882948, + -1857269885 + ], + "m_Dropdowns": [], + "m_DropdownSelectedEntries": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CrossProductNode", + "m_ObjectId": "54089ffc784c48d8aa0a8a5eca7a846a", + "m_Group": { + "m_Id": "f7e5f5a0f03449efa9830a4491cf162f" + }, + "m_Name": "Cross Product", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 1903.0, + "y": -90.00000762939453, + "width": 129.9998779296875, + "height": 118.0 + } + }, + "m_Slots": [ + { + "m_Id": "0345a43c2c8f4eac90eb7f4108bff2d2" }, { - "m_Id": "3afadf4d35b047c1bbce3b534fcdc90c" + "m_Id": "96e8262fab4d4bf7b5e27c3cf60edfe2" }, { - "m_Id": "cde4014783234d6ea0e8d977430344b0" + "m_Id": "2c5e6032210744f3a9846a47e3f8b7da" } ], - "synonyms": [], + "synonyms": [ + "perpendicular" + ], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] - }, - "m_SerializedSubGraph": "{\n \"subGraph\": {\n \"fileID\": -5475051401550479605,\n \"guid\": \"e2571e5c45e5e114394039d5a21142b4\",\n \"type\": 3\n }\n}", - "m_PropertyGuids": [ - "46edf5f2-65e9-41ef-b450-1fefbac39c42", - "b5d09db8-58ca-4050-a66b-c79edd6b1fe5", - "c49efae1-02c1-4f2e-be33-24b1e29d21d7", - "f978864a-d6d1-4932-9fb0-c4db87afc2fa" - ], - "m_PropertyIds": [ - -1434385643, - -1906785015, - -306882948, - -1857269885 - ], - "m_Dropdowns": [], - "m_DropdownSelectedEntries": [] + } } { @@ -6153,6 +6817,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -6246,9 +6911,9 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": 1685.9998779296875, - "y": 902.7999267578125, - "width": 56.0001220703125, + "x": 1346.0, + "y": 936.9999389648438, + "width": 56.0, "height": 24.0 } }, @@ -6263,6 +6928,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -6306,6 +6972,7 @@ ], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -6373,8 +7040,32 @@ "m_ObjectId": "589f4e11412a4cbb90d671b22e237450", "m_Title": "glTF Base Color", "m_Position": { - "x": -1873.9998779296875, - "y": 177.5999755859375 + "x": -1874.0, + "y": 177.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "59765d44558c41fa9b629c3f17827036", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 } } @@ -6393,6 +7084,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -6420,6 +7112,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -6495,10 +7188,10 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": 1376.800048828125, - "y": 551.5999755859375, - "width": 120.0001220703125, - "height": 150.0 + "x": 1037.0, + "y": 586.0, + "width": 120.0, + "height": 148.99981689453126 } }, "m_Slots": [ @@ -6523,6 +7216,7 @@ ], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -6565,6 +7259,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -6675,6 +7370,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -6759,6 +7455,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -6872,6 +7569,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -7002,6 +7700,7 @@ ], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -7044,6 +7743,7 @@ ], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -7217,6 +7917,9 @@ }, { "m_Id": "7de6510c684046cb8ace0a0049c1c2f7" + }, + { + "m_Id": "6cb1312b5f6141b9ba8b8f67370dbf8f" } ] } @@ -7259,8 +7962,8 @@ "m_ObjectId": "69cd55544d0c4d0398f9591b9fbe134d", "m_Title": "glTF PBR Metallic-Roughness", "m_Position": { - "x": -1865.199951171875, - "y": 1582.39990234375 + "x": -1865.0, + "y": 1692.0 } } @@ -7315,6 +8018,29 @@ "m_Labels": [] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Internal.BooleanShaderProperty", + "m_ObjectId": "6cb1312b5f6141b9ba8b8f67370dbf8f", + "m_Guid": { + "m_GuidSerialized": "b1876fc9-1b52-4a75-b2fe-b4d4663660ba" + }, + "m_Name": "computeFlatNormals", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "computeFlatNormals", + "m_DefaultReferenceName": "_computeFlatNormals", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": false +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", @@ -7389,6 +8115,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -7478,6 +8205,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -7490,6 +8218,30 @@ } } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "70085e4a30eb4851a811ee51f0349dec", + "m_Id": 3, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", @@ -7541,6 +8293,29 @@ "m_Labels": [] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "7223713d8434430b88305717a077e3d4", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [] +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot", @@ -7553,7 +8328,7 @@ "m_StageCapability": 2, "m_BareResource": false, "m_Texture": { - "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", + "m_SerializedTexture": "", "m_Guid": "" }, "m_DefaultType": 0 @@ -7636,6 +8411,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -7657,10 +8433,10 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": 678.800048828125, - "y": 780.800048828125, - "width": 270.39984130859377, - "height": 35.2000732421875 + "x": 339.0000305175781, + "y": 814.9998779296875, + "width": 270.0000305175781, + "height": 34.0001220703125 } }, "m_Slots": [ @@ -7671,6 +8447,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -7680,6 +8457,20 @@ } } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BooleanMaterialSlot", + "m_ObjectId": "747b5e14d51943908c079338ba677faf", + "m_Id": 0, + "m_DisplayName": "computeFlatNormals", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": false, + "m_DefaultValue": false +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.RedirectNodeData", @@ -7692,10 +8483,10 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": 639.2000122070313, - "y": -200.00001525878907, - "width": 55.99993896484375, - "height": 24.000015258789064 + "x": 336.0, + "y": -169.0000457763672, + "width": 56.00006103515625, + "height": 24.0 } }, "m_Slots": [ @@ -7709,12 +8500,37 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] } } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "74e497239e8b4bc48385b05b0d44cdb0", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 2, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Internal.Texture2DShaderProperty", @@ -7730,12 +8546,13 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, "m_Hidden": false, "m_Value": { - "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", + "m_SerializedTexture": "", "m_Guid": "" }, "isMainTexture": false, @@ -7772,6 +8589,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -7799,6 +8617,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -7874,6 +8693,29 @@ "m_Labels": [] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "7adee16ed2d44efba1c5e2f5ad976014", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [] +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.SubGraphNode", @@ -7903,6 +8745,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -7966,6 +8809,30 @@ } } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "7c05808747144c63ad13f3594f695885", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", @@ -7993,10 +8860,10 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": 765.199951171875, - "y": 352.8000183105469, - "width": 234.79998779296876, - "height": 35.199951171875 + "x": 462.00006103515627, + "y": 383.99993896484377, + "width": 233.99993896484376, + "height": 34.00006103515625 } }, "m_Slots": [ @@ -8007,6 +8874,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -8031,6 +8899,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -8043,6 +8912,30 @@ } } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "7f67489942b0433baa7d1789d4aa3914", + "m_Id": 0, + "m_DisplayName": "", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.PropertyNode", @@ -8069,6 +8962,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -8160,6 +9054,7 @@ ], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -8185,12 +9080,13 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, "m_Hidden": false, "m_Value": { - "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", + "m_SerializedTexture": "", "m_Guid": "" }, "isMainTexture": false, @@ -8287,6 +9183,7 @@ ], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -8342,6 +9239,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -8403,12 +9301,13 @@ } { - "m_SGVersion": 0, + "m_SGVersion": 2, "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalLitSubTarget", "m_ObjectId": "84c4a27cc281482e826d5ff5910c3594", "m_WorkflowMode": 1, - "m_NormalDropOffSpace": 0, - "m_ClearCoat": false + "m_NormalDropOffSpace": 2, + "m_ClearCoat": false, + "m_BlendModePreserveSpecular": false } { @@ -8499,6 +9398,52 @@ "m_Labels": [] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BranchNode", + "m_ObjectId": "868a96f538664302a00f6880cbb29ca8", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Branch", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 2440.0, + "y": 304.0, + "width": 172.000244140625, + "height": 142.00006103515626 + } + }, + "m_Slots": [ + { + "m_Id": "2935a7606408494db10a33c7ad8b11ef" + }, + { + "m_Id": "22d571d16d7048cf982e26d2190ab6fd" + }, + { + "m_Id": "4414fcd211ab4608919304f20b76243c" + }, + { + "m_Id": "70085e4a30eb4851a811ee51f0349dec" + } + ], + "synonyms": [ + "switch", + "if", + "else" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", @@ -8561,6 +9506,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -8584,6 +9530,42 @@ "m_DropdownSelectedEntries": [] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.NormalizeNode", + "m_ObjectId": "873faf653391473781711c89bc29e2f5", + "m_Group": { + "m_Id": "f7e5f5a0f03449efa9830a4491cf162f" + }, + "m_Name": "Normalize", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 2070.0, + "y": -89.00003051757813, + "width": 208.0, + "height": 278.0 + } + }, + "m_Slots": [ + { + "m_Id": "7c05808747144c63ad13f3594f695885" + }, + { + "m_Id": "3f6433de9dc74c0fb4778dd84f00be9c" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.PropertyNode", @@ -8610,6 +9592,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -8631,10 +9614,10 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": 1059.2000732421875, - "y": -16.800052642822267, - "width": 291.599853515625, - "height": 168.39999389648438 + "x": 756.0000610351563, + "y": 13.999963760375977, + "width": 291.00006103515627, + "height": 166.99998474121095 } }, "m_Slots": [ @@ -8657,6 +9640,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -8840,6 +9824,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -8881,6 +9866,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -8928,6 +9914,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -9003,6 +9990,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -9103,6 +10091,7 @@ ], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -9223,6 +10212,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -9256,6 +10246,30 @@ } } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "90e18ccc8e9240a791ea2a3616fb9a15", + "m_Id": 0, + "m_DisplayName": "", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", @@ -9283,8 +10297,8 @@ "m_ObjectId": "9152a890faa84cd7b266b944cf210185", "m_Title": "glTF Emissive Texture", "m_Position": { - "x": -1864.8001708984375, - "y": 2352.39990234375 + "x": -1865.0, + "y": 2352.0 } } @@ -9300,10 +10314,10 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": 1059.2000732421875, - "y": -241.99998474121095, - "width": 291.599853515625, - "height": 168.39993286132813 + "x": 756.0000610351563, + "y": -211.0, + "width": 291.00006103515627, + "height": 166.99998474121095 } }, "m_Slots": [ @@ -9326,6 +10340,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -9402,12 +10417,13 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, "m_Hidden": false, "m_Value": { - "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", + "m_SerializedTexture": "", "m_Guid": "" }, "isMainTexture": false, @@ -9445,6 +10461,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -9460,6 +10477,29 @@ "m_DropdownSelectedEntries": [] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "96e8262fab4d4bf7b5e27c3cf60edfe2", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 1.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [] +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", @@ -9496,6 +10536,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -9549,6 +10590,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -9644,6 +10686,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -9679,6 +10722,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -9724,6 +10768,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -9783,6 +10828,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -9807,6 +10853,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 2, @@ -9831,7 +10878,7 @@ "m_StageCapability": 2, "m_BareResource": false, "m_Texture": { - "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", + "m_SerializedTexture": "", "m_Guid": "" }, "m_DefaultType": 0 @@ -9863,6 +10910,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -9949,6 +10997,7 @@ ], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -9985,6 +11034,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -10016,6 +11066,42 @@ } } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "a45a227e5fc24030b7373e4822cb23a5", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 2102.0, + "y": 263.0, + "width": 186.0, + "height": 34.000030517578128 + } + }, + "m_Slots": [ + { + "m_Id": "747b5e14d51943908c079338ba677faf" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "6cb1312b5f6141b9ba8b8f67370dbf8f" + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", @@ -10037,6 +11123,43 @@ "m_Labels": [] } +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.PositionNode", + "m_ObjectId": "a4e96b8e69b44e7f9214b41558530c06", + "m_Group": { + "m_Id": "f7e5f5a0f03449efa9830a4491cf162f" + }, + "m_Name": "Position", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 1478.0, + "y": -80.0, + "width": 206.0, + "height": 130.99996948242188 + } + }, + "m_Slots": [ + { + "m_Id": "1617b92e449d4875832609f993ad55bd" + } + ], + "synonyms": [ + "location" + ], + "m_Precision": 1, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 2, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Space": 2, + "m_PositionSource": 0 +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", @@ -10088,6 +11211,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -10271,6 +11395,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -10372,12 +11497,13 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, "m_Hidden": false, "m_Value": { - "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", + "m_SerializedTexture": "", "m_Guid": "" }, "isMainTexture": false, @@ -10422,6 +11548,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -10470,10 +11597,10 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": 1059.2000732421875, - "y": 203.20004272460938, - "width": 291.599853515625, - "height": 168.39999389648438 + "x": 756.0000610351563, + "y": 233.99998474121095, + "width": 291.00006103515627, + "height": 166.99989318847657 } }, "m_Slots": [ @@ -10496,6 +11623,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -10645,6 +11773,7 @@ ], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -10732,12 +11861,13 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, "m_Hidden": false, "m_Value": { - "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", + "m_SerializedTexture": "", "m_Guid": "" }, "isMainTexture": false, @@ -10834,6 +11964,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -10891,6 +12022,7 @@ ], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -10973,6 +12105,7 @@ ], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -10991,10 +12124,10 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": 826.7999267578125, - "y": 65.20001983642578, - "width": 173.20001220703126, - "height": 35.199951171875 + "x": 523.9999389648438, + "y": 95.99994659423828, + "width": 173.00006103515626, + "height": 33.999977111816409 } }, "m_Slots": [ @@ -11005,6 +12138,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -11081,6 +12215,7 @@ ], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -11159,6 +12294,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -11277,6 +12413,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -11318,6 +12455,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -11399,6 +12537,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -11468,6 +12607,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -11495,10 +12635,10 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": 1840.800048828125, - "y": 567.2000122070313, - "width": 208.80029296875, - "height": 303.20001220703127 + "x": 1501.0, + "y": 600.9999389648438, + "width": 208.0001220703125, + "height": 302.00006103515627 } }, "m_Slots": [ @@ -11519,6 +12659,7 @@ ], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -11537,10 +12678,10 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": 831.5999145507813, - "y": -123.99998474121094, - "width": 174.800048828125, - "height": 35.199951171875 + "x": 529.0, + "y": -93.0000228881836, + "width": 174.00006103515626, + "height": 33.99998092651367 } }, "m_Slots": [ @@ -11551,6 +12692,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -11600,6 +12742,7 @@ ], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -11635,6 +12778,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -11667,6 +12811,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -11689,6 +12834,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -11828,6 +12974,42 @@ "m_Labels": [] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.RedirectNodeData", + "m_ObjectId": "c86d6ff811944260a0a178bd87667660", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Redirect Node", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 2631.0, + "y": 759.0, + "width": 56.0, + "height": 24.0 + } + }, + "m_Slots": [ + { + "m_Id": "90e18ccc8e9240a791ea2a3616fb9a15" + }, + { + "m_Id": "fbb2451cd5314016b6d393d841afef4c" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", @@ -11861,10 +13043,10 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": 748.39990234375, - "y": 722.3999633789063, - "width": 210.400146484375, - "height": 35.2000732421875 + "x": 408.0, + "y": 756.0, + "width": 209.99993896484376, + "height": 33.9998779296875 } }, "m_Slots": [ @@ -11875,6 +13057,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -11914,6 +13097,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -11953,7 +13137,7 @@ "m_StageCapability": 3, "m_BareResource": false, "m_Texture": { - "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", + "m_SerializedTexture": "", "m_Guid": "" }, "m_DefaultType": 0 @@ -11999,6 +13183,44 @@ "m_Labels": [] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DDYNode", + "m_ObjectId": "cd790485106e402fa8d831c299674502", + "m_Group": { + "m_Id": "f7e5f5a0f03449efa9830a4491cf162f" + }, + "m_Name": "DDY", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 1730.9998779296875, + "y": -135.00001525878907, + "width": 132.0, + "height": 94.0 + } + }, + "m_Slots": [ + { + "m_Id": "59765d44558c41fa9b629c3f17827036" + }, + { + "m_Id": "74e497239e8b4bc48385b05b0d44cdb0" + } + ], + "synonyms": [ + "derivative" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", @@ -12174,6 +13396,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -12207,6 +13430,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -12216,6 +13440,30 @@ } } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", + "m_ObjectId": "d33958b64eee481cba013a159a037553", + "m_Id": 0, + "m_DisplayName": "Normal (World Space)", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "NormalWS", + "m_StageCapability": 2, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_Space": 2 +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.SampleTexture2DNode", @@ -12263,13 +13511,15 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] }, "m_TextureType": 0, "m_NormalMapSpace": 0, - "m_EnableGlobalMipBias": true + "m_EnableGlobalMipBias": true, + "m_MipSamplingMode": 0 } { @@ -12314,10 +13564,10 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": 678.800048828125, - "y": 670.3999633789063, - "width": 287.9998779296875, - "height": 35.2000732421875 + "x": 339.0000305175781, + "y": 704.0, + "width": 287.9999694824219, + "height": 33.9998779296875 } }, "m_Slots": [ @@ -12328,6 +13578,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -12470,6 +13721,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 2, "m_CustomColors": { "m_SerializableColors": [] @@ -12491,6 +13743,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -12503,6 +13756,30 @@ } } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "d9a4f4f3136d44dabc16a4720d580cc3", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 2, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.SplitNode", @@ -12543,6 +13820,7 @@ ], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -12555,8 +13833,8 @@ "m_ObjectId": "da5f26e4dc7649dbae635a3bcb0ac50b", "m_Title": "glTF Ambient Occlusion", "m_Position": { - "x": -1869.599853515625, - "y": 3075.2001953125 + "x": -1869.0, + "y": 3089.0 } } @@ -12657,6 +13935,7 @@ ], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -12669,8 +13948,8 @@ "m_ObjectId": "dbd4e9568a614874b25288e2229220e7", "m_Title": "glTF Normal Texture", "m_Position": { - "x": -1868.4000244140625, - "y": 947.2000122070313 + "x": -1868.0, + "y": 947.0 } } @@ -12702,6 +13981,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -12726,7 +14006,7 @@ "m_StageCapability": 2, "m_BareResource": false, "m_Texture": { - "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", + "m_SerializedTexture": "", "m_Guid": "" }, "m_DefaultType": 0 @@ -12805,7 +14085,7 @@ "m_StageCapability": 3, "m_BareResource": false, "m_Texture": { - "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", + "m_SerializedTexture": "", "m_Guid": "" }, "m_DefaultType": 0 @@ -12844,6 +14124,7 @@ ], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -13009,6 +14290,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -13105,6 +14387,7 @@ ], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -13139,6 +14422,7 @@ "m_SGVersion": 1, "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget", "m_ObjectId": "e5345877026f422cb9787a73aef331b2", + "m_Datas": [], "m_ActiveSubTarget": { "m_Id": "84c4a27cc281482e826d5ff5910c3594" }, @@ -13151,6 +14435,7 @@ "m_AlphaClip": true, "m_CastShadows": true, "m_ReceiveShadows": true, + "m_SupportsLODCrossFade": false, "m_CustomEditorGUI": "", "m_SupportVFX": false } @@ -13181,6 +14466,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -13214,6 +14500,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -13400,6 +14687,7 @@ ], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -13487,6 +14775,7 @@ ], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -13524,6 +14813,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -13648,6 +14938,7 @@ ], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -13731,6 +15022,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -13771,8 +15063,8 @@ "m_Theme": 0, "m_Position": { "serializedVersion": "2", - "x": 536.3999633789063, - "y": -332.3999938964844, + "x": 233.0, + "y": -301.0, "width": 140.0, "height": 100.0 }, @@ -13817,10 +15109,10 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": 824.3998413085938, - "y": 288.4000244140625, - "width": 174.800048828125, - "height": 35.199951171875 + "x": 520.9999389648438, + "y": 319.0, + "width": 174.00006103515626, + "height": 33.999969482421878 } }, "m_Slots": [ @@ -13831,6 +15123,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -13887,6 +15180,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -13927,6 +15221,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -13948,12 +15243,23 @@ "m_StageCapability": 3, "m_BareResource": false, "m_Texture": { - "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", + "m_SerializedTexture": "", "m_Guid": "" }, "m_DefaultType": 0 } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.GroupData", + "m_ObjectId": "f7e5f5a0f03449efa9830a4491cf162f", + "m_Title": "Compute Flat Normals", + "m_Position": { + "x": 1453.0, + "y": -194.0 + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector2Node", @@ -13991,6 +15297,7 @@ ], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -14053,7 +15360,7 @@ "m_StageCapability": 3, "m_BareResource": false, "m_Texture": { - "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", + "m_SerializedTexture": "", "m_Guid": "" }, "m_DefaultType": 0 @@ -14095,8 +15402,32 @@ "m_ObjectId": "fb5719d9c5c74100943dcfd4d0eb6eb7", "m_Title": "Raster Overlays", "m_Position": { - "x": 511.2000427246094, - "y": -390.7999572753906 + "x": 208.0, + "y": -360.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "fbb2451cd5314016b6d393d841afef4c", + "m_Id": 1, + "m_DisplayName": "", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 } } @@ -14162,6 +15493,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, diff --git a/native~/Runtime/src/UnityPrepareRendererResources.cpp b/native~/Runtime/src/UnityPrepareRendererResources.cpp index 832bb3e1..f23c1e18 100644 --- a/native~/Runtime/src/UnityPrepareRendererResources.cpp +++ b/native~/Runtime/src/UnityPrepareRendererResources.cpp @@ -101,36 +101,6 @@ std::vector generateIndices(const int32_t count) { return syntheticIndexBuffer; } -// template -// void computeFlatNormals( -// uint8_t* pWritePos, -// size_t stride, -// TIndex* indices, -// int32_t indexCount, -// const AccessorView& positionView) { -// -// for (int i = 0; i < indexCount; i += 3) { -// -// TIndex i0 = indices[i]; -// TIndex i1 = indices[i + 1]; -// TIndex i2 = indices[i + 2]; -// -// const glm::vec3& v0 = -// *reinterpret_cast(&positionView[i0]); -// const glm::vec3& v1 = -// *reinterpret_cast(&positionView[i1]); -// const glm::vec3& v2 = -// *reinterpret_cast(&positionView[i2]); -// -// glm::vec3 normal = glm::normalize(glm::cross(v1 - v0, v2 - v0)); -// for (int j = 0; j < 3; j++) { -// *reinterpret_cast(pWritePos) = normal; -// pWritePos += stride; -// } -// } -// } - - namespace { struct MikkTPayload { @@ -140,15 +110,35 @@ struct MikkTPayload { uint8_t* pNormalData; uint8_t* pTexCoordData; uint8_t* pTangentData; + std::unordered_map normalCache; glm::vec3& getPosition(const int vert) const { uint8_t* ptr = &pPositionData[vert * stride]; return *reinterpret_cast(ptr); } - glm::vec3& getNormal(const int vert) const { - uint8_t* ptr = &pNormalData[vert * stride]; - return *reinterpret_cast(ptr); + glm::vec3 getNormal(const int vert) { + if (pNormalData) { + uint8_t* ptr = &pNormalData[vert * stride]; + return *reinterpret_cast(ptr); + } else { + // calculate the face normal from the vertex stream + // assumes a non-indexed model. + int i0 = 3 * (vert / 3); + if (normalCache.contains(i0)) + return normalCache[i0]; + else { + assert(i0+2 < numIndices && "Not enough vertices. Is this an indexed model?"); + glm::vec3& v0 = getPosition(i0); + glm::vec3& v1 = getPosition(i0 + 1); + glm::vec3& v2 = getPosition(i0 + 2); + + glm::vec3 normal = glm::normalize(glm::cross(v1 - v0, v2 - v0)); + normalCache.insert({i0,normal}); + + return normal; + } + } } glm::vec2& getTexCoord(const int vert) const { @@ -197,7 +187,7 @@ void mikkGetNormal( float normal[3], const int face, const int vert) { - const auto& payload = *reinterpret_cast(context->m_pUserData); + auto& payload = *reinterpret_cast(context->m_pUserData); const auto& norm = payload.getNormal(face * 3 + vert); normal[0] = norm.x; @@ -489,18 +479,15 @@ void loadPrimitive( bool duplicateVertices = false; - bool hasNormals = false; - bool computeFlatNormals = false; auto normalAccessorIt = primitive.attributes.find("NORMAL"); AccessorView normalView; if (normalAccessorIt != primitive.attributes.end()) { normalView = AccessorView(gltf, normalAccessorIt->second); - hasNormals = normalView.status() == AccessorViewStatus::Valid; + primitiveInfo.hasNormals = normalView.status() == AccessorViewStatus::Valid; } else if ( !primitiveInfo.isUnlit && primitive.mode != MeshPrimitive::Mode::POINTS) { - computeFlatNormals = hasNormals = true; - duplicateVertices = true; + primitiveInfo.hasNormals = false; } bool hasTangents = false; @@ -590,7 +577,7 @@ void loadPrimitive( ++numberOfAttributes; // Add the NORMAL attribute, if it exists. - if (hasNormals) { + if (primitiveInfo.hasNormals) { assert(numberOfAttributes < MAX_ATTRIBUTES); descriptor[numberOfAttributes].attribute = VertexAttribute::Normal; descriptor[numberOfAttributes].format = VertexAttributeFormat::Float32; @@ -736,7 +723,7 @@ void loadPrimitive( size_t stride = sizeof(Vector3); size_t normalByteOffset; - if (hasNormals) { + if (primitiveInfo.hasNormals) { normalByteOffset = stride; stride += sizeof(Vector3); } @@ -760,21 +747,13 @@ void loadPrimitive( } if (duplicateVertices) { - // if (computeFlatNormals) { - // ::computeFlatNormals( - // pWritePos + normalByteOffset, - // stride, - // indices, - // indexCount, - // positionView); - // } for (int64_t i = 0; i < vertexCount; ++i) { TIndex vertexIndex = indices[i]; *reinterpret_cast(pWritePos) = positionView[vertexIndex]; // skip position pWritePos += sizeof(Vector3); // load normal from view or reserve space - if (hasNormals) { + if (primitiveInfo.hasNormals) { if (vertexIndex < normalView.size()) { *reinterpret_cast(pWritePos) = normalView[vertexIndex]; } @@ -807,7 +786,7 @@ void loadPrimitive( indices, indexCount, pBufferStart, - pBufferStart + normalByteOffset, + primitiveInfo.hasNormals ? pBufferStart + normalByteOffset : nullptr, pBufferStart + texCoordByteOffset, pBufferStart + tangentByteOffset); } @@ -817,7 +796,7 @@ void loadPrimitive( *reinterpret_cast(pWritePos) = positionView[i]; pWritePos += sizeof(Vector3); - if (hasNormals) { + if (primitiveInfo.hasNormals) { *reinterpret_cast(pWritePos) = normalView[i]; pWritePos += sizeof(Vector3); } @@ -1416,6 +1395,11 @@ void setGltfMaterialParameterValues( } } + const float computeFlatNormals = !primitiveInfo.isUnlit && !primitiveInfo.hasNormals; + unityMaterial.SetFloat( + materialProperties.getComputeFlatNormalsID(), + computeFlatNormals); + if (gltfMaterial.occlusionTexture) { auto texCoordIndexIt = primitiveInfo.uvIndexMap.find(gltfMaterial.occlusionTexture->texCoord); diff --git a/native~/Runtime/src/UnityPrepareRendererResources.h b/native~/Runtime/src/UnityPrepareRendererResources.h index 1d4850e6..56990a43 100644 --- a/native~/Runtime/src/UnityPrepareRendererResources.h +++ b/native~/Runtime/src/UnityPrepareRendererResources.h @@ -11,17 +11,17 @@ namespace CesiumForUnityNative { struct CreateModelOptions { /** - * Whether to ignore the KHR_materials_unlit extension in the model. If this - * is true and the extension is present, then flat normals will be generated - * for the model as it loads. - */ + * @brief Whether to ignore the KHR_materials_unlit extension in the model. + * @remarks If this is true and the extension is present, then flat normals + * will be generated for the model as it loads. + **/ bool ignoreKhrMaterialUnlit = false; - /* - * Whether to include tangents in the vertex buffer. If tangents are not - * present in the source glTF, they will be generated via the mikktspace - * algorithm. - */ + /** + * @brief Whether to include tangents in the vertex buffer. + * @remarks If tangents are not present in the source glTF, they will be + * generated via the mikktspace algorithm. + **/ bool alwaysIncludeTangents = false; CreateModelOptions() = default; @@ -36,19 +36,19 @@ struct CreateModelOptions { */ struct CesiumPrimitiveInfo { /** - * @brief Whether or not the primitive's mode is set to POINTS. - * This affects whether or not it can be baked into a physics mesh. + * @brief Whether the primitive's mode is set to POINTS. + * This affects whether it can be baked into a physics mesh. */ bool containsPoints = false; /** - * @brief Whether or not the primitive contains translucent vertex + * @brief Whether the primitive contains translucent vertex * colors. This can affect material tags used to render the model. */ bool isTranslucent = false; /** - * @brief Whether or not the primitive material has the KHR_materials_unlit + * @brief Whether the primitive material has the KHR_materials_unlit * extension. * @remarks This may be overridden if * DotNet::CesiumForUnity::Cesium3DTileset::ignoreignoreKHRMaterialsUnlit() is @@ -56,6 +56,14 @@ struct CesiumPrimitiveInfo { */ bool isUnlit = false; + /** + * @brief Whether the primitive vertex buffer has normals + * @remarks When rendering a lit tileset that does not have normals, and + * the generateSmoothNormals option is not enabled, the shader should + * generate flat normals in the pixel shader. + */ + bool hasNormals = false; + /** * @brief Maps a texture coordinate index i (TEXCOORD_) to the * corresponding Unity texture coordinate index. From 8a27e48b024c3cc2886fb67cbba181502da817e5 Mon Sep 17 00:00:00 2001 From: David Lively Date: Thu, 25 Sep 2025 14:07:47 -0500 Subject: [PATCH 4/7] Formatting and changed assert message --- .../Runtime/src/TilesetMaterialProperties.cpp | 4 ++-- .../src/UnityPrepareRendererResources.cpp | 17 ++++++++++------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/native~/Runtime/src/TilesetMaterialProperties.cpp b/native~/Runtime/src/TilesetMaterialProperties.cpp index f9136163..c55be2da 100644 --- a/native~/Runtime/src/TilesetMaterialProperties.cpp +++ b/native~/Runtime/src/TilesetMaterialProperties.cpp @@ -83,7 +83,7 @@ const std::string const std::string TilesetMaterialProperties::_overlayTranslationAndScalePrefix = "_overlayTranslationAndScale_"; const std::string TilesetMaterialProperties::_computeFlatNormalsName = - "_computeFlatNormals"; + "_computeFlatNormals"; #pragma endregion @@ -135,7 +135,7 @@ TilesetMaterialProperties::TilesetMaterialProperties() _occlusionTextureRotationID( Shader::PropertyToID(System::String(_occlusionTextureRotationName))), _computeFlatNormalsID( - Shader::PropertyToID(System::String(_computeFlatNormalsName))), + Shader::PropertyToID(System::String(_computeFlatNormalsName))), _overlayTextureCoordinateIndexIDs(), _overlayTextureIDs(), _overlayTranslationAndScaleIDs() {} diff --git a/native~/Runtime/src/UnityPrepareRendererResources.cpp b/native~/Runtime/src/UnityPrepareRendererResources.cpp index f23c1e18..3e9bf443 100644 --- a/native~/Runtime/src/UnityPrepareRendererResources.cpp +++ b/native~/Runtime/src/UnityPrepareRendererResources.cpp @@ -110,7 +110,7 @@ struct MikkTPayload { uint8_t* pNormalData; uint8_t* pTexCoordData; uint8_t* pTangentData; - std::unordered_map normalCache; + std::unordered_map normalCache; glm::vec3& getPosition(const int vert) const { uint8_t* ptr = &pPositionData[vert * stride]; @@ -128,13 +128,15 @@ struct MikkTPayload { if (normalCache.contains(i0)) return normalCache[i0]; else { - assert(i0+2 < numIndices && "Not enough vertices. Is this an indexed model?"); + assert( + i0 + 2 < numIndices && "Not enough vertices. Model must be " + "non-indexed to use this function."); glm::vec3& v0 = getPosition(i0); glm::vec3& v1 = getPosition(i0 + 1); glm::vec3& v2 = getPosition(i0 + 2); glm::vec3 normal = glm::normalize(glm::cross(v1 - v0, v2 - v0)); - normalCache.insert({i0,normal}); + normalCache.insert({i0, normal}); return normal; } @@ -226,7 +228,7 @@ void computeTangents( uint8_t* normals, uint8_t* texCoords, uint8_t* tangents) { - SMikkTSpaceInterface interface{}; + SMikkTSpaceInterface interface {}; interface.m_getNormal = mikkGetNormal; interface.m_getNumFaces = mikkGetNumFaces; interface.m_getNumVerticesOfFace = mikkGetNumVerticesOfFaces; @@ -1395,10 +1397,11 @@ void setGltfMaterialParameterValues( } } - const float computeFlatNormals = !primitiveInfo.isUnlit && !primitiveInfo.hasNormals; + const float computeFlatNormals = + !primitiveInfo.isUnlit && !primitiveInfo.hasNormals; unityMaterial.SetFloat( - materialProperties.getComputeFlatNormalsID(), - computeFlatNormals); + materialProperties.getComputeFlatNormalsID(), + computeFlatNormals); if (gltfMaterial.occlusionTexture) { auto texCoordIndexIt = From 3b18aa6c7a1f5db0efb4a4841cd729bf67b64ac4 Mon Sep 17 00:00:00 2001 From: David Lively Date: Thu, 25 Sep 2025 14:39:09 -0500 Subject: [PATCH 5/7] Updated change log --- CHANGES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index fa69a783..98634e39 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,8 @@ - Added an option to `Cesium3DTileset` to enable tangent generation on the CPU for any tiles that are missing them. +- Flat normals are now generated in the pixel shader when rendering lit models that do not include normals. + ## v1.18.0 - 2025-09-02 ##### Additions :tada: From 0ebc920b4199f8154e67058d9ede6dafb0d48d8e Mon Sep 17 00:00:00 2001 From: David Lively Date: Thu, 25 Sep 2025 14:41:18 -0500 Subject: [PATCH 6/7] Formatting --- native~/Runtime/src/UnityPrepareRendererResources.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native~/Runtime/src/UnityPrepareRendererResources.cpp b/native~/Runtime/src/UnityPrepareRendererResources.cpp index 3e9bf443..957b4671 100644 --- a/native~/Runtime/src/UnityPrepareRendererResources.cpp +++ b/native~/Runtime/src/UnityPrepareRendererResources.cpp @@ -228,7 +228,7 @@ void computeTangents( uint8_t* normals, uint8_t* texCoords, uint8_t* tangents) { - SMikkTSpaceInterface interface {}; + SMikkTSpaceInterface interface{}; interface.m_getNormal = mikkGetNormal; interface.m_getNumFaces = mikkGetNumFaces; interface.m_getNumVerticesOfFace = mikkGetNumVerticesOfFaces; From 87a94fcf43fbbb12b55e123980371f02d68cd253 Mon Sep 17 00:00:00 2001 From: David Lively Date: Fri, 26 Sep 2025 13:31:24 -0500 Subject: [PATCH 7/7] Stashing debug changes --- .../CesiumDefaultTilesetMaterial.mat | 11 +- .../CesiumDefaultTilesetShader.shadergraph | 546 ++++++++++++++++-- .../src/UnityPrepareRendererResources.cpp | 5 +- 3 files changed, 496 insertions(+), 66 deletions(-) diff --git a/Runtime/Resources/CesiumDefaultTilesetMaterial.mat b/Runtime/Resources/CesiumDefaultTilesetMaterial.mat index 2f9b4d27..51299739 100644 --- a/Runtime/Resources/CesiumDefaultTilesetMaterial.mat +++ b/Runtime/Resources/CesiumDefaultTilesetMaterial.mat @@ -23,13 +23,15 @@ Material: m_Name: CesiumDefaultTilesetMaterial m_Shader: {fileID: -6465566751694194690, guid: 407c0cff68611ac46a65eec87a5203f5, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 m_ValidKeywords: - _ALPHATEST_ON - _BUILTIN_ALPHATEST_ON - _BUILTIN_AlphaClip + m_InvalidKeywords: - _DISABLE_SSR_TRANSPARENT - _DOUBLESIDED_ON - m_InvalidKeywords: [] m_LightmapFlags: 2 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 1 @@ -43,6 +45,7 @@ Material: - TransparentBackface - RayTracingPrepass - MOTIONVECTORS + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -101,7 +104,7 @@ Material: - _AlphaCutoffEnable: 1 - _AlphaDstBlend: 0 - _AlphaSrcBlend: 1 - - _AlphaToMask: 0 + - _AlphaToMask: 1 - _AlphaToMaskInspectorValue: 0 - _BUILTIN_AlphaClip: 1 - _BUILTIN_Blend: 0 @@ -116,6 +119,7 @@ Material: - _BUILTIN_ZWriteControl: 0 - _Blend: 0 - _BlendMode: 0 + - _BlendModePreserveSpecular: 0 - _CastShadows: 1 - _ConservativeDepthOffsetEnable: 0 - _Cull: 0 @@ -168,6 +172,7 @@ Material: - _ZWrite: 1 - _ZWriteControl: 0 - _baseColorTextureCoordinateIndex: 0 + - _computeFlatNormals: 0 - _emissiveTextureCoordinateIndex: 0 - _metallicRoughnessTextureCoordinateIndex: 0 - _normalMapScale: 0 @@ -222,4 +227,4 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 5 + version: 7 diff --git a/Runtime/Resources/CesiumDefaultTilesetShader.shadergraph b/Runtime/Resources/CesiumDefaultTilesetShader.shadergraph index f74c4564..b49bcab1 100644 --- a/Runtime/Resources/CesiumDefaultTilesetShader.shadergraph +++ b/Runtime/Resources/CesiumDefaultTilesetShader.shadergraph @@ -488,6 +488,21 @@ }, { "m_Id": "17ca69882cb74acebe447d1023d2c4f8" + }, + { + "m_Id": "d3804c5f98964b87b2c5dffacb400873" + }, + { + "m_Id": "8ebc5517f6f24cd8ae0a0c78ab7049be" + }, + { + "m_Id": "7b77e46038904eb3addc679d4d6a4e06" + }, + { + "m_Id": "55c3767d21cb4c1ca90d4ccb4da6f02d" + }, + { + "m_Id": "a61374c3ecf943f79e1c1c86664c457d" } ], "m_GroupDatas": [ @@ -588,7 +603,7 @@ }, "m_InputSlot": { "m_Node": { - "m_Id": "a308cd02a0b642a786cb6ed1aeb208a6" + "m_Id": "d3804c5f98964b87b2c5dffacb400873" }, "m_SlotId": 0 } @@ -901,6 +916,20 @@ "m_SlotId": 0 } }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "26b50b73d7584d738ec741528e3919d2" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "3a08d0a60405435fa92432d670b09f6d" + }, + "m_SlotId": 0 + } + }, { "m_OutputSlot": { "m_Node": { @@ -1064,7 +1093,7 @@ }, "m_InputSlot": { "m_Node": { - "m_Id": "d12188a9cb824131bf5ec7a1ca5a2ee6" + "m_Id": "55c3767d21cb4c1ca90d4ccb4da6f02d" }, "m_SlotId": 0 } @@ -1419,20 +1448,6 @@ "m_SlotId": 2 } }, - { - "m_OutputSlot": { - "m_Node": { - "m_Id": "868a96f538664302a00f6880cbb29ca8" - }, - "m_SlotId": 3 - }, - "m_InputSlot": { - "m_Node": { - "m_Id": "16187569ba8647619aeff7c78cd44bf0" - }, - "m_SlotId": 0 - } - }, { "m_OutputSlot": { "m_Node": { @@ -1699,20 +1714,6 @@ "m_SlotId": -1906785015 } }, - { - "m_OutputSlot": { - "m_Node": { - "m_Id": "a45a227e5fc24030b7373e4822cb23a5" - }, - "m_SlotId": 0 - }, - "m_InputSlot": { - "m_Node": { - "m_Id": "868a96f538664302a00f6880cbb29ca8" - }, - "m_SlotId": 0 - } - }, { "m_OutputSlot": { "m_Node": { @@ -2030,21 +2031,7 @@ }, "m_InputSlot": { "m_Node": { - "m_Id": "350ba852757d40bab5b55c9841ef5c9f" - }, - "m_SlotId": 0 - } - }, - { - "m_OutputSlot": { - "m_Node": { - "m_Id": "c86d6ff811944260a0a178bd87667660" - }, - "m_SlotId": 1 - }, - "m_InputSlot": { - "m_Node": { - "m_Id": "3a08d0a60405435fa92432d670b09f6d" + "m_Id": "7b77e46038904eb3addc679d4d6a4e06" }, "m_SlotId": 0 } @@ -2198,7 +2185,7 @@ }, "m_InputSlot": { "m_Node": { - "m_Id": "15b4aee3e1aa4be1a43a4f138e704d3e" + "m_Id": "8ebc5517f6f24cd8ae0a0c78ab7049be" }, "m_SlotId": 0 } @@ -2373,9 +2360,6 @@ { "m_Id": "16187569ba8647619aeff7c78cd44bf0" }, - { - "m_Id": "2eacb23513544fc097cb3007f3134d97" - }, { "m_Id": "e5ca7bb83a9d4a5b99c6b17e8aa77844" }, @@ -2385,6 +2369,9 @@ { "m_Id": "15b4aee3e1aa4be1a43a4f138e704d3e" }, + { + "m_Id": "2eacb23513544fc097cb3007f3134d97" + }, { "m_Id": "350ba852757d40bab5b55c9841ef5c9f" }, @@ -2716,6 +2703,27 @@ "m_Labels": [] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "056e3a1e943142b883d32081411c68d2", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", @@ -3276,6 +3284,30 @@ "m_DropdownSelectedEntries": [] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "0f8f01f462e04f4b9e7fe455b1504343", + "m_Id": 1, + "m_DisplayName": "", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", @@ -3799,8 +3831,8 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": 2191.0, - "y": 353.0000305175781, + "x": 2209.0, + "y": 421.0, "width": 211.0, "height": 157.0 } @@ -3986,6 +4018,30 @@ "m_Labels": [] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "1acd7866149a4fd5a54f169caa7c2420", + "m_Id": 0, + "m_DisplayName": "", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", @@ -5957,6 +6013,54 @@ "m_Labels": [] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "41a28500f64b45f488a9ecbcfaf8bc50", + "m_Id": 0, + "m_DisplayName": "", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "43072fe92cf84dd3b03a066e33859666", + "m_Id": 1, + "m_DisplayName": "", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", @@ -6899,6 +7003,42 @@ } } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.RedirectNodeData", + "m_ObjectId": "55c3767d21cb4c1ca90d4ccb4da6f02d", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Redirect Node", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 2617.84326171875, + "y": 1264.01416015625, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "c7645b59b1914d6bb6f6c3440e8c4a21" + }, + { + "m_Id": "43072fe92cf84dd3b03a066e33859666" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.RedirectNodeData", @@ -7040,8 +7180,8 @@ "m_ObjectId": "589f4e11412a4cbb90d671b22e237450", "m_Title": "glTF Base Color", "m_Position": { - "x": -1874.0, - "y": 177.0 + "x": -1874.0003662109375, + "y": 176.99998474121095 } } @@ -7378,6 +7518,23 @@ "m_SerializedDescriptor": "SurfaceDescription.BentNormal" } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "5ffd14815b66416bb60f6f35066d6b58", + "m_Id": 2, + "m_DisplayName": "Y", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Y", + "m_StageCapability": 3, + "m_Value": 1.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "Y" + ] +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", @@ -7454,7 +7611,7 @@ ], "synonyms": [], "m_Precision": 0, - "m_PreviewExpanded": false, + "m_PreviewExpanded": true, "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { @@ -7585,6 +7742,30 @@ "m_DropdownSelectedEntries": [] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "65450cc01587401f8dc3382299d0aa58", + "m_Id": 1, + "m_DisplayName": "", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", @@ -7962,7 +8143,7 @@ "m_ObjectId": "69cd55544d0c4d0398f9591b9fbe134d", "m_Title": "glTF PBR Metallic-Roughness", "m_Position": { - "x": -1865.0, + "x": -1865.0003662109375, "y": 1692.0 } } @@ -8716,6 +8897,42 @@ "m_Labels": [] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.RedirectNodeData", + "m_ObjectId": "7b77e46038904eb3addc679d4d6a4e06", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Redirect Node", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 2636.09375, + "y": 1151.4693603515625, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "af80c5605f4f4026b349a36fe72d6815" + }, + { + "m_Id": "0f8f01f462e04f4b9e7fe455b1504343" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.SubGraphNode", @@ -9756,6 +9973,21 @@ "m_Labels": [] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "895f4e7e43f24e62842e75418d591896", + "m_Id": 1, + "m_DisplayName": "X", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "X", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", @@ -10138,6 +10370,42 @@ "m_Labels": [] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.RedirectNodeData", + "m_ObjectId": "8ebc5517f6f24cd8ae0a0c78ab7049be", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Redirect Node", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 2635.0, + "y": 1068.0, + "width": 56.0, + "height": 24.0 + } + }, + "m_Slots": [ + { + "m_Id": "41a28500f64b45f488a9ecbcfaf8bc50" + }, + { + "m_Id": "65450cc01587401f8dc3382299d0aa58" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", @@ -10297,7 +10565,7 @@ "m_ObjectId": "9152a890faa84cd7b266b944cf210185", "m_Title": "glTF Emissive Texture", "m_Position": { - "x": -1865.0, + "x": -1865.0003662109375, "y": 2352.0 } } @@ -11245,6 +11513,54 @@ } } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector2Node", + "m_ObjectId": "a61374c3ecf943f79e1c1c86664c457d", + "m_Group": { + "m_Id": "dbd4e9568a614874b25288e2229220e7" + }, + "m_Name": "Vector 2", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1286.0, + "y": 1624.0, + "width": 128.0, + "height": 101.0 + } + }, + "m_Slots": [ + { + "m_Id": "895f4e7e43f24e62842e75418d591896" + }, + { + "m_Id": "5ffd14815b66416bb60f6f35066d6b58" + }, + { + "m_Id": "056e3a1e943142b883d32081411c68d2" + } + ], + "synonyms": [ + "2", + "v2", + "vec2", + "float2" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Value": { + "x": 0.0, + "y": 0.0 + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", @@ -11821,6 +12137,30 @@ } } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "af80c5605f4f4026b349a36fe72d6815", + "m_Id": 0, + "m_DisplayName": "", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", @@ -12959,6 +13299,30 @@ "m_Labels": [] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "c7645b59b1914d6bb6f6c3440e8c4a21", + "m_Id": 0, + "m_DisplayName": "", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", @@ -13522,6 +13886,42 @@ "m_MipSamplingMode": 0 } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.RedirectNodeData", + "m_ObjectId": "d3804c5f98964b87b2c5dffacb400873", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Redirect Node", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 2636.0, + "y": 1024.0, + "width": 56.0, + "height": 24.0 + } + }, + "m_Slots": [ + { + "m_Id": "1acd7866149a4fd5a54f169caa7c2420" + }, + { + "m_Id": "f9304aa7ea0f4f12b95ec8ecb052a6c7" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", @@ -13834,7 +14234,7 @@ "m_Title": "glTF Ambient Occlusion", "m_Position": { "x": -1869.0, - "y": 3089.0 + "y": 3088.999755859375 } } @@ -13948,8 +14348,8 @@ "m_ObjectId": "dbd4e9568a614874b25288e2229220e7", "m_Title": "glTF Normal Texture", "m_Position": { - "x": -1868.0, - "y": 947.0 + "x": -1868.0003662109375, + "y": 947.0000610351563 } } @@ -15256,7 +15656,7 @@ "m_Title": "Compute Flat Normals", "m_Position": { "x": 1453.0, - "y": -194.0 + "y": -194.00001525878907 } } @@ -15323,6 +15723,30 @@ "m_Labels": [] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "f9304aa7ea0f4f12b95ec8ecb052a6c7", + "m_Id": 1, + "m_DisplayName": "", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", @@ -15403,7 +15827,7 @@ "m_Title": "Raster Overlays", "m_Position": { "x": 208.0, - "y": -360.0 + "y": -360.0000305175781 } } diff --git a/native~/Runtime/src/UnityPrepareRendererResources.cpp b/native~/Runtime/src/UnityPrepareRendererResources.cpp index 957b4671..909082e9 100644 --- a/native~/Runtime/src/UnityPrepareRendererResources.cpp +++ b/native~/Runtime/src/UnityPrepareRendererResources.cpp @@ -135,7 +135,8 @@ struct MikkTPayload { glm::vec3& v1 = getPosition(i0 + 1); glm::vec3& v2 = getPosition(i0 + 2); - glm::vec3 normal = glm::normalize(glm::cross(v1 - v0, v2 - v0)); + // glm::vec3 normal = glm::normalize(glm::cross(v1 - v0, v2 - v0)); + glm::vec3 normal = glm::normalize(glm::cross( v0 - v1, v2 - v1)); normalCache.insert({i0, normal}); return normal; @@ -503,7 +504,7 @@ void loadPrimitive( } else if ( !primitiveInfo.isUnlit && primitive.mode != MeshPrimitive::Mode::POINTS) { computeTangents = hasTangents = - options.alwaysIncludeTangents || pMaterial->normalTexture; + options.alwaysIncludeTangents;// || pMaterial->normalTexture; duplicateVertices |= computeTangents; }