diff --git a/CHANGELOG.md b/CHANGELOG.md index fdb737e3..6c4b6a66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [6.7.1] - 2024-08-07 + +### Fixed +- (Export) Cases of corrupt glTFs when not all vertex attributes of a mesh were exported. +- Alpha blending via baseColorTexture's alpha value is now in correct color space, less opaque and as a result consistent with other glTF viewers (affected URP and built-in render pipeline projects in linear color space; fixes [#700](https://github.com/atteneder/glTFast/issues/700)). + ## [6.7.0] - 2024-06-25 ### Added diff --git a/Runtime/Scripts/Export/Constants.cs b/Runtime/Scripts/Export/Constants.cs index 12109be4..45c766d5 100644 --- a/Runtime/Scripts/Export/Constants.cs +++ b/Runtime/Scripts/Export/Constants.cs @@ -7,7 +7,7 @@ namespace GLTFast.Export { static class Constants { - public const string version = "6.7.0"; + public const string version = "6.7.1"; internal const string mimeTypePNG = "image/png"; internal const string mimeTypeJPG = "image/jpeg"; diff --git a/Runtime/Scripts/Export/ExportSettings.cs b/Runtime/Scripts/Export/ExportSettings.cs index 4081f2f0..98dd7e7a 100644 --- a/Runtime/Scripts/Export/ExportSettings.cs +++ b/Runtime/Scripts/Export/ExportSettings.cs @@ -57,16 +57,18 @@ public enum FileConflictResolution } /// - /// Compression + /// glTF compression method. /// [Flags] public enum Compression { /// No compression Uncompressed = 1, - /// Replace existing files with newly created ones + /// Meshopt compression + /// via MeshOpt = 1 << 1, - /// Replace existing files with newly created ones + /// Draco 3D Data compression + /// via Draco = 1 << 2, } diff --git a/Runtime/Scripts/Export/GltfWriter.cs b/Runtime/Scripts/Export/GltfWriter.cs index 495933ed..fa023aa0 100755 --- a/Runtime/Scripts/Export/GltfWriter.cs +++ b/Runtime/Scripts/Export/GltfWriter.cs @@ -56,7 +56,8 @@ enum State struct AttributeData { public int stream; - public int offset; + public int inputOffset; + public int outputOffset; public int accessorId; public int size; } @@ -903,7 +904,8 @@ async Task BakeMesh(int meshId, UnityEngine.Mesh.MeshData meshData) var attrData = new AttributeData { - offset = inputStrides[attribute.stream], + inputOffset = inputStrides[attribute.stream], + outputOffset = outputStrides[attribute.stream], stream = attribute.stream, size = attribute.dimension * attributeSize }; @@ -915,17 +917,14 @@ async Task BakeMesh(int meshId, UnityEngine.Mesh.MeshData meshData) { continue; } - else - { - outputStrides[attribute.stream] += attrData.size; - } + outputStrides[attribute.stream] += attrData.size; // Adhere data alignment rules - Assert.IsTrue(attrData.offset % 4 == 0); + Assert.IsTrue(attrData.outputOffset % 4 == 0); var accessor = new Accessor { - byteOffset = attrData.offset, + byteOffset = attrData.outputOffset, componentType = Accessor.GetComponentType(attribute.format), count = vertexCount, }; @@ -1554,10 +1553,10 @@ NativeArray outputStream { var job = new ExportJobs.ConvertPositionFloatJob { - input = (byte*)inputStream.GetUnsafeReadOnlyPtr() + attrData.offset, + input = (byte*)inputStream.GetUnsafeReadOnlyPtr() + attrData.inputOffset, inputByteStride = inputByteStride, outputByteStride = outputByteStride, - output = (byte*)outputStream.GetUnsafePtr() + attrData.offset + output = (byte*)outputStream.GetUnsafePtr() + attrData.outputOffset }.Schedule(vertexCount, k_DefaultInnerLoopBatchCount); return job; } @@ -1597,10 +1596,10 @@ NativeArray outputStream { var job = new ExportJobs.ConvertTangentFloatJob { - input = (byte*)inputStream.GetUnsafeReadOnlyPtr() + attrData.offset, + input = (byte*)inputStream.GetUnsafeReadOnlyPtr() + attrData.inputOffset, inputByteStride = inputByteStride, outputByteStride = outputByteStride, - output = (byte*)outputStream.GetUnsafePtr() + attrData.offset + output = (byte*)outputStream.GetUnsafePtr() + attrData.outputOffset }.Schedule(vertexCount, k_DefaultInnerLoopBatchCount); return job; } @@ -1662,10 +1661,10 @@ NativeArray outputStream { var job = new ExportJobs.ConvertTexCoordFloatJob { - input = (byte*)inputStream.GetUnsafeReadOnlyPtr() + attrData.offset, + input = (byte*)inputStream.GetUnsafeReadOnlyPtr() + attrData.inputOffset, inputByteStride = inputByteStride, outputByteStride = outputByteStride, - output = (byte*)outputStream.GetUnsafePtr() + attrData.offset + output = (byte*)outputStream.GetUnsafePtr() + attrData.outputOffset }.Schedule(vertexCount, k_DefaultInnerLoopBatchCount); return job; } @@ -1684,8 +1683,8 @@ NativeArray outputStream inputByteStride = inputByteStride, outputByteStride = outputByteStride, byteLength = (uint)attrData.size, - input = (byte*)inputStream.GetUnsafeReadOnlyPtr() + attrData.offset, - output = (byte*)outputStream.GetUnsafePtr() + attrData.offset + input = (byte*)inputStream.GetUnsafeReadOnlyPtr() + attrData.inputOffset, + output = (byte*)outputStream.GetUnsafePtr() + attrData.outputOffset }.Schedule(vertexCount, k_DefaultInnerLoopBatchCount); return job; } diff --git a/Runtime/Shader/Built-In/glTFIncludes/glTFUnityStandardInput.cginc b/Runtime/Shader/Built-In/glTFIncludes/glTFUnityStandardInput.cginc index f2f0c20f..d4a1045e 100644 --- a/Runtime/Shader/Built-In/glTFIncludes/glTFUnityStandardInput.cginc +++ b/Runtime/Shader/Built-In/glTFIncludes/glTFUnityStandardInput.cginc @@ -153,7 +153,11 @@ half Alpha(float2 uv) #if defined(_SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A) return baseColorFactor.a; #else - return tex2D(baseColorTexture, uv).a * baseColorFactor.a; + half alpha = tex2D(baseColorTexture, uv).a; +#ifndef UNITY_COLORSPACE_GAMMA + alpha = GammaToLinearSpace(alpha); +#endif + return alpha * baseColorFactor.a; #endif } diff --git a/Runtime/Shader/Built-In/glTFUnlit.shader b/Runtime/Shader/Built-In/glTFUnlit.shader index 2c766baf..23bf5045 100644 --- a/Runtime/Shader/Built-In/glTFUnlit.shader +++ b/Runtime/Shader/Built-In/glTFUnlit.shader @@ -80,7 +80,11 @@ SubShader { fixed4 frag (v2f i) : SV_Target { - fixed4 col = tex2D(baseColorTexture, i.texcoord) * baseColorFactor; + fixed4 col = tex2D(baseColorTexture, i.texcoord); +#ifndef UNITY_COLORSPACE_GAMMA + col.a = GammaToLinearSpace(col.a); +#endif + col *= baseColorFactor; col *= i.color; #ifdef _ALPHATEST_ON clip(col.a - alphaCutoff); diff --git a/Runtime/Shader/SubGraphs/BaseColor.shadersubgraph b/Runtime/Shader/SubGraphs/BaseColor.shadersubgraph index e2cfa08b..0f9019d2 100644 --- a/Runtime/Shader/SubGraphs/BaseColor.shadersubgraph +++ b/Runtime/Shader/SubGraphs/BaseColor.shadersubgraph @@ -16,6 +16,9 @@ "m_Keywords": [ { "m_Id": "77b0beb4204941d6abdcb8dad422f287" + }, + { + "m_Id": "011f4b30e3014c7292a23a61d90bbafc" } ], "m_Nodes": [ @@ -60,6 +63,21 @@ }, { "m_Id": "694a11edcfc84825b16012f21ea98bfb" + }, + { + "m_Id": "5426501522404b52b23f9cbad6b92767" + }, + { + "m_Id": "99338bef02924dd6a94b580bd685bb2b" + }, + { + "m_Id": "242a5f3b3de14d329fe0da242b464278" + }, + { + "m_Id": "b114aedb9a3c4ce884294e2017c21001" + }, + { + "m_Id": "921b04f05cc4457c97b26797e6401906" } ], "m_GroupDatas": [ @@ -67,7 +85,11 @@ "m_Id": "b0da37b8d05f4a1fbd0f231f92cd16c1" } ], - "m_StickyNoteDatas": [], + "m_StickyNoteDatas": [ + { + "m_Id": "80581c4568b94d5db8959f4ebb96fff3" + } + ], "m_Edges": [ { "m_OutputSlot": { @@ -106,11 +128,53 @@ }, "m_InputSlot": { "m_Node": { - "m_Id": "042d6775af3e4882bfd8f0ce4caa146c" + "m_Id": "242a5f3b3de14d329fe0da242b464278" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "138397a6db27508ebfa37e627012b311" + }, + "m_SlotId": 7 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "921b04f05cc4457c97b26797e6401906" }, "m_SlotId": 1 } }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "138397a6db27508ebfa37e627012b311" + }, + "m_SlotId": 7 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "b114aedb9a3c4ce884294e2017c21001" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "242a5f3b3de14d329fe0da242b464278" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "921b04f05cc4457c97b26797e6401906" + }, + "m_SlotId": 2 + } + }, { "m_OutputSlot": { "m_Node": { @@ -148,7 +212,7 @@ }, "m_InputSlot": { "m_Node": { - "m_Id": "5b7cc1ccc3c2cc8e9b782803430a5ba4" + "m_Id": "5426501522404b52b23f9cbad6b92767" }, "m_SlotId": 0 } @@ -162,9 +226,9 @@ }, "m_InputSlot": { "m_Node": { - "m_Id": "694a11edcfc84825b16012f21ea98bfb" + "m_Id": "5b7cc1ccc3c2cc8e9b782803430a5ba4" }, - "m_SlotId": 2 + "m_SlotId": 0 } }, { @@ -176,9 +240,9 @@ }, "m_InputSlot": { "m_Node": { - "m_Id": "b387cfe84ba48c80b009292201f697eb" + "m_Id": "694a11edcfc84825b16012f21ea98bfb" }, - "m_SlotId": 0 + "m_SlotId": 2 } }, { @@ -209,6 +273,20 @@ "m_SlotId": 2 } }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "5426501522404b52b23f9cbad6b92767" + }, + "m_SlotId": 4 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "99338bef02924dd6a94b580bd685bb2b" + }, + "m_SlotId": 0 + } + }, { "m_OutputSlot": { "m_Node": { @@ -265,6 +343,34 @@ "m_SlotId": 0 } }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "921b04f05cc4457c97b26797e6401906" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "042d6775af3e4882bfd8f0ce4caa146c" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "99338bef02924dd6a94b580bd685bb2b" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "b387cfe84ba48c80b009292201f697eb" + }, + "m_SlotId": 0 + } + }, { "m_OutputSlot": { "m_Node": { @@ -279,12 +385,26 @@ "m_SlotId": 1 } }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "b114aedb9a3c4ce884294e2017c21001" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "242a5f3b3de14d329fe0da242b464278" + }, + "m_SlotId": 2 + } + }, { "m_OutputSlot": { "m_Node": { "m_Id": "b387cfe84ba48c80b009292201f697eb" }, - "m_SlotId": 4 + "m_SlotId": 1 }, "m_InputSlot": { "m_Node": { @@ -337,6 +457,25 @@ "m_ActiveTargets": [] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ShaderKeyword", + "m_ObjectId": "011f4b30e3014c7292a23a61d90bbafc", + "m_Guid": { + "m_GuidSerialized": "09c8bebf-1c56-471e-b134-d89d7ea59793" + }, + "m_Name": "SHADEROPTIONS_PRE_EXPOSITION", + "m_DefaultReferenceName": "BOOLEAN_011F4B30E3014C7292A23A61D90BBAFC_ON", + "m_OverrideReferenceName": "SHADEROPTIONS_PRE_EXPOSITION", + "m_GeneratePropertyBlock": true, + "m_KeywordType": 0, + "m_KeywordDefinition": 2, + "m_KeywordScope": 1, + "m_Entries": [], + "m_Value": 0, + "m_IsEditable": true +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.MultiplyNode", @@ -349,10 +488,10 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": 175.0, - "y": 152.99998474121095, - "width": 129.0, - "height": 118.00000762939453 + "x": 815.0000610351563, + "y": 99.00005340576172, + "width": 124.99999237060547, + "height": 117.99999237060547 } }, "m_Slots": [ @@ -375,6 +514,45 @@ } } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "0e186197c2204e8e815cfd9117fd2cac", + "m_Id": 2, + "m_DisplayName": "Off", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Off", + "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", + "m_ObjectId": "0ff6115df3344cdeb497ec37bbee8760", + "m_Id": 0, + "m_DisplayName": "gammaValue", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "gammaValue", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", @@ -536,6 +714,47 @@ ] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.KeywordNode", + "m_ObjectId": "242a5f3b3de14d329fe0da242b464278", + "m_Group": { + "m_Id": "b0da37b8d05f4a1fbd0f231f92cd16c1" + }, + "m_Name": "UNITY_COLORSPACE_GAMMA", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 261.5, + "y": 231.00001525878907, + "width": 222.49998474121095, + "height": 117.99999237060547 + } + }, + "m_Slots": [ + { + "m_Id": "2aead6d1ba194f569dc4e63dced95f96" + }, + { + "m_Id": "6a8e3715b14d46e184dba0a3c919be95" + }, + { + "m_Id": "8c03c4dd76d840f0acbe4011358e558a" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Keyword": { + "m_Id": "77b0beb4204941d6abdcb8dad422f287" + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.PropertyNode", @@ -600,9 +819,9 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": 508.5, - "y": 57.49998092651367, - "width": 125.0, + "x": 974.9999389648438, + "y": 4.500027656555176, + "width": 124.99999237060547, "height": 117.99999237060547 } }, @@ -626,6 +845,30 @@ } } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "2aead6d1ba194f569dc4e63dced95f96", + "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, + "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", @@ -650,6 +893,30 @@ } } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "2f68c6b4453b44ce8e32f1195fd76979", + "m_Id": 1, + "m_DisplayName": "On", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "On", + "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.VertexColorNode", @@ -699,6 +966,33 @@ ] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "3214a913adc74431b5bd2330daace53f", + "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": [ + "X", + "Y", + "Z" + ] +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", @@ -787,6 +1081,30 @@ ] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "3ba9600b7650425e9a0871968770f8a4", + "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.Vector4MaterialSlot", @@ -988,6 +1306,52 @@ "m_Channel": 0 } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.SplitNode", + "m_ObjectId": "5426501522404b52b23f9cbad6b92767", + "m_Group": { + "m_Id": "b0da37b8d05f4a1fbd0f231f92cd16c1" + }, + "m_Name": "Split", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -66.0, + "y": -313.0, + "width": 119.0, + "height": 149.0 + } + }, + "m_Slots": [ + { + "m_Id": "3ba9600b7650425e9a0871968770f8a4" + }, + { + "m_Id": "eaab19823b3f49fba5233cd936e9b61a" + }, + { + "m_Id": "f1b0d8d9190f4c99a1239370c85fda56" + }, + { + "m_Id": "e9d98b9ec47343a9bb0cdd3788f7f253" + }, + { + "m_Id": "de121a4c9e4c4f6295cc900fc86dec41" + } + ], + "synonyms": [ + "separate" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", @@ -1196,6 +1560,27 @@ } } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CategoryData", + "m_ObjectId": "670d5448f2e4446c9d84fa55a37797ab", + "m_Name": "", + "m_ChildObjectList": [ + { + "m_Id": "bbcb866077389285b6753f7439d8cefe" + }, + { + "m_Id": "f5798993603c168f9f2f35781e76f32d" + }, + { + "m_Id": "ce8f6554e8d0508f97307598c2be7200" + }, + { + "m_Id": "77b0beb4204941d6abdcb8dad422f287" + } + ] +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.KeywordNode", @@ -1232,8 +1617,56 @@ "m_CustomColors": { "m_SerializableColors": [] }, - "m_Keyword": { - "m_Id": "77b0beb4204941d6abdcb8dad422f287" + "m_Keyword": { + "m_Id": "77b0beb4204941d6abdcb8dad422f287" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "6a8e3715b14d46e184dba0a3c919be95", + "m_Id": 1, + "m_DisplayName": "On", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "On", + "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": "6c59c4ca548c4933a4f04dc6a26a7bf4", + "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, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 } } @@ -1303,7 +1736,7 @@ } { - "m_SGVersion": 0, + "m_SGVersion": 1, "m_Type": "UnityEditor.ShaderGraph.ShaderKeyword", "m_ObjectId": "77b0beb4204941d6abdcb8dad422f287", "m_Guid": { @@ -1339,6 +1772,41 @@ "m_DefaultType": 0 } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "7e432a9601d346e8b0c3413c867b77f9", + "m_Id": 1, + "m_DisplayName": "linearValue", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "linearValue", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.StickyNoteData", + "m_ObjectId": "80581c4568b94d5db8959f4ebb96fff3", + "m_Title": "HDRP detection", + "m_Content": "SHADEROPTIONS_PRE_EXPOSITION is set when High Definition Render Pipeline is in use.\nNOTE: Does not work in Shader Graph Preview", + "m_TextSize": 0, + "m_Theme": 0, + "m_Position": { + "serializedVersion": "2", + "x": 522.5, + "y": 58.0, + "width": 201.5, + "height": 100.0 + }, + "m_Group": { + "m_Id": "b0da37b8d05f4a1fbd0f231f92cd16c1" + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", @@ -1435,6 +1903,30 @@ } } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "8c03c4dd76d840f0acbe4011358e558a", + "m_Id": 2, + "m_DisplayName": "Off", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Off", + "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.SubGraphOutputNode", @@ -1447,10 +1939,10 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": 875.0000610351563, - "y": -69.99999237060547, - "width": 134.0, - "height": 101.00000762939453 + "x": 1179.0, + "y": -100.0, + "width": 114.49999237060547, + "height": 101.0 } }, "m_Slots": [ @@ -1471,6 +1963,86 @@ "IsFirstSlotValid": true } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.KeywordNode", + "m_ObjectId": "921b04f05cc4457c97b26797e6401906", + "m_Group": { + "m_Id": "b0da37b8d05f4a1fbd0f231f92cd16c1" + }, + "m_Name": "SHADEROPTIONS_PRE_EXPOSITION", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 516.4999389648438, + "y": 172.00001525878907, + "width": 254.49998474121095, + "height": 117.99999237060547 + } + }, + "m_Slots": [ + { + "m_Id": "6c59c4ca548c4933a4f04dc6a26a7bf4" + }, + { + "m_Id": "2f68c6b4453b44ce8e32f1195fd76979" + }, + { + "m_Id": "0e186197c2204e8e815cfd9117fd2cac" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Keyword": { + "m_Id": "011f4b30e3014c7292a23a61d90bbafc" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ColorspaceConversionNode", + "m_ObjectId": "99338bef02924dd6a94b580bd685bb2b", + "m_Group": { + "m_Id": "b0da37b8d05f4a1fbd0f231f92cd16c1" + }, + "m_Name": "Colorspace Conversion", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 69.49998474121094, + "y": -312.9999694824219, + "width": 210.9999542236328, + "height": 130.49998474121095 + } + }, + "m_Slots": [ + { + "m_Id": "3214a913adc74431b5bd2330daace53f" + }, + { + "m_Id": "c4631f2fd6e342c08fed118e0d79ce50" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Conversion": { + "from": 1, + "to": 0 + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", @@ -1519,7 +2091,7 @@ ], "synonyms": [], "m_Precision": 0, - "m_PreviewExpanded": true, + "m_PreviewExpanded": false, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -1680,11 +2252,53 @@ "m_ObjectId": "b0da37b8d05f4a1fbd0f231f92cd16c1", "m_Title": "BaseColor", "m_Position": { - "x": -374.0000305175781, - "y": -578.0 + "x": -374.0, + "y": -577.5 } } +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.CustomFunctionNode", + "m_ObjectId": "b114aedb9a3c4ce884294e2017c21001", + "m_Group": { + "m_Id": "b0da37b8d05f4a1fbd0f231f92cd16c1" + }, + "m_Name": "GammaToLinearSpaceScalar (Custom Function)", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -99.49992370605469, + "y": 275.9999694824219, + "width": 317.4999694824219, + "height": 93.99999237060547 + } + }, + "m_Slots": [ + { + "m_Id": "0ff6115df3344cdeb497ec37bbee8760" + }, + { + "m_Id": "7e432a9601d346e8b0c3413c867b77f9" + } + ], + "synonyms": [ + "code", + "HLSL" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SourceType": 1, + "m_FunctionName": "GammaToLinearSpaceScalar", + "m_FunctionSource": "", + "m_FunctionBody": "// Approximate version from http://chilliant.blogspot.com.au/2012/08/srgb-approximations-for-hlsl.html?m=1\n linearValue = gammaValue * (gammaValue * (gammaValue * 0.305306011h + 0.682171111h) + 0.012522878h);" +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.SplitNode", @@ -1697,9 +2311,9 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": 254.99996948242188, - "y": -317.0, - "width": 120.99999237060547, + "x": 296.5, + "y": -313.0, + "width": 119.0, "height": 149.0 } }, @@ -1810,6 +2424,33 @@ ] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "c4631f2fd6e342c08fed118e0d79ce50", + "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": [ + "X", + "Y", + "Z" + ] +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", @@ -1884,6 +2525,21 @@ ] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "de121a4c9e4c4f6295cc900fc86dec41", + "m_Id": 4, + "m_DisplayName": "A", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", @@ -1925,6 +2581,36 @@ ] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "e9d98b9ec47343a9bb0cdd3788f7f253", + "m_Id": 3, + "m_DisplayName": "B", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "eaab19823b3f49fba5233cd936e9b61a", + "m_Id": 1, + "m_DisplayName": "R", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "R", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", @@ -1985,9 +2671,9 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": 508.4999694824219, - "y": -217.0, - "width": 129.0, + "x": 974.9999389648438, + "y": -167.49996948242188, + "width": 128.99998474121095, "height": 117.99999237060547 } }, @@ -2035,6 +2721,21 @@ } } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "f1b0d8d9190f4c99a1239370c85fda56", + "m_Id": 2, + "m_DisplayName": "G", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "G", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Internal.Texture2DShaderProperty", diff --git a/ValidationExceptions.json b/ValidationExceptions.json new file mode 100644 index 00000000..6b566e00 --- /dev/null +++ b/ValidationExceptions.json @@ -0,0 +1,10 @@ +{ + "ErrorExceptions": [ + { + "ValidationTest": "API Validation", + "ExceptionMessage": "Additions require a new minor or major version.", + "PackageVersion": "6.7.1" + } + ], + "WarningExceptions": [] +} diff --git a/ValidationExceptions.json.meta b/ValidationExceptions.json.meta new file mode 100644 index 00000000..1dbcacbe --- /dev/null +++ b/ValidationExceptions.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: de0eeb8ef67124af5a71ee59c9aa3947 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/package.json b/package.json index 52103e30..08dd0cbb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.atteneder.gltfast", - "version": "6.7.0", + "version": "6.7.1", "displayName": "glTFast", "description": "Use glTFast to import and export glTF 3D files efficiently at runtime or in the Editor", "unity": "2020.3",