diff --git a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/Android/OpenGLES3/None/InputNodes.png b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/Android/OpenGLES3/None/InputNodes.png index 65c6097584d..059a2c83da6 100755 --- a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/Android/OpenGLES3/None/InputNodes.png +++ b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/Android/OpenGLES3/None/InputNodes.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1be9e7434d0029042f8885d5d692a1dcb8a34acdb429e7607c02fcd2e6c9a5ed -size 554279 +oid sha256:cd68f56c4faccbee8526c4c4414e31b37a07a140d533eb8e84381a91fc261410 +size 552912 diff --git a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/Android/Vulkan/None/InputNodes.png b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/Android/Vulkan/None/InputNodes.png index 5bdff123d48..059a2c83da6 100755 --- a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/Android/Vulkan/None/InputNodes.png +++ b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/Android/Vulkan/None/InputNodes.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5ab8c05c9955091c06d3148d657a7bc6bc13a02b50ca8bdec30024189d41ece3 -size 554445 +oid sha256:cd68f56c4faccbee8526c4c4414e31b37a07a140d533eb8e84381a91fc261410 +size 552912 diff --git a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/IPhonePlayer/Metal/None/InputNodes.png b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/IPhonePlayer/Metal/None/InputNodes.png index 68b19109418..623bb66c04f 100644 --- a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/IPhonePlayer/Metal/None/InputNodes.png +++ b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/IPhonePlayer/Metal/None/InputNodes.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b11744554b5c1fddba4d0b57fa5ca40cd7e6cfdbcfffe97cfe072872737ec591 -size 568672 +oid sha256:376458b49f8380dacb2f3cca95f219a1b4f549572befb44de084810e88d9ff22 +size 570383 diff --git a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/LinuxEditor/OpenGLCore/None/InputNodes.png b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/LinuxEditor/OpenGLCore/None/InputNodes.png index 23cdb5ce3ef..059a2c83da6 100644 --- a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/LinuxEditor/OpenGLCore/None/InputNodes.png +++ b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/LinuxEditor/OpenGLCore/None/InputNodes.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ae8dafc3dbef8b8ae9b9f6eaefbe598f0c7e773abc112cd69609452eb91d3bc0 -size 623857 +oid sha256:cd68f56c4faccbee8526c4c4414e31b37a07a140d533eb8e84381a91fc261410 +size 552912 diff --git a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/InputNodes.png b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/InputNodes.png index 64c46dd464b..059a2c83da6 100644 --- a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/InputNodes.png +++ b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/InputNodes.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a08453fc98d58e6b50dfd808119911ec3e25f8278ea2fb33c7d95ed082e35d6e -size 550974 +oid sha256:cd68f56c4faccbee8526c4c4414e31b37a07a140d533eb8e84381a91fc261410 +size 552912 diff --git a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/LinuxPlayer/OpenGLCore/None/InputNodes.png b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/LinuxPlayer/OpenGLCore/None/InputNodes.png index 23cdb5ce3ef..059a2c83da6 100644 --- a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/LinuxPlayer/OpenGLCore/None/InputNodes.png +++ b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/LinuxPlayer/OpenGLCore/None/InputNodes.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ae8dafc3dbef8b8ae9b9f6eaefbe598f0c7e773abc112cd69609452eb91d3bc0 -size 623857 +oid sha256:cd68f56c4faccbee8526c4c4414e31b37a07a140d533eb8e84381a91fc261410 +size 552912 diff --git a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/LinuxPlayer/Vulkan/None/InputNodes.png b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/LinuxPlayer/Vulkan/None/InputNodes.png index 64c46dd464b..059a2c83da6 100644 --- a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/LinuxPlayer/Vulkan/None/InputNodes.png +++ b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/LinuxPlayer/Vulkan/None/InputNodes.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a08453fc98d58e6b50dfd808119911ec3e25f8278ea2fb33c7d95ed082e35d6e -size 550974 +oid sha256:cd68f56c4faccbee8526c4c4414e31b37a07a140d533eb8e84381a91fc261410 +size 552912 diff --git a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/InputNodes.png b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/InputNodes.png index 542aada6602..2520e686ff6 100644 --- a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/InputNodes.png +++ b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/InputNodes.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c9b58b967c66cb715e818451f7fe79d11b5de86194afb9b845da1af7116b45f6 -size 560834 +oid sha256:b706a9f3578fd8bb0acd73a425a3b643f800fedc6e77c047bff3b08a0b7b2eec +size 562711 diff --git a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/OSXEditor/OpenGLCore/None/InputNodes.png b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/OSXEditor/OpenGLCore/None/InputNodes.png index 23cdb5ce3ef..059a2c83da6 100644 --- a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/OSXEditor/OpenGLCore/None/InputNodes.png +++ b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/OSXEditor/OpenGLCore/None/InputNodes.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ae8dafc3dbef8b8ae9b9f6eaefbe598f0c7e773abc112cd69609452eb91d3bc0 -size 623857 +oid sha256:cd68f56c4faccbee8526c4c4414e31b37a07a140d533eb8e84381a91fc261410 +size 552912 diff --git a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/OSXPlayer/OpenGLCore/None/InputNodes.png b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/OSXPlayer/OpenGLCore/None/InputNodes.png index 23cdb5ce3ef..059a2c83da6 100644 --- a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/OSXPlayer/OpenGLCore/None/InputNodes.png +++ b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/OSXPlayer/OpenGLCore/None/InputNodes.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ae8dafc3dbef8b8ae9b9f6eaefbe598f0c7e773abc112cd69609452eb91d3bc0 -size 623857 +oid sha256:cd68f56c4faccbee8526c4c4414e31b37a07a140d533eb8e84381a91fc261410 +size 552912 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 4bb821f216b..059a2c83da6 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:c0b55b1a624f2d4aa6fcd146aab7d38e2df2dd027dc33aaf89af37a8be7f1d7a -size 550974 +oid sha256:cd68f56c4faccbee8526c4c4414e31b37a07a140d533eb8e84381a91fc261410 +size 552912 diff --git a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/InputNodes.png b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/InputNodes.png index 23cdb5ce3ef..059a2c83da6 100644 --- a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/InputNodes.png +++ b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/InputNodes.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ae8dafc3dbef8b8ae9b9f6eaefbe598f0c7e773abc112cd69609452eb91d3bc0 -size 623857 +oid sha256:cd68f56c4faccbee8526c4c4414e31b37a07a140d533eb8e84381a91fc261410 +size 552912 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 ef1d1ab643b..059a2c83da6 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:74473be81fc84073c9d503ca32a450542472099dd4f53b79a60f9f7cf3c6b7d8 -size 550934 +oid sha256:cd68f56c4faccbee8526c4c4414e31b37a07a140d533eb8e84381a91fc261410 +size 552912 diff --git a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsPlayer/Vulkan/None/InputNodes.png b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsPlayer/Vulkan/None/InputNodes.png index 23cdb5ce3ef..059a2c83da6 100644 --- a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsPlayer/Vulkan/None/InputNodes.png +++ b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsPlayer/Vulkan/None/InputNodes.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ae8dafc3dbef8b8ae9b9f6eaefbe598f0c7e773abc112cd69609452eb91d3bc0 -size 623857 +oid sha256:cd68f56c4faccbee8526c4c4414e31b37a07a140d533eb8e84381a91fc261410 +size 552912 diff --git a/TestProjects/ShaderGraph/Assets/Scenes/InputNodes.unity b/TestProjects/ShaderGraph/Assets/Scenes/InputNodes.unity index 41711574211..296990d83ab 100644 --- a/TestProjects/ShaderGraph/Assets/Scenes/InputNodes.unity +++ b/TestProjects/ShaderGraph/Assets/Scenes/InputNodes.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.12731749, g: 0.13414757, b: 0.1210787, a: 1} + m_IndirectSpecularColor: {r: 0.12731713, g: 0.13414736, b: 0.12107852, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -3651,7 +3651,7 @@ Transform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1427803695} - m_RootOrder: 4 + m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 180.00002, z: 0} --- !u!23 &582133712 MeshRenderer: @@ -8093,6 +8093,7 @@ Transform: - {fileID: 801207485} - {fileID: 507897635} - {fileID: 480521285} + - {fileID: 1889196525} - {fileID: 582133711} m_Father: {fileID: 134715868} m_RootOrder: 3 @@ -11206,6 +11207,103 @@ Transform: m_Father: {fileID: 303484558} m_RootOrder: 8 m_LocalEulerAnglesHint: {x: -90, y: 180, z: -90} +--- !u!1 &1889196524 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1889196525} + - component: {fileID: 1889196528} + - component: {fileID: 1889196527} + - component: {fileID: 1889196526} + m_Layer: 0 + m_Name: MainLightDirection + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1889196525 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1889196524} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -7, y: 0, z: -3} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1427803695} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &1889196526 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1889196524} + 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: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: bdd050ef568927b45b30302183ca8316, 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 &1889196527 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1889196524} + 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 &1889196528 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1889196524} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} --- !u!1 &1889255731 GameObject: m_ObjectHideFlags: 0 diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Lighting/MainLightDirection.mat b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Lighting/MainLightDirection.mat new file mode 100644 index 00000000000..16b2126cfbc --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Lighting/MainLightDirection.mat @@ -0,0 +1,53 @@ +%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: MainLightDirection + m_Shader: {fileID: -6465566751694194690, guid: 2467c0155b22f574a9be7b9069d78e38, + type: 3} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - 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: [] +--- !u!114 &6787485369437698938 +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 diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Lighting/MainLightDirection.mat.meta b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Lighting/MainLightDirection.mat.meta new file mode 100644 index 00000000000..865ff30efc0 --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Lighting/MainLightDirection.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bdd050ef568927b45b30302183ca8316 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Lighting/MainLightDirection.shadergraph b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Lighting/MainLightDirection.shadergraph new file mode 100644 index 00000000000..1927078804a --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Lighting/MainLightDirection.shadergraph @@ -0,0 +1,669 @@ +{ + "m_SGVersion": 3, + "m_Type": "UnityEditor.ShaderGraph.GraphData", + "m_ObjectId": "ea6d01c70c0f4d738f14e6c2ea9bdc26", + "m_Properties": [], + "m_Keywords": [], + "m_Dropdowns": [], + "m_CategoryData": [ + { + "m_Id": "a5ef653f137c4f888186c50d55184c31" + } + ], + "m_Nodes": [ + { + "m_Id": "a9fe4566a86d45d5ace39fad303b9f02" + }, + { + "m_Id": "e82ace186cff47b0a01a45293f098e9e" + }, + { + "m_Id": "c4675b01247b44edbc01c25ac8788f1f" + }, + { + "m_Id": "e34c34ffe5284a19ba359d6cd2f707b0" + }, + { + "m_Id": "50a0b0bb554f45b6be3a22fd0f4a9773" + }, + { + "m_Id": "86d9ef078bdb4278b7d992d9833c821b" + }, + { + "m_Id": "3181f6926c0a4346b74afe0e8bca0013" + }, + { + "m_Id": "e4f0f0e9cf8744298bcf0f41ffc861ae" + } + ], + "m_GroupDatas": [], + "m_StickyNoteDatas": [], + "m_Edges": [ + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "3181f6926c0a4346b74afe0e8bca0013" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "e4f0f0e9cf8744298bcf0f41ffc861ae" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "86d9ef078bdb4278b7d992d9833c821b" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "e4f0f0e9cf8744298bcf0f41ffc861ae" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "e4f0f0e9cf8744298bcf0f41ffc861ae" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "e34c34ffe5284a19ba359d6cd2f707b0" + }, + "m_SlotId": 0 + } + } + ], + "m_VertexContext": { + "m_Position": { + "x": 0.0, + "y": 0.0 + }, + "m_Blocks": [ + { + "m_Id": "a9fe4566a86d45d5ace39fad303b9f02" + }, + { + "m_Id": "e82ace186cff47b0a01a45293f098e9e" + }, + { + "m_Id": "c4675b01247b44edbc01c25ac8788f1f" + } + ] + }, + "m_FragmentContext": { + "m_Position": { + "x": 0.0, + "y": 200.0 + }, + "m_Blocks": [ + { + "m_Id": "e34c34ffe5284a19ba359d6cd2f707b0" + }, + { + "m_Id": "50a0b0bb554f45b6be3a22fd0f4a9773" + } + ] + }, + "m_PreviewData": { + "serializedMesh": { + "m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}", + "m_Guid": "" + }, + "preventRotation": false + }, + "m_Path": "Shader Graph Tests/Input/Lighting", + "m_GraphPrecision": 0, + "m_PreviewMode": 2, + "m_OutputNode": { + "m_Id": "" + }, + "m_ActiveTargets": [ + { + "m_Id": "693a8efdcadb4b948681cccf3a4a85ca" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalUnlitSubTarget", + "m_ObjectId": "1933ee6064f248b08a6fca6f86b58dd4" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "2c4193eafbef42ceaabe060ecfdc1ae2", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 1.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", + "m_ObjectId": "2d5a2d436d8242a9bb8dd4bfb28f032e", + "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.NormalVectorNode", + "m_ObjectId": "3181f6926c0a4346b74afe0e8bca0013", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Normal Vector", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -459.0000305175781, + "y": 251.99998474121095, + "width": 205.99998474121095, + "height": 131.00001525878907 + } + }, + "m_Slots": [ + { + "m_Id": "75e4d91929444e94a4994425e8d8dbce" + } + ], + "synonyms": [ + "surface direction" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_PreviewMode": 2, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Space": 2 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "33a383ad790047808ef8d668cb1486eb", + "m_Id": 2, + "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.BlockNode", + "m_ObjectId": "50a0b0bb554f45b6be3a22fd0f4a9773", + "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": "75cd7ae2597d40a6a1f5f8f471dd6c9d" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.AlphaClipThreshold" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot", + "m_ObjectId": "63e5b3f554ee40d8b878ba030097dd6f", + "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": 1, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget", + "m_ObjectId": "693a8efdcadb4b948681cccf3a4a85ca", + "m_ActiveSubTarget": { + "m_Id": "1933ee6064f248b08a6fca6f86b58dd4" + }, + "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_SupportVFX": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "6e156951fa074730898f804b769fa1c6", + "m_Id": 0, + "m_DisplayName": "Direction", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Direction", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "75cd7ae2597d40a6a1f5f8f471dd6c9d", + "m_Id": 0, + "m_DisplayName": "Alpha Clip Threshold", + "m_SlotType": 0, + "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.Vector3MaterialSlot", + "m_ObjectId": "75e4d91929444e94a4994425e8d8dbce", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.MainLightDirectionNode", + "m_ObjectId": "86d9ef078bdb4278b7d992d9833c821b", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Main Light Direction", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -413.0000305175781, + "y": 160.99998474121095, + "width": 159.99998474121095, + "height": 78.00003051757813 + } + }, + "m_Slots": [ + { + "m_Id": "6e156951fa074730898f804b769fa1c6" + } + ], + "synonyms": [ + "sun" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CategoryData", + "m_ObjectId": "a5ef653f137c4f888186c50d55184c31", + "m_Name": "", + "m_ChildObjectList": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "a9fe4566a86d45d5ace39fad303b9f02", + "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": "d672a58ef649437084a3356d315e5ddd" + } + ], + "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.BlockNode", + "m_ObjectId": "c4675b01247b44edbc01c25ac8788f1f", + "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": "db185695ee8d4932a426b6b988ab4e81" + } + ], + "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.PositionMaterialSlot", + "m_ObjectId": "d672a58ef649437084a3356d315e5ddd", + "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.TangentMaterialSlot", + "m_ObjectId": "db185695ee8d4932a426b6b988ab4e81", + "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 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "e34c34ffe5284a19ba359d6cd2f707b0", + "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": "63e5b3f554ee40d8b878ba030097dd6f" + } + ], + "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.DotProductNode", + "m_ObjectId": "e4f0f0e9cf8744298bcf0f41ffc861ae", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Dot Product", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -204.00001525878907, + "y": 199.99996948242188, + "width": 128.0, + "height": 118.00003051757813 + } + }, + "m_Slots": [ + { + "m_Id": "f4710baac9754c1aabc33d08a5987aa8" + }, + { + "m_Id": "2c4193eafbef42ceaabe060ecfdc1ae2" + }, + { + "m_Id": "33a383ad790047808ef8d668cb1486eb" + } + ], + "synonyms": [ + "scalar product" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "e82ace186cff47b0a01a45293f098e9e", + "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": "2d5a2d436d8242a9bb8dd4bfb28f032e" + } + ], + "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.DynamicVectorMaterialSlot", + "m_ObjectId": "f4710baac9754c1aabc33d08a5987aa8", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Lighting/MainLightDirection.shadergraph.meta b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Lighting/MainLightDirection.shadergraph.meta new file mode 100644 index 00000000000..840d221f393 --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Lighting/MainLightDirection.shadergraph.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 2467c0155b22f574a9be7b9069d78e38 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index d17afd71345..7496c268d5b 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -145,6 +145,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Added an option to render screen space global illumination in half resolution to achieve real-time compatible performance in high resolutions (case 1353727). - Added a built-in custom pass to draw object IDs. - Added an example in the documentation that shows how to use the accumulation API for high quality antialiasing (supersampling). +- Added a SG node to get the main directional light direction. ### Fixed - Fixed Intensity Multiplier not affecting realtime global illumination. diff --git a/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl b/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl index 86080b58668..1a1c20e37c3 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl @@ -27,6 +27,22 @@ float3 shadergraph_HDBakedGI(float3 positionWS, float3 normalWS, float2 uvStatic return SampleBakedGI(positionRWS, normalWS, uvStaticLightmap, uvDynamicLightmap); } +float3 shadergraph_HDMainLightDirection() +{ +#if defined(SHADERPASS) && (SHADERPASS != SHADERPASS_LIGHT_TRANSPORT) + uint lightIndex = _DirectionalShadowIndex; + if (_DirectionalShadowIndex < 0) + { + if (_DirectionalLightCount == 0) + return 0.0f; + lightIndex = 0; + } + return _DirectionalLightDatas[lightIndex].forward; +#else + return 0.0f; +#endif +} + // If we already defined the Macro, now we need to redefine them given that HDRP functions are now defined. #ifdef SHADERGRAPH_SAMPLE_SCENE_DEPTH @@ -46,4 +62,10 @@ float3 shadergraph_HDBakedGI(float3 positionWS, float3 normalWS, float2 uvStatic #define SHADERGRAPH_BAKED_GI(positionWS, normalWS, uvStaticLightmap, uvDynamicLightmap, applyScaling) shadergraph_HDBakedGI(positionWS, normalWS, uvStaticLightmap, uvDynamicLightmap, applyScaling) +#ifdef SHADERGRAPH_MAIN_LIGHT_DIRECTION +#undef SHADERGRAPH_MAIN_LIGHT_DIRECTION +#endif +#define SHADERGRAPH_MAIN_LIGHT_DIRECTION shadergraph_HDMainLightDirection + + #endif // UNITY_GRAPHFUNCTIONS_HD_INCLUDED diff --git a/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl b/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl index a272650ac73..9f6b82165be 100644 --- a/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl +++ b/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl @@ -9,6 +9,8 @@ #define SHADERGRAPH_AMBIENT_SKY unity_AmbientSky #define SHADERGRAPH_AMBIENT_EQUATOR unity_AmbientEquator #define SHADERGRAPH_AMBIENT_GROUND unity_AmbientGround +#define SHADERGRAPH_MAIN_LIGHT_DIRECTION shadergraph_URPMainLightDirection + #if defined(REQUIRE_DEPTH_TEXTURE) #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareDepthTexture.hlsl" @@ -95,6 +97,11 @@ float3x3 BuildTangentToWorld(float4 tangentWS, float3 normalWS) return tangentToWorld; } +float3 shadergraph_URPMainLightDirection() +{ + return -GetMainLight().direction; +} + // Always include Shader Graph version // Always include last to avoid double macros #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" diff --git a/com.unity.shadergraph/Documentation~/Main-Light-Direction-Node.md b/com.unity.shadergraph/Documentation~/Main-Light-Direction-Node.md new file mode 100644 index 00000000000..e6d03689054 --- /dev/null +++ b/com.unity.shadergraph/Documentation~/Main-Light-Direction-Node.md @@ -0,0 +1,12 @@ +# Get Main Light Direction Node + +## Description + +Provides access to the direction of the main directional light in the scene. +The main directional light is the one casting shadows if there is any. Otherwise, it fallbacks to the first non shadow casting directional light. + +### Ports + +| Name | Direction | Type | Description | +| :------------ | :-------- | :------------- | :-------------------------------------------------------- | +| **Direction** | Output | Vector3 | The normalized direction of the sun light in world space. | diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Lighting/MainLightDirectionNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Lighting/MainLightDirectionNode.cs new file mode 100644 index 00000000000..8bbc9430be6 --- /dev/null +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Lighting/MainLightDirectionNode.cs @@ -0,0 +1,37 @@ +using System.Reflection; +using UnityEngine; + +namespace UnityEditor.ShaderGraph +{ + [Title("Input", "Lighting", "Main Light Direction")] + class MainLightDirectionNode : CodeFunctionNode + { + public MainLightDirectionNode() + { + name = "Main Light Direction"; + synonyms = new string[] { "sun" }; + } + + public override bool hasPreview { get { return false; } } + + protected override MethodInfo GetFunctionToConvert() + { + return GetType().GetMethod("MainLightDirection", BindingFlags.Static | BindingFlags.NonPublic); + } + + static string MainLightDirection([Slot(0, Binding.None)] out Vector3 Direction) + { + Direction = Vector3.one; + return +@" +{ + #if SHADERGRAPH_PREVIEW + Direction = half3(-0.5, -0.5, 0); + #else + Direction = SHADERGRAPH_MAIN_LIGHT_DIRECTION(); + #endif +} +"; + } + } +} diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Lighting/MainLightDirectionNode.cs.meta b/com.unity.shadergraph/Editor/Data/Nodes/Input/Lighting/MainLightDirectionNode.cs.meta new file mode 100644 index 00000000000..347f5e84bbe --- /dev/null +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Lighting/MainLightDirectionNode.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 237285c961caaa04dbef3bf0a425fb42 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/ShaderLibrary/ShaderGraphFunctions.hlsl b/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/ShaderLibrary/ShaderGraphFunctions.hlsl index b48cb052603..705b76dd3ac 100644 --- a/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/ShaderLibrary/ShaderGraphFunctions.hlsl +++ b/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/ShaderLibrary/ShaderGraphFunctions.hlsl @@ -9,6 +9,7 @@ #define SHADERGRAPH_AMBIENT_SKY unity_AmbientSky #define SHADERGRAPH_AMBIENT_EQUATOR unity_AmbientEquator #define SHADERGRAPH_AMBIENT_GROUND unity_AmbientGround +#define SHADERGRAPH_MAIN_LIGHT_DIRECTION shadergraph_MainLightDirection #if defined(REQUIRE_DEPTH_TEXTURE) #include "Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/ShaderLibrary/DeclareDepthTexture.hlsl" @@ -87,6 +88,11 @@ float3x3 BuildTangentToWorld(float4 tangentWS, float3 normalWS) return tangentToWorld; } +float3 shadergraph_MainLightDirection() +{ + return 0.0f; +} + // Always include Shader Graph version // Always include last to avoid double macros #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl"