From 760aee2db504f5f2d88b73800b5e3e21ac63727d Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Wed, 21 Oct 2020 22:17:08 +0200 Subject: [PATCH 1/6] Add a new Sample Cubemap node --- com.unity.shadergraph/CHANGELOG.md | 1 + .../Documentation~/Input-Nodes.md | 2 +- .../Documentation~/Sample-Cubemap-Node.md | 9 +-- .../Sample-Reflected-Cubemap-Node.md | 24 ++++++ .../Documentation~/TableOfContents.md | 3 +- .../Documentation~/Upgrade-Guide-10-0-x.md | 4 + .../Nodes/Input/Texture/SampleCubemapNode.cs | 11 ++- .../Input/Texture/SampleRawCubemapNode.cs | 81 +++++++++++++++++++ .../Texture/SampleRawCubemapNode.cs.meta | 11 +++ 9 files changed, 137 insertions(+), 9 deletions(-) create mode 100644 com.unity.shadergraph/Documentation~/Sample-Reflected-Cubemap-Node.md create mode 100644 com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleRawCubemapNode.cs create mode 100644 com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleRawCubemapNode.cs.meta diff --git a/com.unity.shadergraph/CHANGELOG.md b/com.unity.shadergraph/CHANGELOG.md index d6e28187940..aea089458fb 100644 --- a/com.unity.shadergraph/CHANGELOG.md +++ b/com.unity.shadergraph/CHANGELOG.md @@ -14,6 +14,7 @@ The version number for this package has increased due to a version update of a r ### Added ### Changed +- Rename the current Sample Cubemap Node -> Sample Reflected Cubemap Node and create a new Sample Cubemap Node which sample cubemap with a direction ### Fixed - Fixed an issue where old ShaderGraphs would import non-deterministically, changing their embedded property names each import [1283800] diff --git a/com.unity.shadergraph/Documentation~/Input-Nodes.md b/com.unity.shadergraph/Documentation~/Input-Nodes.md index f21a02cb834..0bbb0f7c474 100644 --- a/com.unity.shadergraph/Documentation~/Input-Nodes.md +++ b/com.unity.shadergraph/Documentation~/Input-Nodes.md @@ -90,7 +90,7 @@ ## Texture -|[Cubemap Asset](Cubemap-Asset-Node.md)|[Sample Cubemap](Sample-Cubemap-Node.md)| +|[Cubemap Asset](Cubemap-Asset-Node.md)|[Sample Cubemap](Sample-Cubemap-Node.md)|[Sample Cubemap](Sample-Reflected-Cubemap-Node.md)| |:--------:|:------:| |[![Image](images/CubemapAssetNodeThumb.png)](Combine-Node)|![](images/SampleCubemapNodeThumb.png)| | Defines a constant Cubemap Asset for use in the shader. | Samples a Cubemap and returns a Vector 4 color value for use in the shader. | diff --git a/com.unity.shadergraph/Documentation~/Sample-Cubemap-Node.md b/com.unity.shadergraph/Documentation~/Sample-Cubemap-Node.md index 657357135cc..961001716b6 100644 --- a/com.unity.shadergraph/Documentation~/Sample-Cubemap-Node.md +++ b/com.unity.shadergraph/Documentation~/Sample-Cubemap-Node.md @@ -2,15 +2,14 @@ ## Description -Samples a **Cubemap** and returns a **Vector 4** color value for use in the shader. Requires **View Direction** and **Normal** inputs to sample the **Cubemap**. You can achieve a blurring effect by sampling at a different Level of Detail using the **LOD** input. You can also define a custom **Sampler State** using the **Sampler** input. +Samples a **Cubemap** and returns a **Vector 4** color value for use in the shader. Requires **Direction** inputs in world space to sample the **Cubemap**. You can achieve a blurring effect by sampling at a different Level of Detail using the **LOD** input. You can also define a custom **Sampler State** using the **Sampler** input. ## Ports | Name | Direction | Type | Binding | Description | |:------------ |:-------------|:-----|:---|:---| | Cube | Input | Cubemap | None | Cubemap to sample | -| View Dir | Input | Vector 3 | View Direction (object space) | Mesh's view direction | -| Normal | Input | Vector 3 | Normal (object space) | Mesh's normal vector | +| Dir | Input | Vector 3 | Normal (world space) | Direction or Mesh's normal vector | | Sampler | Input | Sampler State | Default sampler state | Sampler for the **Cubemap** | | LOD | Input | Float | None | Level of detail for sampling | | Out | Output | Vector 4 | None | Output value | @@ -20,5 +19,5 @@ Samples a **Cubemap** and returns a **Vector 4** color value for use in the shad The following example code represents one possible outcome of this node. ``` -float4 _SampleCubemap_Out = SAMPLE_TEXTURECUBE_LOD(Cubemap, Sampler, reflect(-ViewDir, Normal), LOD); -``` \ No newline at end of file +float4 _SampleCubemap_Out = SAMPLE_TEXTURECUBE_LOD(Cubemap, Sampler, Dir, LOD); +``` diff --git a/com.unity.shadergraph/Documentation~/Sample-Reflected-Cubemap-Node.md b/com.unity.shadergraph/Documentation~/Sample-Reflected-Cubemap-Node.md new file mode 100644 index 00000000000..3e4f9252577 --- /dev/null +++ b/com.unity.shadergraph/Documentation~/Sample-Reflected-Cubemap-Node.md @@ -0,0 +1,24 @@ +# Sample Cubemap Node + +## Description + +Samples a **Cubemap** with reflected vector and returns a **Vector 4** color value for use in the shader. Requires **View Direction** and **Normal** inputs to sample the **Cubemap**. You can achieve a blurring effect by sampling at a different Level of Detail using the **LOD** input. You can also define a custom **Sampler State** using the **Sampler** input. + +## Ports + +| Name | Direction | Type | Binding | Description | +|:------------ |:-------------|:-----|:---|:---| +| Cube | Input | Cubemap | None | Cubemap to sample | +| View Dir | Input | Vector 3 | View Direction (object space) | Mesh's view direction | +| Normal | Input | Vector 3 | Normal (object space) | Mesh's normal vector | +| Sampler | Input | Sampler State | Default sampler state | Sampler for the **Cubemap** | +| LOD | Input | Float | None | Level of detail for sampling | +| Out | Output | Vector 4 | None | Output value | + +## Generated Code Example + +The following example code represents one possible outcome of this node. + +``` +float4 _SampleCubemap_Out = SAMPLE_TEXTURECUBE_LOD(Cubemap, Sampler, reflect(-ViewDir, Normal), LOD); +``` diff --git a/com.unity.shadergraph/Documentation~/TableOfContents.md b/com.unity.shadergraph/Documentation~/TableOfContents.md index 4f25ced7f0f..ad97644c9a8 100644 --- a/com.unity.shadergraph/Documentation~/TableOfContents.md +++ b/com.unity.shadergraph/Documentation~/TableOfContents.md @@ -115,7 +115,8 @@ * [Screen](Screen-Node) * Texture * [Cubemap Asset](Cubemap-Asset-Node) - * [Sample Cubemap](Sample-Cubemap-Node) + * [Sample Cubemap](Sample-Cubemap-Node) + * [Sample Reflected Cubemap](Sample-Reflected-Cubemap-Node) * [Sample Texture 2D](Sample-Texture-2D-Node) * [Sample Texture 2D Array](Sample-Texture-2D-Array-Node) * [Sample Texture 2D LOD](Sample-Texture-2D-LOD-Node) diff --git a/com.unity.shadergraph/Documentation~/Upgrade-Guide-10-0-x.md b/com.unity.shadergraph/Documentation~/Upgrade-Guide-10-0-x.md index 129b48b7d53..0c21412c36c 100644 --- a/com.unity.shadergraph/Documentation~/Upgrade-Guide-10-0-x.md +++ b/com.unity.shadergraph/Documentation~/Upgrade-Guide-10-0-x.md @@ -4,6 +4,10 @@ Shader Graph has renamed the **Vector 1** property as **Float** in both the Vector 1 node and the exposed parameter list. The **Float** precision was also renamed as **Single**. Behavior is exactly the same, and only the names have changed. +## Renamed Sample Cubemap + +Shader Graph has renamed the previous Sample Cubemap Node in Sample Reflected Cubemap and have added a new Sample Cubemap which used world space direction. + ## Master Stack graph output Shader Graph has removed the Master Nodes and introduced a more flexible [Master Stack](Master-Stack.md) solution for defining graph output in 10.0. You can still open all graphs created in previous versions, because Shader Graph automatically upgrades them. This page describes the expected behavior and explains when you might need to perform manual upgrade steps. diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleCubemapNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleCubemapNode.cs index aab9f69b541..c5d8d99dd42 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleCubemapNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleCubemapNode.cs @@ -6,7 +6,7 @@ namespace UnityEditor.ShaderGraph { [FormerName("UnityEditor.ShaderGraph.CubemapNode")] - [Title("Input", "Texture", "Sample Cubemap")] + [Title("Input", "Texture", "Sample Reflected Cubemap")] class SampleCubemapNode : AbstractMaterialNode, IGeneratesBodyCode, IMayRequireViewDirection, IMayRequireNormal { public const int OutputSlotId = 0; @@ -26,7 +26,7 @@ class SampleCubemapNode : AbstractMaterialNode, IGeneratesBodyCode, IMayRequireV public SampleCubemapNode() { - name = "Sample Cubemap"; + name = "Sample Reflected Cubemap"; UpdateNodeAfterDeserialization(); } @@ -85,5 +85,12 @@ public NeededCoordinateSpace RequiresNormal(ShaderStageCapability stageCapabilit else return NeededCoordinateSpace.None; } + + public override void OnAfterDeserialize() + { + base.OnAfterDeserialize(); + + name = "Sample Reflected Cubemap"; + } } } diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleRawCubemapNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleRawCubemapNode.cs new file mode 100644 index 00000000000..65c5025421f --- /dev/null +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleRawCubemapNode.cs @@ -0,0 +1,81 @@ +using System.Linq; +using UnityEngine; +using UnityEditor.Graphing; +using UnityEditor.ShaderGraph.Internal; + +namespace UnityEditor.ShaderGraph +{ + [Title("Input", "Texture", "Sample Cubemap")] + class SampleRawCubemapNode : AbstractMaterialNode, IGeneratesBodyCode, IMayRequireNormal + { + public const int OutputSlotId = 0; + public const int CubemapInputId = 1; + public const int NormalInputId = 2; + public const int SamplerInputId = 3; + public const int LODInputId = 4; + const string kOutputSlotName = "Out"; + const string kCubemapInputName = "Cube"; + const string kNormalInputName = "Dir"; + const string kSamplerInputName = "Sampler"; + const string kLODInputName = "LOD"; + + public override bool hasPreview { get { return true; } } + + public SampleRawCubemapNode() + { + name = "Sample Cubemap"; + UpdateNodeAfterDeserialization(); + } + + + public sealed override void UpdateNodeAfterDeserialization() + { + AddSlot(new Vector4MaterialSlot(OutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output, Vector4.zero)); + AddSlot(new CubemapInputMaterialSlot(CubemapInputId, kCubemapInputName, kCubemapInputName)); + AddSlot(new NormalMaterialSlot(NormalInputId, kNormalInputName, kNormalInputName, CoordinateSpace.World)); + AddSlot(new SamplerStateMaterialSlot(SamplerInputId, kSamplerInputName, kSamplerInputName, SlotType.Input)); + AddSlot(new Vector1MaterialSlot(LODInputId, kLODInputName, kLODInputName, SlotType.Input, 0)); + RemoveSlotsNameNotMatching(new[] { OutputSlotId, CubemapInputId, NormalInputId, SamplerInputId, LODInputId }); + } + + public override PreviewMode previewMode + { + get { return PreviewMode.Preview3D; } + } + + // Node generations + public virtual void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMode) + { + //Sampler input slot + var samplerSlot = FindInputSlot(SamplerInputId); + var edgesSampler = owner.GetEdges(samplerSlot.slotReference); + + var id = GetSlotValue(CubemapInputId, generationMode); + string result = string.Format("$precision4 {0} = SAMPLE_TEXTURECUBE_LOD({1}, {2}, {3}, {4});" + , GetVariableNameForSlot(OutputSlotId) + , id + , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : "sampler" + id + , GetSlotValue(NormalInputId, generationMode) + , GetSlotValue(LODInputId, generationMode)); + + sb.AppendLine(result); + } + + public NeededCoordinateSpace RequiresNormal(ShaderStageCapability stageCapability) + { + var normalSlot = FindInputSlot(NormalInputId); + var edgesNormal = owner.GetEdges(normalSlot.slotReference); + if (!edgesNormal.Any()) + return CoordinateSpace.Object.ToNeededCoordinateSpace(); + else + return NeededCoordinateSpace.None; + } + + public override void OnAfterDeserialize() + { + base.OnAfterDeserialize(); + + name = "Sample Cubemap"; + } + } +} diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleRawCubemapNode.cs.meta b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleRawCubemapNode.cs.meta new file mode 100644 index 00000000000..ddf7ecde961 --- /dev/null +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleRawCubemapNode.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1790cabd561426148b5f93f010b5b046 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From d37f65cd10b6283c4cf785e3512ab8c3a3c3ab3d Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Wed, 21 Oct 2020 22:27:21 +0200 Subject: [PATCH 2/6] Add new cubemap sample node to input test --- .../Assets/Scenes/InputNodes.unity | 139 +++- .../Input/Texture/SampleCubemapProperty.mat | 13 + .../Texture/SampleCubemapProperty.mat.meta | 2 +- .../Texture/SampleCubemapProperty.shadergraph | 682 +++++++++++++++++- .../SampleCubemapProperty.shadergraph.meta | 2 +- .../SampleReflectedCubemapProperty.mat | 41 ++ .../SampleReflectedCubemapProperty.mat.meta | 8 + ...SampleReflectedCubemapProperty.shadergraph | 52 ++ ...eReflectedCubemapProperty.shadergraph.meta | 10 + 9 files changed, 900 insertions(+), 49 deletions(-) create mode 100644 TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Texture/SampleReflectedCubemapProperty.mat create mode 100644 TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Texture/SampleReflectedCubemapProperty.mat.meta create mode 100644 TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Texture/SampleReflectedCubemapProperty.shadergraph create mode 100644 TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Texture/SampleReflectedCubemapProperty.shadergraph.meta diff --git a/TestProjects/ShaderGraph/Assets/Scenes/InputNodes.unity b/TestProjects/ShaderGraph/Assets/Scenes/InputNodes.unity index 6af789b8771..08a7f2c47da 100644 --- a/TestProjects/ShaderGraph/Assets/Scenes/InputNodes.unity +++ b/TestProjects/ShaderGraph/Assets/Scenes/InputNodes.unity @@ -251,7 +251,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 596523079} - m_RootOrder: 13 + m_RootOrder: 14 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!23 &1221711 MeshRenderer: @@ -816,13 +816,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 97661562} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalRotation: {x: -0.0000015744266, y: -0.00095836265, z: -0.00018746467, w: 0.9999995} m_LocalPosition: {x: -1, y: 0, z: 1} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 242909117} m_RootOrder: 26 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: 0, y: -0.11, z: -0.021} --- !u!23 &97661564 MeshRenderer: m_ObjectHideFlags: 0 @@ -2179,10 +2179,15 @@ MonoBehaviour: TargetWidth: 1800 TargetHeight: 960 PerPixelCorrectnessThreshold: 0.00075 + PerPixelGammaThreshold: 0.003921569 + PerPixelAlphaThreshold: 0.003921569 AverageCorrectnessThreshold: 0.0001 + IncorrectPixelsThreshold: 0.0000038146973 UseHDR: 0 UseBackBuffer: 0 ImageResolution: 0 + ActiveImageTests: 1 + ActivePixelTests: 7 WaitFrames: 2 --- !u!114 &366199733 MonoBehaviour: @@ -2388,7 +2393,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 596523079} - m_RootOrder: 5 + m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!23 &414293741 MeshRenderer: @@ -2863,7 +2868,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 596523079} - m_RootOrder: 10 + m_RootOrder: 11 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!23 &485539995 MeshRenderer: @@ -3287,7 +3292,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 596523079} - m_RootOrder: 6 + m_RootOrder: 7 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!23 &524449749 MeshRenderer: @@ -3759,6 +3764,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 840653958} + - {fileID: 978955574} - {fileID: 853683121} - {fileID: 1050940235} - {fileID: 804860713} @@ -4094,7 +4100,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 596523079} - m_RootOrder: 16 + m_RootOrder: 17 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!23 &697337479 MeshRenderer: @@ -4664,7 +4670,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 596523079} - m_RootOrder: 3 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!23 &804860714 MeshRenderer: @@ -5026,7 +5032,7 @@ GameObject: - component: {fileID: 853683123} - component: {fileID: 853683122} m_Layer: 0 - m_Name: SampleCubemapProperty + m_Name: SampleReflectedCubemapProperty m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -5044,7 +5050,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 596523079} - m_RootOrder: 1 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!23 &853683122 MeshRenderer: @@ -5393,6 +5399,101 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 925157434} m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &978955573 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 978955574} + - component: {fileID: 978955577} + - component: {fileID: 978955576} + - component: {fileID: 978955575} + m_Layer: 0 + m_Name: SampleCubemapProperty + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &978955574 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 978955573} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 3.01, y: 0, z: -2.02} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 596523079} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &978955575 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 978955573} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a958d8eb02753764abcbfb4550a6dc9e, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!135 &978955576 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 978955573} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!33 &978955577 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 978955573} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} --- !u!1 &991341882 GameObject: m_ObjectHideFlags: 0 @@ -5709,7 +5810,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 596523079} - m_RootOrder: 2 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!23 &1050940236 MeshRenderer: @@ -7324,7 +7425,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 596523079} - m_RootOrder: 9 + m_RootOrder: 10 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!23 &1343815777 MeshRenderer: @@ -7739,7 +7840,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 596523079} - m_RootOrder: 4 + m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 179.99998} --- !u!23 &1462505746 MeshRenderer: @@ -8820,7 +8921,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 596523079} - m_RootOrder: 12 + m_RootOrder: 13 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!23 &1701306556 MeshRenderer: @@ -8915,7 +9016,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 596523079} - m_RootOrder: 14 + m_RootOrder: 15 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!23 &1704958865 MeshRenderer: @@ -9549,7 +9650,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 596523079} - m_RootOrder: 8 + m_RootOrder: 9 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!23 &1785428292 MeshRenderer: @@ -10879,7 +10980,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 596523079} - m_RootOrder: 7 + m_RootOrder: 8 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!23 &1926593706 MeshRenderer: @@ -11110,7 +11211,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 596523079} - m_RootOrder: 15 + m_RootOrder: 16 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!23 &1976893046 MeshRenderer: @@ -11965,7 +12066,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 596523079} - m_RootOrder: 11 + m_RootOrder: 12 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!23 &2140997634 MeshRenderer: diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Texture/SampleCubemapProperty.mat b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Texture/SampleCubemapProperty.mat index 79486c8fe9e..ae80c1baf70 100644 --- a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Texture/SampleCubemapProperty.mat +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Texture/SampleCubemapProperty.mat @@ -24,5 +24,18 @@ Material: m_Texture: {fileID: 8900000, guid: f7111c407ddfe4109af9703cb740eaf9, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} m_Floats: [] m_Colors: [] + m_BuildTextureStacks: [] diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Texture/SampleCubemapProperty.mat.meta b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Texture/SampleCubemapProperty.mat.meta index 0452f46f1a5..c4d5dff46e0 100644 --- a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Texture/SampleCubemapProperty.mat.meta +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Texture/SampleCubemapProperty.mat.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: a958d8eb02753764abcbfb4550a6dc9e +guid: a221d79ca52eaf2418a0cc1726451402 NativeFormatImporter: externalObjects: {} mainObjectFileID: 2100000 diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Texture/SampleCubemapProperty.shadergraph b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Texture/SampleCubemapProperty.shadergraph index a68bbdbbf72..cd30da66a52 100644 --- a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Texture/SampleCubemapProperty.shadergraph +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Texture/SampleCubemapProperty.shadergraph @@ -1,52 +1,678 @@ { - "m_SerializedProperties": [ + "m_SGVersion": 2, + "m_Type": "UnityEditor.ShaderGraph.GraphData", + "m_ObjectId": "a778ec6afcc744189cfce8d114e3ae53", + "m_Properties": [ { - "typeInfo": { - "fullName": "UnityEditor.ShaderGraph.CubemapShaderProperty" - }, - "JSONnodeData": "{\n \"m_Name\": \"Cubemap\",\n \"m_GeneratePropertyBlock\": true,\n \"m_Guid\": {\n \"m_GuidSerialized\": \"21a8f887-848e-47ae-99a1-e1d639e4e717\"\n },\n \"m_DefaultReferenceName\": \"Cubemap_E35DF532\",\n \"m_OverrideReferenceName\": \"\",\n \"m_Value\": {\n \"m_SerializedCubemap\": \"{\\\"cubemap\\\":{\\\"fileID\\\":8900000,\\\"guid\\\":\\\"f7111c407ddfe4109af9703cb740eaf9\\\",\\\"type\\\":3}}\",\n \"m_Guid\": \"\"\n },\n \"m_Modifiable\": true\n}" + "m_Id": "1cefd9225355028db3dfbbfb8b1b95ec" } ], - "m_SerializableNodes": [ + "m_Keywords": [], + "m_Nodes": [ { - "typeInfo": { - "fullName": "UnityEditor.ShaderGraph.UnlitMasterNode" - }, - "JSONnodeData": "{\n \"m_GuidSerialized\": \"333812a6-5e88-4340-bbb3-f9ef94923b72\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Unlit Master\",\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": 0.0,\n \"y\": 0.0,\n \"width\": 0.0,\n \"height\": 0.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.PositionMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 9,\\n \\\"m_DisplayName\\\": \\\"Position\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Position\\\",\\n \\\"m_StageCapability\\\": 1,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_Labels\\\": [\\n \\\"X\\\",\\n \\\"Y\\\",\\n \\\"Z\\\"\\n ],\\n \\\"m_Space\\\": 0\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.ColorRGBMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"Color\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Color\\\",\\n \\\"m_StageCapability\\\": 2,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.5,\\n \\\"y\\\": 0.5,\\n \\\"z\\\": 0.5\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_Labels\\\": [\\n \\\"X\\\",\\n \\\"Y\\\",\\n \\\"Z\\\"\\n ],\\n \\\"m_ColorMode\\\": 0\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 7,\\n \\\"m_DisplayName\\\": \\\"Alpha\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Alpha\\\",\\n \\\"m_StageCapability\\\": 2,\\n \\\"m_Value\\\": 1.0,\\n \\\"m_DefaultValue\\\": 1.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 8,\\n \\\"m_DisplayName\\\": \\\"AlphaClipThreshold\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"AlphaClipThreshold\\\",\\n \\\"m_StageCapability\\\": 2,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.5,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n }\n ],\n \"m_PreviewExpanded\": true,\n \"m_SerializableSubShaders\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEngine.Rendering.LWRP.LightWeightUnlitSubShader\"\n },\n \"JSONnodeData\": \"{}\"\n }\n ],\n \"m_SurfaceType\": 0,\n \"m_AlphaMode\": 0,\n \"m_TwoSided\": false\n}" + "m_Id": "c3319c219142e588bb68f772d4fb4cc1" }, { - "typeInfo": { - "fullName": "UnityEditor.ShaderGraph.SampleCubemapNode" - }, - "JSONnodeData": "{\n \"m_GuidSerialized\": \"13ce2405-e357-4edc-9579-18fbdb4bb9bb\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Sample Cubemap\",\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -412.0,\n \"y\": 11.0,\n \"width\": 208.0,\n \"height\": 374.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector4MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"Out\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.CubemapInputMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"Cube\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Cube\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Cubemap\\\": {\\n \\\"m_SerializedCubemap\\\": \\\"{\\\\\\\"cubemap\\\\\\\":{\\\\\\\"instanceID\\\\\\\":0}}\\\",\\n \\\"m_Guid\\\": \\\"\\\"\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.ViewDirectionMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 2,\\n \\\"m_DisplayName\\\": \\\"ViewDir\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"ViewDir\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_Labels\\\": [\\n \\\"X\\\",\\n \\\"Y\\\",\\n \\\"Z\\\"\\n ],\\n \\\"m_Space\\\": 0\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.NormalMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 3,\\n \\\"m_DisplayName\\\": \\\"Normal\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Normal\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_Labels\\\": [\\n \\\"X\\\",\\n \\\"Y\\\",\\n \\\"Z\\\"\\n ],\\n \\\"m_Space\\\": 0\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.SamplerStateMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 5,\\n \\\"m_DisplayName\\\": \\\"Sampler\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Sampler\\\",\\n \\\"m_StageCapability\\\": 3\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 4,\\n \\\"m_DisplayName\\\": \\\"LOD\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"LOD\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n }\n ],\n \"m_PreviewExpanded\": true\n}" + "m_Id": "add6096074624674972b36856c29ec2d" }, { - "typeInfo": { - "fullName": "UnityEditor.ShaderGraph.PropertyNode" - }, - "JSONnodeData": "{\n \"m_GuidSerialized\": \"926ff6ad-5e9f-4f60-a8e9-9562b875253a\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Property\",\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -547.0,\n \"y\": 11.0,\n \"width\": 122.0,\n \"height\": 34.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.CubemapMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"Cubemap\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3\\n}\"\n }\n ],\n \"m_PreviewExpanded\": true,\n \"m_PropertyGuidSerialized\": \"21a8f887-848e-47ae-99a1-e1d639e4e717\"\n}" + "m_Id": "a73e575c68dc48c199755edac7042880" + }, + { + "m_Id": "06a8be25dd934bdba5355154d8c63af3" + }, + { + "m_Id": "510182d012af49fb89909ba2e9ec0153" + }, + { + "m_Id": "ceda94c751784843bc06ec2c1d144eba" + }, + { + "m_Id": "89cfaa9a6a8640d09315b9da8e858bf0" + }, + { + "m_Id": "fb0ee55a4fc1472d9281d50f3c0d1acd" } ], - "m_Groups": [], - "m_SerializableEdges": [ + "m_GroupDatas": [], + "m_StickyNoteDatas": [], + "m_Edges": [ { - "typeInfo": { - "fullName": "UnityEditor.Graphing.Edge" + "m_OutputSlot": { + "m_Node": { + "m_Id": "c3319c219142e588bb68f772d4fb4cc1" + }, + "m_SlotId": 0 }, - "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"926ff6ad-5e9f-4f60-a8e9-9562b875253a\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"13ce2405-e357-4edc-9579-18fbdb4bb9bb\"\n }\n}" + "m_InputSlot": { + "m_Node": { + "m_Id": "fb0ee55a4fc1472d9281d50f3c0d1acd" + }, + "m_SlotId": 1 + } }, { - "typeInfo": { - "fullName": "UnityEditor.Graphing.Edge" + "m_OutputSlot": { + "m_Node": { + "m_Id": "fb0ee55a4fc1472d9281d50f3c0d1acd" + }, + "m_SlotId": 0 }, - "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"13ce2405-e357-4edc-9579-18fbdb4bb9bb\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"333812a6-5e88-4340-bbb3-f9ef94923b72\"\n }\n}" + "m_InputSlot": { + "m_Node": { + "m_Id": "510182d012af49fb89909ba2e9ec0153" + }, + "m_SlotId": 0 + } } ], + "m_VertexContext": { + "m_Position": { + "x": 0.0, + "y": 0.0 + }, + "m_Blocks": [ + { + "m_Id": "add6096074624674972b36856c29ec2d" + }, + { + "m_Id": "a73e575c68dc48c199755edac7042880" + }, + { + "m_Id": "06a8be25dd934bdba5355154d8c63af3" + } + ] + }, + "m_FragmentContext": { + "m_Position": { + "x": 0.0, + "y": 200.0 + }, + "m_Blocks": [ + { + "m_Id": "510182d012af49fb89909ba2e9ec0153" + }, + { + "m_Id": "ceda94c751784843bc06ec2c1d144eba" + }, + { + "m_Id": "89cfaa9a6a8640d09315b9da8e858bf0" + } + ] + }, "m_PreviewData": { "serializedMesh": { "m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}", "m_Guid": "" } }, - "m_Path": "Shader Graph Tests/Input/Texture" -} \ No newline at end of file + "m_Path": "Shader Graph Tests/Input/Texture", + "m_ConcretePrecision": 0, + "m_OutputNode": { + "m_Id": "" + }, + "m_ActiveTargets": [ + { + "m_Id": "64e07f2be4bc4cfdb8a0f3c913aecf13" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "06a8be25dd934bdba5355154d8c63af3", + "m_Group": { + "m_Id": "" + }, + "m_Name": "VertexDescription.Tangent", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "1cf41afe9c9c4b999a24783654b834e2" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Tangent" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "16eefc57b7b04b77a83c6066d5a9c3bf", + "m_Id": 0, + "m_DisplayName": "Alpha", + "m_SlotType": 0, + "m_Priority": 2147483647, + "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.Internal.CubemapShaderProperty", + "m_ObjectId": "1cefd9225355028db3dfbbfb8b1b95ec", + "m_Guid": { + "m_GuidSerialized": "21a8f887-848e-47ae-99a1-e1d639e4e717" + }, + "m_Name": "Cubemap", + "m_DefaultReferenceName": "Cubemap_E35DF532", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": true, + "m_Precision": 0, + "m_GPUInstanced": false, + "m_Hidden": false, + "m_Value": { + "m_SerializedCubemap": "{\"cubemap\":{\"fileID\":8900000,\"guid\":\"f7111c407ddfe4109af9703cb740eaf9\",\"type\":3}}", + "m_Guid": "" + }, + "m_Modifiable": true +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.TangentMaterialSlot", + "m_ObjectId": "1cf41afe9c9c4b999a24783654b834e2", + "m_Id": 0, + "m_DisplayName": "Tangent", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Tangent", + "m_StageCapability": 1, + "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": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "221a190ea5ee4ed7a07a7876cab7ea0b", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "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_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", + "m_ObjectId": "28511e0404514b21a4a2a71407f17eb6", + "m_Id": 3, + "m_DisplayName": "Sampler", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Sampler", + "m_StageCapability": 3 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "2a700599e9614321a393b54d337aaec3", + "m_Id": 4, + "m_DisplayName": "LOD", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "LOD", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "510182d012af49fb89909ba2e9ec0153", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.BaseColor", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "d7b030773694407e95c339a9a31d7111" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.BaseColor" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot", + "m_ObjectId": "5bc5e44dffbe4698962aff6bf28c5d1c", + "m_Id": 0, + "m_DisplayName": "Position", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Position", + "m_StageCapability": 1, + "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": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget", + "m_ObjectId": "64e07f2be4bc4cfdb8a0f3c913aecf13", + "m_ActiveSubTarget": { + "m_Id": "df265ac4684e4e938acbb1207dcc009e" + }, + "m_SurfaceType": 0, + "m_AlphaMode": 0, + "m_TwoSided": false, + "m_AlphaClip": false, + "m_CustomEditorGUI": "" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "89cfaa9a6a8640d09315b9da8e858bf0", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.AlphaClipThreshold", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "a4af1570f3ce467081a6f4cdc22fb2b7" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.AlphaClipThreshold" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "a4af1570f3ce467081a6f4cdc22fb2b7", + "m_Id": 0, + "m_DisplayName": "Alpha Clip Threshold", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "AlphaClipThreshold", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.5, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "a73e575c68dc48c199755edac7042880", + "m_Group": { + "m_Id": "" + }, + "m_Name": "VertexDescription.Normal", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "f504e9ee72d84838a1493c702804d6e2" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Normal" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "add6096074624674972b36856c29ec2d", + "m_Group": { + "m_Id": "" + }, + "m_Name": "VertexDescription.Position", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "5bc5e44dffbe4698962aff6bf28c5d1c" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Position" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", + "m_ObjectId": "c205387cb6034af182ae0855fb7e2b2b", + "m_Id": 2, + "m_DisplayName": "Dir", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Dir", + "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_Space": 2 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "c3319c219142e588bb68f772d4fb4cc1", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -547.0, + "y": 11.0, + "width": 122.0, + "height": 34.0 + } + }, + "m_Slots": [ + { + "m_Id": "fb42f68b32d76289849c1c56571c79aa" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "1cefd9225355028db3dfbbfb8b1b95ec" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "ceda94c751784843bc06ec2c1d144eba", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.Alpha", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "16eefc57b7b04b77a83c6066d5a9c3bf" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.Alpha" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CubemapInputMaterialSlot", + "m_ObjectId": "d5fab5c38ef3499983fd4fd76b104823", + "m_Id": 1, + "m_DisplayName": "Cube", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Cube", + "m_StageCapability": 3, + "m_Cubemap": { + "m_SerializedCubemap": "{\"cubemap\":{\"instanceID\":0}}", + "m_Guid": "" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot", + "m_ObjectId": "d7b030773694407e95c339a9a31d7111", + "m_Id": 0, + "m_DisplayName": "Base Color", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "BaseColor", + "m_StageCapability": 2, + "m_Value": { + "x": 0.5, + "y": 0.5, + "z": 0.5 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_ColorMode": 0, + "m_DefaultColor": { + "r": 0.5, + "g": 0.5, + "b": 0.5, + "a": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalUnlitSubTarget", + "m_ObjectId": "df265ac4684e4e938acbb1207dcc009e" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", + "m_ObjectId": "f504e9ee72d84838a1493c702804d6e2", + "m_Id": 0, + "m_DisplayName": "Normal", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Normal", + "m_StageCapability": 1, + "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": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.SampleRawCubemapNode", + "m_ObjectId": "fb0ee55a4fc1472d9281d50f3c0d1acd", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Sample Cubemap", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -387.0000305175781, + "y": 25.000001907348634, + "width": 208.0, + "height": 350.0 + } + }, + "m_Slots": [ + { + "m_Id": "221a190ea5ee4ed7a07a7876cab7ea0b" + }, + { + "m_Id": "d5fab5c38ef3499983fd4fd76b104823" + }, + { + "m_Id": "c205387cb6034af182ae0855fb7e2b2b" + }, + { + "m_Id": "28511e0404514b21a4a2a71407f17eb6" + }, + { + "m_Id": "2a700599e9614321a393b54d337aaec3" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CubemapMaterialSlot", + "m_ObjectId": "fb42f68b32d76289849c1c56571c79aa", + "m_Id": 0, + "m_DisplayName": "Cubemap", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3 +} + diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Texture/SampleCubemapProperty.shadergraph.meta b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Texture/SampleCubemapProperty.shadergraph.meta index 8847eda7a11..6f14c13784a 100644 --- a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Texture/SampleCubemapProperty.shadergraph.meta +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Texture/SampleCubemapProperty.shadergraph.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b0e726e44403d2346bc0efbac129f619 +guid: b2c278bedc246644ea7502aa5201f71a ScriptedImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Texture/SampleReflectedCubemapProperty.mat b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Texture/SampleReflectedCubemapProperty.mat new file mode 100644 index 00000000000..acb4c7fd09c --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Texture/SampleReflectedCubemapProperty.mat @@ -0,0 +1,41 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: SampleReflectedCubemapProperty + m_Shader: {fileID: -6465566751694194690, guid: b0e726e44403d2346bc0efbac129f619, + type: 3} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - Cubemap_E35DF532: + m_Texture: {fileID: 8900000, guid: f7111c407ddfe4109af9703cb740eaf9, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: [] + m_Colors: [] + m_BuildTextureStacks: [] diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Texture/SampleReflectedCubemapProperty.mat.meta b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Texture/SampleReflectedCubemapProperty.mat.meta new file mode 100644 index 00000000000..0452f46f1a5 --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Texture/SampleReflectedCubemapProperty.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a958d8eb02753764abcbfb4550a6dc9e +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Texture/SampleReflectedCubemapProperty.shadergraph b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Texture/SampleReflectedCubemapProperty.shadergraph new file mode 100644 index 00000000000..a68bbdbbf72 --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Texture/SampleReflectedCubemapProperty.shadergraph @@ -0,0 +1,52 @@ +{ + "m_SerializedProperties": [ + { + "typeInfo": { + "fullName": "UnityEditor.ShaderGraph.CubemapShaderProperty" + }, + "JSONnodeData": "{\n \"m_Name\": \"Cubemap\",\n \"m_GeneratePropertyBlock\": true,\n \"m_Guid\": {\n \"m_GuidSerialized\": \"21a8f887-848e-47ae-99a1-e1d639e4e717\"\n },\n \"m_DefaultReferenceName\": \"Cubemap_E35DF532\",\n \"m_OverrideReferenceName\": \"\",\n \"m_Value\": {\n \"m_SerializedCubemap\": \"{\\\"cubemap\\\":{\\\"fileID\\\":8900000,\\\"guid\\\":\\\"f7111c407ddfe4109af9703cb740eaf9\\\",\\\"type\\\":3}}\",\n \"m_Guid\": \"\"\n },\n \"m_Modifiable\": true\n}" + } + ], + "m_SerializableNodes": [ + { + "typeInfo": { + "fullName": "UnityEditor.ShaderGraph.UnlitMasterNode" + }, + "JSONnodeData": "{\n \"m_GuidSerialized\": \"333812a6-5e88-4340-bbb3-f9ef94923b72\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Unlit Master\",\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": 0.0,\n \"y\": 0.0,\n \"width\": 0.0,\n \"height\": 0.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.PositionMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 9,\\n \\\"m_DisplayName\\\": \\\"Position\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Position\\\",\\n \\\"m_StageCapability\\\": 1,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_Labels\\\": [\\n \\\"X\\\",\\n \\\"Y\\\",\\n \\\"Z\\\"\\n ],\\n \\\"m_Space\\\": 0\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.ColorRGBMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"Color\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Color\\\",\\n \\\"m_StageCapability\\\": 2,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.5,\\n \\\"y\\\": 0.5,\\n \\\"z\\\": 0.5\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_Labels\\\": [\\n \\\"X\\\",\\n \\\"Y\\\",\\n \\\"Z\\\"\\n ],\\n \\\"m_ColorMode\\\": 0\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 7,\\n \\\"m_DisplayName\\\": \\\"Alpha\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Alpha\\\",\\n \\\"m_StageCapability\\\": 2,\\n \\\"m_Value\\\": 1.0,\\n \\\"m_DefaultValue\\\": 1.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 8,\\n \\\"m_DisplayName\\\": \\\"AlphaClipThreshold\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"AlphaClipThreshold\\\",\\n \\\"m_StageCapability\\\": 2,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.5,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n }\n ],\n \"m_PreviewExpanded\": true,\n \"m_SerializableSubShaders\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEngine.Rendering.LWRP.LightWeightUnlitSubShader\"\n },\n \"JSONnodeData\": \"{}\"\n }\n ],\n \"m_SurfaceType\": 0,\n \"m_AlphaMode\": 0,\n \"m_TwoSided\": false\n}" + }, + { + "typeInfo": { + "fullName": "UnityEditor.ShaderGraph.SampleCubemapNode" + }, + "JSONnodeData": "{\n \"m_GuidSerialized\": \"13ce2405-e357-4edc-9579-18fbdb4bb9bb\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Sample Cubemap\",\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -412.0,\n \"y\": 11.0,\n \"width\": 208.0,\n \"height\": 374.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector4MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"Out\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.CubemapInputMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"Cube\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Cube\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Cubemap\\\": {\\n \\\"m_SerializedCubemap\\\": \\\"{\\\\\\\"cubemap\\\\\\\":{\\\\\\\"instanceID\\\\\\\":0}}\\\",\\n \\\"m_Guid\\\": \\\"\\\"\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.ViewDirectionMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 2,\\n \\\"m_DisplayName\\\": \\\"ViewDir\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"ViewDir\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_Labels\\\": [\\n \\\"X\\\",\\n \\\"Y\\\",\\n \\\"Z\\\"\\n ],\\n \\\"m_Space\\\": 0\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.NormalMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 3,\\n \\\"m_DisplayName\\\": \\\"Normal\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Normal\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_Labels\\\": [\\n \\\"X\\\",\\n \\\"Y\\\",\\n \\\"Z\\\"\\n ],\\n \\\"m_Space\\\": 0\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.SamplerStateMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 5,\\n \\\"m_DisplayName\\\": \\\"Sampler\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Sampler\\\",\\n \\\"m_StageCapability\\\": 3\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 4,\\n \\\"m_DisplayName\\\": \\\"LOD\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"LOD\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n }\n ],\n \"m_PreviewExpanded\": true\n}" + }, + { + "typeInfo": { + "fullName": "UnityEditor.ShaderGraph.PropertyNode" + }, + "JSONnodeData": "{\n \"m_GuidSerialized\": \"926ff6ad-5e9f-4f60-a8e9-9562b875253a\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Property\",\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -547.0,\n \"y\": 11.0,\n \"width\": 122.0,\n \"height\": 34.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.CubemapMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"Cubemap\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3\\n}\"\n }\n ],\n \"m_PreviewExpanded\": true,\n \"m_PropertyGuidSerialized\": \"21a8f887-848e-47ae-99a1-e1d639e4e717\"\n}" + } + ], + "m_Groups": [], + "m_SerializableEdges": [ + { + "typeInfo": { + "fullName": "UnityEditor.Graphing.Edge" + }, + "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"926ff6ad-5e9f-4f60-a8e9-9562b875253a\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"13ce2405-e357-4edc-9579-18fbdb4bb9bb\"\n }\n}" + }, + { + "typeInfo": { + "fullName": "UnityEditor.Graphing.Edge" + }, + "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"13ce2405-e357-4edc-9579-18fbdb4bb9bb\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"333812a6-5e88-4340-bbb3-f9ef94923b72\"\n }\n}" + } + ], + "m_PreviewData": { + "serializedMesh": { + "m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}", + "m_Guid": "" + } + }, + "m_Path": "Shader Graph Tests/Input/Texture" +} \ No newline at end of file diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Texture/SampleReflectedCubemapProperty.shadergraph.meta b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Texture/SampleReflectedCubemapProperty.shadergraph.meta new file mode 100644 index 00000000000..8847eda7a11 --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Texture/SampleReflectedCubemapProperty.shadergraph.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: b0e726e44403d2346bc0efbac129f619 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} From e25cb7f5dd7c9f195d557d811885e11857eb5c5e Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Wed, 21 Oct 2020 22:31:39 +0200 Subject: [PATCH 3/6] fix issue in test --- TestProjects/ShaderGraph/Assets/Scenes/InputNodes.unity | 2 +- .../Graphs/Input/Texture/SampleCubemapProperty.mat | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/TestProjects/ShaderGraph/Assets/Scenes/InputNodes.unity b/TestProjects/ShaderGraph/Assets/Scenes/InputNodes.unity index 08a7f2c47da..df7f573ac79 100644 --- a/TestProjects/ShaderGraph/Assets/Scenes/InputNodes.unity +++ b/TestProjects/ShaderGraph/Assets/Scenes/InputNodes.unity @@ -5451,7 +5451,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 2100000, guid: a958d8eb02753764abcbfb4550a6dc9e, type: 2} + - {fileID: 2100000, guid: a221d79ca52eaf2418a0cc1726451402, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Texture/SampleCubemapProperty.mat b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Texture/SampleCubemapProperty.mat index ae80c1baf70..9116e724b2d 100644 --- a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Texture/SampleCubemapProperty.mat +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Texture/SampleCubemapProperty.mat @@ -8,7 +8,7 @@ Material: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: SampleCubemapProperty - m_Shader: {fileID: -6465566751694194690, guid: b0e726e44403d2346bc0efbac129f619, + m_Shader: {fileID: -6465566751694194690, guid: b2c278bedc246644ea7502aa5201f71a, type: 3} m_ShaderKeywords: m_LightmapFlags: 4 From f6dfd598ed2036c81ffc68db17e60024b89c4539 Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Thu, 22 Oct 2020 00:16:23 +0200 Subject: [PATCH 4/6] update reference screenshots --- .../Linear/WindowsEditor/Direct3D11/None/InputNodes.png | 4 ++-- .../Linear/WindowsPlayer/Direct3D11/None/InputNodes.png | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png index 9afa5dc86b1..7df3e93baf9 100644 --- a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png +++ b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6c0594d5cc6af44c8cf13843a176d32e5e4637c1662706341ed5226a1f119f97 -size 573979 +oid sha256:b2b6637ed4a83705ff8cf30e17ebcc573651c55e4bb18070031e346d979f2de3 +size 522856 diff --git a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/None/InputNodes.png b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/None/InputNodes.png index 9afa5dc86b1..7df3e93baf9 100644 --- a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/None/InputNodes.png +++ b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/None/InputNodes.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6c0594d5cc6af44c8cf13843a176d32e5e4637c1662706341ed5226a1f119f97 -size 573979 +oid sha256:b2b6637ed4a83705ff8cf30e17ebcc573651c55e4bb18070031e346d979f2de3 +size 522856 From da8eb99fcb9266f75544cad1f6fbc9442f7c2099 Mon Sep 17 00:00:00 2001 From: Sharlene Tan Date: Wed, 21 Oct 2020 17:23:50 -0700 Subject: [PATCH 5/6] Edited Sample Cubemap Node page --- com.unity.shadergraph/CHANGELOG.md | 2 +- com.unity.shadergraph/Documentation~/Sample-Cubemap-Node.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/com.unity.shadergraph/CHANGELOG.md b/com.unity.shadergraph/CHANGELOG.md index aea089458fb..81627232570 100644 --- a/com.unity.shadergraph/CHANGELOG.md +++ b/com.unity.shadergraph/CHANGELOG.md @@ -14,7 +14,7 @@ The version number for this package has increased due to a version update of a r ### Added ### Changed -- Rename the current Sample Cubemap Node -> Sample Reflected Cubemap Node and create a new Sample Cubemap Node which sample cubemap with a direction +- Renamed the existing Sample Cubemap Node to Sample Reflected Cubemap Node, and created a new Sample Cubemap Node that samples cubemaps with a direction. ### Fixed - Fixed an issue where old ShaderGraphs would import non-deterministically, changing their embedded property names each import [1283800] diff --git a/com.unity.shadergraph/Documentation~/Sample-Cubemap-Node.md b/com.unity.shadergraph/Documentation~/Sample-Cubemap-Node.md index 961001716b6..969a0a54797 100644 --- a/com.unity.shadergraph/Documentation~/Sample-Cubemap-Node.md +++ b/com.unity.shadergraph/Documentation~/Sample-Cubemap-Node.md @@ -2,7 +2,7 @@ ## Description -Samples a **Cubemap** and returns a **Vector 4** color value for use in the shader. Requires **Direction** inputs in world space to sample the **Cubemap**. You can achieve a blurring effect by sampling at a different Level of Detail using the **LOD** input. You can also define a custom **Sampler State** using the **Sampler** input. +Samples a **Cubemap** and returns a **Vector 4** color value for use in the shader. Requires a **Direction** input in world space to sample the **Cubemap**. You can achieve a blurring effect by sampling at a different Level of Detail using the **LOD** input. You can also define a custom **Sampler State** using the **Sampler** input. ## Ports From 4ce3b97e088ab9e33381618f45ad5e4d934564ae Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Thu, 22 Oct 2020 10:23:09 +0200 Subject: [PATCH 6/6] adress PR feedback on doc --- com.unity.shadergraph/Documentation~/Input-Nodes.md | 2 +- com.unity.shadergraph/Documentation~/Upgrade-Guide-10-0-x.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/com.unity.shadergraph/Documentation~/Input-Nodes.md b/com.unity.shadergraph/Documentation~/Input-Nodes.md index 0bbb0f7c474..f21a02cb834 100644 --- a/com.unity.shadergraph/Documentation~/Input-Nodes.md +++ b/com.unity.shadergraph/Documentation~/Input-Nodes.md @@ -90,7 +90,7 @@ ## Texture -|[Cubemap Asset](Cubemap-Asset-Node.md)|[Sample Cubemap](Sample-Cubemap-Node.md)|[Sample Cubemap](Sample-Reflected-Cubemap-Node.md)| +|[Cubemap Asset](Cubemap-Asset-Node.md)|[Sample Cubemap](Sample-Cubemap-Node.md)| |:--------:|:------:| |[![Image](images/CubemapAssetNodeThumb.png)](Combine-Node)|![](images/SampleCubemapNodeThumb.png)| | Defines a constant Cubemap Asset for use in the shader. | Samples a Cubemap and returns a Vector 4 color value for use in the shader. | diff --git a/com.unity.shadergraph/Documentation~/Upgrade-Guide-10-0-x.md b/com.unity.shadergraph/Documentation~/Upgrade-Guide-10-0-x.md index 0c21412c36c..745bf315385 100644 --- a/com.unity.shadergraph/Documentation~/Upgrade-Guide-10-0-x.md +++ b/com.unity.shadergraph/Documentation~/Upgrade-Guide-10-0-x.md @@ -6,7 +6,7 @@ Shader Graph has renamed the **Vector 1** property as **Float** in both the Vect ## Renamed Sample Cubemap -Shader Graph has renamed the previous Sample Cubemap Node in Sample Reflected Cubemap and have added a new Sample Cubemap which used world space direction. +Shader Graph has renamed the previous Sample Cubemap Node **to** Sample Reflected Cubemap**,** and **has** added a new Sample Cubemap**,** which **uses** world space direction. ## Master Stack graph output