From c2dab790a5d0b6707774d0b6ed19f55c4618cdd7 Mon Sep 17 00:00:00 2001 From: Chris Tchou Date: Tue, 21 Sep 2021 14:25:58 -0700 Subject: [PATCH] [ShaderGraph] [2022.1/Ruby] Adding anisotropic option (#5657) * Adding anisotropic option * Shortening name * Adding changelog * Adding inline anisotropic test * Updating Test Images * Moved anisotropic control to node inspector, changed wording # Conflicts: # com.unity.shadergraph/CHANGELOG.md --- .../Android/Vulkan/None/SamplerStateTests.png | 4 +- .../Metal/None/SamplerStateTests.png | 4 +- .../Vulkan/None/SamplerStateTests.png | 4 +- .../Vulkan/None/SamplerStateTests.png | 4 +- .../Metal/None/SamplerStateTests.png | 4 +- .../Direct3D11/None/SamplerStateTests.png | 4 +- .../Direct3D11/None/SamplerStateTests.png | 4 +- .../Assets/Scenes/SamplerStateTests.unity | 103 +- .../InlineAnisotropicSampler.mat | 57 + .../InlineAnisotropicSampler.mat.meta | 8 + .../InlineAnisotropicSampler.shadergraph | 1623 +++++++++++++++++ .../InlineAnisotropicSampler.shadergraph.meta | 10 + com.unity.shadergraph/CHANGELOG.md | 1 + .../Editor/Data/Graphs/TextureSamplerState.cs | 49 +- .../Nodes/Input/Texture/SamplerStateNode.cs | 26 +- .../SamplerStateNodePropertyDrawer.cs | 34 + .../SamplerStateNodePropertyDrawer.cs.meta | 11 + 17 files changed, 1925 insertions(+), 25 deletions(-) create mode 100644 TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/SamplerStates/InlineAnisotropicSampler.mat create mode 100644 TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/SamplerStates/InlineAnisotropicSampler.mat.meta create mode 100644 TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/SamplerStates/InlineAnisotropicSampler.shadergraph create mode 100644 TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/SamplerStates/InlineAnisotropicSampler.shadergraph.meta create mode 100644 com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/SamplerStateNodePropertyDrawer.cs create mode 100644 com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/SamplerStateNodePropertyDrawer.cs.meta diff --git a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/Android/Vulkan/None/SamplerStateTests.png b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/Android/Vulkan/None/SamplerStateTests.png index 13f29385d1c..6c15cd60765 100644 --- a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/Android/Vulkan/None/SamplerStateTests.png +++ b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/Android/Vulkan/None/SamplerStateTests.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bfd3be966990aee09462cae2261ad62dc1aa81db65438e5ef1f58c7daf1a8969 -size 271708 +oid sha256:2da2cc7dfbcf875b974c9e26bf25142fbcec7a763fa71db58229e9440d4a7849 +size 411403 diff --git a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/IPhonePlayer/Metal/None/SamplerStateTests.png b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/IPhonePlayer/Metal/None/SamplerStateTests.png index a1a4acc5730..c18279a9340 100644 --- a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/IPhonePlayer/Metal/None/SamplerStateTests.png +++ b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/IPhonePlayer/Metal/None/SamplerStateTests.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:610208030a561fbfc74a6a0729253dd829bc36b9dcf7a7f6a40c85702a1a7fe5 -size 288343 +oid sha256:a468316e81a521750f59748c9bfce2add9eeb5f76cf85e61a7e4c72e104faf70 +size 416152 diff --git a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/SamplerStateTests.png b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/SamplerStateTests.png index ef815f7241a..5d7103a7dd4 100644 --- a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/SamplerStateTests.png +++ b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/SamplerStateTests.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3f5a69d2cb71d5a22a6bf5146134aed87809cced8a9cba103114ac82fe86eb92 -size 271051 +oid sha256:3bb528cb905627b48093825254044f443f7abc2b4f1bad5a2d4e32033f8747f1 +size 400920 diff --git a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/LinuxPlayer/Vulkan/None/SamplerStateTests.png b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/LinuxPlayer/Vulkan/None/SamplerStateTests.png index ef815f7241a..5d7103a7dd4 100644 --- a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/LinuxPlayer/Vulkan/None/SamplerStateTests.png +++ b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/LinuxPlayer/Vulkan/None/SamplerStateTests.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3f5a69d2cb71d5a22a6bf5146134aed87809cced8a9cba103114ac82fe86eb92 -size 271051 +oid sha256:3bb528cb905627b48093825254044f443f7abc2b4f1bad5a2d4e32033f8747f1 +size 400920 diff --git a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/SamplerStateTests.png b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/SamplerStateTests.png index 9c1a0575d95..d7354f6f562 100644 --- a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/SamplerStateTests.png +++ b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/SamplerStateTests.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:22af5915c01fd626bc716dfe462d61e63b0457d4d4f50b3d8c6be93b232e1fe7 -size 281438 +oid sha256:2d51c029be8a11b27b0ffbe8057b5c89db0969981321101f146051e3486a8771 +size 233332 diff --git a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/SamplerStateTests.png b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/SamplerStateTests.png index c208edecfc3..b2227bbf78b 100644 --- a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/SamplerStateTests.png +++ b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/SamplerStateTests.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e7f33e42676eb19406b695461cfec29370430b26e4242480ef6cbc4283e5a502 -size 271112 +oid sha256:cab409e4142955041a628474cb5cb70e9e8a1b7eeb80bfa1d1cdd7d348bb925b +size 400962 diff --git a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/None/SamplerStateTests.png b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/None/SamplerStateTests.png index c208edecfc3..b2227bbf78b 100644 --- a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/None/SamplerStateTests.png +++ b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/None/SamplerStateTests.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e7f33e42676eb19406b695461cfec29370430b26e4242480ef6cbc4283e5a502 -size 271112 +oid sha256:cab409e4142955041a628474cb5cb70e9e8a1b7eeb80bfa1d1cdd7d348bb925b +size 400962 diff --git a/TestProjects/ShaderGraph/Assets/Scenes/SamplerStateTests.unity b/TestProjects/ShaderGraph/Assets/Scenes/SamplerStateTests.unity index 18c49fa4baf..8df05db4efa 100644 --- a/TestProjects/ShaderGraph/Assets/Scenes/SamplerStateTests.unity +++ b/TestProjects/ShaderGraph/Assets/Scenes/SamplerStateTests.unity @@ -148,12 +148,14 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 24034508} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: -1, y: 0, z: 1} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: - {fileID: 208238512} - {fileID: 1402671932} - {fileID: 1679244218} + - {fileID: 1850167078} m_Father: {fileID: 0} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -169,7 +171,7 @@ GameObject: - component: {fileID: 208238514} - component: {fileID: 208238513} m_Layer: 0 - m_Name: CustomFunctionString + m_Name: SameSamplerStates m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -183,8 +185,9 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 208238511} m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} - m_LocalPosition: {x: -2, y: 0, z: 0} + m_LocalPosition: {x: 2, y: 0, z: -2} m_LocalScale: {x: 2, y: 2, z: 2} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 24034509} m_RootOrder: 0 @@ -200,6 +203,7 @@ MeshRenderer: m_CastShadows: 1 m_ReceiveShadows: 1 m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -310,7 +314,7 @@ Camera: far clip plane: 1000 field of view: 60 orthographic: 1 - orthographic size: 1.7 + orthographic size: 2 m_Depth: -1 m_CullingMask: serializedVersion: 2 @@ -336,6 +340,7 @@ Transform: m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} m_LocalPosition: {x: 0, y: 10, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} m_RootOrder: 0 @@ -362,6 +367,7 @@ MonoBehaviour: serializedVersion: 2 m_Bits: 1 m_VolumeTrigger: {fileID: 0} + m_VolumeFrameworkUpdateModeOption: 2 m_RenderPostProcessing: 0 m_Antialiasing: 0 m_AntialiasingQuality: 2 @@ -400,6 +406,7 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 2, y: 2, z: 2} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 24034509} m_RootOrder: 1 @@ -415,6 +422,7 @@ MeshRenderer: m_CastShadows: 1 m_ReceiveShadows: 1 m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -465,7 +473,7 @@ GameObject: - component: {fileID: 1679244217} - component: {fileID: 1679244216} m_Layer: 0 - m_Name: Preview + m_Name: DifferentSamplerStates m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -482,6 +490,7 @@ MeshRenderer: m_CastShadows: 1 m_ReceiveShadows: 1 m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -530,7 +539,91 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} m_LocalPosition: {x: 2, y: 0, z: 0} m_LocalScale: {x: 2, y: 2, z: 2} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 24034509} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} +--- !u!1 &1850167077 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1850167078} + - component: {fileID: 1850167080} + - component: {fileID: 1850167079} + m_Layer: 0 + m_Name: InlineAnisotropicSampler + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1850167078 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1850167077} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -2} + m_LocalScale: {x: 2, y: 2, z: 2} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 24034509} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} +--- !u!23 &1850167079 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1850167077} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 4294967295 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 440ad02572c7d33448c5ce5f5e858cd5, 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: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + 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!33 &1850167080 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1850167077} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/SamplerStates/InlineAnisotropicSampler.mat b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/SamplerStates/InlineAnisotropicSampler.mat new file mode 100644 index 00000000000..8299814a6fe --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/SamplerStates/InlineAnisotropicSampler.mat @@ -0,0 +1,57 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-1912330463391763020 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 5 +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: InlineAnisotropicSampler + m_Shader: {fileID: -6465566751694194690, guid: 17c146f984007bc4698e13061114e5a0, + type: 3} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AnisoBlurCustomFunction_0b915a068776433499d033832b94a3ce_tex_0: + m_Texture: {fileID: 2800000, guid: 53ee4b410c7f7564b8fd0ff023cfc560, 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_Ints: [] + m_Floats: + - _QueueControl: 0 + - _QueueOffset: 0 + m_Colors: [] + m_BuildTextureStacks: [] diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/SamplerStates/InlineAnisotropicSampler.mat.meta b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/SamplerStates/InlineAnisotropicSampler.mat.meta new file mode 100644 index 00000000000..3a416f41ca1 --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/SamplerStates/InlineAnisotropicSampler.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 440ad02572c7d33448c5ce5f5e858cd5 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/SamplerStates/InlineAnisotropicSampler.shadergraph b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/SamplerStates/InlineAnisotropicSampler.shadergraph new file mode 100644 index 00000000000..961175aee94 --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/SamplerStates/InlineAnisotropicSampler.shadergraph @@ -0,0 +1,1623 @@ +{ + "m_SGVersion": 3, + "m_Type": "UnityEditor.ShaderGraph.GraphData", + "m_ObjectId": "01c058523f4e43d388463e0a9b28ae52", + "m_Properties": [], + "m_Keywords": [], + "m_Dropdowns": [], + "m_CategoryData": [ + { + "m_Id": "9a2e04b9639c447a851cc7df706cb078" + } + ], + "m_Nodes": [ + { + "m_Id": "b693d3b9a40347ae9185bdb9fdf7cadd" + }, + { + "m_Id": "5ccac3daeae84f24af5579a757cb5e2c" + }, + { + "m_Id": "d724a48404804daea89b97ccf1341150" + }, + { + "m_Id": "f42fb9ac22664c05852719ca85437e42" + }, + { + "m_Id": "dc1fb6300b4b47d8a84b9f8de9f2cf0d" + }, + { + "m_Id": "0b915a068776433499d033832b94a3ce" + }, + { + "m_Id": "ce0a2ad5ffce4515a5ad602912a24c14" + }, + { + "m_Id": "96e4837db75e403297b39bb8add4a8c0" + }, + { + "m_Id": "9e5ade5a5f3d4a34b7ae067db2595dae" + }, + { + "m_Id": "ebbe25b03f8f42cf8f6515563f4919a9" + }, + { + "m_Id": "a5ad0b697c0c4b70bb7b8362e451d4b1" + }, + { + "m_Id": "4bb51c34020b450f922c5ca8d9dacaf9" + }, + { + "m_Id": "9be4dccd1307492ca3d721ea6e8b85c3" + }, + { + "m_Id": "25058258925a465aa262b90107cdbce1" + } + ], + "m_GroupDatas": [], + "m_StickyNoteDatas": [], + "m_Edges": [ + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "0b915a068776433499d033832b94a3ce" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "f42fb9ac22664c05852719ca85437e42" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "25058258925a465aa262b90107cdbce1" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "a5ad0b697c0c4b70bb7b8362e451d4b1" + }, + "m_SlotId": 2 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "4bb51c34020b450f922c5ca8d9dacaf9" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "96e4837db75e403297b39bb8add4a8c0" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "4bb51c34020b450f922c5ca8d9dacaf9" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "9e5ade5a5f3d4a34b7ae067db2595dae" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "96e4837db75e403297b39bb8add4a8c0" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "ebbe25b03f8f42cf8f6515563f4919a9" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "9be4dccd1307492ca3d721ea6e8b85c3" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "a5ad0b697c0c4b70bb7b8362e451d4b1" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "9e5ade5a5f3d4a34b7ae067db2595dae" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "ebbe25b03f8f42cf8f6515563f4919a9" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "a5ad0b697c0c4b70bb7b8362e451d4b1" + }, + "m_SlotId": 4 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "4bb51c34020b450f922c5ca8d9dacaf9" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "ce0a2ad5ffce4515a5ad602912a24c14" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "0b915a068776433499d033832b94a3ce" + }, + "m_SlotId": 4 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "dc1fb6300b4b47d8a84b9f8de9f2cf0d" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "0b915a068776433499d033832b94a3ce" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "ebbe25b03f8f42cf8f6515563f4919a9" + }, + "m_SlotId": 6 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "0b915a068776433499d033832b94a3ce" + }, + "m_SlotId": 2 + } + } + ], + "m_VertexContext": { + "m_Position": { + "x": 226.0, + "y": 72.0 + }, + "m_Blocks": [ + { + "m_Id": "b693d3b9a40347ae9185bdb9fdf7cadd" + }, + { + "m_Id": "5ccac3daeae84f24af5579a757cb5e2c" + }, + { + "m_Id": "d724a48404804daea89b97ccf1341150" + } + ] + }, + "m_FragmentContext": { + "m_Position": { + "x": 226.0, + "y": 272.0 + }, + "m_Blocks": [ + { + "m_Id": "f42fb9ac22664c05852719ca85437e42" + } + ] + }, + "m_PreviewData": { + "serializedMesh": { + "m_SerializedMesh": "{\"mesh\":{\"fileID\":10202,\"guid\":\"0000000000000000e000000000000000\",\"type\":0}}", + "m_Guid": "" + }, + "preventRotation": false + }, + "m_Path": "Shader Graphs", + "m_GraphPrecision": 1, + "m_PreviewMode": 2, + "m_OutputNode": { + "m_Id": "" + }, + "m_ActiveTargets": [ + { + "m_Id": "efffdc1f40304d6f9b8a956c6a387d90" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "0af84794dc444226b066fdc12497c10d", + "m_Id": 5, + "m_DisplayName": "RGB", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "RGB", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.CustomFunctionNode", + "m_ObjectId": "0b915a068776433499d033832b94a3ce", + "m_Group": { + "m_Id": "" + }, + "m_Name": "AnisoBlur (Custom Function)", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -215.99998474121095, + "y": 117.0, + "width": 208.99998474121095, + "height": 350.0 + } + }, + "m_Slots": [ + { + "m_Id": "32858a6172e4465fb3c4c156f9955381" + }, + { + "m_Id": "6148adfb322e451693858637c2e32371" + }, + { + "m_Id": "9e7a824370ca477c8a8cd705d7d872df" + }, + { + "m_Id": "8d3a52f16cb54573bab61714156b970a" + }, + { + "m_Id": "9a846d68d57a481a91ae4458b04d02bb" + }, + { + "m_Id": "5f264919e2f043698884e6c61b7e91d0" + } + ], + "synonyms": [ + "code", + "HLSL" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SourceType": 1, + "m_FunctionName": "AnisoBlur", + "m_FunctionSource": "", + "m_FunctionBody": "result = SAMPLE_TEXTURE2D_GRAD(tex, ss, uv, dpdx, dpdy);\n" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalUnlitSubTarget", + "m_ObjectId": "0e49892ffe094983bf6f8fa579b8cb4a" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1Node", + "m_ObjectId": "25058258925a465aa262b90107cdbce1", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Float", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1624.0, + "y": 598.0, + "width": 126.0, + "height": 77.0 + } + }, + "m_Slots": [ + { + "m_Id": "9e97b3405fc543c28b735c46067c7b4e" + }, + { + "m_Id": "f595cb66e6144e7998dcadc876415e04" + } + ], + "synonyms": [ + "Vector 1", + "1", + "v1", + "vec1", + "scalar" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Value": 0.0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "32858a6172e4465fb3c4c156f9955381", + "m_Id": 4, + "m_DisplayName": "uv", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "uv", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "32e0a7d5feca46ae8962f4fa9c633f5e", + "m_Id": 3, + "m_DisplayName": "Frequency", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Frequency", + "m_StageCapability": 3, + "m_Value": { + "x": 1.0, + "y": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "38a0425b6d04417981e17c15612428e9", + "m_Id": 2, + "m_DisplayName": "B", + "m_SlotType": 0, + "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.ColorRGBMaterialSlot", + "m_ObjectId": "44d05cf2982741d186fac6660e27cb7b", + "m_Id": 2, + "m_DisplayName": "Color B", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "ColorB", + "m_StageCapability": 3, + "m_Value": { + "x": 0.699999988079071, + "y": 0.699999988079071, + "z": 0.699999988079071 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_ColorMode": 0, + "m_DefaultColor": { + "r": 0.699999988079071, + "g": 0.699999988079071, + "b": 0.699999988079071, + "a": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot", + "m_ObjectId": "4b565ee0dfa74c1a9554efd09104f315", + "m_Id": 1, + "m_DisplayName": "Color A", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "ColorA", + "m_StageCapability": 3, + "m_Value": { + "x": 1.0, + "y": 1.0, + "z": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_ColorMode": 0, + "m_DefaultColor": { + "r": 0.20000000298023225, + "g": 0.20000000298023225, + "b": 0.20000000298023225, + "a": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.RedirectNodeData", + "m_ObjectId": "4bb51c34020b450f922c5ca8d9dacaf9", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Redirect Node", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1095.0, + "y": 543.0, + "width": 56.0, + "height": 24.0 + } + }, + "m_Slots": [ + { + "m_Id": "fb9f8b2fccab4ce7818eb14f65e76398" + }, + { + "m_Id": "5b2639cc0a1a4bb19b02ad22bc56dcf9" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "569c29608a844a93b56d8ab55440088f", + "m_Id": 1, + "m_DisplayName": "Tiling", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Tiling", + "m_StageCapability": 3, + "m_Value": { + "x": 5.0, + "y": 5.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "5b2639cc0a1a4bb19b02ad22bc56dcf9", + "m_Id": 1, + "m_DisplayName": "", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "5ccac3daeae84f24af5579a757cb5e2c", + "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": "920b7eccf2354acfb98d2a2e2ac1950d" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Normal" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "5f264919e2f043698884e6c61b7e91d0", + "m_Id": 3, + "m_DisplayName": "result", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "result", + "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.DynamicVectorMaterialSlot", + "m_ObjectId": "60e7d82dab9d40ddab80bbabea0dab8d", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot", + "m_ObjectId": "6148adfb322e451693858637c2e32371", + "m_Id": 0, + "m_DisplayName": "tex", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "tex", + "m_StageCapability": 3, + "m_BareResource": false, + "m_Texture": { + "m_SerializedTexture": "{\"texture\":{\"fileID\":2800000,\"guid\":\"53ee4b410c7f7564b8fd0ff023cfc560\",\"type\":3}}", + "m_Guid": "" + }, + "m_DefaultType": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.UVMaterialSlot", + "m_ObjectId": "64ccc97adbec402d9872bc16835b5ccc", + "m_Id": 0, + "m_DisplayName": "UV", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "UV", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [], + "m_Channel": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot", + "m_ObjectId": "654dfa58fa83492ba5141b54abb94521", + "m_Id": 0, + "m_DisplayName": "Position", + "m_SlotType": 0, + "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.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "6d11ca6535c84b24b256545de7002daf", + "m_Id": 3, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "8b56c467a8ee44a49dd5a029b5716d37", + "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.Vector2MaterialSlot", + "m_ObjectId": "8d3a52f16cb54573bab61714156b970a", + "m_Id": 2, + "m_DisplayName": "dpdx", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "dpdx", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "90f6a8b520a0454bb3159cd9146c851e", + "m_Id": 2, + "m_DisplayName": "Offset", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Offset", + "m_StageCapability": 3, + "m_Value": { + "x": -1.0, + "y": -1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", + "m_ObjectId": "920b7eccf2354acfb98d2a2e2ac1950d", + "m_Id": 0, + "m_DisplayName": "Normal", + "m_SlotType": 0, + "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.SineNode", + "m_ObjectId": "96e4837db75e403297b39bb8add4a8c0", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Sine", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -984.0, + "y": 449.0, + "width": 128.0, + "height": 94.0 + } + }, + "m_Slots": [ + { + "m_Id": "8b56c467a8ee44a49dd5a029b5716d37" + }, + { + "m_Id": "60e7d82dab9d40ddab80bbabea0dab8d" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "98703d5abe604bb19f70609b8c61423f", + "m_Id": 1, + "m_DisplayName": "G", + "m_SlotType": 0, + "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.CategoryData", + "m_ObjectId": "9a2e04b9639c447a851cc7df706cb078", + "m_Name": "", + "m_ChildObjectList": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "9a846d68d57a481a91ae4458b04d02bb", + "m_Id": 5, + "m_DisplayName": "dpdy", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "dpdy", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1Node", + "m_ObjectId": "9be4dccd1307492ca3d721ea6e8b85c3", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Float", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1624.0, + "y": 514.0, + "width": 126.0, + "height": 77.0 + } + }, + "m_Slots": [ + { + "m_Id": "b3393711de364b089ad5109db00d263d" + }, + { + "m_Id": "e0791020851e43b994968495334bda2b" + } + ], + "synonyms": [ + "Vector 1", + "1", + "v1", + "vec1", + "scalar" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Value": 0.0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CosineNode", + "m_ObjectId": "9e5ade5a5f3d4a34b7ae067db2595dae", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Cosine", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -984.0, + "y": 543.0, + "width": 128.0, + "height": 94.0 + } + }, + "m_Slots": [ + { + "m_Id": "bba2b75c89f64a03a7dbcb2b76c79ebe" + }, + { + "m_Id": "d1d644f28b9d4e6f821f74089391e6b1" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", + "m_ObjectId": "9e7a824370ca477c8a8cd705d7d872df", + "m_Id": 1, + "m_DisplayName": "ss", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "ss", + "m_StageCapability": 3, + "m_BareResource": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "9e97b3405fc543c28b735c46067c7b4e", + "m_Id": 1, + "m_DisplayName": "X", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "X", + "m_StageCapability": 3, + "m_Value": 2.700000047683716, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", + "m_ObjectId": "9ebf5289db3242b9b71153f6e95357cb", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_BareResource": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "a0cdb32e73194975850a8aa3bfd6dfc4", + "m_Id": 4, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 2, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CheckerboardNode", + "m_ObjectId": "a5ad0b697c0c4b70bb7b8362e451d4b1", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Checkerboard", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1328.0, + "y": 499.0, + "width": 208.0, + "height": 350.0 + } + }, + "m_Slots": [ + { + "m_Id": "cdbf2fa165e74f349f51ff735c45206e" + }, + { + "m_Id": "4b565ee0dfa74c1a9554efd09104f315" + }, + { + "m_Id": "44d05cf2982741d186fac6660e27cb7b" + }, + { + "m_Id": "32e0a7d5feca46ae8962f4fa9c633f5e" + }, + { + "m_Id": "a0cdb32e73194975850a8aa3bfd6dfc4" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "b0082920bd9d48869ec2a8a93bf1059a", + "m_Id": 6, + "m_DisplayName": "RG", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "RG", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "b23240f5680d44fb9aaac141f7863a6a", + "m_Id": 4, + "m_DisplayName": "RGBA", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "RGBA", + "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.Vector1MaterialSlot", + "m_ObjectId": "b3393711de364b089ad5109db00d263d", + "m_Id": 1, + "m_DisplayName": "X", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "X", + "m_StageCapability": 3, + "m_Value": 0.949999988079071, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "b693d3b9a40347ae9185bdb9fdf7cadd", + "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": "654dfa58fa83492ba5141b54abb94521" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Position" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "bba2b75c89f64a03a7dbcb2b76c79ebe", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "bcafae0375c144b29c93f78a9c1a6320", + "m_Id": 3, + "m_DisplayName": "A", + "m_SlotType": 0, + "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.Vector1MaterialSlot", + "m_ObjectId": "c7c72748fbce4f668a1c5b65a6d3edc6", + "m_Id": 0, + "m_DisplayName": "R", + "m_SlotType": 0, + "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.UVMaterialSlot", + "m_ObjectId": "cdbf2fa165e74f349f51ff735c45206e", + "m_Id": 0, + "m_DisplayName": "UV", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "UV", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [], + "m_Channel": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.TilingAndOffsetNode", + "m_ObjectId": "ce0a2ad5ffce4515a5ad602912a24c14", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Tiling And Offset", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -598.0000610351563, + "y": -83.0, + "width": 208.0, + "height": 326.00006103515627 + } + }, + "m_Slots": [ + { + "m_Id": "64ccc97adbec402d9872bc16835b5ccc" + }, + { + "m_Id": "569c29608a844a93b56d8ab55440088f" + }, + { + "m_Id": "90f6a8b520a0454bb3159cd9146c851e" + }, + { + "m_Id": "6d11ca6535c84b24b256545de7002daf" + } + ], + "synonyms": [ + "pan", + "scale" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "d1d644f28b9d4e6f821f74089391e6b1", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "d724a48404804daea89b97ccf1341150", + "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": "fdf3eea274f1400b86d2068805acb8bd" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Tangent" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.SamplerStateNode", + "m_ObjectId": "dc1fb6300b4b47d8a84b9f8de9f2cf0d", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Sampler State", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -535.0, + "y": 243.0, + "width": 145.00003051757813, + "height": 164.00003051757813 + } + }, + "m_Slots": [ + { + "m_Id": "9ebf5289db3242b9b71153f6e95357cb" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_filter": 0, + "m_wrap": 0, + "m_aniso": 4 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "e0791020851e43b994968495334bda2b", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CombineNode", + "m_ObjectId": "ebbe25b03f8f42cf8f6515563f4919a9", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Combine", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -760.9999389648438, + "y": 482.0000305175781, + "width": 207.99993896484376, + "height": 349.9999694824219 + } + }, + "m_Slots": [ + { + "m_Id": "c7c72748fbce4f668a1c5b65a6d3edc6" + }, + { + "m_Id": "98703d5abe604bb19f70609b8c61423f" + }, + { + "m_Id": "38a0425b6d04417981e17c15612428e9" + }, + { + "m_Id": "bcafae0375c144b29c93f78a9c1a6320" + }, + { + "m_Id": "b23240f5680d44fb9aaac141f7863a6a" + }, + { + "m_Id": "0af84794dc444226b066fdc12497c10d" + }, + { + "m_Id": "b0082920bd9d48869ec2a8a93bf1059a" + } + ], + "synonyms": [ + "append" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget", + "m_ObjectId": "efffdc1f40304d6f9b8a956c6a387d90", + "m_ActiveSubTarget": { + "m_Id": "0e49892ffe094983bf6f8fa579b8cb4a" + }, + "m_AllowMaterialOverride": false, + "m_SurfaceType": 0, + "m_ZTestMode": 4, + "m_ZWriteControl": 0, + "m_AlphaMode": 0, + "m_RenderFace": 2, + "m_AlphaClip": false, + "m_CastShadows": true, + "m_ReceiveShadows": true, + "m_CustomEditorGUI": "" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "f42fb9ac22664c05852719ca85437e42", + "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": "f4997dedaecb4e54afc70d2c662973b3" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.BaseColor" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot", + "m_ObjectId": "f4997dedaecb4e54afc70d2c662973b3", + "m_Id": 0, + "m_DisplayName": "Base Color", + "m_SlotType": 0, + "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.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "f595cb66e6144e7998dcadc876415e04", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "fb9f8b2fccab4ce7818eb14f65e76398", + "m_Id": 0, + "m_DisplayName": "", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.TangentMaterialSlot", + "m_ObjectId": "fdf3eea274f1400b86d2068805acb8bd", + "m_Id": 0, + "m_DisplayName": "Tangent", + "m_SlotType": 0, + "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 +} + diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/SamplerStates/InlineAnisotropicSampler.shadergraph.meta b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/SamplerStates/InlineAnisotropicSampler.shadergraph.meta new file mode 100644 index 00000000000..bb2f3769331 --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/SamplerStates/InlineAnisotropicSampler.shadergraph.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 17c146f984007bc4698e13061114e5a0 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} diff --git a/com.unity.shadergraph/CHANGELOG.md b/com.unity.shadergraph/CHANGELOG.md index f26543cd7ce..1b0e5c516b7 100644 --- a/com.unity.shadergraph/CHANGELOG.md +++ b/com.unity.shadergraph/CHANGELOG.md @@ -37,6 +37,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Added visible errors for invalid stage capability connections to shader graph. - Added a ShaderGraph animated preview framerate throttle. - Added many node synonyms for the Create Node search so that it's easier to find nodes. + - Adding control of anisotropic settings on inline Sampler state nodes in ShaderGraph. ### Changed - Properties and Keywords are no longer separated by type on the blackboard. Categories allow for any combination of properties and keywords to be grouped together as the user defines. diff --git a/com.unity.shadergraph/Editor/Data/Graphs/TextureSamplerState.cs b/com.unity.shadergraph/Editor/Data/Graphs/TextureSamplerState.cs index 248c2c8e8b4..557647bad5d 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/TextureSamplerState.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/TextureSamplerState.cs @@ -21,6 +21,15 @@ public enum WrapMode MirrorOnce } + public enum Anisotropic + { + None, + x2, + x4, + x8, + x16 + } + [SerializeField] private FilterMode m_filter = FilterMode.Linear; public FilterMode filter @@ -49,6 +58,44 @@ public WrapMode wrap } } - public string defaultPropertyName => $"SamplerState_{filter}_{wrap}"; + [SerializeField] private Anisotropic m_anisotropic = Anisotropic.None; + + public Anisotropic anisotropic + { + get { return m_anisotropic; } + set + { + if (m_anisotropic == value) + return; + + m_anisotropic = value; + } + } + + static string GetAnisoString(Anisotropic aniso) + { + switch (aniso) + { + default: + case Anisotropic.None: + return String.Empty; + case Anisotropic.x2: + return "_Aniso2"; + case Anisotropic.x4: + return "_Aniso4"; + case Anisotropic.x8: + return "_Aniso8"; + case Anisotropic.x16: + return "_Aniso16"; + } + } + + public static string BuildSamplerStateName(FilterMode filter, WrapMode wrap, Anisotropic aniso) + { + var anisoMode = GetAnisoString(aniso); + return $"SamplerState_{filter}_{wrap}{anisoMode}"; + } + + public string defaultPropertyName => BuildSamplerStateName(filter, wrap, anisotropic); } } diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SamplerStateNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SamplerStateNode.cs index ebe228267c4..c902a2c470e 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SamplerStateNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SamplerStateNode.cs @@ -43,6 +43,22 @@ public TextureSamplerState.WrapMode wrap } } + [SerializeField] + private TextureSamplerState.Anisotropic m_aniso = TextureSamplerState.Anisotropic.None; + + public TextureSamplerState.Anisotropic anisotropic + { + get { return m_aniso; } + set + { + if (m_aniso == value) + return; + + m_aniso = value; + Dirty(ModificationScope.Graph); + } + } + public SamplerStateNode() { name = "Sampler State"; @@ -85,16 +101,15 @@ public override void CollectShaderProperties(PropertyCollector properties, Gener value = new TextureSamplerState() { filter = m_filter, - wrap = m_wrap + wrap = m_wrap, + anisotropic = m_aniso } }); } public override string GetVariableNameForNode() { - return string.Format(@"SamplerState_{0}_{1}", - Enum.GetName(typeof(TextureSamplerState.FilterMode), filter), - Enum.GetName(typeof(TextureSamplerState.WrapMode), wrap)); + return TextureSamplerState.BuildSamplerStateName(filter, wrap, anisotropic); } public AbstractShaderProperty AsShaderProperty() @@ -104,7 +119,8 @@ public AbstractShaderProperty AsShaderProperty() value = new TextureSamplerState() { filter = this.filter, - wrap = this.wrap + wrap = this.wrap, + anisotropic = this.anisotropic } }; } diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/SamplerStateNodePropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/SamplerStateNodePropertyDrawer.cs new file mode 100644 index 00000000000..b1a41bf18ff --- /dev/null +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/SamplerStateNodePropertyDrawer.cs @@ -0,0 +1,34 @@ +using System; +using UnityEditor.UIElements; +using UnityEditor.Graphing; +using UnityEditor.Graphing.Util; +using UnityEngine.UIElements; + +namespace UnityEditor.ShaderGraph.Drawing.Inspector.PropertyDrawers +{ + [SGPropertyDrawer(typeof(SamplerStateNode))] + class SamplerStateNodeNodePropertyDrawer : AbstractMaterialNodePropertyDrawer + { + internal override void AddCustomNodeProperties(VisualElement parentElement, AbstractMaterialNode nodeBase, Action setNodesAsDirtyCallback, Action updateNodeViewsCallback) + { + var node = nodeBase as SamplerStateNode; + var previewField = new EnumField(node.anisotropic); + var propertyRow = new PropertyRow(new Label("Anisotropic Filtering")); + propertyRow.Add(previewField, (field) => + { + field.RegisterValueChangedCallback(evt => + { + if (evt.newValue.Equals(node.anisotropic)) + return; + + setNodesAsDirtyCallback?.Invoke(); + node.owner.owner.RegisterCompleteObjectUndo("Change anisotropic filtering"); + node.anisotropic = (TextureSamplerState.Anisotropic)evt.newValue; + updateNodeViewsCallback?.Invoke(); + node.Dirty(ModificationScope.Graph); + }); + }); + parentElement.Add(propertyRow); + } + } +} diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/SamplerStateNodePropertyDrawer.cs.meta b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/SamplerStateNodePropertyDrawer.cs.meta new file mode 100644 index 00000000000..21502324536 --- /dev/null +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/SamplerStateNodePropertyDrawer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d58a109f5d7f9154a862ddc85c4d1cc1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: