From 72cd2bcb5a408d9009b47ec26e545ce79ec3c317 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoine=20Leli=C3=A8vre?= Date: Tue, 16 Jun 2020 16:05:15 +0200 Subject: [PATCH 1/3] Add the list of forbidden keywords to use in SG blackboard in the doc --- .../Customizing-HDRP-materials-with-Shader-Graph.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Customizing-HDRP-materials-with-Shader-Graph.md b/com.unity.render-pipelines.high-definition/Documentation~/Customizing-HDRP-materials-with-Shader-Graph.md index ec884cc10df..b318adcc4ff 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Customizing-HDRP-materials-with-Shader-Graph.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Customizing-HDRP-materials-with-Shader-Graph.md @@ -66,6 +66,8 @@ You should only expose a property if you intend to change it in the Inspector wh If a property is not exposed, you can still edit it. To edit the property for every Material instance that uses the selected Shader, open the Shader Graph Asset and edit the property directly in the Blackboard. To edit the property for a single Material instance that uses the Shader, use a script. +**:warning: HDRP have a set of restricted property names that you shouldn't use in the blackboard if you want your material to work correctly: `_EmissionColor`, `_BaseColor`, `_BaseColorMap`, `_RenderQueueType`, `_UseShadowThreshold`, `_ReceivesSSR`, `_RequireSplitLighting`, `_TransparentDepthPrepassEnable` and `_TransparentDepthPostpassEnable`.** + ### Material properties in concrete nodes From b7b1a36d050fcd7f4020f1d2d96af2c0c9a520f2 Mon Sep 17 00:00:00 2001 From: Antoine Lelievre Date: Tue, 16 Jun 2020 18:38:36 +0200 Subject: [PATCH 2/3] Update Customizing-HDRP-materials-with-Shader-Graph.md --- ...mizing-HDRP-materials-with-Shader-Graph.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Customizing-HDRP-materials-with-Shader-Graph.md b/com.unity.render-pipelines.high-definition/Documentation~/Customizing-HDRP-materials-with-Shader-Graph.md index b318adcc4ff..1d90b85cec9 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Customizing-HDRP-materials-with-Shader-Graph.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Customizing-HDRP-materials-with-Shader-Graph.md @@ -66,7 +66,22 @@ You should only expose a property if you intend to change it in the Inspector wh If a property is not exposed, you can still edit it. To edit the property for every Material instance that uses the selected Shader, open the Shader Graph Asset and edit the property directly in the Blackboard. To edit the property for a single Material instance that uses the Shader, use a script. -**:warning: HDRP have a set of restricted property names that you shouldn't use in the blackboard if you want your material to work correctly: `_EmissionColor`, `_BaseColor`, `_BaseColorMap`, `_RenderQueueType`, `_UseShadowThreshold`, `_ReceivesSSR`, `_RequireSplitLighting`, `_TransparentDepthPrepassEnable` and `_TransparentDepthPostpassEnable`.** +**:warning: HDRP reserves a set of property names that you should not use in the Blackboard. If you use any of them, the Material will most likely not work correctly. The restricted property names in this table:** + +Property Name | HDRP Usage +--- | --- +`_EmissionColor` | GI emission color. +`_BaseColor` | GI alpha clip. +`_BaseColorMap` | GI alpha clip. +`_RenderQueueType` | HDRP render queue to generate the material render queue. +`_UseShadowThreshold` | HDRP internal. +`_RequireSplitLighting` | HDRP internal. +`_ReceivesSSR` | Already exposed in surface options. +`_TransparentDepthPrepassEnable` | Already exposed in surface options. +`_TransparentDepthPostpassEnable` | Already exposed in surface options. +`_SurfaceType` | Already exposed in surface options. +`_DoubleSidedEnable` | Already exposed in surface options. +`_AlphaCutoffEnable` | Already exposed in surface options. @@ -97,4 +112,4 @@ This system is great to avoid duplicating graphs but it have some problem relate - When you modify the properties of the Master Mode in a Shader Graph, Unity does not synchronize them with Materials unless the Material is open in the Inspector. This means that, when you change certain properties in the Master Node settings, like **Material Type**, Materials that are not open in the Inspector fall out of sync, which breaks the rendering of these Materials. To fix the rendering and synchronize the properties of a Material with its Shader Graph, you can do the following: - - Open the Material in the Inspector, change the value of one of its properties, and then change it back. This triggers a sync between the master node and the Material, and fixes the Material. - - Call `HDEditorUtils.ResetMaterialKeywords(Material)` from a C# script in your Project. This synchronizes the properties of the Material you pass in with the Material's Shader Graph. \ No newline at end of file + - Call `HDEditorUtils.ResetMaterialKeywords(Material)` from a C# script in your Project. This synchronizes the properties of the Material you pass in with the Material's Shader Graph. From 7c9c61253f4b7f2b2914c8d3e5da40459c431d68 Mon Sep 17 00:00:00 2001 From: Antoine Lelievre Date: Wed, 17 Jun 2020 10:51:33 +0200 Subject: [PATCH 3/3] Update Customizing-HDRP-materials-with-Shader-Graph.md --- ...mizing-HDRP-materials-with-Shader-Graph.md | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Customizing-HDRP-materials-with-Shader-Graph.md b/com.unity.render-pipelines.high-definition/Documentation~/Customizing-HDRP-materials-with-Shader-Graph.md index 1d90b85cec9..75560c223c8 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Customizing-HDRP-materials-with-Shader-Graph.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Customizing-HDRP-materials-with-Shader-Graph.md @@ -66,22 +66,23 @@ You should only expose a property if you intend to change it in the Inspector wh If a property is not exposed, you can still edit it. To edit the property for every Material instance that uses the selected Shader, open the Shader Graph Asset and edit the property directly in the Blackboard. To edit the property for a single Material instance that uses the Shader, use a script. -**:warning: HDRP reserves a set of property names that you should not use in the Blackboard. If you use any of them, the Material will most likely not work correctly. The restricted property names in this table:** +**:warning: HDRP reserves a set of property names that you should not use in the Blackboard. If you use any of them, the Material will most likely not work correctly. +For the list of restricted property names and their uses, see the following table:** Property Name | HDRP Usage --- | --- -`_EmissionColor` | GI emission color. -`_BaseColor` | GI alpha clip. -`_BaseColorMap` | GI alpha clip. -`_RenderQueueType` | HDRP render queue to generate the material render queue. +`_EmissionColor` | Global illumination emission color. +`_BaseColor` | Global illumination alpha clip. +`_BaseColorMap` | Global illumination alpha clip. +`_RenderQueueType` | The render queue type HDRP uses to schedule the Material in the render queue. `_UseShadowThreshold` | HDRP internal. `_RequireSplitLighting` | HDRP internal. -`_ReceivesSSR` | Already exposed in surface options. -`_TransparentDepthPrepassEnable` | Already exposed in surface options. -`_TransparentDepthPostpassEnable` | Already exposed in surface options. -`_SurfaceType` | Already exposed in surface options. -`_DoubleSidedEnable` | Already exposed in surface options. -`_AlphaCutoffEnable` | Already exposed in surface options. +`_ReceivesSSR` | Surface Options. +`_TransparentDepthPrepassEnable` | Surface Options. +`_TransparentDepthPostpassEnable` | Surface Options. +`_SurfaceType` | Surface Options. +`_DoubleSidedEnable` | Surface Options. +`_AlphaCutoffEnable` | Surface Options.