From a319f6d70b58ab7eb2f6ed270a42387159bb8d16 Mon Sep 17 00:00:00 2001 From: Anis Date: Wed, 14 Oct 2020 16:40:25 +0200 Subject: [PATCH] Added the support of eye shader for ray tracing. --- .../None/101_ReflectionsPerfFullRes.png | 4 +- .../None/102_ReflectionsPerfHalfRes.png | 4 +- .../None/103_ReflectionsQuality.png | 4 +- .../None/900_Materials_AlphaTest_SG.png | 4 +- .../EyeSG.shadergraph | 1118 +++++++++++++++++ .../EyeSG.shadergraph.meta | 10 + .../RayTracedReflectionsData/M_EyeSG.mat | 105 ++ .../RayTracedReflectionsData/M_EyeSG.mat.meta | 8 + .../MaterialCollection.prefab | 204 ++- .../CHANGELOG.md | 1 + .../Material/Eye/ShaderGraph/EyeSubTarget.cs | 13 +- .../Editor/Material/ShaderGraph/HDTarget.cs | 1 + .../Runtime/Material/Eye/EyeRaytracing.hlsl | 54 + .../Material/Eye/EyeRaytracing.hlsl.meta | 10 + 14 files changed, 1529 insertions(+), 11 deletions(-) create mode 100644 TestProjects/HDRP_DXR_Tests/Assets/Scenes/RayTracedReflectionsData/EyeSG.shadergraph create mode 100644 TestProjects/HDRP_DXR_Tests/Assets/Scenes/RayTracedReflectionsData/EyeSG.shadergraph.meta create mode 100644 TestProjects/HDRP_DXR_Tests/Assets/Scenes/RayTracedReflectionsData/M_EyeSG.mat create mode 100644 TestProjects/HDRP_DXR_Tests/Assets/Scenes/RayTracedReflectionsData/M_EyeSG.mat.meta create mode 100644 com.unity.render-pipelines.high-definition/Runtime/Material/Eye/EyeRaytracing.hlsl create mode 100644 com.unity.render-pipelines.high-definition/Runtime/Material/Eye/EyeRaytracing.hlsl.meta diff --git a/TestProjects/HDRP_DXR_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/101_ReflectionsPerfFullRes.png b/TestProjects/HDRP_DXR_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/101_ReflectionsPerfFullRes.png index c8ca173e2db..5d822e278e9 100644 --- a/TestProjects/HDRP_DXR_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/101_ReflectionsPerfFullRes.png +++ b/TestProjects/HDRP_DXR_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/101_ReflectionsPerfFullRes.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fda7ffe4224937278c9385bb315506d827d1936c7e1559bbaaec1e8d2f816078 -size 73039 +oid sha256:05c8df6e8c4e6fca5eab5a9171bed258311926d5121a728ae6cc6496098aee43 +size 81606 diff --git a/TestProjects/HDRP_DXR_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/102_ReflectionsPerfHalfRes.png b/TestProjects/HDRP_DXR_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/102_ReflectionsPerfHalfRes.png index 4de911b30b7..332e8ab9ebf 100644 --- a/TestProjects/HDRP_DXR_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/102_ReflectionsPerfHalfRes.png +++ b/TestProjects/HDRP_DXR_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/102_ReflectionsPerfHalfRes.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c0a090174d200bbf162672e5bd138ca0b3e99e5e69183023c395c3d6cce4028b -size 88268 +oid sha256:137dc73ae4b5267944b8dc9c69b3bd408dfdfeeecefa9d9c5981a1b77d50fd97 +size 98841 diff --git a/TestProjects/HDRP_DXR_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/103_ReflectionsQuality.png b/TestProjects/HDRP_DXR_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/103_ReflectionsQuality.png index 97a1e1b5e79..3c2a60a7cbb 100644 --- a/TestProjects/HDRP_DXR_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/103_ReflectionsQuality.png +++ b/TestProjects/HDRP_DXR_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/103_ReflectionsQuality.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d55ded9649ae41d7f14500813f529b0577f01ad2b5c6f2569b576381046d5484 -size 72700 +oid sha256:18d1132e50a3ffa0bb97fb259fd7c01972a6d822d8ab73ffbcdbd23cf2bf32ea +size 82847 diff --git a/TestProjects/HDRP_DXR_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/900_Materials_AlphaTest_SG.png b/TestProjects/HDRP_DXR_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/900_Materials_AlphaTest_SG.png index d92340d1d24..9d11cc33e99 100644 --- a/TestProjects/HDRP_DXR_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/900_Materials_AlphaTest_SG.png +++ b/TestProjects/HDRP_DXR_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/900_Materials_AlphaTest_SG.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f53a1a08febd962bd12f5313b166b57a0b6f0bec9e099056637f9d61931bdd0f -size 321422 +oid sha256:7028642ee8abd16539530829876eaa0a6b44e13c82f0af02585ecb5818b11895 +size 342170 diff --git a/TestProjects/HDRP_DXR_Tests/Assets/Scenes/RayTracedReflectionsData/EyeSG.shadergraph b/TestProjects/HDRP_DXR_Tests/Assets/Scenes/RayTracedReflectionsData/EyeSG.shadergraph new file mode 100644 index 00000000000..ae84dbb28ae --- /dev/null +++ b/TestProjects/HDRP_DXR_Tests/Assets/Scenes/RayTracedReflectionsData/EyeSG.shadergraph @@ -0,0 +1,1118 @@ +{ + "m_SGVersion": 2, + "m_Type": "UnityEditor.ShaderGraph.GraphData", + "m_ObjectId": "d484cd98a1e34584adc40eac0e93a57b", + "m_Properties": [ + { + "m_Id": "ae20c9f56dff4c199c2832dedf04ef20" + }, + { + "m_Id": "cf2fddf7f8cf47dd9ea5b0282a065d6f" + } + ], + "m_Keywords": [], + "m_Nodes": [ + { + "m_Id": "b490a8b74e294be7b90d07e5aef20e58" + }, + { + "m_Id": "6f8542f3b2154a9c8f2e65e6b45f3158" + }, + { + "m_Id": "f56cc6d8099b4acbb037c355281ad626" + }, + { + "m_Id": "919c8e0c29bb41b1b5f7c7b58bc809da" + }, + { + "m_Id": "642bf1c8acd34428ae24058a8ddc5ea1" + }, + { + "m_Id": "37857958d34b4c9e80cb1c50e4f8c8f8" + }, + { + "m_Id": "47bfe850bc4b402da86a83d1236daafc" + }, + { + "m_Id": "60d25075fab94bbe91051ba71c6f0a1b" + }, + { + "m_Id": "9f99591ff2704a94a2619e8148876272" + }, + { + "m_Id": "b07d8e7fd2e24bed98f471ba49ab3159" + }, + { + "m_Id": "f4223096ae1b436d8112a78c747cfa43" + }, + { + "m_Id": "0de7f713160c4224858440120a43dc12" + }, + { + "m_Id": "a6820bbcce4e4eeeb2180ba517d0b4b0" + }, + { + "m_Id": "3eb0dcf4b8ac4c4b8b34db3d5112e276" + }, + { + "m_Id": "fb11f9189be24a9da6067d6931dd7e10" + } + ], + "m_GroupDatas": [], + "m_StickyNoteDatas": [], + "m_Edges": [ + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "3eb0dcf4b8ac4c4b8b34db3d5112e276" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "919c8e0c29bb41b1b5f7c7b58bc809da" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "fb11f9189be24a9da6067d6931dd7e10" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "60d25075fab94bbe91051ba71c6f0a1b" + }, + "m_SlotId": 0 + } + } + ], + "m_VertexContext": { + "m_Position": { + "x": 0.0, + "y": 0.0 + }, + "m_Blocks": [ + { + "m_Id": "b490a8b74e294be7b90d07e5aef20e58" + }, + { + "m_Id": "6f8542f3b2154a9c8f2e65e6b45f3158" + }, + { + "m_Id": "f56cc6d8099b4acbb037c355281ad626" + } + ] + }, + "m_FragmentContext": { + "m_Position": { + "x": 0.0, + "y": 200.0 + }, + "m_Blocks": [ + { + "m_Id": "919c8e0c29bb41b1b5f7c7b58bc809da" + }, + { + "m_Id": "642bf1c8acd34428ae24058a8ddc5ea1" + }, + { + "m_Id": "37857958d34b4c9e80cb1c50e4f8c8f8" + }, + { + "m_Id": "47bfe850bc4b402da86a83d1236daafc" + }, + { + "m_Id": "60d25075fab94bbe91051ba71c6f0a1b" + }, + { + "m_Id": "9f99591ff2704a94a2619e8148876272" + }, + { + "m_Id": "b07d8e7fd2e24bed98f471ba49ab3159" + }, + { + "m_Id": "f4223096ae1b436d8112a78c747cfa43" + }, + { + "m_Id": "0de7f713160c4224858440120a43dc12" + }, + { + "m_Id": "a6820bbcce4e4eeeb2180ba517d0b4b0" + } + ] + }, + "m_PreviewData": { + "serializedMesh": { + "m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}", + "m_Guid": "" + } + }, + "m_Path": "Shader Graphs", + "m_ConcretePrecision": 0, + "m_OutputNode": { + "m_Id": "" + }, + "m_ActiveTargets": [ + { + "m_Id": "321d6bea54ae4c8cadddde0de0737aef" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "0de7f713160c4224858440120a43dc12", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.Emission", + "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": "8e32e8d3bfc54e6e86280801ec7bbfdc" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.Emission" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", + "m_ObjectId": "2d1521301e0e46009e00569561c1caa4", + "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.Rendering.HighDefinition.ShaderGraph.LightingData", + "m_ObjectId": "31f849218e9a42f580097f81e87ec36b", + "m_NormalDropOffSpace": 0, + "m_BlendPreserveSpecular": true, + "m_ReceiveDecals": true, + "m_ReceiveSSR": true, + "m_ReceiveSSRTransparent": false, + "m_SpecularAA": false, + "m_SpecularOcclusionMode": 0, + "m_OverrideBakedGI": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.HDTarget", + "m_ObjectId": "321d6bea54ae4c8cadddde0de0737aef", + "m_ActiveSubTarget": { + "m_Id": "4d56dde5af30471ab1e5c72f0e584632" + }, + "m_Datas": [ + { + "m_Id": "81edd832e6744271943046c0b34aeddb" + }, + { + "m_Id": "31f849218e9a42f580097f81e87ec36b" + }, + { + "m_Id": "a3832fb586384529a66efac3defbcacf" + }, + { + "m_Id": "c485d3e49aed41718c9a0dacc79eebd7" + } + ], + "m_CustomEditorGUI": "" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "37857958d34b4c9e80cb1c50e4f8c8f8", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.IrisNormalTS", + "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": "b2d32b6120694915b7e75a0bbd878bf3" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.IrisNormalTS" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "3eb0dcf4b8ac4c4b8b34db3d5112e276", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -395.0, + "y": 120.0, + "width": 107.0, + "height": 34.0 + } + }, + "m_Slots": [ + { + "m_Id": "7ce766a5b2eb4de087448ef693ee1352" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "ae20c9f56dff4c199c2832dedf04ef20" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "47bfe850bc4b402da86a83d1236daafc", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.BentNormal", + "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": "5ea5c9b72a4f42abb7973693743bbf81" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.BentNormal" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.EyeSubTarget", + "m_ObjectId": "4d56dde5af30471ab1e5c72f0e584632" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", + "m_ObjectId": "5ea5c9b72a4f42abb7973693743bbf81", + "m_Id": 0, + "m_DisplayName": "Bent Normal", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "BentNormal", + "m_StageCapability": 2, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_Space": 3 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "5f097157741042c88a0e2480e5235e94", + "m_Id": 0, + "m_DisplayName": "IOR", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "IOR", + "m_StageCapability": 2, + "m_Value": 1.399999976158142, + "m_DefaultValue": 1.399999976158142, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "5f6fb3b92a734de5bbe8cdac273f3deb", + "m_Id": 0, + "m_DisplayName": "Ambient Occlusion", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Occlusion", + "m_StageCapability": 2, + "m_Value": 1.0, + "m_DefaultValue": 1.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "60d25075fab94bbe91051ba71c6f0a1b", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.Smoothness", + "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": "79d5812e9da44d0b8a1a7af829585307" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.Smoothness" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "642bf1c8acd34428ae24058a8ddc5ea1", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.NormalTS", + "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": "fea1e8bf7a154f93b3c8f4f2915b9536" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.NormalTS" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "6f8542f3b2154a9c8f2e65e6b45f3158", + "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": "2d1521301e0e46009e00569561c1caa4" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Normal" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "79d5812e9da44d0b8a1a7af829585307", + "m_Id": 0, + "m_DisplayName": "Smoothness", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Smoothness", + "m_StageCapability": 2, + "m_Value": 0.5, + "m_DefaultValue": 0.5, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "7ce766a5b2eb4de087448ef693ee1352", + "m_Id": 0, + "m_DisplayName": "BaseColor", + "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.Rendering.HighDefinition.ShaderGraph.BuiltinData", + "m_ObjectId": "81edd832e6744271943046c0b34aeddb", + "m_Distortion": false, + "m_DistortionMode": 0, + "m_DistortionDepthTest": true, + "m_AddPrecomputedVelocity": false, + "m_TransparentWritesMotionVec": false, + "m_AlphaToMask": false, + "m_DepthOffset": false, + "m_TransparencyFog": true, + "m_AlphaTestShadow": false, + "m_BackThenFrontRendering": false, + "m_TransparentDepthPrepass": false, + "m_TransparentDepthPostpass": false, + "m_SupportLodCrossFade": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot", + "m_ObjectId": "86f2916501dc4ea9bb461367af777baf", + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot", + "m_ObjectId": "8e32e8d3bfc54e6e86280801ec7bbfdc", + "m_Id": 0, + "m_DisplayName": "Emission", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Emission", + "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_ColorMode": 1 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "919c8e0c29bb41b1b5f7c7b58bc809da", + "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": "86f2916501dc4ea9bb461367af777baf" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.BaseColor" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.TangentMaterialSlot", + "m_ObjectId": "9e37c157b286445b9f54d80f5203196c", + "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.BlockNode", + "m_ObjectId": "9f99591ff2704a94a2619e8148876272", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.IOR", + "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": "5f097157741042c88a0e2480e5235e94" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.IOR" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "a14173a3b5d545a191fede71d29c4e42", + "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.Rendering.HighDefinition.ShaderGraph.SystemData", + "m_ObjectId": "a3832fb586384529a66efac3defbcacf", + "m_MaterialNeedsUpdateHash": 0, + "m_SurfaceType": 0, + "m_RenderingPass": 1, + "m_BlendMode": 0, + "m_ZTest": 4, + "m_ZWrite": false, + "m_TransparentCullMode": 2, + "m_OpaqueCullMode": 2, + "m_SortPriority": 0, + "m_AlphaTest": false, + "m_TransparentDepthPrepass": false, + "m_TransparentDepthPostpass": false, + "m_SupportLodCrossFade": false, + "m_DoubleSidedMode": 0, + "m_DOTSInstancing": false, + "m_Version": 0, + "m_FirstTimeMigrationExecuted": true, + "inspectorFoldoutMask": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "a6820bbcce4e4eeeb2180ba517d0b4b0", + "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": "a14173a3b5d545a191fede71d29c4e42" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.Alpha" +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.ColorShaderProperty", + "m_ObjectId": "ae20c9f56dff4c199c2832dedf04ef20", + "m_Guid": { + "m_GuidSerialized": "9dad96db-f8df-4584-8e81-7b1a98342689" + }, + "m_Name": "BaseColor", + "m_DefaultReferenceName": "Color_ae20c9f56dff4c199c2832dedf04ef20", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": true, + "m_Precision": 0, + "m_GPUInstanced": false, + "m_Hidden": false, + "m_Value": { + "r": 0.0, + "g": 0.0, + "b": 0.0, + "a": 0.0 + }, + "m_ColorMode": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "b07d8e7fd2e24bed98f471ba49ab3159", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.Occlusion", + "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": "5f6fb3b92a734de5bbe8cdac273f3deb" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.Occlusion" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", + "m_ObjectId": "b2d32b6120694915b7e75a0bbd878bf3", + "m_Id": 0, + "m_DisplayName": "Iris Normal (Tangent Space)", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "IrisNormalTS", + "m_StageCapability": 2, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_Space": 3 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "b490a8b74e294be7b90d07e5aef20e58", + "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": "d9e3d5fe4a13482c9c88c259505baf1f" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Position" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.EyeData", + "m_ObjectId": "c485d3e49aed41718c9a0dacc79eebd7", + "m_MaterialType": 0, + "m_SubsurfaceScattering": false, + "m_IrisNormal": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "c785cc33bdaf457fb0925cb0cec9f811", + "m_Id": 0, + "m_DisplayName": "Smoothness", + "m_SlotType": 1, + "m_Priority": 2147483647, + "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.Internal.Vector1ShaderProperty", + "m_ObjectId": "cf2fddf7f8cf47dd9ea5b0282a065d6f", + "m_Guid": { + "m_GuidSerialized": "9d64c58a-4e44-4aac-a505-a3b975369d2b" + }, + "m_Name": "Smoothness", + "m_DefaultReferenceName": "Vector1_cf2fddf7f8cf47dd9ea5b0282a065d6f", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": true, + "m_Precision": 0, + "m_GPUInstanced": false, + "m_Hidden": false, + "m_Value": 0.0, + "m_FloatType": 0, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot", + "m_ObjectId": "d9e3d5fe4a13482c9c88c259505baf1f", + "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.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "e5e101f971f34d32bd64ccd97980c4e4", + "m_Id": 0, + "m_DisplayName": "Mask", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Mask", + "m_StageCapability": 2, + "m_Value": { + "x": 1.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "f4223096ae1b436d8112a78c747cfa43", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.Mask", + "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": "e5e101f971f34d32bd64ccd97980c4e4" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.Mask" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "f56cc6d8099b4acbb037c355281ad626", + "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": "9e37c157b286445b9f54d80f5203196c" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Tangent" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "fb11f9189be24a9da6067d6931dd7e10", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -381.0, + "y": 329.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "c785cc33bdaf457fb0925cb0cec9f811" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "cf2fddf7f8cf47dd9ea5b0282a065d6f" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", + "m_ObjectId": "fea1e8bf7a154f93b3c8f4f2915b9536", + "m_Id": 0, + "m_DisplayName": "Normal (Tangent Space)", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "NormalTS", + "m_StageCapability": 2, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_Space": 3 +} + diff --git a/TestProjects/HDRP_DXR_Tests/Assets/Scenes/RayTracedReflectionsData/EyeSG.shadergraph.meta b/TestProjects/HDRP_DXR_Tests/Assets/Scenes/RayTracedReflectionsData/EyeSG.shadergraph.meta new file mode 100644 index 00000000000..1577857b812 --- /dev/null +++ b/TestProjects/HDRP_DXR_Tests/Assets/Scenes/RayTracedReflectionsData/EyeSG.shadergraph.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 67c981429dcf7664d97d2d5bd65d7479 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} diff --git a/TestProjects/HDRP_DXR_Tests/Assets/Scenes/RayTracedReflectionsData/M_EyeSG.mat b/TestProjects/HDRP_DXR_Tests/Assets/Scenes/RayTracedReflectionsData/M_EyeSG.mat new file mode 100644 index 00000000000..8bd2be3e4a8 --- /dev/null +++ b/TestProjects/HDRP_DXR_Tests/Assets/Scenes/RayTracedReflectionsData/M_EyeSG.mat @@ -0,0 +1,105 @@ +%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: M_EyeSG + m_Shader: {fileID: -6465566751694194690, guid: 67c981429dcf7664d97d2d5bd65d7479, + type: 3} + m_ShaderKeywords: _DISABLE_SSR_TRANSPARENT + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 2225 + stringTagMap: + MotionVector: User + disabledShaderPasses: + - MOTIONVECTORS + - TransparentDepthPrepass + - TransparentDepthPostpass + - TransparentBackface + 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_Floats: + - Vector1_cf2fddf7f8cf47dd9ea5b0282a065d6f: 0.75 + - _AddPrecomputedVelocity: 0 + - _AlphaCutoffEnable: 0 + - _AlphaDstBlend: 0 + - _AlphaSrcBlend: 1 + - _AlphaToMask: 0 + - _AlphaToMaskInspectorValue: 0 + - _BlendMode: 0 + - _CullMode: 2 + - _CullModeForward: 2 + - _DepthOffsetEnable: 0 + - _DoubleSidedEnable: 0 + - _DoubleSidedNormalMode: 2 + - _DstBlend: 0 + - _EnableBlendModePreserveSpecularLighting: 1 + - _EnableFogOnTransparent: 1 + - _OpaqueCullMode: 2 + - _ReceivesSSR: 1 + - _ReceivesSSRTransparent: 0 + - _RenderQueueType: 1 + - _RequireSplitLighting: 0 + - _SrcBlend: 1 + - _StencilRef: 0 + - _StencilRefDepth: 8 + - _StencilRefDistortionVec: 4 + - _StencilRefGBuffer: 10 + - _StencilRefMV: 40 + - _StencilWriteMask: 6 + - _StencilWriteMaskDepth: 8 + - _StencilWriteMaskDistortionVec: 4 + - _StencilWriteMaskGBuffer: 14 + - _StencilWriteMaskMV: 40 + - _SupportDecals: 1 + - _SurfaceType: 0 + - _TransparentBackfaceEnable: 0 + - _TransparentCullMode: 2 + - _TransparentDepthPostpassEnable: 0 + - _TransparentDepthPrepassEnable: 0 + - _TransparentSortPriority: 0 + - _TransparentWritingMotionVec: 0 + - _TransparentZWrite: 0 + - _UseShadowThreshold: 0 + - _ZTestDepthEqualForOpaque: 3 + - _ZTestGBuffer: 4 + - _ZTestTransparent: 4 + - _ZWrite: 1 + m_Colors: + - Color_ae20c9f56dff4c199c2832dedf04ef20: {r: 0.777015, g: 0.7924528, b: 0.115877524, + a: 0} + - _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} + - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} + m_BuildTextureStacks: [] +--- !u!114 &4942899784943701917 +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: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 9 diff --git a/TestProjects/HDRP_DXR_Tests/Assets/Scenes/RayTracedReflectionsData/M_EyeSG.mat.meta b/TestProjects/HDRP_DXR_Tests/Assets/Scenes/RayTracedReflectionsData/M_EyeSG.mat.meta new file mode 100644 index 00000000000..3388bf35d56 --- /dev/null +++ b/TestProjects/HDRP_DXR_Tests/Assets/Scenes/RayTracedReflectionsData/M_EyeSG.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 60b7aef1f0622fd49acceb24666a6503 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/HDRP_DXR_Tests/Assets/Scenes/RayTracedReflectionsData/MaterialCollection.prefab b/TestProjects/HDRP_DXR_Tests/Assets/Scenes/RayTracedReflectionsData/MaterialCollection.prefab index 33318eee0f9..e37a0871c88 100644 --- a/TestProjects/HDRP_DXR_Tests/Assets/Scenes/RayTracedReflectionsData/MaterialCollection.prefab +++ b/TestProjects/HDRP_DXR_Tests/Assets/Scenes/RayTracedReflectionsData/MaterialCollection.prefab @@ -192,6 +192,102 @@ MeshCollider: m_Convex: 0 m_CookingOptions: 30 m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1585587604497181121 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1422695313859916334} + - component: {fileID: 4159540982299857323} + - component: {fileID: 6240267259823558717} + - component: {fileID: 6432890278668456426} + m_Layer: 0 + m_Name: EyeSG + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1422695313859916334 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1585587604497181121} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -8, y: 2, z: 2} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4268232187021217667} + m_Father: {fileID: 8401416846743860938} + m_RootOrder: 18 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &4159540982299857323 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1585587604497181121} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &6240267259823558717 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1585587604497181121} + 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: 60b7aef1f0622fd49acceb24666a6503, 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: 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!65 &6432890278668456426 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1585587604497181121} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} --- !u!1 &1661099919569048474 GameObject: m_ObjectHideFlags: 0 @@ -384,6 +480,101 @@ BoxCollider: serializedVersion: 2 m_Size: {x: 1, y: 1, z: 1} m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &4217812889297754221 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4268232187021217667} + - component: {fileID: 2435701198074234481} + - component: {fileID: 6277922286514885049} + m_Layer: 0 + m_Name: text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4268232187021217667 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4217812889297754221} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0.6775, y: -1.82125, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1422695313859916334} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &2435701198074234481 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4217812889297754221} + 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: 10100, guid: 0000000000000000e000000000000000, type: 0} + 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: 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!102 &6277922286514885049 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4217812889297754221} + m_Text: Eye SG + m_OffsetZ: 0 + m_CharacterSize: 0.05 + m_LineSpacing: 1 + m_Anchor: 0 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 64 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_Color: + serializedVersion: 2 + rgba: 4294967295 --- !u!1 &4307500840075600929 GameObject: m_ObjectHideFlags: 0 @@ -907,6 +1098,7 @@ Transform: - {fileID: 8991192067351909759} - {fileID: 1227134734225696504} - {fileID: 2948013597145328879} + - {fileID: 1422695313859916334} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -1096,6 +1288,7 @@ Light: m_UseColorTemperature: 0 m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 m_ShadowRadius: 0 m_ShadowAngle: 0 --- !u!114 &8401416846860372386 @@ -1110,7 +1303,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 7a68c43fe1f2a47cfa234b5eeaa98012, type: 3} m_Name: m_EditorClassIdentifier: - m_Version: 10 + m_Version: 11 m_ObsoleteShadowResolutionTier: 1 m_ObsoleteUseShadowQualitySettings: 0 m_ObsoleteCustomShadowResolution: 512 @@ -1122,6 +1315,7 @@ MonoBehaviour: m_EnableSpotReflector: 0 m_LuxAtDistance: 1 m_InnerSpotPercent: 0 + m_SpotIESCutoffPercent: 100 m_LightDimmer: 1 m_VolumetricDimmer: 1 m_LightUnit: 0 @@ -1140,6 +1334,8 @@ MonoBehaviour: m_ApplyRangeAttenuation: 1 m_DisplayAreaLightEmissiveMesh: 0 m_AreaLightCookie: {fileID: 0} + m_IESPoint: {fileID: 0} + m_IESSpot: {fileID: 0} m_AreaLightShadowCone: 120 m_UseScreenSpaceShadows: 0 m_InteractsWithSky: 1 @@ -1189,8 +1385,13 @@ MonoBehaviour: m_NormalBias: 0.75 m_SlopeBias: 0.5 m_ShadowUpdateMode: 0 + m_AlwaysDrawDynamicShadows: 0 + m_UpdateShadowOnLightMovement: 0 + m_CachedShadowTranslationThreshold: 0.01 + m_CachedShadowAngularThreshold: 0.5 m_BarnDoorAngle: 90 m_BarnDoorLength: 0.05 + m_preserveCachedShadow: 0 m_ShadowCascadeRatios: - 0.05 - 0.2 @@ -1209,6 +1410,7 @@ MonoBehaviour: showAdditionalSettings: 0 m_AreaLightEmissiveMeshShadowCastingMode: 0 m_AreaLightEmissiveMeshMotionVectorGenerationMode: 0 + m_AreaLightEmissiveMeshLayer: -1 --- !u!1 &8401416847009048942 GameObject: m_ObjectHideFlags: 0 diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index dc5b9538800..b9344a039db 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -38,6 +38,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Added tests for AOV stacking and UI rendering in the graphics compositor. - Added a new ray tracing only function that samples the specular part of the materials. - Adding missing marker for ray tracing profiling (RaytracingDeferredLighting) +- Added the support of eye shader for ray tracing. ### Fixed - Fixed several issues with physically-based DoF (TAA ghosting of the CoC buffer, smooth layer transitions, etc) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/Eye/ShaderGraph/EyeSubTarget.cs b/com.unity.render-pipelines.high-definition/Editor/Material/Eye/ShaderGraph/EyeSubTarget.cs index 2f31c806be2..a57578af5d4 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/Eye/ShaderGraph/EyeSubTarget.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/Eye/ShaderGraph/EyeSubTarget.cs @@ -32,8 +32,7 @@ sealed partial class EyeSubTarget : LightingSubTarget, ILegacyTarget, IRequiresD protected override ShaderID shaderID => HDShaderUtils.ShaderID.SG_Eye; protected override string subShaderInclude => "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Eye/Eye.hlsl"; protected override FieldDescriptor subShaderField => new FieldDescriptor(kSubShader, "Eye SubShader", ""); - - protected override bool supportRaytracing => false; + protected override string raytracingInclude => CoreIncludes.kEyeRaytracing; protected override bool requireSplitLighting => eyeData.subsurfaceScattering; EyeData m_EyeData; @@ -53,6 +52,16 @@ public EyeData eyeData public static FieldDescriptor Eye = new FieldDescriptor(kMaterial, "Eye", "_MATERIAL_FEATURE_EYE 1"); public static FieldDescriptor EyeCinematic = new FieldDescriptor(kMaterial, "EyeCinematic", "_MATERIAL_FEATURE_EYE_CINEMATIC 1"); + protected override SubShaderDescriptor GetRaytracingSubShaderDescriptor() + { + var descriptor = base.GetRaytracingSubShaderDescriptor(); + + if (eyeData.subsurfaceScattering) + descriptor.passes.Add(HDShaderPasses.GenerateRaytracingSubsurface()); + + return descriptor; + } + public override void GetFields(ref TargetFieldContext context) { base.GetFields(ref context); diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDTarget.cs b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDTarget.cs index 63032ae8b16..befd7bb5f07 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDTarget.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDTarget.cs @@ -875,6 +875,7 @@ static class CoreIncludes public const string kLitRaytracing = "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitRaytracing.hlsl"; public const string kUnlitRaytracing = "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Unlit/UnlitRaytracing.hlsl"; public const string kFabricRaytracing = "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Fabric/FabricRaytracing.hlsl"; + public const string kEyeRaytracing = "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Eye/EyeRaytracing.hlsl"; public const string kStackLitRaytracing = "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/StackLit/StackLitRaytracing.hlsl"; public const string kHairRaytracing = "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Hair/HairRaytracing.hlsl"; public const string kRaytracingLightLoop = "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/RaytracingLightLoop.hlsl"; diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Eye/EyeRaytracing.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Material/Eye/EyeRaytracing.hlsl new file mode 100644 index 00000000000..8b4d16911e8 --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Eye/EyeRaytracing.hlsl @@ -0,0 +1,54 @@ +float3 SampleSpecularBRDF(BSDFData bsdfData, float2 sample, float3 viewWS) +{ + float roughness = PerceptualRoughnessToRoughness(bsdfData.perceptualRoughness); + float3x3 localToWorld = GetLocalFrame(bsdfData.normalWS); + float NdotL, NdotH, VdotH; + float3 sampleDir; + SampleGGXDir(sample, viewWS, localToWorld, roughness, sampleDir, NdotL, NdotH, VdotH); + return sampleDir; +} + +#ifdef HAS_LIGHTLOOP +IndirectLighting EvaluateBSDF_RaytracedReflection(LightLoopContext lightLoopContext, + BSDFData bsdfData, + PreLightData preLightData, + float3 reflection) +{ + IndirectLighting lighting; + ZERO_INITIALIZE(IndirectLighting, lighting); + lighting.specularReflected = reflection.rgb * preLightData.specularFGD; + return lighting; +} + + +IndirectLighting EvaluateBSDF_RaytracedRefraction(LightLoopContext lightLoopContext, + PreLightData preLightData, + float3 transmittedColor) +{ + IndirectLighting lighting; + ZERO_INITIALIZE(IndirectLighting, lighting); + return lighting; +} + +float RecursiveRenderingReflectionPerceptualSmoothness(BSDFData bsdfData) +{ + return PerceptualRoughnessToPerceptualSmoothness(bsdfData.perceptualRoughness); +} +#endif + +#if (SHADERPASS == SHADERPASS_RAYTRACING_GBUFFER) +void FitToStandardLit( SurfaceData surfaceData + , BuiltinData builtinData + , uint2 positionSS + , out StandardBSDFData outStandardlit) +{ + outStandardlit.baseColor = surfaceData.baseColor; + outStandardlit.specularOcclusion = surfaceData.specularOcclusion; + outStandardlit.normalWS = surfaceData.normalWS; + outStandardlit.perceptualRoughness = PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness); + outStandardlit.fresnel0 = IorToFresnel0(surfaceData.IOR).xxx; + outStandardlit.coatMask = 0.0; + outStandardlit.emissiveAndBaked = builtinData.bakeDiffuseLighting * surfaceData.ambientOcclusion + builtinData.emissiveColor; + outStandardlit.isUnlit = 0; +} +#endif diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Eye/EyeRaytracing.hlsl.meta b/com.unity.render-pipelines.high-definition/Runtime/Material/Eye/EyeRaytracing.hlsl.meta new file mode 100644 index 00000000000..eb35fdd635b --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Eye/EyeRaytracing.hlsl.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: a056724d08b3f744ba7a15e5398cd2e3 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + preprocessorOverride: 0 + userData: + assetBundleName: + assetBundleVariant: