diff --git a/Assets/QA/Input_Test/GUITest.unity b/Assets/QA/Input_Test/GUITest.unity index e749d7d9d5..9f81ee5773 100644 --- a/Assets/QA/Input_Test/GUITest.unity +++ b/Assets/QA/Input_Test/GUITest.unity @@ -270,7 +270,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -943,7 +943,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1721,7 +1721,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -2377,7 +2377,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 diff --git a/Assets/QA/Materials/Blue.mat b/Assets/QA/Materials/Blue.mat index 2adba28e66..b28b461d90 100644 --- a/Assets/QA/Materials/Blue.mat +++ b/Assets/QA/Materials/Blue.mat @@ -8,7 +8,7 @@ Material: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: Blue - m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_Shader: {fileID: 4800000, guid: a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6, type: 3} m_Parent: {fileID: 0} m_ModifiedSerializedProperties: 0 m_ValidKeywords: [] diff --git a/Assets/QA/Materials/Green.mat b/Assets/QA/Materials/Green.mat index 90370803fa..904bbba117 100644 --- a/Assets/QA/Materials/Green.mat +++ b/Assets/QA/Materials/Green.mat @@ -8,7 +8,7 @@ Material: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: Green - m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_Shader: {fileID: 4800000, guid: a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6, type: 3} m_Parent: {fileID: 0} m_ModifiedSerializedProperties: 0 m_ValidKeywords: [] diff --git a/Assets/QA/Materials/Red.mat b/Assets/QA/Materials/Red.mat index 18e55761de..3263914da4 100644 --- a/Assets/QA/Materials/Red.mat +++ b/Assets/QA/Materials/Red.mat @@ -8,7 +8,7 @@ Material: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: Red - m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_Shader: {fileID: 4800000, guid: a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6, type: 3} m_Parent: {fileID: 0} m_ModifiedSerializedProperties: 0 m_ValidKeywords: [] diff --git a/Assets/QA/Materials/White.mat b/Assets/QA/Materials/White.mat index 84294d0f89..57c4143c80 100644 --- a/Assets/QA/Materials/White.mat +++ b/Assets/QA/Materials/White.mat @@ -8,7 +8,7 @@ Material: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: White - m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_Shader: {fileID: 4800000, guid: a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6, type: 3} m_Parent: {fileID: 0} m_ModifiedSerializedProperties: 0 m_ValidKeywords: [] diff --git a/Assets/QA/MouseEvents/OnMouseEventsTestScene.unity b/Assets/QA/MouseEvents/OnMouseEventsTestScene.unity index f1f00c0a0d..ccf7796fb0 100644 --- a/Assets/QA/MouseEvents/OnMouseEventsTestScene.unity +++ b/Assets/QA/MouseEvents/OnMouseEventsTestScene.unity @@ -289,7 +289,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -407,7 +407,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 diff --git a/Assets/QA/Tests/DocsExamples/Scenes/Example with Actions Asset C# Wrapper.unity b/Assets/QA/Tests/DocsExamples/Scenes/Example with Actions Asset C# Wrapper.unity index 3f18b91706..82a61e43b0 100644 --- a/Assets/QA/Tests/DocsExamples/Scenes/Example with Actions Asset C# Wrapper.unity +++ b/Assets/QA/Tests/DocsExamples/Scenes/Example with Actions Asset C# Wrapper.unity @@ -195,7 +195,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 diff --git a/Assets/QA/Tests/DocsExamples/Scenes/Example with Actions Asset Reference.unity b/Assets/QA/Tests/DocsExamples/Scenes/Example with Actions Asset Reference.unity index 8f84d64438..461abf327b 100644 --- a/Assets/QA/Tests/DocsExamples/Scenes/Example with Actions Asset Reference.unity +++ b/Assets/QA/Tests/DocsExamples/Scenes/Example with Actions Asset Reference.unity @@ -196,7 +196,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 diff --git a/Assets/QA/Tests/DocsExamples/Scenes/Example with PlayerInput component.unity b/Assets/QA/Tests/DocsExamples/Scenes/Example with PlayerInput component.unity index ae490cc5c9..d66bc8f79d 100644 --- a/Assets/QA/Tests/DocsExamples/Scenes/Example with PlayerInput component.unity +++ b/Assets/QA/Tests/DocsExamples/Scenes/Example with PlayerInput component.unity @@ -247,7 +247,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 diff --git a/Assets/QA/Tests/EditMode/EditModeTest.unity b/Assets/QA/Tests/EditMode/EditModeTest.unity index 19bf2170d1..85541990f5 100644 --- a/Assets/QA/Tests/EditMode/EditModeTest.unity +++ b/Assets/QA/Tests/EditMode/EditModeTest.unity @@ -199,7 +199,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -305,7 +305,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -410,7 +410,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -515,7 +515,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -621,7 +621,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -728,7 +728,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -833,7 +833,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -938,7 +938,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1044,7 +1044,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1151,7 +1151,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1351,7 +1351,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1591,7 +1591,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1696,7 +1696,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1837,7 +1837,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1944,7 +1944,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -2180,7 +2180,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -2416,7 +2416,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -2521,7 +2521,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -2626,7 +2626,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -2733,7 +2733,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -2840,7 +2840,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -2945,7 +2945,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -3051,7 +3051,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -3157,7 +3157,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -3262,7 +3262,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -3367,7 +3367,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -3472,7 +3472,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -3617,7 +3617,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -3724,7 +3724,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -3831,7 +3831,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -3938,7 +3938,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -4045,7 +4045,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -4151,7 +4151,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 diff --git a/Assets/QA/Tests/XRDeviceActions/MagicLeap/MLActions.unity b/Assets/QA/Tests/XRDeviceActions/MagicLeap/MLActions.unity index d9af4e8c9a..180f6e218e 100644 --- a/Assets/QA/Tests/XRDeviceActions/MagicLeap/MLActions.unity +++ b/Assets/QA/Tests/XRDeviceActions/MagicLeap/MLActions.unity @@ -6722,7 +6722,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -13120,7 +13120,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: c8291cad59243b24ba551b0bc44dc40d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 diff --git a/Assets/Samples/InGameHints/.sample.json b/Assets/Samples/InGameHints/.sample.json index 5bd2644af4..188d6b1efa 100644 --- a/Assets/Samples/InGameHints/.sample.json +++ b/Assets/Samples/InGameHints/.sample.json @@ -1,4 +1,4 @@ { "displayName": "In-Game Hints", - "description": "Demonstrates how to create in-game hints in the UI which reflect current bindings and active control schemes." + "description": "Demonstrates how to create in-game hints in the UI which reflect current bindings and active control schemes. Requires the Universal Render Pipeline (URP) package to be installed for shader compilation." } \ No newline at end of file diff --git a/Assets/Samples/InGameHints/Default.mat b/Assets/Samples/InGameHints/Default.mat new file mode 100644 index 0000000000..8a7b4649d2 --- /dev/null +++ b/Assets/Samples/InGameHints/Default.mat @@ -0,0 +1,30 @@ +%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: Default + m_Shader: {fileID: 4800000, guid: a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4, type: 3} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Glossiness: 0.5 + - _Metallic: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} diff --git a/Assets/Samples/InGameHints/Default.mat.meta b/Assets/Samples/InGameHints/Default.mat.meta new file mode 100644 index 0000000000..b16ee6ff35 --- /dev/null +++ b/Assets/Samples/InGameHints/Default.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/InGameHints/InGameHintsSampleScene.unity b/Assets/Samples/InGameHints/InGameHintsSampleScene.unity index bbee5f835e..5a000ee4a3 100644 --- a/Assets/Samples/InGameHints/InGameHintsSampleScene.unity +++ b/Assets/Samples/InGameHints/InGameHintsSampleScene.unity @@ -368,7 +368,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -501,7 +501,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -713,7 +713,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -819,7 +819,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -952,7 +952,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1085,7 +1085,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1218,7 +1218,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1351,7 +1351,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1484,7 +1484,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1617,7 +1617,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1750,7 +1750,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1883,7 +1883,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -2016,7 +2016,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -2292,7 +2292,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -2425,7 +2425,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -2558,7 +2558,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -2691,7 +2691,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -2824,7 +2824,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -2957,7 +2957,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -3090,7 +3090,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -3223,7 +3223,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -3356,7 +3356,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 diff --git a/Assets/Samples/InGameHints/SimpleLit.shader b/Assets/Samples/InGameHints/SimpleLit.shader new file mode 100644 index 0000000000..1c9d88da04 --- /dev/null +++ b/Assets/Samples/InGameHints/SimpleLit.shader @@ -0,0 +1,184 @@ +Shader "Samples/InGameHints/SimpleLit" +{ + Properties + { + _Color ("Color", Color) = (1,1,1,1) + _MainTex ("Albedo (RGB)", 2D) = "white" {} + _Glossiness ("Smoothness", Range(0,1)) = 0.5 + _Metallic ("Metallic", Range(0,1)) = 0.0 + } + + SubShader + { + Tags { "RenderType"="Opaque" "RenderPipeline"="UniversalPipeline" "Queue"="Geometry" } + + Pass + { + Name "ForwardLit" + Tags { "LightMode"="UniversalForward" } + + HLSLPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN + #pragma multi_compile _ _SHADOWS_SOFT + #pragma multi_compile _ _ADDITIONAL_LIGHTS + #pragma multi_compile_fog + + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + CBUFFER_START(UnityPerMaterial) + float4 _MainTex_ST; + half4 _Color; + half _Glossiness; + half _Metallic; + CBUFFER_END + + struct Attributes + { + float4 positionOS : POSITION; + float3 normalOS : NORMAL; + float2 uv : TEXCOORD0; + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + float2 uv : TEXCOORD0; + float3 normalWS : TEXCOORD1; + float3 positionWS : TEXCOORD2; + float fogFactor : TEXCOORD3; + }; + + Varyings vert(Attributes input) + { + Varyings output; + VertexPositionInputs posInputs = GetVertexPositionInputs(input.positionOS.xyz); + output.positionCS = posInputs.positionCS; + output.positionWS = posInputs.positionWS; + output.normalWS = TransformObjectToWorldNormal(input.normalOS); + output.uv = TRANSFORM_TEX(input.uv, _MainTex); + output.fogFactor = ComputeFogFactor(posInputs.positionCS.z); + return output; + } + + half4 frag(Varyings input) : SV_Target + { + half4 albedo = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, input.uv) * _Color; + + InputData inputData = (InputData)0; + inputData.positionWS = input.positionWS; + inputData.normalWS = normalize(input.normalWS); + inputData.viewDirectionWS = GetWorldSpaceNormalizeViewDir(input.positionWS); + inputData.shadowCoord = TransformWorldToShadowCoord(input.positionWS); + + SurfaceData surfaceData = (SurfaceData)0; + surfaceData.albedo = albedo.rgb; + surfaceData.alpha = albedo.a; + surfaceData.metallic = _Metallic; + surfaceData.smoothness = _Glossiness; + surfaceData.occlusion = 1.0; + + half4 color = UniversalFragmentPBR(inputData, surfaceData); + color.rgb = MixFog(color.rgb, input.fogFactor); + return color; + } + ENDHLSL + } + + Pass + { + Name "ShadowCaster" + Tags { "LightMode"="ShadowCaster" } + + ZWrite On + ZTest LEqual + ColorMask 0 + + HLSLPROGRAM + #pragma vertex ShadowVert + #pragma fragment ShadowFrag + #pragma multi_compile _ _CASTING_PUNCTUAL_LIGHT_SHADOW + + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl" + + float3 _LightDirection; + float3 _LightPosition; + + struct Attributes + { + float4 positionOS : POSITION; + float3 normalOS : NORMAL; + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + }; + + Varyings ShadowVert(Attributes input) + { + Varyings output; + float3 posWS = TransformObjectToWorld(input.positionOS.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normalOS); + + #if _CASTING_PUNCTUAL_LIGHT_SHADOW + float3 lightDir = normalize(_LightPosition - posWS); + #else + float3 lightDir = _LightDirection; + #endif + + output.positionCS = TransformWorldToHClip(ApplyShadowBias(posWS, normalWS, lightDir)); + #if UNITY_REVERSED_Z + output.positionCS.z = min(output.positionCS.z, UNITY_NEAR_CLIP_VALUE); + #else + output.positionCS.z = max(output.positionCS.z, UNITY_NEAR_CLIP_VALUE); + #endif + return output; + } + + half4 ShadowFrag(Varyings input) : SV_Target + { + return 0; + } + ENDHLSL + } + } + + SubShader + { + Tags { "RenderType"="Opaque" } + LOD 200 + + CGPROGRAM + #pragma surface surf Standard fullforwardshadows + #pragma target 3.0 + + sampler2D _MainTex; + half _Glossiness; + half _Metallic; + fixed4 _Color; + + struct Input + { + float2 uv_MainTex; + }; + + void surf(Input IN, inout SurfaceOutputStandard o) + { + fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; + o.Albedo = c.rgb; + o.Metallic = _Metallic; + o.Smoothness = _Glossiness; + o.Alpha = c.a; + } + ENDCG + } + + FallBack "Diffuse" +} diff --git a/Assets/Samples/InGameHints/SimpleLit.shader.meta b/Assets/Samples/InGameHints/SimpleLit.shader.meta new file mode 100644 index 0000000000..302548e0f9 --- /dev/null +++ b/Assets/Samples/InGameHints/SimpleLit.shader.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + preprocessorOverride: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/InputDeviceTester/.sample.json b/Assets/Samples/InputDeviceTester/.sample.json index 4a89ef6801..4ea3549c35 100644 --- a/Assets/Samples/InputDeviceTester/.sample.json +++ b/Assets/Samples/InputDeviceTester/.sample.json @@ -1,4 +1,4 @@ { "displayName": "InputDeviceTester", - "description": "A scene containing UI to visualize the controls on various supported input devices." + "description": "A scene containing UI to visualize the controls on various supported input devices. Requires the Universal Render Pipeline (URP) package to be installed for shader compilation." } \ No newline at end of file diff --git a/Assets/Samples/ProjectWideActions/Default.mat b/Assets/Samples/ProjectWideActions/Default.mat new file mode 100644 index 0000000000..1ec8689196 --- /dev/null +++ b/Assets/Samples/ProjectWideActions/Default.mat @@ -0,0 +1,30 @@ +%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: Default + m_Shader: {fileID: 4800000, guid: c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0, type: 3} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Glossiness: 0.5 + - _Metallic: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} diff --git a/Assets/Samples/ProjectWideActions/Default.mat.meta b/Assets/Samples/ProjectWideActions/Default.mat.meta new file mode 100644 index 0000000000..2003fad83e --- /dev/null +++ b/Assets/Samples/ProjectWideActions/Default.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/ProjectWideActions/ProjectWideActionsSampleScene.unity b/Assets/Samples/ProjectWideActions/ProjectWideActionsSampleScene.unity index 18fecd297e..2b7c125e83 100644 --- a/Assets/Samples/ProjectWideActions/ProjectWideActionsSampleScene.unity +++ b/Assets/Samples/ProjectWideActions/ProjectWideActionsSampleScene.unity @@ -413,7 +413,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 diff --git a/Assets/Samples/ProjectWideActions/SimpleLit.shader b/Assets/Samples/ProjectWideActions/SimpleLit.shader new file mode 100644 index 0000000000..3cb2ab32f1 --- /dev/null +++ b/Assets/Samples/ProjectWideActions/SimpleLit.shader @@ -0,0 +1,184 @@ +Shader "Samples/ProjectWideActions/SimpleLit" +{ + Properties + { + _Color ("Color", Color) = (1,1,1,1) + _MainTex ("Albedo (RGB)", 2D) = "white" {} + _Glossiness ("Smoothness", Range(0,1)) = 0.5 + _Metallic ("Metallic", Range(0,1)) = 0.0 + } + + SubShader + { + Tags { "RenderType"="Opaque" "RenderPipeline"="UniversalPipeline" "Queue"="Geometry" } + + Pass + { + Name "ForwardLit" + Tags { "LightMode"="UniversalForward" } + + HLSLPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN + #pragma multi_compile _ _SHADOWS_SOFT + #pragma multi_compile _ _ADDITIONAL_LIGHTS + #pragma multi_compile_fog + + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + CBUFFER_START(UnityPerMaterial) + float4 _MainTex_ST; + half4 _Color; + half _Glossiness; + half _Metallic; + CBUFFER_END + + struct Attributes + { + float4 positionOS : POSITION; + float3 normalOS : NORMAL; + float2 uv : TEXCOORD0; + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + float2 uv : TEXCOORD0; + float3 normalWS : TEXCOORD1; + float3 positionWS : TEXCOORD2; + float fogFactor : TEXCOORD3; + }; + + Varyings vert(Attributes input) + { + Varyings output; + VertexPositionInputs posInputs = GetVertexPositionInputs(input.positionOS.xyz); + output.positionCS = posInputs.positionCS; + output.positionWS = posInputs.positionWS; + output.normalWS = TransformObjectToWorldNormal(input.normalOS); + output.uv = TRANSFORM_TEX(input.uv, _MainTex); + output.fogFactor = ComputeFogFactor(posInputs.positionCS.z); + return output; + } + + half4 frag(Varyings input) : SV_Target + { + half4 albedo = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, input.uv) * _Color; + + InputData inputData = (InputData)0; + inputData.positionWS = input.positionWS; + inputData.normalWS = normalize(input.normalWS); + inputData.viewDirectionWS = GetWorldSpaceNormalizeViewDir(input.positionWS); + inputData.shadowCoord = TransformWorldToShadowCoord(input.positionWS); + + SurfaceData surfaceData = (SurfaceData)0; + surfaceData.albedo = albedo.rgb; + surfaceData.alpha = albedo.a; + surfaceData.metallic = _Metallic; + surfaceData.smoothness = _Glossiness; + surfaceData.occlusion = 1.0; + + half4 color = UniversalFragmentPBR(inputData, surfaceData); + color.rgb = MixFog(color.rgb, input.fogFactor); + return color; + } + ENDHLSL + } + + Pass + { + Name "ShadowCaster" + Tags { "LightMode"="ShadowCaster" } + + ZWrite On + ZTest LEqual + ColorMask 0 + + HLSLPROGRAM + #pragma vertex ShadowVert + #pragma fragment ShadowFrag + #pragma multi_compile _ _CASTING_PUNCTUAL_LIGHT_SHADOW + + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl" + + float3 _LightDirection; + float3 _LightPosition; + + struct Attributes + { + float4 positionOS : POSITION; + float3 normalOS : NORMAL; + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + }; + + Varyings ShadowVert(Attributes input) + { + Varyings output; + float3 posWS = TransformObjectToWorld(input.positionOS.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normalOS); + + #if _CASTING_PUNCTUAL_LIGHT_SHADOW + float3 lightDir = normalize(_LightPosition - posWS); + #else + float3 lightDir = _LightDirection; + #endif + + output.positionCS = TransformWorldToHClip(ApplyShadowBias(posWS, normalWS, lightDir)); + #if UNITY_REVERSED_Z + output.positionCS.z = min(output.positionCS.z, UNITY_NEAR_CLIP_VALUE); + #else + output.positionCS.z = max(output.positionCS.z, UNITY_NEAR_CLIP_VALUE); + #endif + return output; + } + + half4 ShadowFrag(Varyings input) : SV_Target + { + return 0; + } + ENDHLSL + } + } + + SubShader + { + Tags { "RenderType"="Opaque" } + LOD 200 + + CGPROGRAM + #pragma surface surf Standard fullforwardshadows + #pragma target 3.0 + + sampler2D _MainTex; + half _Glossiness; + half _Metallic; + fixed4 _Color; + + struct Input + { + float2 uv_MainTex; + }; + + void surf(Input IN, inout SurfaceOutputStandard o) + { + fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; + o.Albedo = c.rgb; + o.Metallic = _Metallic; + o.Smoothness = _Glossiness; + o.Alpha = c.a; + } + ENDCG + } + + FallBack "Diffuse" +} diff --git a/Assets/Samples/ProjectWideActions/SimpleLit.shader.meta b/Assets/Samples/ProjectWideActions/SimpleLit.shader.meta new file mode 100644 index 0000000000..7a0e0b5296 --- /dev/null +++ b/Assets/Samples/ProjectWideActions/SimpleLit.shader.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + preprocessorOverride: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/RebindingUI/.sample.json b/Assets/Samples/RebindingUI/.sample.json index e84e903262..ee58b907d6 100644 --- a/Assets/Samples/RebindingUI/.sample.json +++ b/Assets/Samples/RebindingUI/.sample.json @@ -1,4 +1,4 @@ { "displayName": "Rebinding UI", - "description": "An example UI component that demonstrates how to create UI for rebinding actions." + "description": "An example UI component that demonstrates how to create UI for rebinding actions. Requires the Universal Render Pipeline (URP) package to be installed for shader compilation." } \ No newline at end of file diff --git a/Assets/Samples/RebindingUI/Default.mat b/Assets/Samples/RebindingUI/Default.mat new file mode 100644 index 0000000000..78dcecf5b3 --- /dev/null +++ b/Assets/Samples/RebindingUI/Default.mat @@ -0,0 +1,30 @@ +%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: Default + m_Shader: {fileID: 4800000, guid: c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5f6, type: 3} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Glossiness: 0.5 + - _Metallic: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} diff --git a/Assets/Samples/RebindingUI/Default.mat.meta b/Assets/Samples/RebindingUI/Default.mat.meta new file mode 100644 index 0000000000..6951666b77 --- /dev/null +++ b/Assets/Samples/RebindingUI/Default.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d2e3f4a5b6c7d8e9f0a1b2c3d4e5f6a7 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/RebindingUI/Game/BulletMaterial.mat b/Assets/Samples/RebindingUI/Game/BulletMaterial.mat index b1b5c0921c..7799774819 100644 --- a/Assets/Samples/RebindingUI/Game/BulletMaterial.mat +++ b/Assets/Samples/RebindingUI/Game/BulletMaterial.mat @@ -8,7 +8,7 @@ Material: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: BulletMaterial - m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_Shader: {fileID: 4800000, guid: c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5f6, type: 3} m_Parent: {fileID: 0} m_ModifiedSerializedProperties: 0 m_ValidKeywords: diff --git a/Assets/Samples/RebindingUI/Game/EnemyMaterial.mat b/Assets/Samples/RebindingUI/Game/EnemyMaterial.mat index 92b4050ce8..cb49be369c 100644 --- a/Assets/Samples/RebindingUI/Game/EnemyMaterial.mat +++ b/Assets/Samples/RebindingUI/Game/EnemyMaterial.mat @@ -8,7 +8,7 @@ Material: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: EnemyMaterial - m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_Shader: {fileID: 4800000, guid: c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5f6, type: 3} m_Parent: {fileID: 0} m_ModifiedSerializedProperties: 0 m_ValidKeywords: diff --git a/Assets/Samples/RebindingUI/Game/Explosion.prefab b/Assets/Samples/RebindingUI/Game/Explosion.prefab index 57809ba924..ca14233d1c 100644 --- a/Assets/Samples/RebindingUI/Game/Explosion.prefab +++ b/Assets/Samples/RebindingUI/Game/Explosion.prefab @@ -79,7 +79,7 @@ ParticleSystemRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10301, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: d2e3f4a5b6c7d8e9f0a1b2c3d4e5f6a7, type: 2} - {fileID: 10308, guid: 0000000000000000f000000000000000, type: 0} m_StaticBatchInfo: firstSubMesh: 0 diff --git a/Assets/Samples/RebindingUI/Game/PlayerMaterial.mat b/Assets/Samples/RebindingUI/Game/PlayerMaterial.mat index c8625b01a3..2690d54c89 100644 --- a/Assets/Samples/RebindingUI/Game/PlayerMaterial.mat +++ b/Assets/Samples/RebindingUI/Game/PlayerMaterial.mat @@ -8,7 +8,7 @@ Material: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: PlayerMaterial - m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_Shader: {fileID: 4800000, guid: c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5f6, type: 3} m_Parent: {fileID: 0} m_ModifiedSerializedProperties: 0 m_ValidKeywords: diff --git a/Assets/Samples/RebindingUI/Game/PlayerMaterial2.mat b/Assets/Samples/RebindingUI/Game/PlayerMaterial2.mat index c3e33fa6cf..c8a2dcafa3 100644 --- a/Assets/Samples/RebindingUI/Game/PlayerMaterial2.mat +++ b/Assets/Samples/RebindingUI/Game/PlayerMaterial2.mat @@ -8,7 +8,7 @@ Material: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: PlayerMaterial2 - m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_Shader: {fileID: 4800000, guid: c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5f6, type: 3} m_Parent: {fileID: 0} m_ModifiedSerializedProperties: 0 m_ValidKeywords: diff --git a/Assets/Samples/RebindingUI/SimpleLit.shader b/Assets/Samples/RebindingUI/SimpleLit.shader new file mode 100644 index 0000000000..e6a861e9d3 --- /dev/null +++ b/Assets/Samples/RebindingUI/SimpleLit.shader @@ -0,0 +1,184 @@ +Shader "Samples/RebindingUI/SimpleLit" +{ + Properties + { + _Color ("Color", Color) = (1,1,1,1) + _MainTex ("Albedo (RGB)", 2D) = "white" {} + _Glossiness ("Smoothness", Range(0,1)) = 0.5 + _Metallic ("Metallic", Range(0,1)) = 0.0 + } + + SubShader + { + Tags { "RenderType"="Opaque" "RenderPipeline"="UniversalPipeline" "Queue"="Geometry" } + + Pass + { + Name "ForwardLit" + Tags { "LightMode"="UniversalForward" } + + HLSLPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN + #pragma multi_compile _ _SHADOWS_SOFT + #pragma multi_compile _ _ADDITIONAL_LIGHTS + #pragma multi_compile_fog + + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + CBUFFER_START(UnityPerMaterial) + float4 _MainTex_ST; + half4 _Color; + half _Glossiness; + half _Metallic; + CBUFFER_END + + struct Attributes + { + float4 positionOS : POSITION; + float3 normalOS : NORMAL; + float2 uv : TEXCOORD0; + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + float2 uv : TEXCOORD0; + float3 normalWS : TEXCOORD1; + float3 positionWS : TEXCOORD2; + float fogFactor : TEXCOORD3; + }; + + Varyings vert(Attributes input) + { + Varyings output; + VertexPositionInputs posInputs = GetVertexPositionInputs(input.positionOS.xyz); + output.positionCS = posInputs.positionCS; + output.positionWS = posInputs.positionWS; + output.normalWS = TransformObjectToWorldNormal(input.normalOS); + output.uv = TRANSFORM_TEX(input.uv, _MainTex); + output.fogFactor = ComputeFogFactor(posInputs.positionCS.z); + return output; + } + + half4 frag(Varyings input) : SV_Target + { + half4 albedo = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, input.uv) * _Color; + + InputData inputData = (InputData)0; + inputData.positionWS = input.positionWS; + inputData.normalWS = normalize(input.normalWS); + inputData.viewDirectionWS = GetWorldSpaceNormalizeViewDir(input.positionWS); + inputData.shadowCoord = TransformWorldToShadowCoord(input.positionWS); + + SurfaceData surfaceData = (SurfaceData)0; + surfaceData.albedo = albedo.rgb; + surfaceData.alpha = albedo.a; + surfaceData.metallic = _Metallic; + surfaceData.smoothness = _Glossiness; + surfaceData.occlusion = 1.0; + + half4 color = UniversalFragmentPBR(inputData, surfaceData); + color.rgb = MixFog(color.rgb, input.fogFactor); + return color; + } + ENDHLSL + } + + Pass + { + Name "ShadowCaster" + Tags { "LightMode"="ShadowCaster" } + + ZWrite On + ZTest LEqual + ColorMask 0 + + HLSLPROGRAM + #pragma vertex ShadowVert + #pragma fragment ShadowFrag + #pragma multi_compile _ _CASTING_PUNCTUAL_LIGHT_SHADOW + + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl" + + float3 _LightDirection; + float3 _LightPosition; + + struct Attributes + { + float4 positionOS : POSITION; + float3 normalOS : NORMAL; + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + }; + + Varyings ShadowVert(Attributes input) + { + Varyings output; + float3 posWS = TransformObjectToWorld(input.positionOS.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normalOS); + + #if _CASTING_PUNCTUAL_LIGHT_SHADOW + float3 lightDir = normalize(_LightPosition - posWS); + #else + float3 lightDir = _LightDirection; + #endif + + output.positionCS = TransformWorldToHClip(ApplyShadowBias(posWS, normalWS, lightDir)); + #if UNITY_REVERSED_Z + output.positionCS.z = min(output.positionCS.z, UNITY_NEAR_CLIP_VALUE); + #else + output.positionCS.z = max(output.positionCS.z, UNITY_NEAR_CLIP_VALUE); + #endif + return output; + } + + half4 ShadowFrag(Varyings input) : SV_Target + { + return 0; + } + ENDHLSL + } + } + + SubShader + { + Tags { "RenderType"="Opaque" } + LOD 200 + + CGPROGRAM + #pragma surface surf Standard fullforwardshadows + #pragma target 3.0 + + sampler2D _MainTex; + half _Glossiness; + half _Metallic; + fixed4 _Color; + + struct Input + { + float2 uv_MainTex; + }; + + void surf(Input IN, inout SurfaceOutputStandard o) + { + fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; + o.Albedo = c.rgb; + o.Metallic = _Metallic; + o.Smoothness = _Glossiness; + o.Alpha = c.a; + } + ENDCG + } + + FallBack "Diffuse" +} diff --git a/Assets/Samples/RebindingUI/SimpleLit.shader.meta b/Assets/Samples/RebindingUI/SimpleLit.shader.meta new file mode 100644 index 0000000000..993ddc84a3 --- /dev/null +++ b/Assets/Samples/RebindingUI/SimpleLit.shader.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5f6 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + preprocessorOverride: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/SimpleDemo/.sample.json b/Assets/Samples/SimpleDemo/.sample.json index f12e390272..a9b2bd52c5 100644 --- a/Assets/Samples/SimpleDemo/.sample.json +++ b/Assets/Samples/SimpleDemo/.sample.json @@ -1,4 +1,4 @@ { "displayName": "Simple Demo", - "description": "A walkthrough of a simple character controller that demonstrates several techniques for working with the input system. See the README.md file in the sample for details." + "description": "A walkthrough of a simple character controller that demonstrates several techniques for working with the input system. See the README.md file in the sample for details. Requires the Universal Render Pipeline (URP) package to be installed for shader compilation." } \ No newline at end of file diff --git a/Assets/Samples/SimpleDemo/Default.mat b/Assets/Samples/SimpleDemo/Default.mat new file mode 100644 index 0000000000..847fbdd07c --- /dev/null +++ b/Assets/Samples/SimpleDemo/Default.mat @@ -0,0 +1,30 @@ +%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: Default + m_Shader: {fileID: 4800000, guid: e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6, type: 3} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Glossiness: 0.5 + - _Metallic: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} diff --git a/Assets/Samples/SimpleDemo/Default.mat.meta b/Assets/Samples/SimpleDemo/Default.mat.meta new file mode 100644 index 0000000000..55ca30f20a --- /dev/null +++ b/Assets/Samples/SimpleDemo/Default.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/SimpleDemo/Environment.prefab b/Assets/Samples/SimpleDemo/Environment.prefab index 0c7c7e1330..3fa98963ff 100644 --- a/Assets/Samples/SimpleDemo/Environment.prefab +++ b/Assets/Samples/SimpleDemo/Environment.prefab @@ -124,7 +124,7 @@ MeshRenderer: m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -324,7 +324,7 @@ MeshRenderer: m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -429,7 +429,7 @@ MeshRenderer: m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -534,7 +534,7 @@ MeshRenderer: m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -639,7 +639,7 @@ MeshRenderer: m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 diff --git a/Assets/Samples/SimpleDemo/SimpleLit.shader b/Assets/Samples/SimpleDemo/SimpleLit.shader new file mode 100644 index 0000000000..edbf00cc3e --- /dev/null +++ b/Assets/Samples/SimpleDemo/SimpleLit.shader @@ -0,0 +1,184 @@ +Shader "Samples/SimpleDemo/SimpleLit" +{ + Properties + { + _Color ("Color", Color) = (1,1,1,1) + _MainTex ("Albedo (RGB)", 2D) = "white" {} + _Glossiness ("Smoothness", Range(0,1)) = 0.5 + _Metallic ("Metallic", Range(0,1)) = 0.0 + } + + SubShader + { + Tags { "RenderType"="Opaque" "RenderPipeline"="UniversalPipeline" "Queue"="Geometry" } + + Pass + { + Name "ForwardLit" + Tags { "LightMode"="UniversalForward" } + + HLSLPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN + #pragma multi_compile _ _SHADOWS_SOFT + #pragma multi_compile _ _ADDITIONAL_LIGHTS + #pragma multi_compile_fog + + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + CBUFFER_START(UnityPerMaterial) + float4 _MainTex_ST; + half4 _Color; + half _Glossiness; + half _Metallic; + CBUFFER_END + + struct Attributes + { + float4 positionOS : POSITION; + float3 normalOS : NORMAL; + float2 uv : TEXCOORD0; + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + float2 uv : TEXCOORD0; + float3 normalWS : TEXCOORD1; + float3 positionWS : TEXCOORD2; + float fogFactor : TEXCOORD3; + }; + + Varyings vert(Attributes input) + { + Varyings output; + VertexPositionInputs posInputs = GetVertexPositionInputs(input.positionOS.xyz); + output.positionCS = posInputs.positionCS; + output.positionWS = posInputs.positionWS; + output.normalWS = TransformObjectToWorldNormal(input.normalOS); + output.uv = TRANSFORM_TEX(input.uv, _MainTex); + output.fogFactor = ComputeFogFactor(posInputs.positionCS.z); + return output; + } + + half4 frag(Varyings input) : SV_Target + { + half4 albedo = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, input.uv) * _Color; + + InputData inputData = (InputData)0; + inputData.positionWS = input.positionWS; + inputData.normalWS = normalize(input.normalWS); + inputData.viewDirectionWS = GetWorldSpaceNormalizeViewDir(input.positionWS); + inputData.shadowCoord = TransformWorldToShadowCoord(input.positionWS); + + SurfaceData surfaceData = (SurfaceData)0; + surfaceData.albedo = albedo.rgb; + surfaceData.alpha = albedo.a; + surfaceData.metallic = _Metallic; + surfaceData.smoothness = _Glossiness; + surfaceData.occlusion = 1.0; + + half4 color = UniversalFragmentPBR(inputData, surfaceData); + color.rgb = MixFog(color.rgb, input.fogFactor); + return color; + } + ENDHLSL + } + + Pass + { + Name "ShadowCaster" + Tags { "LightMode"="ShadowCaster" } + + ZWrite On + ZTest LEqual + ColorMask 0 + + HLSLPROGRAM + #pragma vertex ShadowVert + #pragma fragment ShadowFrag + #pragma multi_compile _ _CASTING_PUNCTUAL_LIGHT_SHADOW + + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl" + + float3 _LightDirection; + float3 _LightPosition; + + struct Attributes + { + float4 positionOS : POSITION; + float3 normalOS : NORMAL; + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + }; + + Varyings ShadowVert(Attributes input) + { + Varyings output; + float3 posWS = TransformObjectToWorld(input.positionOS.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normalOS); + + #if _CASTING_PUNCTUAL_LIGHT_SHADOW + float3 lightDir = normalize(_LightPosition - posWS); + #else + float3 lightDir = _LightDirection; + #endif + + output.positionCS = TransformWorldToHClip(ApplyShadowBias(posWS, normalWS, lightDir)); + #if UNITY_REVERSED_Z + output.positionCS.z = min(output.positionCS.z, UNITY_NEAR_CLIP_VALUE); + #else + output.positionCS.z = max(output.positionCS.z, UNITY_NEAR_CLIP_VALUE); + #endif + return output; + } + + half4 ShadowFrag(Varyings input) : SV_Target + { + return 0; + } + ENDHLSL + } + } + + SubShader + { + Tags { "RenderType"="Opaque" } + LOD 200 + + CGPROGRAM + #pragma surface surf Standard fullforwardshadows + #pragma target 3.0 + + sampler2D _MainTex; + half _Glossiness; + half _Metallic; + fixed4 _Color; + + struct Input + { + float2 uv_MainTex; + }; + + void surf(Input IN, inout SurfaceOutputStandard o) + { + fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; + o.Albedo = c.rgb; + o.Metallic = _Metallic; + o.Smoothness = _Glossiness; + o.Alpha = c.a; + } + ENDCG + } + + FallBack "Diffuse" +} diff --git a/Assets/Samples/SimpleDemo/SimpleLit.shader.meta b/Assets/Samples/SimpleDemo/SimpleLit.shader.meta new file mode 100644 index 0000000000..cc20862d0e --- /dev/null +++ b/Assets/Samples/SimpleDemo/SimpleLit.shader.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + preprocessorOverride: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/SimpleDemo/SimpleProjectile.prefab b/Assets/Samples/SimpleDemo/SimpleProjectile.prefab index 844c823d0f..39aff06beb 100644 --- a/Assets/Samples/SimpleDemo/SimpleProjectile.prefab +++ b/Assets/Samples/SimpleDemo/SimpleProjectile.prefab @@ -84,7 +84,7 @@ MeshRenderer: m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 diff --git a/Assets/Samples/SimpleMultiplayer/.sample.json b/Assets/Samples/SimpleMultiplayer/.sample.json index 522222de32..ccb36c6f16 100644 --- a/Assets/Samples/SimpleMultiplayer/.sample.json +++ b/Assets/Samples/SimpleMultiplayer/.sample.json @@ -1,4 +1,4 @@ { "displayName": "Simple Multiplayer", - "description": "Demonstrates how to set up a simple local multiplayer scenario." + "description": "Demonstrates how to set up a simple local multiplayer scenario. Requires the Universal Render Pipeline (URP) package to be installed for shader compilation." } \ No newline at end of file diff --git a/Assets/Samples/SimpleMultiplayer/Default.mat b/Assets/Samples/SimpleMultiplayer/Default.mat new file mode 100644 index 0000000000..3c44bd0c30 --- /dev/null +++ b/Assets/Samples/SimpleMultiplayer/Default.mat @@ -0,0 +1,30 @@ +%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: Default + m_Shader: {fileID: 4800000, guid: a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8, type: 3} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Glossiness: 0.5 + - _Metallic: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} diff --git a/Assets/Samples/SimpleMultiplayer/Default.mat.meta b/Assets/Samples/SimpleMultiplayer/Default.mat.meta new file mode 100644 index 0000000000..e032e0d956 --- /dev/null +++ b/Assets/Samples/SimpleMultiplayer/Default.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/SimpleMultiplayer/SimpleLit.shader b/Assets/Samples/SimpleMultiplayer/SimpleLit.shader new file mode 100644 index 0000000000..692b9ecc81 --- /dev/null +++ b/Assets/Samples/SimpleMultiplayer/SimpleLit.shader @@ -0,0 +1,184 @@ +Shader "Samples/SimpleMultiplayer/SimpleLit" +{ + Properties + { + _Color ("Color", Color) = (1,1,1,1) + _MainTex ("Albedo (RGB)", 2D) = "white" {} + _Glossiness ("Smoothness", Range(0,1)) = 0.5 + _Metallic ("Metallic", Range(0,1)) = 0.0 + } + + SubShader + { + Tags { "RenderType"="Opaque" "RenderPipeline"="UniversalPipeline" "Queue"="Geometry" } + + Pass + { + Name "ForwardLit" + Tags { "LightMode"="UniversalForward" } + + HLSLPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN + #pragma multi_compile _ _SHADOWS_SOFT + #pragma multi_compile _ _ADDITIONAL_LIGHTS + #pragma multi_compile_fog + + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + CBUFFER_START(UnityPerMaterial) + float4 _MainTex_ST; + half4 _Color; + half _Glossiness; + half _Metallic; + CBUFFER_END + + struct Attributes + { + float4 positionOS : POSITION; + float3 normalOS : NORMAL; + float2 uv : TEXCOORD0; + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + float2 uv : TEXCOORD0; + float3 normalWS : TEXCOORD1; + float3 positionWS : TEXCOORD2; + float fogFactor : TEXCOORD3; + }; + + Varyings vert(Attributes input) + { + Varyings output; + VertexPositionInputs posInputs = GetVertexPositionInputs(input.positionOS.xyz); + output.positionCS = posInputs.positionCS; + output.positionWS = posInputs.positionWS; + output.normalWS = TransformObjectToWorldNormal(input.normalOS); + output.uv = TRANSFORM_TEX(input.uv, _MainTex); + output.fogFactor = ComputeFogFactor(posInputs.positionCS.z); + return output; + } + + half4 frag(Varyings input) : SV_Target + { + half4 albedo = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, input.uv) * _Color; + + InputData inputData = (InputData)0; + inputData.positionWS = input.positionWS; + inputData.normalWS = normalize(input.normalWS); + inputData.viewDirectionWS = GetWorldSpaceNormalizeViewDir(input.positionWS); + inputData.shadowCoord = TransformWorldToShadowCoord(input.positionWS); + + SurfaceData surfaceData = (SurfaceData)0; + surfaceData.albedo = albedo.rgb; + surfaceData.alpha = albedo.a; + surfaceData.metallic = _Metallic; + surfaceData.smoothness = _Glossiness; + surfaceData.occlusion = 1.0; + + half4 color = UniversalFragmentPBR(inputData, surfaceData); + color.rgb = MixFog(color.rgb, input.fogFactor); + return color; + } + ENDHLSL + } + + Pass + { + Name "ShadowCaster" + Tags { "LightMode"="ShadowCaster" } + + ZWrite On + ZTest LEqual + ColorMask 0 + + HLSLPROGRAM + #pragma vertex ShadowVert + #pragma fragment ShadowFrag + #pragma multi_compile _ _CASTING_PUNCTUAL_LIGHT_SHADOW + + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl" + + float3 _LightDirection; + float3 _LightPosition; + + struct Attributes + { + float4 positionOS : POSITION; + float3 normalOS : NORMAL; + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + }; + + Varyings ShadowVert(Attributes input) + { + Varyings output; + float3 posWS = TransformObjectToWorld(input.positionOS.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normalOS); + + #if _CASTING_PUNCTUAL_LIGHT_SHADOW + float3 lightDir = normalize(_LightPosition - posWS); + #else + float3 lightDir = _LightDirection; + #endif + + output.positionCS = TransformWorldToHClip(ApplyShadowBias(posWS, normalWS, lightDir)); + #if UNITY_REVERSED_Z + output.positionCS.z = min(output.positionCS.z, UNITY_NEAR_CLIP_VALUE); + #else + output.positionCS.z = max(output.positionCS.z, UNITY_NEAR_CLIP_VALUE); + #endif + return output; + } + + half4 ShadowFrag(Varyings input) : SV_Target + { + return 0; + } + ENDHLSL + } + } + + SubShader + { + Tags { "RenderType"="Opaque" } + LOD 200 + + CGPROGRAM + #pragma surface surf Standard fullforwardshadows + #pragma target 3.0 + + sampler2D _MainTex; + half _Glossiness; + half _Metallic; + fixed4 _Color; + + struct Input + { + float2 uv_MainTex; + }; + + void surf(Input IN, inout SurfaceOutputStandard o) + { + fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; + o.Albedo = c.rgb; + o.Metallic = _Metallic; + o.Smoothness = _Glossiness; + o.Alpha = c.a; + } + ENDCG + } + + FallBack "Diffuse" +} diff --git a/Assets/Samples/SimpleMultiplayer/SimpleLit.shader.meta b/Assets/Samples/SimpleMultiplayer/SimpleLit.shader.meta new file mode 100644 index 0000000000..ec8af73811 --- /dev/null +++ b/Assets/Samples/SimpleMultiplayer/SimpleLit.shader.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + preprocessorOverride: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/SimpleMultiplayer/SimpleMultiplayerDemo.unity b/Assets/Samples/SimpleMultiplayer/SimpleMultiplayerDemo.unity index 4f9d90745a..303c632170 100644 --- a/Assets/Samples/SimpleMultiplayer/SimpleMultiplayerDemo.unity +++ b/Assets/Samples/SimpleMultiplayer/SimpleMultiplayerDemo.unity @@ -183,7 +183,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -288,7 +288,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -487,7 +487,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -592,7 +592,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -697,7 +697,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -802,7 +802,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -907,7 +907,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1012,7 +1012,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1117,7 +1117,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1222,7 +1222,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1327,7 +1327,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1433,7 +1433,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1538,7 +1538,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1643,7 +1643,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1748,7 +1748,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1853,7 +1853,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1958,7 +1958,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -2063,7 +2063,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -2168,7 +2168,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -2273,7 +2273,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -2378,7 +2378,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -2483,7 +2483,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -2588,7 +2588,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -2693,7 +2693,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 diff --git a/Assets/Samples/TouchSamples/.sample.json b/Assets/Samples/TouchSamples/.sample.json index 6bd08af3c2..f135c4ac6e 100644 --- a/Assets/Samples/TouchSamples/.sample.json +++ b/Assets/Samples/TouchSamples/.sample.json @@ -1,4 +1,4 @@ { "displayName": "Touch Samples", - "description": "A series of sample scenes for using touch input with the Input System package. This sample is not actually part of the package, but needs to be downloaded." + "description": "A series of sample scenes for using touch input with the Input System package. This sample is not actually part of the package, but needs to be downloaded. Requires the Universal Render Pipeline (URP) package to be installed for shader compilation." } \ No newline at end of file diff --git a/Assets/Samples/UIvsGameInput/.sample.json b/Assets/Samples/UIvsGameInput/.sample.json index 226f409858..4ce81292da 100644 --- a/Assets/Samples/UIvsGameInput/.sample.json +++ b/Assets/Samples/UIvsGameInput/.sample.json @@ -1,4 +1,4 @@ { "displayName": "UI vs. Game Input", - "description": "An example that shows how to deal with ambiguities that may arise when overlaying interactive UI elements on top of a game scene." + "description": "An example that shows how to deal with ambiguities that may arise when overlaying interactive UI elements on top of a game scene. Requires the Universal Render Pipeline (URP) package to be installed for shader compilation." } \ No newline at end of file diff --git a/Assets/Samples/UIvsGameInput/Default.mat b/Assets/Samples/UIvsGameInput/Default.mat new file mode 100644 index 0000000000..f6d32625ea --- /dev/null +++ b/Assets/Samples/UIvsGameInput/Default.mat @@ -0,0 +1,30 @@ +%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: Default + m_Shader: {fileID: 4800000, guid: e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2, type: 3} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Glossiness: 0.5 + - _Metallic: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} diff --git a/Assets/Samples/UIvsGameInput/Default.mat.meta b/Assets/Samples/UIvsGameInput/Default.mat.meta new file mode 100644 index 0000000000..5e66507b13 --- /dev/null +++ b/Assets/Samples/UIvsGameInput/Default.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/UIvsGameInput/Projectile.prefab b/Assets/Samples/UIvsGameInput/Projectile.prefab index 353ece6d63..c57d755c8d 100644 --- a/Assets/Samples/UIvsGameInput/Projectile.prefab +++ b/Assets/Samples/UIvsGameInput/Projectile.prefab @@ -84,7 +84,7 @@ MeshRenderer: m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 diff --git a/Assets/Samples/UIvsGameInput/SimpleLit.shader b/Assets/Samples/UIvsGameInput/SimpleLit.shader new file mode 100644 index 0000000000..212bf03afc --- /dev/null +++ b/Assets/Samples/UIvsGameInput/SimpleLit.shader @@ -0,0 +1,184 @@ +Shader "Samples/UIvsGameInput/SimpleLit" +{ + Properties + { + _Color ("Color", Color) = (1,1,1,1) + _MainTex ("Albedo (RGB)", 2D) = "white" {} + _Glossiness ("Smoothness", Range(0,1)) = 0.5 + _Metallic ("Metallic", Range(0,1)) = 0.0 + } + + SubShader + { + Tags { "RenderType"="Opaque" "RenderPipeline"="UniversalPipeline" "Queue"="Geometry" } + + Pass + { + Name "ForwardLit" + Tags { "LightMode"="UniversalForward" } + + HLSLPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN + #pragma multi_compile _ _SHADOWS_SOFT + #pragma multi_compile _ _ADDITIONAL_LIGHTS + #pragma multi_compile_fog + + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + CBUFFER_START(UnityPerMaterial) + float4 _MainTex_ST; + half4 _Color; + half _Glossiness; + half _Metallic; + CBUFFER_END + + struct Attributes + { + float4 positionOS : POSITION; + float3 normalOS : NORMAL; + float2 uv : TEXCOORD0; + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + float2 uv : TEXCOORD0; + float3 normalWS : TEXCOORD1; + float3 positionWS : TEXCOORD2; + float fogFactor : TEXCOORD3; + }; + + Varyings vert(Attributes input) + { + Varyings output; + VertexPositionInputs posInputs = GetVertexPositionInputs(input.positionOS.xyz); + output.positionCS = posInputs.positionCS; + output.positionWS = posInputs.positionWS; + output.normalWS = TransformObjectToWorldNormal(input.normalOS); + output.uv = TRANSFORM_TEX(input.uv, _MainTex); + output.fogFactor = ComputeFogFactor(posInputs.positionCS.z); + return output; + } + + half4 frag(Varyings input) : SV_Target + { + half4 albedo = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, input.uv) * _Color; + + InputData inputData = (InputData)0; + inputData.positionWS = input.positionWS; + inputData.normalWS = normalize(input.normalWS); + inputData.viewDirectionWS = GetWorldSpaceNormalizeViewDir(input.positionWS); + inputData.shadowCoord = TransformWorldToShadowCoord(input.positionWS); + + SurfaceData surfaceData = (SurfaceData)0; + surfaceData.albedo = albedo.rgb; + surfaceData.alpha = albedo.a; + surfaceData.metallic = _Metallic; + surfaceData.smoothness = _Glossiness; + surfaceData.occlusion = 1.0; + + half4 color = UniversalFragmentPBR(inputData, surfaceData); + color.rgb = MixFog(color.rgb, input.fogFactor); + return color; + } + ENDHLSL + } + + Pass + { + Name "ShadowCaster" + Tags { "LightMode"="ShadowCaster" } + + ZWrite On + ZTest LEqual + ColorMask 0 + + HLSLPROGRAM + #pragma vertex ShadowVert + #pragma fragment ShadowFrag + #pragma multi_compile _ _CASTING_PUNCTUAL_LIGHT_SHADOW + + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl" + + float3 _LightDirection; + float3 _LightPosition; + + struct Attributes + { + float4 positionOS : POSITION; + float3 normalOS : NORMAL; + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + }; + + Varyings ShadowVert(Attributes input) + { + Varyings output; + float3 posWS = TransformObjectToWorld(input.positionOS.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normalOS); + + #if _CASTING_PUNCTUAL_LIGHT_SHADOW + float3 lightDir = normalize(_LightPosition - posWS); + #else + float3 lightDir = _LightDirection; + #endif + + output.positionCS = TransformWorldToHClip(ApplyShadowBias(posWS, normalWS, lightDir)); + #if UNITY_REVERSED_Z + output.positionCS.z = min(output.positionCS.z, UNITY_NEAR_CLIP_VALUE); + #else + output.positionCS.z = max(output.positionCS.z, UNITY_NEAR_CLIP_VALUE); + #endif + return output; + } + + half4 ShadowFrag(Varyings input) : SV_Target + { + return 0; + } + ENDHLSL + } + } + + SubShader + { + Tags { "RenderType"="Opaque" } + LOD 200 + + CGPROGRAM + #pragma surface surf Standard fullforwardshadows + #pragma target 3.0 + + sampler2D _MainTex; + half _Glossiness; + half _Metallic; + fixed4 _Color; + + struct Input + { + float2 uv_MainTex; + }; + + void surf(Input IN, inout SurfaceOutputStandard o) + { + fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; + o.Albedo = c.rgb; + o.Metallic = _Metallic; + o.Smoothness = _Glossiness; + o.Alpha = c.a; + } + ENDCG + } + + FallBack "Diffuse" +} diff --git a/Assets/Samples/UIvsGameInput/SimpleLit.shader.meta b/Assets/Samples/UIvsGameInput/SimpleLit.shader.meta new file mode 100644 index 0000000000..d9d9ae8d4d --- /dev/null +++ b/Assets/Samples/UIvsGameInput/SimpleLit.shader.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + preprocessorOverride: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/UIvsGameInput/UIvsGameInput.unity b/Assets/Samples/UIvsGameInput/UIvsGameInput.unity index 3a4a6f8391..8822c703fb 100644 --- a/Assets/Samples/UIvsGameInput/UIvsGameInput.unity +++ b/Assets/Samples/UIvsGameInput/UIvsGameInput.unity @@ -182,7 +182,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -909,7 +909,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1285,7 +1285,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1893,7 +1893,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -2092,7 +2092,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -2197,7 +2197,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -2302,7 +2302,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -2486,7 +2486,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -2724,7 +2724,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -3327,7 +3327,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 diff --git a/Assets/Samples/UnityRemote/.sample.json b/Assets/Samples/UnityRemote/.sample.json index 1f122261a3..3ffc272b32 100644 --- a/Assets/Samples/UnityRemote/.sample.json +++ b/Assets/Samples/UnityRemote/.sample.json @@ -1,4 +1,4 @@ { "displayName": "Unity Remote", - "description": "An example with a simple scene for trying out the Unity Remote app." + "description": "An example with a simple scene for trying out the Unity Remote app. Requires the Universal Render Pipeline (URP) package to be installed for shader compilation." } \ No newline at end of file diff --git a/Assets/Samples/UnityRemote/CubeMaterial.mat b/Assets/Samples/UnityRemote/CubeMaterial.mat index 8ac4accef9..d7593201b1 100644 --- a/Assets/Samples/UnityRemote/CubeMaterial.mat +++ b/Assets/Samples/UnityRemote/CubeMaterial.mat @@ -8,7 +8,7 @@ Material: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: CubeMaterial - m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_Shader: {fileID: 4800000, guid: e3f4a5b6c7d8e9f0a1b2c3d4e5f6a7b8, type: 3} m_Parent: {fileID: 0} m_ModifiedSerializedProperties: 0 m_ValidKeywords: [] diff --git a/Assets/Samples/UnityRemote/SimpleLit.shader b/Assets/Samples/UnityRemote/SimpleLit.shader new file mode 100644 index 0000000000..4c589b7b2c --- /dev/null +++ b/Assets/Samples/UnityRemote/SimpleLit.shader @@ -0,0 +1,184 @@ +Shader "Samples/UnityRemote/SimpleLit" +{ + Properties + { + _Color ("Color", Color) = (1,1,1,1) + _MainTex ("Albedo (RGB)", 2D) = "white" {} + _Glossiness ("Smoothness", Range(0,1)) = 0.5 + _Metallic ("Metallic", Range(0,1)) = 0.0 + } + + SubShader + { + Tags { "RenderType"="Opaque" "RenderPipeline"="UniversalPipeline" "Queue"="Geometry" } + + Pass + { + Name "ForwardLit" + Tags { "LightMode"="UniversalForward" } + + HLSLPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN + #pragma multi_compile _ _SHADOWS_SOFT + #pragma multi_compile _ _ADDITIONAL_LIGHTS + #pragma multi_compile_fog + + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + CBUFFER_START(UnityPerMaterial) + float4 _MainTex_ST; + half4 _Color; + half _Glossiness; + half _Metallic; + CBUFFER_END + + struct Attributes + { + float4 positionOS : POSITION; + float3 normalOS : NORMAL; + float2 uv : TEXCOORD0; + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + float2 uv : TEXCOORD0; + float3 normalWS : TEXCOORD1; + float3 positionWS : TEXCOORD2; + float fogFactor : TEXCOORD3; + }; + + Varyings vert(Attributes input) + { + Varyings output; + VertexPositionInputs posInputs = GetVertexPositionInputs(input.positionOS.xyz); + output.positionCS = posInputs.positionCS; + output.positionWS = posInputs.positionWS; + output.normalWS = TransformObjectToWorldNormal(input.normalOS); + output.uv = TRANSFORM_TEX(input.uv, _MainTex); + output.fogFactor = ComputeFogFactor(posInputs.positionCS.z); + return output; + } + + half4 frag(Varyings input) : SV_Target + { + half4 albedo = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, input.uv) * _Color; + + InputData inputData = (InputData)0; + inputData.positionWS = input.positionWS; + inputData.normalWS = normalize(input.normalWS); + inputData.viewDirectionWS = GetWorldSpaceNormalizeViewDir(input.positionWS); + inputData.shadowCoord = TransformWorldToShadowCoord(input.positionWS); + + SurfaceData surfaceData = (SurfaceData)0; + surfaceData.albedo = albedo.rgb; + surfaceData.alpha = albedo.a; + surfaceData.metallic = _Metallic; + surfaceData.smoothness = _Glossiness; + surfaceData.occlusion = 1.0; + + half4 color = UniversalFragmentPBR(inputData, surfaceData); + color.rgb = MixFog(color.rgb, input.fogFactor); + return color; + } + ENDHLSL + } + + Pass + { + Name "ShadowCaster" + Tags { "LightMode"="ShadowCaster" } + + ZWrite On + ZTest LEqual + ColorMask 0 + + HLSLPROGRAM + #pragma vertex ShadowVert + #pragma fragment ShadowFrag + #pragma multi_compile _ _CASTING_PUNCTUAL_LIGHT_SHADOW + + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl" + + float3 _LightDirection; + float3 _LightPosition; + + struct Attributes + { + float4 positionOS : POSITION; + float3 normalOS : NORMAL; + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + }; + + Varyings ShadowVert(Attributes input) + { + Varyings output; + float3 posWS = TransformObjectToWorld(input.positionOS.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normalOS); + + #if _CASTING_PUNCTUAL_LIGHT_SHADOW + float3 lightDir = normalize(_LightPosition - posWS); + #else + float3 lightDir = _LightDirection; + #endif + + output.positionCS = TransformWorldToHClip(ApplyShadowBias(posWS, normalWS, lightDir)); + #if UNITY_REVERSED_Z + output.positionCS.z = min(output.positionCS.z, UNITY_NEAR_CLIP_VALUE); + #else + output.positionCS.z = max(output.positionCS.z, UNITY_NEAR_CLIP_VALUE); + #endif + return output; + } + + half4 ShadowFrag(Varyings input) : SV_Target + { + return 0; + } + ENDHLSL + } + } + + SubShader + { + Tags { "RenderType"="Opaque" } + LOD 200 + + CGPROGRAM + #pragma surface surf Standard fullforwardshadows + #pragma target 3.0 + + sampler2D _MainTex; + half _Glossiness; + half _Metallic; + fixed4 _Color; + + struct Input + { + float2 uv_MainTex; + }; + + void surf(Input IN, inout SurfaceOutputStandard o) + { + fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; + o.Albedo = c.rgb; + o.Metallic = _Metallic; + o.Smoothness = _Glossiness; + o.Alpha = c.a; + } + ENDCG + } + + FallBack "Diffuse" +} diff --git a/Assets/Samples/UnityRemote/SimpleLit.shader.meta b/Assets/Samples/UnityRemote/SimpleLit.shader.meta new file mode 100644 index 0000000000..93916a47c6 --- /dev/null +++ b/Assets/Samples/UnityRemote/SimpleLit.shader.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: e3f4a5b6c7d8e9f0a1b2c3d4e5f6a7b8 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + preprocessorOverride: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Settings.meta b/Assets/Settings.meta new file mode 100644 index 0000000000..45457f8715 --- /dev/null +++ b/Assets/Settings.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: aa41e7d917ef79248bc044ea5c249b1a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Settings/URP-PipelineAsset.asset b/Assets/Settings/URP-PipelineAsset.asset new file mode 100644 index 0000000000..0d78991fc6 --- /dev/null +++ b/Assets/Settings/URP-PipelineAsset.asset @@ -0,0 +1,114 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + 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: bf2edee5c58d82540a51f03df9d42094, type: 3} + m_Name: URP-PipelineAsset + m_EditorClassIdentifier: + k_AssetVersion: 11 + k_AssetPreviousVersion: 11 + m_RendererType: 1 + m_RendererData: {fileID: 0} + m_RendererDataList: + - {fileID: 11400000, guid: b56d1ee65e4137c4e859545836def71b, type: 2} + m_DefaultRendererIndex: 0 + m_RequireDepthTexture: 0 + m_RequireOpaqueTexture: 0 + m_OpaqueDownsampling: 1 + m_SupportsTerrainHoles: 0 + m_SupportsHDR: 0 + m_HDRColorBufferPrecision: 0 + m_MSAA: 1 + m_RenderScale: 1 + m_UpscalingFilter: 0 + m_FsrOverrideSharpness: 0 + m_FsrSharpness: 0.92 + m_EnableLODCrossFade: 0 + m_LODCrossFadeDitheringType: 1 + m_ShEvalMode: 0 + m_MainLightRenderingMode: 1 + m_MainLightShadowsSupported: 1 + m_MainLightShadowmapResolution: 2048 + m_AdditionalLightsRenderingMode: 1 + m_AdditionalLightsPerObjectLimit: 4 + m_AdditionalLightShadowsSupported: 0 + m_AdditionalLightsShadowmapResolution: 2048 + m_AdditionalLightsShadowResolutionTierLow: 256 + m_AdditionalLightsShadowResolutionTierMedium: 512 + m_AdditionalLightsShadowResolutionTierHigh: 1024 + m_ReflectionProbeBlending: 0 + m_ReflectionProbeBoxProjection: 0 + m_ShadowDistance: 50 + m_ShadowCascadeCount: 1 + m_Cascade2Split: 0.25 + m_Cascade3Split: {x: 0.1, y: 0.3} + m_Cascade4Split: {x: 0.067, y: 0.2, z: 0.467} + m_CascadeBorder: 0.2 + m_ShadowDepthBias: 1 + m_ShadowNormalBias: 1 + m_AnyShadowsSupported: 1 + m_SoftShadowsSupported: 0 + m_ConservativeEnclosingSphere: 1 + m_NumIterationsEnclosingSphere: 64 + m_SoftShadowQuality: 2 + m_AdditionalLightsCookieResolution: 2048 + m_AdditionalLightsCookieFormat: 3 + m_UseSRPBatcher: 1 + m_SupportsDynamicBatching: 0 + m_MixedLightingSupported: 1 + m_SupportsLightCookies: 0 + m_SupportsLightLayers: 0 + m_DebugLevel: 0 + m_StoreActionsOptimization: 0 + m_EnableRenderGraph: 1 + m_UseAdaptivePerformance: 0 + m_ColorGradingMode: 0 + m_ColorGradingLutSize: 32 + m_UseFastSRGBLinearConversion: 0 + m_SupportDataDrivenLensFlare: 0 + m_ShadowType: 1 + m_LocalShadowsSupported: 0 + m_LocalShadowsAtlasResolution: 256 + m_MaxPixelLights: 0 + m_ShadowAtlasResolution: 256 + m_VolumeFrameworkUpdateMode: 0 + m_Textures: + blueNoise64LTex: {fileID: 2800000, guid: e3d24661c1e055f45a7560c033dbb837, type: 3} + bayerMatrixTex: {fileID: 2800000, guid: f9ee4ed84c1d10c49aabb9b210b0fc44, type: 3} + m_PrefilteringModeMainLightShadows: 1 + m_PrefilteringModeAdditionalLight: 4 + m_PrefilteringModeAdditionalLightShadows: 1 + m_PrefilterXRKeywords: 0 + m_PrefilteringModeForwardPlus: 0 + m_PrefilteringModeDeferredRendering: 0 + m_PrefilteringModeScreenSpaceOcclusion: 0 + m_PrefilterDebugKeywords: 1 + m_PrefilterWriteRenderingLayers: 1 + m_PrefilterHDROutput: 1 + m_PrefilterSSAODepthNormals: 1 + m_PrefilterSSAOSourceDepthLow: 1 + m_PrefilterSSAOSourceDepthMedium: 1 + m_PrefilterSSAOSourceDepthHigh: 1 + m_PrefilterSSAOInterleaved: 1 + m_PrefilterSSAOBlueNoise: 1 + m_PrefilterSSAOSampleCountLow: 1 + m_PrefilterSSAOSampleCountMedium: 1 + m_PrefilterSSAOSampleCountHigh: 1 + m_PrefilterDBufferMRT1: 1 + m_PrefilterDBufferMRT2: 1 + m_PrefilterDBufferMRT3: 1 + m_PrefilterSoftShadowsQualityLow: 1 + m_PrefilterSoftShadowsQualityMedium: 1 + m_PrefilterSoftShadowsQualityHigh: 1 + m_PrefilterSoftShadows: 1 + m_PrefilterScreenCoord: 1 + m_PrefilterNativeRenderPass: 1 + m_ShaderVariantLogLevel: 0 + m_ShadowCascades: 0 diff --git a/Assets/Settings/URP-PipelineAsset.asset.meta b/Assets/Settings/URP-PipelineAsset.asset.meta new file mode 100644 index 0000000000..66a98f5dd6 --- /dev/null +++ b/Assets/Settings/URP-PipelineAsset.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 419b51160a38fc648a23b6a5b447b92e +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Settings/URP-Renderer.asset b/Assets/Settings/URP-Renderer.asset new file mode 100644 index 0000000000..36ac573311 --- /dev/null +++ b/Assets/Settings/URP-Renderer.asset @@ -0,0 +1,68 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + 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: de640fe3d0db1804a85f9fc8f5cadab6, type: 3} + m_Name: URP-Renderer + m_EditorClassIdentifier: + debugShaders: + debugReplacementPS: {fileID: 4800000, guid: cf852408f2e174538bcd9b7fda1c5ae7, + type: 3} + hdrDebugViewPS: {fileID: 4800000, guid: 573620ae32aec764abd4d728906d2587, type: 3} + m_RendererFeatures: [] + m_RendererFeatureMap: + m_UseNativeRenderPass: 0 + postProcessData: {fileID: 0} + xrSystemData: {fileID: 11400000, guid: 60e1133243b97e347b653163a8c01b64, type: 2} + shaders: + blitPS: {fileID: 4800000, guid: c17132b1f77d20942aa75f8429c0f8bc, type: 3} + copyDepthPS: {fileID: 4800000, guid: d6dae50ee9e1bfa4db75f19f99355220, type: 3} + screenSpaceShadowPS: {fileID: 0} + samplingPS: {fileID: 4800000, guid: 04c410c9937594faa893a11dceb85f7e, type: 3} + stencilDeferredPS: {fileID: 4800000, guid: e9155b26e1bc55942a41e518703fe304, type: 3} + fallbackErrorPS: {fileID: 4800000, guid: e6e9a19c3678ded42a3bc431ebef7dbd, type: 3} + fallbackLoadingPS: {fileID: 4800000, guid: 7f888aff2ac86494babad1c2c5daeee2, type: 3} + materialErrorPS: {fileID: 4800000, guid: 5fd9a8feb75a4b5894c241777f519d4e, type: 3} + coreBlitPS: {fileID: 4800000, guid: 93446b5c5339d4f00b85c159e1159b7c, type: 3} + coreBlitColorAndDepthPS: {fileID: 4800000, guid: d104b2fc1ca6445babb8e90b0758136b, + type: 3} + blitHDROverlay: {fileID: 4800000, guid: a89bee29cffa951418fc1e2da94d1959, type: 3} + cameraMotionVector: {fileID: 4800000, guid: c56b7e0d4c7cb484e959caeeedae9bbf, + type: 3} + objectMotionVector: {fileID: 4800000, guid: 7b3ede40266cd49a395def176e1bc486, + type: 3} + dataDrivenLensFlare: {fileID: 4800000, guid: 6cda457ac28612740adb23da5d39ea92, + type: 3} + terrainDetailLitPS: {fileID: 4800000, guid: f6783ab646d374f94b199774402a5144, + type: 3} + terrainDetailGrassPS: {fileID: 4800000, guid: e507fdfead5ca47e8b9a768b51c291a1, + type: 3} + terrainDetailGrassBillboardPS: {fileID: 4800000, guid: 29868e73b638e48ca99a19ea58c48d90, + type: 3} + m_AssetVersion: 2 + m_OpaqueLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_TransparentLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_DefaultStencilState: + overrideStencilState: 0 + stencilReference: 0 + stencilCompareFunction: 8 + passOperation: 2 + failOperation: 0 + zFailOperation: 0 + m_ShadowTransparentReceive: 1 + m_RenderingMode: 0 + m_DepthPrimingMode: 0 + m_CopyDepthMode: 1 + m_AccurateGbufferNormals: 0 + m_IntermediateTextureMode: 1 diff --git a/Assets/Settings/URP-Renderer.asset.meta b/Assets/Settings/URP-Renderer.asset.meta new file mode 100644 index 0000000000..d90b028958 --- /dev/null +++ b/Assets/Settings/URP-Renderer.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b56d1ee65e4137c4e859545836def71b +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Shaders.meta b/Assets/Shaders.meta new file mode 100644 index 0000000000..64025a5c17 --- /dev/null +++ b/Assets/Shaders.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 205fee01971646a4f8a714639ccd3fcf +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Shaders/SamplesSimpleLit.shader b/Assets/Shaders/SamplesSimpleLit.shader new file mode 100644 index 0000000000..0ce7a529da --- /dev/null +++ b/Assets/Shaders/SamplesSimpleLit.shader @@ -0,0 +1,186 @@ +Shader "Samples/SimpleLit" +{ + Properties + { + _Color ("Color", Color) = (1,1,1,1) + _MainTex ("Albedo (RGB)", 2D) = "white" {} + _Glossiness ("Smoothness", Range(0,1)) = 0.5 + _Metallic ("Metallic", Range(0,1)) = 0.0 + } + + // URP SubShader — selected when Universal Render Pipeline is active + SubShader + { + Tags { "RenderType"="Opaque" "RenderPipeline"="UniversalPipeline" "Queue"="Geometry" } + + Pass + { + Name "ForwardLit" + Tags { "LightMode"="UniversalForward" } + + HLSLPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN + #pragma multi_compile _ _SHADOWS_SOFT + #pragma multi_compile _ _ADDITIONAL_LIGHTS + #pragma multi_compile_fog + + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + CBUFFER_START(UnityPerMaterial) + float4 _MainTex_ST; + half4 _Color; + half _Glossiness; + half _Metallic; + CBUFFER_END + + struct Attributes + { + float4 positionOS : POSITION; + float3 normalOS : NORMAL; + float2 uv : TEXCOORD0; + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + float2 uv : TEXCOORD0; + float3 normalWS : TEXCOORD1; + float3 positionWS : TEXCOORD2; + float fogFactor : TEXCOORD3; + }; + + Varyings vert(Attributes input) + { + Varyings output; + VertexPositionInputs posInputs = GetVertexPositionInputs(input.positionOS.xyz); + output.positionCS = posInputs.positionCS; + output.positionWS = posInputs.positionWS; + output.normalWS = TransformObjectToWorldNormal(input.normalOS); + output.uv = TRANSFORM_TEX(input.uv, _MainTex); + output.fogFactor = ComputeFogFactor(posInputs.positionCS.z); + return output; + } + + half4 frag(Varyings input) : SV_Target + { + half4 albedo = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, input.uv) * _Color; + + InputData inputData = (InputData)0; + inputData.positionWS = input.positionWS; + inputData.normalWS = normalize(input.normalWS); + inputData.viewDirectionWS = GetWorldSpaceNormalizeViewDir(input.positionWS); + inputData.shadowCoord = TransformWorldToShadowCoord(input.positionWS); + + SurfaceData surfaceData = (SurfaceData)0; + surfaceData.albedo = albedo.rgb; + surfaceData.alpha = albedo.a; + surfaceData.metallic = _Metallic; + surfaceData.smoothness = _Glossiness; + surfaceData.occlusion = 1.0; + + half4 color = UniversalFragmentPBR(inputData, surfaceData); + color.rgb = MixFog(color.rgb, input.fogFactor); + return color; + } + ENDHLSL + } + + Pass + { + Name "ShadowCaster" + Tags { "LightMode"="ShadowCaster" } + + ZWrite On + ZTest LEqual + ColorMask 0 + + HLSLPROGRAM + #pragma vertex ShadowVert + #pragma fragment ShadowFrag + #pragma multi_compile _ _CASTING_PUNCTUAL_LIGHT_SHADOW + + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl" + + float3 _LightDirection; + float3 _LightPosition; + + struct Attributes + { + float4 positionOS : POSITION; + float3 normalOS : NORMAL; + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + }; + + Varyings ShadowVert(Attributes input) + { + Varyings output; + float3 posWS = TransformObjectToWorld(input.positionOS.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normalOS); + + #if _CASTING_PUNCTUAL_LIGHT_SHADOW + float3 lightDir = normalize(_LightPosition - posWS); + #else + float3 lightDir = _LightDirection; + #endif + + output.positionCS = TransformWorldToHClip(ApplyShadowBias(posWS, normalWS, lightDir)); + #if UNITY_REVERSED_Z + output.positionCS.z = min(output.positionCS.z, UNITY_NEAR_CLIP_VALUE); + #else + output.positionCS.z = max(output.positionCS.z, UNITY_NEAR_CLIP_VALUE); + #endif + return output; + } + + half4 ShadowFrag(Varyings input) : SV_Target + { + return 0; + } + ENDHLSL + } + } + + // Built-in RP SubShader — fallback when no SRP is active + SubShader + { + Tags { "RenderType"="Opaque" } + LOD 200 + + CGPROGRAM + #pragma surface surf Standard fullforwardshadows + #pragma target 3.0 + + sampler2D _MainTex; + half _Glossiness; + half _Metallic; + fixed4 _Color; + + struct Input + { + float2 uv_MainTex; + }; + + void surf(Input IN, inout SurfaceOutputStandard o) + { + fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; + o.Albedo = c.rgb; + o.Metallic = _Metallic; + o.Smoothness = _Glossiness; + o.Alpha = c.a; + } + ENDCG + } + + FallBack "Diffuse" +} diff --git a/Assets/Shaders/SamplesSimpleLit.shader.meta b/Assets/Shaders/SamplesSimpleLit.shader.meta new file mode 100644 index 0000000000..62c26109ac --- /dev/null +++ b/Assets/Shaders/SamplesSimpleLit.shader.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + preprocessorOverride: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UniversalRenderPipelineGlobalSettings.asset b/Assets/UniversalRenderPipelineGlobalSettings.asset new file mode 100644 index 0000000000..783520f247 --- /dev/null +++ b/Assets/UniversalRenderPipelineGlobalSettings.asset @@ -0,0 +1,34 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + 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: 2ec995e51a6e251468d2a3fd8a686257, type: 3} + m_Name: UniversalRenderPipelineGlobalSettings + m_EditorClassIdentifier: + k_AssetVersion: 3 + m_RenderingLayerNames: + - Default + m_ValidRenderingLayers: 1 + lightLayerName0: + lightLayerName1: + lightLayerName2: + lightLayerName3: + lightLayerName4: + lightLayerName5: + lightLayerName6: + lightLayerName7: + m_StripDebugVariants: 1 + m_StripUnusedPostProcessingVariants: 0 + m_StripUnusedVariants: 1 + m_StripUnusedLODCrossFadeVariants: 1 + m_StripScreenCoordOverrideVariants: 1 + supportRuntimeDebugDisplay: 0 + m_ShaderVariantLogLevel: 0 + m_ExportShaderVariants: 1 diff --git a/Assets/UniversalRenderPipelineGlobalSettings.asset.meta b/Assets/UniversalRenderPipelineGlobalSettings.asset.meta new file mode 100644 index 0000000000..38feeadd01 --- /dev/null +++ b/Assets/UniversalRenderPipelineGlobalSettings.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3c7230e15ebbbb640a4fe635e888f015 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/ExternalSampleProjects/InputDeviceTester/Assets/InputDeviceTester/Materials/pc_tablet.mat b/ExternalSampleProjects/InputDeviceTester/Assets/InputDeviceTester/Materials/pc_tablet.mat index ae97ee00dd..5ab046f790 100644 --- a/ExternalSampleProjects/InputDeviceTester/Assets/InputDeviceTester/Materials/pc_tablet.mat +++ b/ExternalSampleProjects/InputDeviceTester/Assets/InputDeviceTester/Materials/pc_tablet.mat @@ -7,7 +7,7 @@ Material: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_Name: pc_tablet - m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_Shader: {fileID: 4800000, guid: c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8, type: 3} m_ShaderKeywords: _NORMALMAP _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A m_LightmapFlags: 4 m_EnableInstancingVariants: 0 diff --git a/ExternalSampleProjects/InputDeviceTester/Assets/InputDeviceTester/Shaders/SimpleLit.shader b/ExternalSampleProjects/InputDeviceTester/Assets/InputDeviceTester/Shaders/SimpleLit.shader new file mode 100644 index 0000000000..924e0eb81c --- /dev/null +++ b/ExternalSampleProjects/InputDeviceTester/Assets/InputDeviceTester/Shaders/SimpleLit.shader @@ -0,0 +1,186 @@ +Shader "Samples/InputDeviceTester/SimpleLit" +{ + Properties + { + _Color ("Color", Color) = (1,1,1,1) + _MainTex ("Albedo (RGB)", 2D) = "white" {} + _Glossiness ("Smoothness", Range(0,1)) = 0.5 + _Metallic ("Metallic", Range(0,1)) = 0.0 + } + + // URP SubShader — selected when Universal Render Pipeline is active + SubShader + { + Tags { "RenderType"="Opaque" "RenderPipeline"="UniversalPipeline" "Queue"="Geometry" } + + Pass + { + Name "ForwardLit" + Tags { "LightMode"="UniversalForward" } + + HLSLPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN + #pragma multi_compile _ _SHADOWS_SOFT + #pragma multi_compile _ _ADDITIONAL_LIGHTS + #pragma multi_compile_fog + + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + CBUFFER_START(UnityPerMaterial) + float4 _MainTex_ST; + half4 _Color; + half _Glossiness; + half _Metallic; + CBUFFER_END + + struct Attributes + { + float4 positionOS : POSITION; + float3 normalOS : NORMAL; + float2 uv : TEXCOORD0; + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + float2 uv : TEXCOORD0; + float3 normalWS : TEXCOORD1; + float3 positionWS : TEXCOORD2; + float fogFactor : TEXCOORD3; + }; + + Varyings vert(Attributes input) + { + Varyings output; + VertexPositionInputs posInputs = GetVertexPositionInputs(input.positionOS.xyz); + output.positionCS = posInputs.positionCS; + output.positionWS = posInputs.positionWS; + output.normalWS = TransformObjectToWorldNormal(input.normalOS); + output.uv = TRANSFORM_TEX(input.uv, _MainTex); + output.fogFactor = ComputeFogFactor(posInputs.positionCS.z); + return output; + } + + half4 frag(Varyings input) : SV_Target + { + half4 albedo = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, input.uv) * _Color; + + InputData inputData = (InputData)0; + inputData.positionWS = input.positionWS; + inputData.normalWS = normalize(input.normalWS); + inputData.viewDirectionWS = GetWorldSpaceNormalizeViewDir(input.positionWS); + inputData.shadowCoord = TransformWorldToShadowCoord(input.positionWS); + + SurfaceData surfaceData = (SurfaceData)0; + surfaceData.albedo = albedo.rgb; + surfaceData.alpha = albedo.a; + surfaceData.metallic = _Metallic; + surfaceData.smoothness = _Glossiness; + surfaceData.occlusion = 1.0; + + half4 color = UniversalFragmentPBR(inputData, surfaceData); + color.rgb = MixFog(color.rgb, input.fogFactor); + return color; + } + ENDHLSL + } + + Pass + { + Name "ShadowCaster" + Tags { "LightMode"="ShadowCaster" } + + ZWrite On + ZTest LEqual + ColorMask 0 + + HLSLPROGRAM + #pragma vertex ShadowVert + #pragma fragment ShadowFrag + #pragma multi_compile _ _CASTING_PUNCTUAL_LIGHT_SHADOW + + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl" + + float3 _LightDirection; + float3 _LightPosition; + + struct Attributes + { + float4 positionOS : POSITION; + float3 normalOS : NORMAL; + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + }; + + Varyings ShadowVert(Attributes input) + { + Varyings output; + float3 posWS = TransformObjectToWorld(input.positionOS.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normalOS); + + #if _CASTING_PUNCTUAL_LIGHT_SHADOW + float3 lightDir = normalize(_LightPosition - posWS); + #else + float3 lightDir = _LightDirection; + #endif + + output.positionCS = TransformWorldToHClip(ApplyShadowBias(posWS, normalWS, lightDir)); + #if UNITY_REVERSED_Z + output.positionCS.z = min(output.positionCS.z, UNITY_NEAR_CLIP_VALUE); + #else + output.positionCS.z = max(output.positionCS.z, UNITY_NEAR_CLIP_VALUE); + #endif + return output; + } + + half4 ShadowFrag(Varyings input) : SV_Target + { + return 0; + } + ENDHLSL + } + } + + // Built-in RP SubShader — fallback when no SRP is active + SubShader + { + Tags { "RenderType"="Opaque" } + LOD 200 + + CGPROGRAM + #pragma surface surf Standard fullforwardshadows + #pragma target 3.0 + + sampler2D _MainTex; + half _Glossiness; + half _Metallic; + fixed4 _Color; + + struct Input + { + float2 uv_MainTex; + }; + + void surf(Input IN, inout SurfaceOutputStandard o) + { + fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; + o.Albedo = c.rgb; + o.Metallic = _Metallic; + o.Smoothness = _Glossiness; + o.Alpha = c.a; + } + ENDCG + } + + FallBack "Diffuse" +} diff --git a/ExternalSampleProjects/InputDeviceTester/Assets/InputDeviceTester/Shaders/SimpleLit.shader.meta b/ExternalSampleProjects/InputDeviceTester/Assets/InputDeviceTester/Shaders/SimpleLit.shader.meta new file mode 100644 index 0000000000..488cca7f40 --- /dev/null +++ b/ExternalSampleProjects/InputDeviceTester/Assets/InputDeviceTester/Shaders/SimpleLit.shader.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + preprocessorOverride: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/ExternalSampleProjects/InputDeviceTester/Assets/InputDeviceTester/Shaders/WorldCoord Diffuse.shader b/ExternalSampleProjects/InputDeviceTester/Assets/InputDeviceTester/Shaders/WorldCoord Diffuse.shader index be4cf322dd..bcc9f40cab 100644 --- a/ExternalSampleProjects/InputDeviceTester/Assets/InputDeviceTester/Shaders/WorldCoord Diffuse.shader +++ b/ExternalSampleProjects/InputDeviceTester/Assets/InputDeviceTester/Shaders/WorldCoord Diffuse.shader @@ -5,6 +5,153 @@ Properties { _BaseScale ("Base Tiling", Vector) = (1,1,1,0) } +// URP SubShader — tri-planar with Lambert lighting +SubShader { + Tags { "RenderType"="Opaque" "RenderPipeline"="UniversalPipeline" "Queue"="Geometry" } + LOD 150 + + Pass + { + Name "ForwardLit" + Tags { "LightMode"="UniversalForward" } + + HLSLPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN + #pragma multi_compile _ _SHADOWS_SOFT + #pragma multi_compile _ _ADDITIONAL_LIGHTS + #pragma multi_compile_fog + + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + CBUFFER_START(UnityPerMaterial) + float4 _MainTex_ST; + half4 _Color; + half3 _BaseScale; + CBUFFER_END + + struct Attributes + { + float4 positionOS : POSITION; + float3 normalOS : NORMAL; + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + float3 positionWS : TEXCOORD0; + float3 normalWS : TEXCOORD1; + float fogFactor : TEXCOORD2; + }; + + Varyings vert(Attributes input) + { + Varyings output; + VertexPositionInputs posInputs = GetVertexPositionInputs(input.positionOS.xyz); + output.positionCS = posInputs.positionCS; + output.positionWS = posInputs.positionWS; + output.normalWS = TransformObjectToWorldNormal(input.normalOS); + output.fogFactor = ComputeFogFactor(posInputs.positionCS.z); + return output; + } + + half4 frag(Varyings input) : SV_Target + { + half3 normalWS = normalize(input.normalWS); + + half4 texXY = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, input.positionWS.xy * _BaseScale.z); + half4 texXZ = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, input.positionWS.xz * _BaseScale.y); + half4 texYZ = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, input.positionWS.yz * _BaseScale.x); + + half3 blendWeights = abs(half3( + dot(normalWS, half3(0, 0, 1)), + dot(normalWS, half3(0, 1, 0)), + dot(normalWS, half3(1, 0, 0)))); + blendWeights /= (blendWeights.x + blendWeights.y + blendWeights.z); + + half4 tex = texXY * blendWeights.x + texXZ * blendWeights.y + texYZ * blendWeights.z; + half4 albedo = tex * _Color; + + float4 shadowCoord = TransformWorldToShadowCoord(input.positionWS); + Light mainLight = GetMainLight(shadowCoord); + half NdotL = saturate(dot(normalWS, mainLight.direction)); + half3 diffuse = albedo.rgb * mainLight.color * (NdotL * mainLight.distanceAttenuation * mainLight.shadowAttenuation); + + half3 ambient = SampleSH(normalWS) * albedo.rgb; + half3 finalColor = ambient + diffuse; + + finalColor = MixFog(finalColor, input.fogFactor); + return half4(finalColor, 1.0); + } + ENDHLSL + } + + Pass + { + Name "ShadowCaster" + Tags { "LightMode"="ShadowCaster" } + + ZWrite On + ZTest LEqual + ColorMask 0 + + HLSLPROGRAM + #pragma vertex ShadowVert + #pragma fragment ShadowFrag + #pragma multi_compile _ _CASTING_PUNCTUAL_LIGHT_SHADOW + + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl" + + float3 _LightDirection; + float3 _LightPosition; + + struct Attributes + { + float4 positionOS : POSITION; + float3 normalOS : NORMAL; + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + }; + + Varyings ShadowVert(Attributes input) + { + Varyings output; + float3 posWS = TransformObjectToWorld(input.positionOS.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normalOS); + + #if _CASTING_PUNCTUAL_LIGHT_SHADOW + float3 lightDir = normalize(_LightPosition - posWS); + #else + float3 lightDir = _LightDirection; + #endif + + output.positionCS = TransformWorldToHClip(ApplyShadowBias(posWS, normalWS, lightDir)); + #if UNITY_REVERSED_Z + output.positionCS.z = min(output.positionCS.z, UNITY_NEAR_CLIP_VALUE); + #else + output.positionCS.z = max(output.positionCS.z, UNITY_NEAR_CLIP_VALUE); + #endif + return output; + } + + half4 ShadowFrag(Varyings input) : SV_Target + { + return 0; + } + ENDHLSL + } +} + +// Built-in RP SubShader — surface shader with Lambert (fallback) SubShader { Tags { "RenderType"="Opaque" } LOD 150 @@ -25,9 +172,9 @@ struct Input { }; void surf (Input IN, inout SurfaceOutput o) { - fixed4 texXY = tex2D(_MainTex, IN.worldPos.xy * _BaseScale.z);// IN.uv_MainTex); - fixed4 texXZ = tex2D(_MainTex, IN.worldPos.xz * _BaseScale.y);// IN.uv_MainTex); - fixed4 texYZ = tex2D(_MainTex, IN.worldPos.yz * _BaseScale.x);// IN.uv_MainTex); + fixed4 texXY = tex2D(_MainTex, IN.worldPos.xy * _BaseScale.z); + fixed4 texXZ = tex2D(_MainTex, IN.worldPos.xz * _BaseScale.y); + fixed4 texYZ = tex2D(_MainTex, IN.worldPos.yz * _BaseScale.x); fixed3 mask = fixed3( dot (IN.worldNormal, fixed3(0,0,1)), dot (IN.worldNormal, fixed3(0,1,0)), diff --git a/ExternalSampleProjects/InputDeviceTester/ProjectSettings/ProjectSettings.asset b/ExternalSampleProjects/InputDeviceTester/ProjectSettings/ProjectSettings.asset index a69797d161..c355b0382c 100644 --- a/ExternalSampleProjects/InputDeviceTester/ProjectSettings/ProjectSettings.asset +++ b/ExternalSampleProjects/InputDeviceTester/ProjectSettings/ProjectSettings.asset @@ -509,7 +509,11 @@ PlayerSettings: webGLLinkerTarget: 1 webGLThreadsSupport: 0 webGLWasmStreaming: 0 - scriptingDefineSymbols: {} + scriptingDefineSymbols: + Android: URP_COMPATIBILITY_MODE + Standalone: URP_COMPATIBILITY_MODE + iPhone: URP_COMPATIBILITY_MODE + tvOS: URP_COMPATIBILITY_MODE platformArchitecture: {} scriptingBackend: {} il2cppCompilerConfiguration: {} diff --git a/ExternalSampleProjects/TouchSamples/Assets/Demo/Materials/Default.mat b/ExternalSampleProjects/TouchSamples/Assets/Demo/Materials/Default.mat new file mode 100644 index 0000000000..2bb586a98f --- /dev/null +++ b/ExternalSampleProjects/TouchSamples/Assets/Demo/Materials/Default.mat @@ -0,0 +1,30 @@ +%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: Default + m_Shader: {fileID: 4800000, guid: b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7, type: 3} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Glossiness: 0.5 + - _Metallic: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} diff --git a/ExternalSampleProjects/TouchSamples/Assets/Demo/Materials/Default.mat.meta b/ExternalSampleProjects/TouchSamples/Assets/Demo/Materials/Default.mat.meta new file mode 100644 index 0000000000..8f05a6cf08 --- /dev/null +++ b/ExternalSampleProjects/TouchSamples/Assets/Demo/Materials/Default.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/ExternalSampleProjects/TouchSamples/Assets/Demo/Materials/Rolling/BasicTerrain.mat b/ExternalSampleProjects/TouchSamples/Assets/Demo/Materials/Rolling/BasicTerrain.mat index 470ed523a5..e8644af708 100644 --- a/ExternalSampleProjects/TouchSamples/Assets/Demo/Materials/Rolling/BasicTerrain.mat +++ b/ExternalSampleProjects/TouchSamples/Assets/Demo/Materials/Rolling/BasicTerrain.mat @@ -7,7 +7,7 @@ Material: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_Name: BasicTerrain - m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_Shader: {fileID: 4800000, guid: b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7, type: 3} m_ShaderKeywords: m_LightmapFlags: 4 m_EnableInstancingVariants: 0 diff --git a/ExternalSampleProjects/TouchSamples/Assets/Demo/Materials/Rolling/BouncyTerrain.mat b/ExternalSampleProjects/TouchSamples/Assets/Demo/Materials/Rolling/BouncyTerrain.mat index 1a017ffb13..e7ada87c2f 100644 --- a/ExternalSampleProjects/TouchSamples/Assets/Demo/Materials/Rolling/BouncyTerrain.mat +++ b/ExternalSampleProjects/TouchSamples/Assets/Demo/Materials/Rolling/BouncyTerrain.mat @@ -7,7 +7,7 @@ Material: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_Name: BouncyTerrain - m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_Shader: {fileID: 4800000, guid: b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7, type: 3} m_ShaderKeywords: m_LightmapFlags: 4 m_EnableInstancingVariants: 0 diff --git a/ExternalSampleProjects/TouchSamples/Assets/Demo/Materials/Rolling/PlayerBall.mat b/ExternalSampleProjects/TouchSamples/Assets/Demo/Materials/Rolling/PlayerBall.mat index b964d99e80..ca94456081 100644 --- a/ExternalSampleProjects/TouchSamples/Assets/Demo/Materials/Rolling/PlayerBall.mat +++ b/ExternalSampleProjects/TouchSamples/Assets/Demo/Materials/Rolling/PlayerBall.mat @@ -7,7 +7,7 @@ Material: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_Name: PlayerBall - m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_Shader: {fileID: 4800000, guid: b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7, type: 3} m_ShaderKeywords: m_LightmapFlags: 4 m_EnableInstancingVariants: 0 diff --git a/ExternalSampleProjects/TouchSamples/Assets/Demo/Materials/Rolling/RoughTerrain.mat b/ExternalSampleProjects/TouchSamples/Assets/Demo/Materials/Rolling/RoughTerrain.mat index 4249ffcf73..d5b39f5a74 100644 --- a/ExternalSampleProjects/TouchSamples/Assets/Demo/Materials/Rolling/RoughTerrain.mat +++ b/ExternalSampleProjects/TouchSamples/Assets/Demo/Materials/Rolling/RoughTerrain.mat @@ -7,7 +7,7 @@ Material: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_Name: RoughTerrain - m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_Shader: {fileID: 4800000, guid: b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7, type: 3} m_ShaderKeywords: m_LightmapFlags: 4 m_EnableInstancingVariants: 0 diff --git a/ExternalSampleProjects/TouchSamples/Assets/Demo/Materials/Rolling/SlipperyTerrain.mat b/ExternalSampleProjects/TouchSamples/Assets/Demo/Materials/Rolling/SlipperyTerrain.mat index f3a70c2afa..66c9e46b6e 100644 --- a/ExternalSampleProjects/TouchSamples/Assets/Demo/Materials/Rolling/SlipperyTerrain.mat +++ b/ExternalSampleProjects/TouchSamples/Assets/Demo/Materials/Rolling/SlipperyTerrain.mat @@ -7,7 +7,7 @@ Material: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_Name: SlipperyTerrain - m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_Shader: {fileID: 4800000, guid: b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7, type: 3} m_ShaderKeywords: m_LightmapFlags: 4 m_EnableInstancingVariants: 0 diff --git a/ExternalSampleProjects/TouchSamples/Assets/Demo/Scenes/Tapping.unity b/ExternalSampleProjects/TouchSamples/Assets/Demo/Scenes/Tapping.unity index d946e969ab..5d44c1df94 100644 --- a/ExternalSampleProjects/TouchSamples/Assets/Demo/Scenes/Tapping.unity +++ b/ExternalSampleProjects/TouchSamples/Assets/Demo/Scenes/Tapping.unity @@ -5095,7 +5095,7 @@ ParticleSystemRenderer: m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: - - {fileID: 10301, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9, type: 2} - {fileID: 0} m_StaticBatchInfo: firstSubMesh: 0 @@ -10314,7 +10314,7 @@ ParticleSystemRenderer: m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: - - {fileID: 10301, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9, type: 2} - {fileID: 2100000, guid: f9ebf49d38f9a184eb352c0508010fab, type: 2} m_StaticBatchInfo: firstSubMesh: 0 @@ -15329,7 +15329,7 @@ ParticleSystemRenderer: m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: - - {fileID: 10301, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9, type: 2} - {fileID: 0} m_StaticBatchInfo: firstSubMesh: 0 diff --git a/ExternalSampleProjects/TouchSamples/Assets/Demo/Shaders/Drawing/Background.shader b/ExternalSampleProjects/TouchSamples/Assets/Demo/Shaders/Drawing/Background.shader index d8db2a445e..cc41504b6b 100644 --- a/ExternalSampleProjects/TouchSamples/Assets/Demo/Shaders/Drawing/Background.shader +++ b/ExternalSampleProjects/TouchSamples/Assets/Demo/Shaders/Drawing/Background.shader @@ -7,6 +7,61 @@ Shader "Samples/Drawing/Background" { _MainTex ("Texture", 2D) = "white" {} } + + // URP SubShader + SubShader + { + Tags { "RenderType"="Transparent" "Queue"="Transparent" "RenderPipeline"="UniversalPipeline" "Premultiplied"="True" } + LOD 100 + + Pass + { + Blend One OneMinusSrcAlpha + ZWrite Off + + HLSLPROGRAM + #pragma vertex vert + #pragma fragment frag + + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + CBUFFER_START(UnityPerMaterial) + float4 _MainTex_ST; + CBUFFER_END + + struct Attributes + { + float4 positionOS : POSITION; + float2 uv : TEXCOORD0; + }; + + struct Varyings + { + float2 uv : TEXCOORD0; + float4 positionCS : SV_POSITION; + }; + + Varyings vert(Attributes input) + { + Varyings output; + output.positionCS = TransformObjectToHClip(input.positionOS.xyz); + output.uv = TRANSFORM_TEX(input.uv, _MainTex); + return output; + } + + half4 frag(Varyings input) : SV_Target + { + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, input.uv); + return col; + } + ENDHLSL + } + } + + // Built-in RP SubShader (fallback) SubShader { Tags { "RenderType"="Transparent" "Queue"="Transparent" "Premultiplied"="True" } @@ -47,7 +102,6 @@ Shader "Samples/Drawing/Background" fixed4 frag (v2f i) : SV_Target { - // sample the texture fixed4 col = tex2D(_MainTex, i.uv); return col; } diff --git a/ExternalSampleProjects/TouchSamples/Assets/Demo/Shaders/Drawing/Capture.shader b/ExternalSampleProjects/TouchSamples/Assets/Demo/Shaders/Drawing/Capture.shader index f3bfae2f8b..b16e4304fa 100644 --- a/ExternalSampleProjects/TouchSamples/Assets/Demo/Shaders/Drawing/Capture.shader +++ b/ExternalSampleProjects/TouchSamples/Assets/Demo/Shaders/Drawing/Capture.shader @@ -3,102 +3,123 @@ Shader "Hidden/Drawing/Capture" Properties { _MainTex ("Texture", 2D) = "white" {} + [Enum(SrcAlpha,5,One,1)] _SrcBlend ("Source Blend", Float) = 5 + [Enum(OneMinusSrcAlpha,10)] _DstBlend ("Dest Blend", Float) = 10 + [Toggle] _Premultiplied ("Premultiplied Alpha", Float) = 0 } + // URP SubShader SubShader { - Tags { "RenderType"="Transparent" "Queue"="Transparent" "Premultiplied"="False" } + Tags { "RenderType"="Transparent" "Queue"="Transparent" "RenderPipeline"="UniversalPipeline" } LOD 100 Pass { - Blend SrcAlpha OneMinusSrcAlpha, OneMinusDstAlpha One + Blend [_SrcBlend] [_DstBlend], OneMinusDstAlpha One + ZWrite Off - CGPROGRAM - struct appdata + HLSLPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma shader_feature_local _PREMULTIPLIED_ON + + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + CBUFFER_START(UnityPerMaterial) + float4 _MainTex_ST; + CBUFFER_END + + struct Attributes { - float4 vertex : POSITION; + float4 positionOS : POSITION; float2 uv : TEXCOORD0; float4 color : COLOR0; }; - struct v2f + struct Varyings { float2 uv : TEXCOORD0; - float4 vertex : SV_POSITION; + float4 positionCS : SV_POSITION; float4 color : COLOR0; }; - sampler2D _MainTex; - float4 _MainTex_ST; - - #pragma vertex vert - #pragma fragment frag - - #include "UnityCG.cginc" - - v2f vert (appdata v) + Varyings vert(Attributes input) { - v2f o; - o.vertex = UnityObjectToClipPos(v.vertex); - o.uv = TRANSFORM_TEX(v.uv, _MainTex); - o.color = v.color; - return o; + Varyings output; + output.positionCS = TransformObjectToHClip(input.positionOS.xyz); + output.uv = TRANSFORM_TEX(input.uv, _MainTex); + output.color = input.color; + return output; } - fixed4 frag (v2f i) : SV_Target + half4 frag(Varyings input) : SV_Target { - // sample the texture - fixed4 col = tex2D(_MainTex, i.uv) * i.color; - return col; + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, input.uv); + #if _PREMULTIPLIED_ON + return col; + #else + return col * input.color; + #endif } - ENDCG + ENDHLSL } } + // Built-in RP SubShader (fallback) SubShader { - Tags { "RenderType"="Transparent" "Queue"="Transparent" "Premultiplied"="True" } + Tags { "RenderType"="Transparent" "Queue"="Transparent" } LOD 100 Pass { - Blend One OneMinusSrcAlpha, OneMinusDstAlpha One + Blend [_SrcBlend] [_DstBlend], OneMinusDstAlpha One CGPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma shader_feature_local _PREMULTIPLIED_ON + + #include "UnityCG.cginc" + + sampler2D _MainTex; + float4 _MainTex_ST; + struct appdata { float4 vertex : POSITION; float2 uv : TEXCOORD0; + float4 color : COLOR0; }; struct v2f { float2 uv : TEXCOORD0; float4 vertex : SV_POSITION; + float4 color : COLOR0; }; - sampler2D _MainTex; - float4 _MainTex_ST; - - #pragma vertex vert - #pragma fragment frag - - #include "UnityCG.cginc" - - v2f vert (appdata v) + v2f vert(appdata v) { v2f o; o.vertex = UnityObjectToClipPos(v.vertex); o.uv = TRANSFORM_TEX(v.uv, _MainTex); + o.color = v.color; return o; } - fixed4 frag (v2f i) : SV_Target + fixed4 frag(v2f i) : SV_Target { - // sample the texture fixed4 col = tex2D(_MainTex, i.uv); - return col; + #if _PREMULTIPLIED_ON + return col; + #else + return col * i.color; + #endif } ENDCG } diff --git a/ExternalSampleProjects/TouchSamples/Assets/Demo/Shaders/Drawing/Tool.shader b/ExternalSampleProjects/TouchSamples/Assets/Demo/Shaders/Drawing/Tool.shader index 567894646a..c57518330a 100644 --- a/ExternalSampleProjects/TouchSamples/Assets/Demo/Shaders/Drawing/Tool.shader +++ b/ExternalSampleProjects/TouchSamples/Assets/Demo/Shaders/Drawing/Tool.shader @@ -4,6 +4,64 @@ Shader "Samples/Drawing/Tool" { _MainTex ("Texture", 2D) = "white" {} } + + // URP SubShader + SubShader + { + Tags { "RenderType"="Transparent" "Queue"="Transparent" "RenderPipeline"="UniversalPipeline" "Premultiplied"="False" } + LOD 100 + + Pass + { + Blend SrcAlpha OneMinusSrcAlpha + ZWrite Off + + HLSLPROGRAM + #pragma vertex vert + #pragma fragment frag + + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + CBUFFER_START(UnityPerMaterial) + float4 _MainTex_ST; + CBUFFER_END + + struct Attributes + { + float4 positionOS : POSITION; + float2 uv : TEXCOORD0; + float4 color : COLOR0; + }; + + struct Varyings + { + float2 uv : TEXCOORD0; + float4 positionCS : SV_POSITION; + float4 color : COLOR0; + }; + + Varyings vert(Attributes input) + { + Varyings output; + output.positionCS = TransformObjectToHClip(input.positionOS.xyz); + output.uv = TRANSFORM_TEX(input.uv, _MainTex); + output.color = input.color; + return output; + } + + half4 frag(Varyings input) : SV_Target + { + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, input.uv) * input.color; + return col; + } + ENDHLSL + } + } + + // Built-in RP SubShader (fallback) SubShader { Tags { "RenderType"="Transparent" "Queue"="Transparent" "Premultiplied"="False" } @@ -47,7 +105,6 @@ Shader "Samples/Drawing/Tool" fixed4 frag (v2f i) : SV_Target { - // sample the texture fixed4 col = tex2D(_MainTex, i.uv) * i.color; return col; } diff --git a/ExternalSampleProjects/TouchSamples/Assets/Demo/Shaders/SimpleLit.shader b/ExternalSampleProjects/TouchSamples/Assets/Demo/Shaders/SimpleLit.shader new file mode 100644 index 0000000000..fe06c0dd11 --- /dev/null +++ b/ExternalSampleProjects/TouchSamples/Assets/Demo/Shaders/SimpleLit.shader @@ -0,0 +1,186 @@ +Shader "Samples/TouchSamples/SimpleLit" +{ + Properties + { + _Color ("Color", Color) = (1,1,1,1) + _MainTex ("Albedo (RGB)", 2D) = "white" {} + _Glossiness ("Smoothness", Range(0,1)) = 0.5 + _Metallic ("Metallic", Range(0,1)) = 0.0 + } + + // URP SubShader — selected when Universal Render Pipeline is active + SubShader + { + Tags { "RenderType"="Opaque" "RenderPipeline"="UniversalPipeline" "Queue"="Geometry" } + + Pass + { + Name "ForwardLit" + Tags { "LightMode"="UniversalForward" } + + HLSLPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN + #pragma multi_compile _ _SHADOWS_SOFT + #pragma multi_compile _ _ADDITIONAL_LIGHTS + #pragma multi_compile_fog + + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + CBUFFER_START(UnityPerMaterial) + float4 _MainTex_ST; + half4 _Color; + half _Glossiness; + half _Metallic; + CBUFFER_END + + struct Attributes + { + float4 positionOS : POSITION; + float3 normalOS : NORMAL; + float2 uv : TEXCOORD0; + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + float2 uv : TEXCOORD0; + float3 normalWS : TEXCOORD1; + float3 positionWS : TEXCOORD2; + float fogFactor : TEXCOORD3; + }; + + Varyings vert(Attributes input) + { + Varyings output; + VertexPositionInputs posInputs = GetVertexPositionInputs(input.positionOS.xyz); + output.positionCS = posInputs.positionCS; + output.positionWS = posInputs.positionWS; + output.normalWS = TransformObjectToWorldNormal(input.normalOS); + output.uv = TRANSFORM_TEX(input.uv, _MainTex); + output.fogFactor = ComputeFogFactor(posInputs.positionCS.z); + return output; + } + + half4 frag(Varyings input) : SV_Target + { + half4 albedo = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, input.uv) * _Color; + + InputData inputData = (InputData)0; + inputData.positionWS = input.positionWS; + inputData.normalWS = normalize(input.normalWS); + inputData.viewDirectionWS = GetWorldSpaceNormalizeViewDir(input.positionWS); + inputData.shadowCoord = TransformWorldToShadowCoord(input.positionWS); + + SurfaceData surfaceData = (SurfaceData)0; + surfaceData.albedo = albedo.rgb; + surfaceData.alpha = albedo.a; + surfaceData.metallic = _Metallic; + surfaceData.smoothness = _Glossiness; + surfaceData.occlusion = 1.0; + + half4 color = UniversalFragmentPBR(inputData, surfaceData); + color.rgb = MixFog(color.rgb, input.fogFactor); + return color; + } + ENDHLSL + } + + Pass + { + Name "ShadowCaster" + Tags { "LightMode"="ShadowCaster" } + + ZWrite On + ZTest LEqual + ColorMask 0 + + HLSLPROGRAM + #pragma vertex ShadowVert + #pragma fragment ShadowFrag + #pragma multi_compile _ _CASTING_PUNCTUAL_LIGHT_SHADOW + + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl" + + float3 _LightDirection; + float3 _LightPosition; + + struct Attributes + { + float4 positionOS : POSITION; + float3 normalOS : NORMAL; + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + }; + + Varyings ShadowVert(Attributes input) + { + Varyings output; + float3 posWS = TransformObjectToWorld(input.positionOS.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normalOS); + + #if _CASTING_PUNCTUAL_LIGHT_SHADOW + float3 lightDir = normalize(_LightPosition - posWS); + #else + float3 lightDir = _LightDirection; + #endif + + output.positionCS = TransformWorldToHClip(ApplyShadowBias(posWS, normalWS, lightDir)); + #if UNITY_REVERSED_Z + output.positionCS.z = min(output.positionCS.z, UNITY_NEAR_CLIP_VALUE); + #else + output.positionCS.z = max(output.positionCS.z, UNITY_NEAR_CLIP_VALUE); + #endif + return output; + } + + half4 ShadowFrag(Varyings input) : SV_Target + { + return 0; + } + ENDHLSL + } + } + + // Built-in RP SubShader — fallback when no SRP is active + SubShader + { + Tags { "RenderType"="Opaque" } + LOD 200 + + CGPROGRAM + #pragma surface surf Standard fullforwardshadows + #pragma target 3.0 + + sampler2D _MainTex; + half _Glossiness; + half _Metallic; + fixed4 _Color; + + struct Input + { + float2 uv_MainTex; + }; + + void surf(Input IN, inout SurfaceOutputStandard o) + { + fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; + o.Albedo = c.rgb; + o.Metallic = _Metallic; + o.Smoothness = _Glossiness; + o.Alpha = c.a; + } + ENDCG + } + + FallBack "Diffuse" +} diff --git a/ExternalSampleProjects/TouchSamples/Assets/Demo/Shaders/SimpleLit.shader.meta b/ExternalSampleProjects/TouchSamples/Assets/Demo/Shaders/SimpleLit.shader.meta new file mode 100644 index 0000000000..da9e6caa07 --- /dev/null +++ b/ExternalSampleProjects/TouchSamples/Assets/Demo/Shaders/SimpleLit.shader.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + preprocessorOverride: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/ExternalSampleProjects/TouchSamples/ProjectSettings/ProjectSettings.asset b/ExternalSampleProjects/TouchSamples/ProjectSettings/ProjectSettings.asset index 14a44a0e16..fd367abe32 100644 --- a/ExternalSampleProjects/TouchSamples/ProjectSettings/ProjectSettings.asset +++ b/ExternalSampleProjects/TouchSamples/ProjectSettings/ProjectSettings.asset @@ -509,7 +509,11 @@ PlayerSettings: webGLLinkerTarget: 1 webGLThreadsSupport: 0 webGLWasmStreaming: 0 - scriptingDefineSymbols: {} + scriptingDefineSymbols: + Android: URP_COMPATIBILITY_MODE + Standalone: URP_COMPATIBILITY_MODE + iPhone: URP_COMPATIBILITY_MODE + tvOS: URP_COMPATIBILITY_MODE platformArchitecture: {} scriptingBackend: {} il2cppCompilerConfiguration: {} diff --git a/Packages/com.unity.inputsystem/CHANGELOG.md b/Packages/com.unity.inputsystem/CHANGELOG.md index 006097717b..a3df17656c 100644 --- a/Packages/com.unity.inputsystem/CHANGELOG.md +++ b/Packages/com.unity.inputsystem/CHANGELOG.md @@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Changed +- Migrated sample scenes to use Universal Render Pipeline (URP) with Built-in Render Pipeline fallback shaders. The URP package is now required to run the samples. (ISX-2343) - Changed the UI for `Actions.inputactions` asset to use UI Toolkit framework. ### Added diff --git a/Packages/manifest.json b/Packages/manifest.json index 5486b34afd..79c4346e45 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -1,10 +1,10 @@ { "dependencies": { - "com.unity.ai.navigation": "1.1.6", + "com.unity.ai.navigation": "1.1.7", "com.unity.analytics": "3.8.1", "com.unity.cinemachine": "3.1.6", "com.unity.coding": "0.1.0-preview.26", - "com.unity.ide.rider": "3.0.36", + "com.unity.ide.rider": "3.0.38", "com.unity.ide.visualstudio": "2.0.22", "com.unity.settings-manager": "2.1.0", "com.unity.test-framework": "1.4.5", @@ -12,6 +12,7 @@ "com.unity.test-framework.performance": "3.0.3", "com.unity.test-framework.utp-reporter": "1.1.0-preview", "com.unity.textmeshpro": "3.0.7", + "com.unity.render-pipelines.universal": "14.0.11", "com.unity.ugui": "2.0.0", "nuget.mono-cecil": "1.0.0", "com.unity.modules.ai": "1.0.0", diff --git a/ProjectSettings/GraphicsSettings.asset b/ProjectSettings/GraphicsSettings.asset index 78c90e918e..cd2970f7d6 100644 --- a/ProjectSettings/GraphicsSettings.asset +++ b/ProjectSettings/GraphicsSettings.asset @@ -40,7 +40,8 @@ GraphicsSettings: m_PreloadShadersBatchTimeLimit: -1 m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} - m_CustomRenderPipeline: {fileID: 0} + m_CustomRenderPipeline: {fileID: 11400000, guid: 419b51160a38fc648a23b6a5b447b92e, + type: 2} m_TransparencySortMode: 0 m_TransparencySortAxis: {x: 0, y: 0, z: 1} m_DefaultRenderingPath: 1 @@ -60,11 +61,13 @@ GraphicsSettings: m_FogKeepExp: 1 m_FogKeepExp2: 1 m_AlbedoSwatchInfos: [] - m_LightsUseLinearIntensity: 0 - m_LightsUseColorTemperature: 0 + m_LightsUseLinearIntensity: 1 + m_LightsUseColorTemperature: 1 m_DefaultRenderingLayerMask: 1 m_LogWhenShaderIsCompiled: 0 - m_SRPDefaultSettings: {} + m_SRPDefaultSettings: + UnityEngine.Rendering.Universal.UniversalRenderPipeline: {fileID: 11400000, guid: 3c7230e15ebbbb640a4fe635e888f015, + type: 2} m_LightProbeOutsideHullStrategy: 0 m_CameraRelativeLightCulling: 0 m_CameraRelativeShadowCulling: 0 diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 50e06c227a..d440ac678d 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -46,8 +46,8 @@ PlayerSettings: defaultScreenHeight: 768 defaultScreenWidthWeb: 960 defaultScreenHeightWeb: 600 - m_StereoRenderingPath: 1 - m_ActiveColorSpace: 0 + m_StereoRenderingPath: 0 + m_ActiveColorSpace: 1 unsupportedMSAAFallback: 0 m_SpriteBatchVertexThreshold: 300 m_MTRendering: 1 @@ -434,7 +434,7 @@ PlayerSettings: m_APIs: 10000000 m_Automatic: 1 - m_BuildTarget: AndroidPlayer - m_APIs: 0b00000008000000 + m_APIs: 0b000000 m_Automatic: 0 m_BuildTargetVRSettings: - m_BuildTarget: Standalone @@ -732,7 +732,10 @@ PlayerSettings: webGLMemoryGeometricGrowthCap: 96 webGLPowerPreference: 2 scriptingDefineSymbols: - Standalone: UNITY_ENABLE_STEAM_CONTROLLER_SUPPORT + Android: URP_COMPATIBILITY_MODE + Standalone: UNITY_ENABLE_STEAM_CONTROLLER_SUPPORT;URP_COMPATIBILITY_MODE + iPhone: URP_COMPATIBILITY_MODE + tvOS: URP_COMPATIBILITY_MODE additionalCompilerArguments: {} platformArchitecture: iPhone: 1 diff --git a/ProjectSettings/QualitySettings.asset b/ProjectSettings/QualitySettings.asset index 35680235d7..3d94a7d48a 100644 --- a/ProjectSettings/QualitySettings.asset +++ b/ProjectSettings/QualitySettings.asset @@ -44,7 +44,8 @@ QualitySettings: asyncUploadBufferSize: 4 asyncUploadPersistentBuffer: 1 resolutionScalingFixedDPIFactor: 1 - customRenderPipeline: {fileID: 0} + customRenderPipeline: {fileID: 11400000, guid: 419b51160a38fc648a23b6a5b447b92e, + type: 2} terrainQualityOverrides: 0 terrainPixelError: 1 terrainDetailDensityScale: 1 @@ -93,7 +94,8 @@ QualitySettings: asyncUploadBufferSize: 4 asyncUploadPersistentBuffer: 1 resolutionScalingFixedDPIFactor: 1 - customRenderPipeline: {fileID: 0} + customRenderPipeline: {fileID: 11400000, guid: 419b51160a38fc648a23b6a5b447b92e, + type: 2} terrainQualityOverrides: 0 terrainPixelError: 1 terrainDetailDensityScale: 1 @@ -142,7 +144,8 @@ QualitySettings: asyncUploadBufferSize: 4 asyncUploadPersistentBuffer: 1 resolutionScalingFixedDPIFactor: 1 - customRenderPipeline: {fileID: 0} + customRenderPipeline: {fileID: 11400000, guid: 419b51160a38fc648a23b6a5b447b92e, + type: 2} terrainQualityOverrides: 0 terrainPixelError: 1 terrainDetailDensityScale: 1 @@ -191,7 +194,8 @@ QualitySettings: asyncUploadBufferSize: 4 asyncUploadPersistentBuffer: 1 resolutionScalingFixedDPIFactor: 1 - customRenderPipeline: {fileID: 0} + customRenderPipeline: {fileID: 11400000, guid: 419b51160a38fc648a23b6a5b447b92e, + type: 2} terrainQualityOverrides: 0 terrainPixelError: 1 terrainDetailDensityScale: 1 @@ -240,7 +244,8 @@ QualitySettings: asyncUploadBufferSize: 4 asyncUploadPersistentBuffer: 1 resolutionScalingFixedDPIFactor: 1 - customRenderPipeline: {fileID: 0} + customRenderPipeline: {fileID: 11400000, guid: 419b51160a38fc648a23b6a5b447b92e, + type: 2} terrainQualityOverrides: 0 terrainPixelError: 1 terrainDetailDensityScale: 1 @@ -289,7 +294,8 @@ QualitySettings: asyncUploadBufferSize: 4 asyncUploadPersistentBuffer: 1 resolutionScalingFixedDPIFactor: 1 - customRenderPipeline: {fileID: 0} + customRenderPipeline: {fileID: 11400000, guid: 419b51160a38fc648a23b6a5b447b92e, + type: 2} terrainQualityOverrides: 0 terrainPixelError: 1 terrainDetailDensityScale: 1 diff --git a/ProjectSettings/ShaderGraphSettings.asset b/ProjectSettings/ShaderGraphSettings.asset new file mode 100644 index 0000000000..59c4647f47 --- /dev/null +++ b/ProjectSettings/ShaderGraphSettings.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &1 +MonoBehaviour: + m_ObjectHideFlags: 53 + 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: de02f9e1d18f588468e474319d09a723, type: 3} + m_Name: + m_EditorClassIdentifier: + shaderVariantLimit: 2048 + customInterpolatorErrorThreshold: 32 + customInterpolatorWarningThreshold: 16 diff --git a/ProjectSettings/URPProjectSettings.asset b/ProjectSettings/URPProjectSettings.asset new file mode 100644 index 0000000000..cd7fd8c61b --- /dev/null +++ b/ProjectSettings/URPProjectSettings.asset @@ -0,0 +1,15 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &1 +MonoBehaviour: + m_ObjectHideFlags: 61 + 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: 247994e1f5a72c2419c26a37e9334c01, type: 3} + m_Name: + m_EditorClassIdentifier: + m_LastMaterialVersion: 7