浏览代码

Merge branch 'master' into shadows

/main
uygar 8 年前
当前提交
77102a68
共有 273 个文件被更改,包括 4286 次插入5534 次删除
  1. 2
      Assets/ScriptableRenderPipeline.meta
  2. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline.meta
  3. 16
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/HDRenderPipelineDebug.cs
  4. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Editor.meta
  5. 106
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Editor/HDRenderPipelineInspector.cs
  6. 62
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Editor/HDRenderPipelineMenuItems.cs
  7. 14
      Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.asset
  8. 137
      Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs
  9. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting.meta
  10. 4
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop.cs
  11. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/Resources.meta
  12. 22
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/Resources/Deferred.shader
  13. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass.meta
  14. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/Resources/lightlistbuild-bigtile.compute
  15. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/Resources/lightlistbuild-clustered.compute
  16. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/Resources/lightlistbuild.compute
  17. 52
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.cs
  18. 8
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.hlsl
  19. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material.meta
  20. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit.meta
  21. 292
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/Editor/LayeredLitUI.cs
  22. 39
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLit.shader
  23. 35
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLitTessellation.shader
  24. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit.meta
  25. 585
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Editor/BaseLitUI.cs
  26. 161
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Editor/LitUI.cs
  27. 8
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.cs
  28. 8
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.cs.hlsl
  29. 149
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.hlsl
  30. 37
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.shader
  31. 105
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitData.hlsl
  32. 41
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitDataInternal.hlsl
  33. 72
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitProperties.hlsl
  34. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitTessellation.hlsl
  35. 35
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitTessellation.shader
  36. 9
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/CombineSubsurfaceScattering.shader
  37. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/ShaderPass/LitSharePass.hlsl
  38. 276
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Unlit/Editor/BaseUnlitUI.cs
  39. 58
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Unlit/Editor/UnlitUI.cs
  40. 10
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Unlit/Unlit.shader
  41. 6
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Unlit/UnlitProperties.hlsl
  42. 48
      Assets/ScriptableRenderPipeline/HDRenderPipeline/PostProcess/Editor/PostProcessingEditor.cs
  43. 17
      Assets/ScriptableRenderPipeline/HDRenderPipeline/PostProcess/PostProcessing.Settings.cs
  44. 151
      Assets/ScriptableRenderPipeline/HDRenderPipeline/PostProcess/PostProcessing.cs
  45. 26
      Assets/ScriptableRenderPipeline/HDRenderPipeline/PostProcess/Resources/FinalPass.shader
  46. 403
      Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/SubsurfaceScatteringParameters.cs
  47. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/ShaderPass.meta
  48. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky.meta
  49. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/HDRISky/Editor/HDRISkyEditor.cs
  50. 6
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/HDRISky/HDRISkyRenderer.cs
  51. 26
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/ProceduralSky/ProceduralSkyRenderer.cs
  52. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/ProceduralSky/ProceduralSkySettings.cs
  53. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/Resources.meta
  54. 44
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/SkyManager.cs
  55. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/SkyRenderer.cs
  56. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/SkySettings.cs
  57. 7
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Utilities.cs
  58. 4
      Assets/ScriptableRenderPipeline/ShaderLibrary/Common.hlsl
  59. 6
      Assets/ScriptableRenderPipeline/fptl/FptlLighting.cs
  60. 2
      Assets/ScriptableRenderPipeline/fptl/lightlistbuild-bigtile.compute
  61. 2
      Assets/ScriptableRenderPipeline/fptl/lightlistbuild-clustered.compute
  62. 2
      Assets/ScriptableRenderPipeline/fptl/lightlistbuild.compute
  63. 122
      Assets/TestScenes/FPTL/Materials/Custom_NewSurfaceShader.mat
  64. 206
      Assets/TestScenes/FPTL/Materials/gray.mat
  65. 4
      Assets/TestScenes/HDTest/CascadedShadowsTest/Lit_Gray.mat
  66. 4
      Assets/TestScenes/HDTest/GlobalIlluminationTest/Material/Chrome.mat
  67. 20
      Assets/TestScenes/HDTest/GlobalIlluminationTest/Material/Lit_Green.mat
  68. 23
      Assets/TestScenes/HDTest/GlobalIlluminationTest/Material/Lit_Grey.mat
  69. 4
      Assets/TestScenes/HDTest/GlobalIlluminationTest/Material/Lit_Red.mat
  70. 2
      Assets/TestScenes/HDTest/GlobalIlluminationTest/TestRealtime.cs
  71. 4
      Assets/TestScenes/HDTest/GraphicTest/Common/Dragon/DragonStatue.mat
  72. 25
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Lit_Blue.mat
  73. 25
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Lit_Green.mat
  74. 23
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Lit_Red.mat
  75. 23
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Lit_White.mat
  76. 280
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_0.mat
  77. 280
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_1.mat
  78. 280
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_2.mat
  79. 280
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_3.mat
  80. 280
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_4.mat
  81. 280
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_5.mat
  82. 280
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_6.mat
  83. 280
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_7.mat
  84. 280
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_8.mat
  85. 280
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_9.mat
  86. 280
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth1_1.mat
  87. 280
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric0_0.mat
  88. 280
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric0_1.mat
  89. 280
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric0_2.mat
  90. 280
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric0_3.mat
  91. 280
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric0_4.mat
  92. 280
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric0_5.mat
  93. 280
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric0_6.mat
  94. 280
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric0_7.mat
  95. 280
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric0_8.mat
  96. 280
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric0_9.mat
  97. 280
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric1_0.mat
  98. 16
      Assets/TestScenes/HDTest/GraphicTest/LayeredTessellation/Layer-2-woord-rock.mat
  99. 2
      Assets/TestScenes/HDTest/GraphicTest/LayeredTessellation/Layer-2-woord-rock.mat.meta
  100. 24
      Assets/TestScenes/HDTest/GraphicTest/Parallax Occlusion Mapping/Material/POM - Rock.mat

2
Assets/ScriptableRenderPipeline.meta


fileFormatVersion: 2
guid: a62ed1932757f454fbf6146f0d6c95eb
guid: 403e54624681147459c529bbda90360e
folderAsset: yes
timeCreated: 1466769773
licenseType: Pro

2
Assets/ScriptableRenderPipeline/HDRenderPipeline.meta


fileFormatVersion: 2
guid: 0a96e08781fd8d344afbb2f427fe9b2a
guid: a75de3f722a762f4daf65be08cd9c5c6
folderAsset: yes
timeCreated: 1483548930
licenseType: Pro

16
Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/HDRenderPipelineDebug.cs


namespace UnityEngine.Experimental.Rendering.HDPipeline
{
[Serializable]
public class GlobalDebugParameters
public class GlobalDebugSettings
{
public float debugOverlayRatio = 0.33f;
public bool displayMaterialDebug = false;

public MaterialDebugParameters materialDebugParameters = new MaterialDebugParameters();
public LightingDebugParameters lightingDebugParameters = new LightingDebugParameters();
public RenderingDebugParameters renderingDebugParametrs = new RenderingDebugParameters();
public MaterialDebugSettings materialDebugSettings = new MaterialDebugSettings();
public LightingDebugSettings lightingDebugSettings = new LightingDebugSettings();
public RenderingDebugSettings renderingDebugSettings = new RenderingDebugSettings();
lightingDebugParameters.OnValidate();
lightingDebugSettings.OnValidate();
public class MaterialDebugParameters
public class MaterialDebugSettings
public class RenderingDebugParameters
public class RenderingDebugSettings
{
public bool displayOpaqueObjects = true;
public bool displayTransparentObjects = true;

}
[Serializable]
public class LightingDebugParameters
public class LightingDebugSettings
{
public bool enableShadows = true;
public ShadowDebugMode shadowDebugMode = ShadowDebugMode.None;

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Editor.meta


fileFormatVersion: 2
guid: ab51b986e84ae98449eab2308fbe74db
guid: 6170264326b703040b82caf4f14a7567
folderAsset: yes
timeCreated: 1479127051
licenseType: Pro

106
Assets/ScriptableRenderPipeline/HDRenderPipeline/Editor/HDRenderPipelineInspector.cs


// Sky Settings
public readonly GUIContent skyParams = new GUIContent("Sky Settings");
// Global debug parameters
// Global debug Settings
public readonly GUIContent debugging = new GUIContent("Debugging");
public readonly GUIContent debugOverlayRatio = new GUIContent("Overlay Ratio");

public int[] debugViewMaterialValues = null;
// Rendering Debug
public readonly GUIContent renderingDebugParameters = new GUIContent("Rendering Debug");
public readonly GUIContent renderingDebugSettings = new GUIContent("Rendering Debug");
public readonly GUIContent lightingDebugParameters = new GUIContent("Lighting Debug");
public readonly GUIContent lightingDebugSettings = new GUIContent("Lighting Debug");
public readonly GUIContent shadowDebugEnable = new GUIContent("Enable Shadows");
public readonly GUIContent shadowDebugVisualizationMode = new GUIContent("Shadow Debug Mode");
public readonly GUIContent shadowDebugVisualizeShadowIndex = new GUIContent("Visualize Shadow Index");

SerializedProperty m_LightingDebugOverrideSmoothnessValue = null;
SerializedProperty m_LightingDebugAlbedo = null;
// Rendering Parameters
// Rendering Settings
SerializedProperty m_RenderingUseForwardOnly = null;
SerializedProperty m_RenderingUseDepthPrepass = null;

m_DebugOverlayRatio = FindProperty(x => x.globalDebugParameters.debugOverlayRatio);
m_ShowLightingDebug = FindProperty(x => x.globalDebugParameters.displayLightingDebug);
m_ShowRenderingDebug = FindProperty(x => x.globalDebugParameters.displayRenderingDebug);
m_ShowMaterialDebug = FindProperty(x => x.globalDebugParameters.displayMaterialDebug);
m_DebugOverlayRatio = FindProperty(x => x.globalDebugSettings.debugOverlayRatio);
m_ShowLightingDebug = FindProperty(x => x.globalDebugSettings.displayLightingDebug);
m_ShowRenderingDebug = FindProperty(x => x.globalDebugSettings.displayRenderingDebug);
m_ShowMaterialDebug = FindProperty(x => x.globalDebugSettings.displayMaterialDebug);
m_MaterialDebugMode = FindProperty(x => x.globalDebugParameters.materialDebugParameters.debugViewMaterial);
m_MaterialDebugMode = FindProperty(x => x.globalDebugSettings.materialDebugSettings.debugViewMaterial);
m_DisplayOpaqueObjects = FindProperty(x => x.globalDebugParameters.renderingDebugParametrs.displayOpaqueObjects);
m_DisplayTransparentObjects = FindProperty(x => x.globalDebugParameters.renderingDebugParametrs.displayTransparentObjects);
m_EnableDistortion = FindProperty(x => x.globalDebugParameters.renderingDebugParametrs.enableDistortion);
m_DisplayOpaqueObjects = FindProperty(x => x.globalDebugSettings.renderingDebugSettings.displayOpaqueObjects);
m_DisplayTransparentObjects = FindProperty(x => x.globalDebugSettings.renderingDebugSettings.displayTransparentObjects);
m_EnableDistortion = FindProperty(x => x.globalDebugSettings.renderingDebugSettings.enableDistortion);
m_DebugShadowEnabled = FindProperty(x => x.globalDebugParameters.lightingDebugParameters.enableShadows);
m_ShadowDebugMode = FindProperty(x => x.globalDebugParameters.lightingDebugParameters.shadowDebugMode);
m_ShadowDebugShadowMapIndex = FindProperty(x => x.globalDebugParameters.lightingDebugParameters.shadowMapIndex);
m_LightingDebugMode = FindProperty(x => x.globalDebugParameters.lightingDebugParameters.lightingDebugMode);
m_LightingDebugOverrideSmoothness = FindProperty(x => x.globalDebugParameters.lightingDebugParameters.overrideSmoothness);
m_LightingDebugOverrideSmoothnessValue = FindProperty(x => x.globalDebugParameters.lightingDebugParameters.overrideSmoothnessValue);
m_LightingDebugAlbedo = FindProperty(x => x.globalDebugParameters.lightingDebugParameters.debugLightingAlbedo);
m_DebugShadowEnabled = FindProperty(x => x.globalDebugSettings.lightingDebugSettings.enableShadows);
m_ShadowDebugMode = FindProperty(x => x.globalDebugSettings.lightingDebugSettings.shadowDebugMode);
m_ShadowDebugShadowMapIndex = FindProperty(x => x.globalDebugSettings.lightingDebugSettings.shadowMapIndex);
m_LightingDebugMode = FindProperty(x => x.globalDebugSettings.lightingDebugSettings.lightingDebugMode);
m_LightingDebugOverrideSmoothness = FindProperty(x => x.globalDebugSettings.lightingDebugSettings.overrideSmoothness);
m_LightingDebugOverrideSmoothnessValue = FindProperty(x => x.globalDebugSettings.lightingDebugSettings.overrideSmoothnessValue);
m_LightingDebugAlbedo = FindProperty(x => x.globalDebugSettings.lightingDebugSettings.debugLightingAlbedo);
m_RenderingUseForwardOnly = FindProperty(x => x.renderingParameters.useForwardRenderingOnly);
m_RenderingUseDepthPrepass = FindProperty(x => x.renderingParameters.useDepthPrepass);
m_RenderingUseForwardOnly = FindProperty(x => x.renderingSettings.useForwardRenderingOnly);
m_RenderingUseDepthPrepass = FindProperty(x => x.renderingSettings.useDepthPrepass);
}

{
EditorGUILayout.LabelField(styles.debugging);
// Global debug parameters
// Global debug settings
MaterialDebugParametersUI(renderContext);
RenderingDebugParametersUI(renderContext);
LightingDebugParametersUI(renderContext, renderpipelineInstance);
MaterialDebugSettingsUI(renderContext);
RenderingDebugSettingsUI(renderContext);
LightingDebugSettingsUI(renderContext, renderpipelineInstance);
EditorGUILayout.Space();

private void MaterialDebugParametersUI(HDRenderPipeline renderContext)
private void MaterialDebugSettingsUI(HDRenderPipeline renderContext)
{
m_ShowMaterialDebug.boolValue = EditorGUILayout.Foldout(m_ShowMaterialDebug.boolValue, styles.materialDebugLabel);
if (!m_ShowMaterialDebug.boolValue)

EditorGUI.indentLevel--;
}
private void RenderingDebugParametersUI(HDRenderPipeline renderContext)
private void RenderingDebugSettingsUI(HDRenderPipeline renderContext)
m_ShowRenderingDebug.boolValue = EditorGUILayout.Foldout(m_ShowRenderingDebug.boolValue, styles.renderingDebugParameters);
m_ShowRenderingDebug.boolValue = EditorGUILayout.Foldout(m_ShowRenderingDebug.boolValue, styles.renderingDebugSettings);
if (!m_ShowRenderingDebug.boolValue)
return;

}
}
private void LightingDebugParametersUI(HDRenderPipeline renderContext, HDRenderPipelineInstance renderpipelineInstance)
private void LightingDebugSettingsUI(HDRenderPipeline renderContext, HDRenderPipelineInstance renderpipelineInstance)
m_ShowLightingDebug.boolValue = EditorGUILayout.Foldout(m_ShowLightingDebug.boolValue, styles.lightingDebugParameters);
m_ShowLightingDebug.boolValue = EditorGUILayout.Foldout(m_ShowLightingDebug.boolValue, styles.lightingDebugSettings);
if (!m_ShowLightingDebug.boolValue)
return;

HackSetDirty(renderContext); // Repaint
}
SkySettingsUI(renderContext);
ShadowParametersUI(renderContext);
TextureParametersUI(renderContext);
RendereringParametersUI(renderContext);
ShadowSettingsUI(renderContext);
TextureSettingsUI(renderContext);
RendereringSettingsUI(renderContext);
private void SkySettingsUI(HDRenderPipeline pipe)
private void ShadowSettingsUI(HDRenderPipeline renderContext)
EditorGUILayout.LabelField(styles.skyParams);
EditorGUI.BeginChangeCheck();
EditorGUI.indentLevel++;
pipe.skyParameters = (SkyParameters)EditorGUILayout.ObjectField(new GUIContent("Sky Settings"), pipe.skyParameters, typeof(SkyParameters), false);
EditorGUI.indentLevel--;
if (EditorGUI.EndChangeCheck())
{
HackSetDirty(pipe); // Repaint
}
}
private void ShadowParametersUI(HDRenderPipeline renderContext)
{
EditorGUILayout.Space();
var shadowParameters = renderContext.shadowSettings;
var shadowSettings = renderContext.shadowSettings;
shadowParameters.shadowAtlasWidth = Mathf.Max(0, EditorGUILayout.IntField(styles.shadowsAtlasWidth, shadowParameters.shadowAtlasWidth));
shadowParameters.shadowAtlasHeight = Mathf.Max(0, EditorGUILayout.IntField(styles.shadowsAtlasHeight, shadowParameters.shadowAtlasHeight));
shadowSettings.shadowAtlasWidth = Mathf.Max(0, EditorGUILayout.IntField(styles.shadowsAtlasWidth, shadowSettings.shadowAtlasWidth));
shadowSettings.shadowAtlasHeight = Mathf.Max(0, EditorGUILayout.IntField(styles.shadowsAtlasHeight, shadowSettings.shadowAtlasHeight));
if (EditorGUI.EndChangeCheck())
{

}
private void RendereringParametersUI(HDRenderPipeline renderContext)
private void RendereringSettingsUI(HDRenderPipeline renderContext)
{
EditorGUILayout.Space();
EditorGUILayout.LabelField(styles.renderingSettingsLabel);

EditorGUI.indentLevel--;
}
private void TextureParametersUI(HDRenderPipeline renderContext)
private void TextureSettingsUI(HDRenderPipeline renderContext)
var textureParameters = renderContext.textureSettings;
var textureSettings = renderContext.textureSettings;
textureParameters.spotCookieSize = Mathf.NextPowerOfTwo(Mathf.Clamp(EditorGUILayout.IntField(styles.spotCookieSize, textureParameters.spotCookieSize), 16, 1024));
textureParameters.pointCookieSize = Mathf.NextPowerOfTwo(Mathf.Clamp(EditorGUILayout.IntField(styles.pointCookieSize, textureParameters.pointCookieSize), 16, 1024));
textureParameters.reflectionCubemapSize = Mathf.NextPowerOfTwo(Mathf.Clamp(EditorGUILayout.IntField(styles.reflectionCubemapSize, textureParameters.reflectionCubemapSize), 64, 1024));
textureSettings.spotCookieSize = Mathf.NextPowerOfTwo(Mathf.Clamp(EditorGUILayout.IntField(styles.spotCookieSize, textureSettings.spotCookieSize), 16, 1024));
textureSettings.pointCookieSize = Mathf.NextPowerOfTwo(Mathf.Clamp(EditorGUILayout.IntField(styles.pointCookieSize, textureSettings.pointCookieSize), 16, 1024));
textureSettings.reflectionCubemapSize = Mathf.NextPowerOfTwo(Mathf.Clamp(EditorGUILayout.IntField(styles.reflectionCubemapSize, textureSettings.reflectionCubemapSize), 64, 1024));
renderContext.textureSettings = textureParameters;
renderContext.textureSettings = textureSettings;
HackSetDirty(renderContext); // Repaint
}
EditorGUI.indentLevel--;

62
Assets/ScriptableRenderPipeline/HDRenderPipeline/Editor/HDRenderPipelineMenuItems.cs


using UnityEngine;
using UnityEditor;
using UnityEngine.SceneManagement;
using UnityEngine.Experimental.Rendering.HDPipeline;
// This script is a helper for the artits to re-synchronise all layered materials
[MenuItem("HDRenderPipeline/Synchronize all Layered materials")]
static void SynchronizeAllLayeredMaterial()
{

if (mat.shader.name == "HDRenderPipeline/LayeredLit" || mat.shader.name == "HDRenderPipeline/LayeredLitTessellation")
{
LayeredLitGUI.SynchronizeAllLayers(mat);
EditorUtility.SetDirty(mat);
}
}
static void RemoveMaterialKeywords(Material material)
{
string[] keywordsToRemove = material.shaderKeywords;
foreach (var keyword in keywordsToRemove)
{
material.DisableKeyword(keyword);
}
}
// The goal of this script is to help maintenance of data that have already been produced but need to update to the latest shader code change.
// In case the shader code have change and the inspector have been update with new kind of keywords we need to regenerate the set of keywords use by the material.
// This script will remove all keyword of a material and trigger the inspector that will re-setup all the used keywords.
// It require that the inspector of the material have a static function call that update all keyword based on material properties.
[MenuItem("HDRenderPipeline/Reset all materials keywords")]
static void ResetAllMaterialKeywords()
{
try
{
Object[] materials = Resources.FindObjectsOfTypeAll<Material>();
for (int i = 0, length = materials.Length; i < length; i++)
{
Material mat = materials[i] as Material;
EditorUtility.DisplayProgressBar(
"Setup materials Keywords...",
string.Format("{0} / {1} materials cleaned.", i, length),
i / (float)(length - 1));
if (mat.shader.name == "HDRenderPipeline/LayeredLit" || mat.shader.name == "HDRenderPipeline/LayeredLitTessellation")
{
// We remove all keyword already present
RemoveMaterialKeywords(mat);
LayeredLitGUI.SetupMaterialKeywordsAndPass(mat);
EditorUtility.SetDirty(mat);
}
else if (mat.shader.name == "HDRenderPipeline/Lit" || mat.shader.name == "HDRenderPipeline/LitTessellation")
{
// We remove all keyword already present
RemoveMaterialKeywords(mat);
LitGUI.SetupMaterialKeywordsAndPass(mat);
EditorUtility.SetDirty(mat);
}
else if (mat.shader.name == "HDRenderPipeline/Unlit")
{
// We remove all keyword already present
RemoveMaterialKeywords(mat);
UnlitGUI.SetupMaterialKeywordsAndPass(mat);
EditorUtility.SetDirty(mat);
}
}
}
finally
{
EditorUtility.ClearProgressBar();
}
}
}

14
Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.asset


m_EditorClassIdentifier:
m_LightLoopProducer: {fileID: 11400000, guid: bf8cd9ae03ff7d54c89603e67be0bfc5,
type: 2}
globalDebugParameters:
globalDebugSettings:
materialDebugParameters:
materialDebugSettings:
lightingDebugParameters:
lightingDebugSettings:
enableShadows: 1
shadowDebugMode: 0
shadowMapIndex: 0

debugLightingAlbedo: {r: 0.5, g: 0.5, b: 0.5, a: 1}
renderingDebugParametrs:
renderingDebugSettings:
renderingParameters:
renderingSettings:
useForwardRenderingOnly: 0
useDepthPrepass: 0
m_ShadowSettings:

maxShadowDistance: 1000
maxShadowDistance: 400
directionalLightCascadeCount: 4
directionalLightCascades: {x: 0.05, y: 0.2, z: 0.3}
directionalLightNearPlaneOffset: 5

m_ShadowCascadeSplit1: 0.2
m_ShadowCascadeSplit2: 0.3
m_ShadowNearPlaneOffset: 5
m_SkyParameters: {fileID: 0}
m_SkySettings: {fileID: 0}

137
Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs


// NOTE:
// All those properties are public because of how HDRenderPipelineInspector retrieve those properties via serialization/reflection
// Those that are not will be refatored later.
public GlobalDebugParameters globalDebugParameters = new GlobalDebugParameters();
public GlobalDebugSettings globalDebugSettings = new GlobalDebugSettings();
public RenderingParameters renderingParameters = new RenderingParameters();
public RenderingSettings renderingSettings = new RenderingSettings();
[SerializeField] ShadowSettings m_ShadowSettings = ShadowSettings.Default;
public SubsurfaceScatteringParameters localSssParameters;
[SerializeField] TextureSettings m_TextureSettings = TextureSettings.Default;

// Renderer Settings (per "scene")
[SerializeField] private CommonSettings.Settings m_CommonSettings = CommonSettings.Settings.s_Defaultsettings;
[SerializeField] private SkyParameters m_SkyParameters;
[SerializeField] private SkySettings m_SkySettings;
public CommonSettings.Settings commonSettingsToUse
{

}
}
public SkyParameters skyParameters
public SkySettings skySettings
get { return m_SkyParameters; }
set { m_SkyParameters = value; }
get { return m_SkySettings; }
set { m_SkySettings = value; }
public SkyParameters skyParametersToUse
public SkySettings skySettingsToUse
if (SkyParametersSingleton.overrideSettings)
return SkyParametersSingleton.overrideSettings;
if (SkySettingsSingleton.overrideSettings)
return SkySettingsSingleton.overrideSettings;
return m_SkyParameters;
return m_SkySettings;
}
}

return localSssParameters;
}
}
public void ApplyDebugParameters()
public void ApplyDebugSettings()
m_ShadowSettings.enabled = globalDebugParameters.lightingDebugParameters.enableShadows;
m_ShadowSettings.enabled = globalDebugSettings.lightingDebugSettings.enableShadows;
LightingDebugParameters lightDebugParameters = globalDebugParameters.lightingDebugParameters;
Vector4 debugModeAndAlbedo = new Vector4((float)lightDebugParameters.lightingDebugMode, lightDebugParameters.debugLightingAlbedo.r, lightDebugParameters.debugLightingAlbedo.g, lightDebugParameters.debugLightingAlbedo.b);
Vector4 debugSmoothness = new Vector4(lightDebugParameters.overrideSmoothness ? 1.0f : 0.0f, lightDebugParameters.overrideSmoothnessValue, 0.0f, 0.0f);
LightingDebugSettings lightDebugSettings = globalDebugSettings.lightingDebugSettings;
Vector4 debugModeAndAlbedo = new Vector4((float)lightDebugSettings.lightingDebugMode, lightDebugSettings.debugLightingAlbedo.r, lightDebugSettings.debugLightingAlbedo.g, lightDebugSettings.debugLightingAlbedo.b);
Vector4 debugSmoothness = new Vector4(lightDebugSettings.overrideSmoothness ? 1.0f : 0.0f, lightDebugSettings.overrideSmoothnessValue, 0.0f, 0.0f);
Shader.SetGlobalVector("_DebugLightModeAndAlbedo", debugModeAndAlbedo);
Shader.SetGlobalVector("_DebugLightingSmoothness", debugSmoothness);

public void OnValidate()
{
globalDebugParameters.OnValidate();
globalDebugSettings.OnValidate();
public class RenderingParameters
public class RenderingSettings
{
public bool useForwardRenderingOnly = false; // TODO: Currently there is no way to strip the extra forward shaders generated by the shaders compiler, so we can switch dynamically.
public bool useDepthPrepass = false;

readonly SkyManager m_SkyManager = new SkyManager();
private readonly BaseLightLoop m_LightLoop;
private GlobalDebugParameters globalDebugParameters
private GlobalDebugSettings globalDebugSettings
get { return m_Owner.globalDebugParameters; }
get { return m_Owner.globalDebugSettings; }
}
public HDRenderPipelineInstance(HDRenderPipeline owner)

if(m_LightLoop != null)
m_LightLoop.Build(owner.textureSettings);
m_SkyManager.skyParameters = owner.skyParametersToUse;
m_SkyManager.Build();
m_SkyManager.skySettings = owner.skySettingsToUse;
}
public override void Dispose()

// TODO: This is the wrong way to handle resize/allocation. We can have several different camera here, mean that the loop on camera will allocate and deallocate
// the below buffer which is bad. Best is to have a set of buffer for each camera that is persistent and reallocate resource if need
// For now consider we have only one camera that go to this code, the main one.
m_SkyManager.skyParameters = m_Owner.skyParametersToUse;
m_SkyManager.skySettings = m_Owner.skySettingsToUse;
m_SkyManager.Resize(camera.nearClipPlane, camera.farClipPlane); // TODO: Also a bad naming, here we just want to realloc texture if skyparameters change (usefull for lookdev)
if (m_LightLoop == null)

}
}
public void PushGlobalParams(HDCamera hdCamera, ScriptableRenderContext renderContext)
public void PushGlobalParams(HDCamera hdCamera, ScriptableRenderContext renderContext, SubsurfaceScatteringParameters sssParameters)
{
if (m_SkyManager.IsSkyValid())
{

Shader.SetGlobalInt("_EnvLightSkyEnabled", 0);
}
// Broadcast SSS parameters to all shaders.
Shader.SetGlobalInt("_TransmissionFlags", sssParameters.transmissionFlags);
Shader.SetGlobalFloatArray("_ThicknessScales", sssParameters.thicknessScales);
Shader.SetGlobalVectorArray("_HalfRcpVariancesAndLerpWeights", sssParameters.halfRcpVariancesAndLerpWeights);
if (sssParameters.enableSSS)
{
Shader.EnableKeyword("_SUBSURFACE_SCATTERING");
}
else
{
Shader.DisableKeyword("_SUBSURFACE_SCATTERING");
}
var cmd = new CommandBuffer {name = "Push Global Parameters"};
cmd.SetGlobalVector("_ScreenSize", hdCamera.screenSize);

GraphicsSettings.lightsUseLinearIntensity = true;
GraphicsSettings.lightsUseColorTemperature = true;
m_SkyManager.Build();
if (!m_LitRenderLoop.isInit)
m_LitRenderLoop.RenderInit(renderContext);

m_LightLoop.NewFrame();
m_Owner.ApplyDebugParameters();
m_Owner.ApplyDebugSettings();
m_Owner.UpdateCommonSettings();
// Set Frame constant buffer

cmd.Dispose();
}
if (globalDebugParameters.materialDebugParameters.debugViewMaterial != 0)
if (globalDebugSettings.materialDebugSettings.debugViewMaterial != 0)
{
RenderDebugViewMaterial(cullResults, hdCamera, renderContext);
}

}
}
PushGlobalParams(hdCamera, renderContext);
PushGlobalParams(hdCamera, renderContext, m_Owner.sssParameters);
// Caution: We require sun light here as some sky use the sun light to render, mean UpdateSkyEnvironment
// must be call after BuildGPULightLists.

RenderDeferredLighting(hdCamera, renderContext);
RenderDeferredLighting(hdCamera, renderContext, m_Owner.sssParameters.enableSSS);
// We compute subsurface scattering here. Therefore, no objects rendered afterwards will exhibit SSS.
// Currently, there is no efficient way to switch between SRT and MRT for the forward pass;

void RenderOpaqueRenderList(CullResults cull, Camera camera, ScriptableRenderContext renderContext, string passName, RendererConfiguration rendererConfiguration = 0)
{
if (!globalDebugParameters.renderingDebugParametrs.displayOpaqueObjects)
if (!globalDebugSettings.renderingDebugSettings.displayOpaqueObjects)
return;
var settings = new DrawRendererSettings(cull, camera, new ShaderPassName(passName))

void RenderTransparentRenderList(CullResults cull, Camera camera, ScriptableRenderContext renderContext, string passName, RendererConfiguration rendererConfiguration = 0)
{
if (!globalDebugParameters.renderingDebugParametrs.displayTransparentObjects)
if (!globalDebugSettings.renderingDebugSettings.displayTransparentObjects)
return;
var settings = new DrawRendererSettings(cull, camera, new ShaderPassName(passName))

{
// If we are forward only we will do a depth prepass
// TODO: Depth prepass should be enabled based on light loop settings. LightLoop define if they need a depth prepass + forward only...
if (!m_Owner.renderingParameters.useDepthPrepass)
if (!m_Owner.renderingSettings.useDepthPrepass)
return;
using (new Utilities.ProfilingSample("Depth Prepass", renderContext))

void RenderGBuffer(CullResults cull, Camera camera, ScriptableRenderContext renderContext)
{
if (m_Owner.renderingParameters.ShouldUseForwardRenderingOnly())
if (m_Owner.renderingSettings.ShouldUseForwardRenderingOnly())
{
return ;
}

bool debugLighting = globalDebugParameters.lightingDebugParameters.lightingDebugMode != LightingDebugMode.None;
bool debugLighting = globalDebugSettings.lightingDebugSettings.lightingDebugMode != LightingDebugMode.None;
// setup GBuffer for rendering
Utilities.SetRenderTarget(renderContext, m_gbufferManager.GetGBuffers(), m_CameraDepthStencilBufferRT);

{
// If we are forward only we don't need to render ForwardOnlyOpaqueDepthOnly object
// But in case we request a prepass we render it
if (m_Owner.renderingParameters.ShouldUseForwardRenderingOnly() && !m_Owner.renderingParameters.useDepthPrepass)
if (m_Owner.renderingSettings.ShouldUseForwardRenderingOnly() && !m_Owner.renderingSettings.useDepthPrepass)
return;
using (new Utilities.ProfilingSample("Forward opaque depth", renderContext))

{
Utilities.SetRenderTarget(renderContext, m_CameraColorBufferRT, m_CameraDepthStencilBufferRT, Utilities.kClearAll, Color.black);
Shader.SetGlobalInt("_DebugViewMaterial", (int)globalDebugParameters.materialDebugParameters.debugViewMaterial);
Shader.SetGlobalInt("_DebugViewMaterial", (int)globalDebugSettings.materialDebugSettings.debugViewMaterial);
if (!m_Owner.renderingParameters.ShouldUseForwardRenderingOnly())
if (!m_Owner.renderingSettings.ShouldUseForwardRenderingOnly())
m_DebugViewMaterialGBuffer.SetFloat("_DebugViewMaterial", (float)globalDebugParameters.materialDebugParameters.debugViewMaterial);
m_DebugViewMaterialGBuffer.SetFloat("_DebugViewMaterial", (float)globalDebugSettings.materialDebugSettings.debugViewMaterial);
// m_gbufferManager.BindBuffers(m_DebugViewMaterialGBuffer);
// TODO: Bind depth textures

}
}
void RenderDeferredLighting(HDCamera hdCamera, ScriptableRenderContext renderContext)
void RenderDeferredLighting(HDCamera hdCamera, ScriptableRenderContext renderContext, bool enableSSS)
if (m_Owner.renderingParameters.ShouldUseForwardRenderingOnly() || m_LightLoop == null)
if (m_Owner.renderingSettings.ShouldUseForwardRenderingOnly() || m_LightLoop == null)
{
return ;
}

// Output split lighting for materials tagged with the SSS stencil bit.
m_LightLoop.RenderDeferredLighting(hdCamera, renderContext, globalDebugParameters.lightingDebugParameters, colorRTs, m_CameraStencilBufferRT, true);
if (enableSSS)
{
// Output split lighting for materials tagged with the SSS stencil bit.
m_LightLoop.RenderDeferredLighting(hdCamera, renderContext, globalDebugSettings.lightingDebugSettings, colorRTs, m_CameraStencilBufferRT, true, enableSSS);
}
m_LightLoop.RenderDeferredLighting(hdCamera, renderContext, globalDebugParameters.lightingDebugParameters, colorRTs, m_CameraStencilBufferRT, false);
m_LightLoop.RenderDeferredLighting(hdCamera, renderContext, globalDebugSettings.lightingDebugSettings, colorRTs, m_CameraStencilBufferRT, false, enableSSS);
}
// Combines specular lighting and diffuse lighting with subsurface scattering.

if (m_Owner.renderingParameters.ShouldUseForwardRenderingOnly()) return;
if (m_Owner.renderingSettings.ShouldUseForwardRenderingOnly()) return;
// Load the kernel data.
Vector4[] kernelData = new Vector4[SubsurfaceScatteringParameters.maxNumProfiles * SubsurfaceScatteringProfile.numVectors];
for (int j = 0, m = sssParameters.profiles.Length; j < m; j++)
{
for (int i = 0, n = SubsurfaceScatteringProfile.numVectors; i < n; i++)
{
kernelData[n * j + i] = sssParameters.profiles[j].filterKernel[i];
}
}
if (!sssParameters.enableSSS) return;
m_FilterSubsurfaceScattering.SetVectorArray("_FilterKernels", kernelData);
m_FilterSubsurfaceScattering.SetVectorArray("_FilterKernels", sssParameters.filterKernels);
m_FilterSubsurfaceScattering.SetVectorArray("_HalfRcpWeightedVariances", sssParameters.halfRcpWeightedVariances);
cmd.SetGlobalTexture("_IrradianceSource", m_CameraSubsurfaceBufferRT);
Utilities.DrawFullScreen(cmd, m_FilterSubsurfaceScattering, hdCamera,
m_CameraFilteringBufferRT, m_CameraStencilBufferRT);

m_FilterAndCombineSubsurfaceScattering.SetVectorArray("_FilterKernels", kernelData);
m_FilterAndCombineSubsurfaceScattering.SetVectorArray("_FilterKernels", sssParameters.filterKernels);
m_FilterAndCombineSubsurfaceScattering.SetVectorArray("_HalfRcpWeightedVariances", sssParameters.halfRcpWeightedVariances);
cmd.SetGlobalTexture("_IrradianceSource", m_CameraFilteringBufferRT);
Utilities.DrawFullScreen(cmd, m_FilterAndCombineSubsurfaceScattering, hdCamera,
m_CameraColorBufferRT, m_CameraStencilBufferRT);

{
// TODO: Currently we can't render opaque object forward when deferred is enabled
// miss option
if (!m_Owner.renderingParameters.ShouldUseForwardRenderingOnly() && renderOpaque)
if (!m_Owner.renderingSettings.ShouldUseForwardRenderingOnly() && renderOpaque)
return;
using (new Utilities.ProfilingSample("Forward Pass", renderContext))

if (m_LightLoop != null)
m_LightLoop.RenderForward(camera, renderContext, renderOpaque);
bool debugLighting = globalDebugParameters.lightingDebugParameters.lightingDebugMode != LightingDebugMode.None;
bool debugLighting = globalDebugSettings.lightingDebugSettings.lightingDebugMode != LightingDebugMode.None;
string forwardPassName = debugLighting ? "ForwardDebugLighting" : "Forward";
if (renderOpaque)

if (m_LightLoop != null)
m_LightLoop.RenderForward(camera, renderContext, true);
bool debugLighting = globalDebugParameters.lightingDebugParameters.lightingDebugMode != LightingDebugMode.None;
bool debugLighting = globalDebugSettings.lightingDebugSettings.lightingDebugMode != LightingDebugMode.None;
RenderOpaqueRenderList(cullResults, camera, renderContext, debugLighting ? "ForwardOnlyOpaqueDebugLighting" : "ForwardOnlyOpaque", Utilities.kRendererConfigurationBakedLighting);
}
}

using (new Utilities.ProfilingSample("Velocity Pass", renderContext))
{
// If opaque velocity have been render during GBuffer no need to render it here
if ((ShaderConfig.s_VelocityInGbuffer == 1) || m_Owner.renderingParameters.ShouldUseForwardRenderingOnly())
if ((ShaderConfig.s_VelocityInGbuffer == 1) || m_Owner.renderingSettings.ShouldUseForwardRenderingOnly())
return ;
int w = camera.pixelWidth;

void RenderDistortion(CullResults cullResults, Camera camera, ScriptableRenderContext renderContext)
{
if (!globalDebugParameters.renderingDebugParametrs.enableDistortion)
if (!globalDebugSettings.renderingDebugSettings.enableDistortion)
return ;
using (new Utilities.ProfilingSample("Distortion Pass", renderContext))

debugCB.name = "Debug Overlay";
float x = 0;
float overlayRatio = globalDebugParameters.debugOverlayRatio;
float overlayRatio = globalDebugSettings.debugOverlayRatio;
LightingDebugParameters shadowDebug = globalDebugParameters.lightingDebugParameters;
LightingDebugSettings shadowDebug = globalDebugSettings.lightingDebugSettings;
if (shadowDebug.shadowDebugMode != ShadowDebugMode.None)
{

cmd.GetTemporaryRT(m_CameraDepthStencilBufferCopy, w, h, 24, FilterMode.Point, RenderTextureFormat.Depth);
cmd.GetTemporaryRT(m_CameraStencilBuffer, w, h, 24, FilterMode.Point, RenderTextureFormat.Depth);
if (!m_Owner.renderingParameters.ShouldUseForwardRenderingOnly())
if (!m_Owner.renderingSettings.ShouldUseForwardRenderingOnly())
{
m_gbufferManager.InitGBuffers(w, h, cmd);
}

}
// Clear GBuffers
if (!m_Owner.renderingParameters.ShouldUseForwardRenderingOnly())
if (!m_Owner.renderingSettings.ShouldUseForwardRenderingOnly())
{
using (new Utilities.ProfilingSample("Clear GBuffer", renderContext))
{

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting.meta


fileFormatVersion: 2
guid: 1c14e71d397fce047b1675fc26d0bb48
guid: 3002976b0b09954499dd1f6e00169b06
folderAsset: yes
timeCreated: 1474297943
licenseType: Pro

4
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop.cs


public virtual void PushGlobalParams(Camera camera, ScriptableRenderContext loop) {}
public virtual void RenderDeferredLighting(HDCamera hdCamera, ScriptableRenderContext renderContext,
LightingDebugParameters lightDebugParameters,
LightingDebugSettings lightDebugParameters,
bool outputSplitLighting) {}
bool outputSplitLightingForSSS, bool enableSSS) {}
public virtual void RenderForward(Camera camera, ScriptableRenderContext renderContext, bool renderOpaque) {}

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/Resources.meta


fileFormatVersion: 2
guid: 8d7b73e3debb13b46a544563ce8f4a64
guid: 0823a45531ce4ee45ab39bcbe1ea52a6
folderAsset: yes
timeCreated: 1479129942
licenseType: Pro

22
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/Resources/Deferred.shader


_SrcBlend("", Float) = 1
_DstBlend("", Float) = 1
_StencilRef("_StencilRef", Int) = 0
_StencilRef("", Int) = 0
_StencilCmp("", Int) = 3
}
SubShader

Stencil
{
Ref [_StencilRef]
Comp Equal
Comp [_StencilCmp]
Pass Keep
}

PreLightData preLightData = GetPreLightData(V, posInput, bsdfData);
float3 diffuseLighting = float3(0, 0, 0);
float3 specularLighting = float3(0, 0, 0);
#if UNITY_REVERSED_Z
float clearDepth = 0;
#else
float clearDepth = 1;
#endif
// Do not shade the far plane - wastes cycles and produces wrong results.
if (depth != clearDepth)
{
LightLoop(V, posInput, preLightData, bsdfData, bakeDiffuseLighting, diffuseLighting, specularLighting);
}
float3 diffuseLighting;
float3 specularLighting;
LightLoop(V, posInput, preLightData, bsdfData, bakeDiffuseLighting, diffuseLighting, specularLighting);
Outputs outputs;
#ifdef OUTPUT_SPLIT_LIGHTING

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass.meta


fileFormatVersion: 2
guid: 8a355c056864a5d4cb26d9c3168ae0bb
guid: 8d0d2ae5d51ae6e42a81b92e8693272f
folderAsset: yes
timeCreated: 1479218330
licenseType: Pro

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/Resources/lightlistbuild-bigtile.compute


// sort lights
SORTLIST(lightsListLDS, iNrCoarseLights, MAX_NR_BIGTILE_LIGHTS_PLUSONE, t, NR_THREADS);
lightOffs = 0;
if(t==0) lightOffs = 0;
GroupMemoryBarrierWithGroupSync();
int i;
for(i=t; i<iNrCoarseLights; i+=NR_THREADS) if((int)lightsListLDS[i]<g_iNrVisibLights) InterlockedAdd(lightOffs, 1);

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/Resources/lightlistbuild-clustered.compute


}
#ifdef ENABLE_DEPTH_TEXTURE_BACKPLANE
g_logBaseBuffer[tileIDX.y*nrTilesX + tileIDX.x] = suggestedBase;
if(threadID==0) g_logBaseBuffer[tileIDX.y*nrTilesX + tileIDX.x] = suggestedBase;
#endif
}

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/Resources/lightlistbuild.compute


#ifdef PERFORM_SPHERICAL_INTERSECTION_TESTS
int SphericalIntersectionTests(uint threadID, int iNrCoarseLights, float2 screenCoordinate)
{
lightOffsSph = 0;
if(threadID==0) lightOffsSph = 0;
// make a copy of coarseList in prunedList.
int l;

52
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.cs


Utilities.SelectKeyword(m_DeferredDirectMaterialSRT, tileKeywords, 0);
m_DeferredDirectMaterialSRT.EnableKeyword("LIGHTLOOP_TILE_PASS");
m_DeferredDirectMaterialSRT.DisableKeyword("OUTPUT_SPLIT_LIGHTING");
m_DeferredDirectMaterialSRT.SetInt("_StencilRef", (int)StencilBits.None);
m_DeferredDirectMaterialSRT.SetInt("_StencilRef", (int)StencilBits.Standard);
m_DeferredDirectMaterialSRT.SetInt("_StencilCmp", 4 /* LEqual */);
m_DeferredDirectMaterialSRT.SetInt("_SrcBlend", (int)BlendMode.One);
m_DeferredDirectMaterialSRT.SetInt("_DstBlend", (int)BlendMode.Zero);

m_DeferredDirectMaterialMRT.EnableKeyword("OUTPUT_SPLIT_LIGHTING");
m_DeferredDirectMaterialMRT.SetInt("_StencilRef", (int)StencilBits.SSS);
m_DeferredDirectMaterialMRT.SetInt("_StencilCmp", 3 /* Equal */);
m_DeferredDirectMaterialMRT.SetInt("_SrcBlend", (int)BlendMode.One);
m_DeferredDirectMaterialMRT.SetInt("_DstBlend", (int)BlendMode.Zero);

m_DeferredIndirectMaterialSRT.DisableKeyword("OUTPUT_SPLIT_LIGHTING");
m_DeferredIndirectMaterialSRT.SetInt("_StencilRef", (int)StencilBits.None);
m_DeferredIndirectMaterialSRT.SetInt("_StencilRef", (int)StencilBits.Standard);
m_DeferredIndirectMaterialSRT.SetInt("_StencilCmp", 4 /* LEqual */);
m_DeferredIndirectMaterialSRT.SetInt("_SrcBlend", (int)BlendMode.One);
m_DeferredIndirectMaterialSRT.SetInt("_DstBlend", (int)BlendMode.One); // Additive color & alpha source

m_DeferredIndirectMaterialMRT.EnableKeyword("OUTPUT_SPLIT_LIGHTING");
m_DeferredIndirectMaterialMRT.SetInt("_StencilRef", (int)StencilBits.SSS);
m_DeferredIndirectMaterialMRT.SetInt("_StencilCmp", 3 /* Equal */);
m_DeferredIndirectMaterialMRT.SetInt("_SrcBlend", (int)BlendMode.One);
m_DeferredIndirectMaterialMRT.SetInt("_DstBlend", (int)BlendMode.One); // Additive color & alpha source

m_DeferredAllMaterialSRT.DisableKeyword("OUTPUT_SPLIT_LIGHTING");
m_DeferredAllMaterialSRT.SetInt("_StencilRef", (int)StencilBits.None);
m_DeferredAllMaterialSRT.SetInt("_StencilRef", (int)StencilBits.Standard);
m_DeferredAllMaterialSRT.SetInt("_StencilCmp", 4 /* LEqual */);
m_DeferredAllMaterialSRT.SetInt("_SrcBlend", (int)BlendMode.One);
m_DeferredAllMaterialSRT.SetInt("_DstBlend", (int)BlendMode.Zero);

m_DeferredAllMaterialMRT.EnableKeyword("OUTPUT_SPLIT_LIGHTING");
m_DeferredAllMaterialMRT.SetInt("_StencilRef", (int)StencilBits.SSS);
m_DeferredAllMaterialMRT.SetInt("_StencilCmp", 3 /* Equal */);
m_DeferredAllMaterialMRT.SetInt("_SrcBlend", (int)BlendMode.One);
m_DeferredAllMaterialMRT.SetInt("_DstBlend", (int)BlendMode.Zero);

m_SingleDeferredMaterialSRT.EnableKeyword("LIGHTLOOP_SINGLE_PASS");
m_SingleDeferredMaterialSRT.DisableKeyword("OUTPUT_SPLIT_LIGHTING");
m_SingleDeferredMaterialSRT.SetInt("_StencilRef", (int)StencilBits.None);
m_SingleDeferredMaterialSRT.SetInt("_StencilRef", (int)StencilBits.Standard);
m_SingleDeferredMaterialSRT.SetInt("_StencilCmp", 4 /* LEqual */);
m_SingleDeferredMaterialSRT.SetInt("_SrcBlend", (int)BlendMode.One);
m_SingleDeferredMaterialSRT.SetInt("_DstBlend", (int)BlendMode.Zero);

m_SingleDeferredMaterialMRT.SetInt("_StencilRef", (int)StencilBits.SSS);
m_SingleDeferredMaterialMRT.SetInt("_StencilCmp", 3 /* Equal */);
m_SingleDeferredMaterialMRT.SetInt("_SrcBlend", (int)BlendMode.One);
m_SingleDeferredMaterialMRT.SetInt("_DstBlend", (int)BlendMode.Zero);

#endif
}
private void SetupRenderingForDebug(LightingDebugParameters lightDebugParameters)
private void SetupRenderingForDebug(LightingDebugSettings lightDebugSettings)
Utilities.SetKeyword(m_DeferredDirectMaterialSRT, "LIGHTING_DEBUG", lightDebugParameters.lightingDebugMode != LightingDebugMode.None);
Utilities.SetKeyword(m_DeferredDirectMaterialMRT, "LIGHTING_DEBUG", lightDebugParameters.lightingDebugMode != LightingDebugMode.None);
Utilities.SetKeyword(m_DeferredIndirectMaterialSRT, "LIGHTING_DEBUG", lightDebugParameters.lightingDebugMode != LightingDebugMode.None);
Utilities.SetKeyword(m_DeferredIndirectMaterialMRT, "LIGHTING_DEBUG", lightDebugParameters.lightingDebugMode != LightingDebugMode.None);
Utilities.SetKeyword(m_DeferredAllMaterialSRT, "LIGHTING_DEBUG", lightDebugParameters.lightingDebugMode != LightingDebugMode.None);
Utilities.SetKeyword(m_DeferredAllMaterialMRT, "LIGHTING_DEBUG", lightDebugParameters.lightingDebugMode != LightingDebugMode.None);
Utilities.SetKeyword(m_SingleDeferredMaterialSRT, "LIGHTING_DEBUG", lightDebugParameters.lightingDebugMode != LightingDebugMode.None);
Utilities.SetKeyword(m_SingleDeferredMaterialMRT, "LIGHTING_DEBUG", lightDebugParameters.lightingDebugMode != LightingDebugMode.None);
Utilities.SetKeyword(m_DeferredDirectMaterialSRT, "LIGHTING_DEBUG", lightDebugSettings.lightingDebugMode != LightingDebugMode.None);
Utilities.SetKeyword(m_DeferredDirectMaterialMRT, "LIGHTING_DEBUG", lightDebugSettings.lightingDebugMode != LightingDebugMode.None);
Utilities.SetKeyword(m_DeferredIndirectMaterialSRT, "LIGHTING_DEBUG", lightDebugSettings.lightingDebugMode != LightingDebugMode.None);
Utilities.SetKeyword(m_DeferredIndirectMaterialMRT, "LIGHTING_DEBUG", lightDebugSettings.lightingDebugMode != LightingDebugMode.None);
Utilities.SetKeyword(m_DeferredAllMaterialSRT, "LIGHTING_DEBUG", lightDebugSettings.lightingDebugMode != LightingDebugMode.None);
Utilities.SetKeyword(m_DeferredAllMaterialMRT, "LIGHTING_DEBUG", lightDebugSettings.lightingDebugMode != LightingDebugMode.None);
Utilities.SetKeyword(m_SingleDeferredMaterialSRT, "LIGHTING_DEBUG", lightDebugSettings.lightingDebugMode != LightingDebugMode.None);
Utilities.SetKeyword(m_SingleDeferredMaterialMRT, "LIGHTING_DEBUG", lightDebugSettings.lightingDebugMode != LightingDebugMode.None);
LightingDebugParameters lightDebugParameters,
LightingDebugSettings lightDebugSettings,
bool outputSplitLighting)
bool outputSplitLightingForSSS, bool enableSSS)
{
var bUseClusteredForDeferred = !usingFptl;

SetGlobalBuffer("g_vLightListGlobal", bUseClusteredForDeferred ? s_PerVoxelLightLists : s_LightList); // opaques list (unless MSAA possibly)
if (lightDebugParameters.lightingDebugMode == LightingDebugMode.None)
if (lightDebugSettings.lightingDebugMode == LightingDebugMode.None)
SetGlobalPropertyRedirect(shadeOpaqueShader, usingFptl ? s_shadeOpaqueFptlKernel : s_shadeOpaqueClusteredKernel, cmd);
else
SetGlobalPropertyRedirect(shadeOpaqueShader, usingFptl ? s_shadeOpaqueFptlDebugLightingKernel : s_shadeOpaqueClusteredDebugLightingKernel, cmd);

}
// Must be done after setting up the compute shader above.
SetupRenderingForDebug(lightDebugParameters);
SetupRenderingForDebug(lightDebugSettings);
if (outputSplitLighting)
if (outputSplitLightingForSSS)
m_SingleDeferredMaterialSRT.SetInt("_StencilRef", (int)(enableSSS ? StencilBits.Standard : StencilBits.SSS));
Utilities.DrawFullScreen(cmd, m_SingleDeferredMaterialSRT, hdCamera, colorBuffers[0], stencilBuffer);
}
}

// Pixel shader evaluation
if (m_PassSettings.enableSplitLightEvaluation)
{
if (outputSplitLighting)
if (outputSplitLightingForSSS)
{
Utilities.SelectKeyword(m_DeferredDirectMaterialMRT, "USE_CLUSTERED_LIGHTLIST", "USE_FPTL_LIGHTLIST", bUseClusteredForDeferred);
Utilities.DrawFullScreen(cmd, m_DeferredDirectMaterialMRT, hdCamera, colorBuffers, stencilBuffer);

}
else
{
m_DeferredDirectMaterialSRT.SetInt("_StencilRef", (int)(enableSSS ? StencilBits.Standard : StencilBits.SSS));
m_DeferredIndirectMaterialSRT.SetInt("_StencilRef", (int)(enableSSS ? StencilBits.Standard : StencilBits.SSS));
Utilities.SelectKeyword(m_DeferredIndirectMaterialSRT, "USE_CLUSTERED_LIGHTLIST", "USE_FPTL_LIGHTLIST", bUseClusteredForDeferred);
Utilities.DrawFullScreen(cmd, m_DeferredIndirectMaterialSRT, hdCamera, colorBuffers[0], stencilBuffer);
}

if (outputSplitLighting)
if (outputSplitLightingForSSS)
{
Utilities.SelectKeyword(m_DeferredAllMaterialMRT, "USE_CLUSTERED_LIGHTLIST", "USE_FPTL_LIGHTLIST", bUseClusteredForDeferred);
Utilities.DrawFullScreen(cmd, m_DeferredAllMaterialMRT, hdCamera, colorBuffers, stencilBuffer);

m_DeferredAllMaterialSRT.SetInt("_StencilRef", (int)(enableSSS ? StencilBits.Standard : StencilBits.SSS));
Utilities.SelectKeyword(m_DeferredAllMaterialSRT, "USE_CLUSTERED_LIGHTLIST", "USE_FPTL_LIGHTLIST", bUseClusteredForDeferred);
Utilities.DrawFullScreen(cmd, m_DeferredAllMaterialSRT, hdCamera, colorBuffers[0], stencilBuffer);
}

8
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.hlsl


// Note: scale and bias of shadow atlas are included in ShadowTransform but could be apply here.
float4 positionTXS = mul(float4(positionWS, 1.0), shadowData.worldToShadow);
positionTXS.xyz /= positionTXS.w;
// positionTXS.z -= shadowData.bias; // Apply a linear bias
positionTXS.z -= 0.001;
// positionTXS.z -= shadowData.bias;
positionTXS.z -= 0.001; // Apply a linear bias
#if UNITY_REVERSED_Z
positionTXS.z = 1.0 - positionTXS.z;

// Note: scale and bias of shadow atlas are included in ShadowTransform but could be apply here.
float4 positionTXS = mul(float4(positionWS, 1.0), shadowData.worldToShadow);
positionTXS.xyz /= positionTXS.w;
// positionTXS.z -= shadowData.bias; // Apply a linear bias
positionTXS.z -= 0.003;
// positionTXS.z -= shadowData.bias;
positionTXS.z -= 0.003; // Apply a linear bias
#if UNITY_REVERSED_Z
positionTXS.z = 1.0 - positionTXS.z;

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material.meta


fileFormatVersion: 2
guid: 96af336cb096f854ea18990a1c0a4e19
guid: 49844bc6823848a4087668ebd3367436
folderAsset: yes
timeCreated: 1474297943
licenseType: Pro

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit.meta


fileFormatVersion: 2
guid: e173dfe6cd75d954b95306237244f6de
guid: c526d3e6d7f3ce1408308bb431089d2d
folderAsset: yes
timeCreated: 1476653183
licenseType: Pro

292
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/Editor/LayeredLitUI.cs


Material[] m_MaterialLayers = new Material[kMaxLayerCount];
// Layer options
MaterialProperty layerCount = null;
const string kLayerCount = "_LayerCount";
MaterialProperty layerCount = null;
const string kLayerCount = "_LayerCount";
MaterialProperty objectScaleAffectTile = null;
const string kObjectScaleAffectTile = "_ObjectScaleAffectTile";
MaterialProperty UVBlendMask = null;
const string kUVBlendMask = "_UVBlendMask";
MaterialProperty UVMappingPlanarBlendMask = null;
const string kUVMappingPlanarBlendMask = "_UVMappingPlanarBlendMask";
MaterialProperty layerTilingBlendMask = null;
const string kLayerTilingBlendMask = "_LayerTilingBlendMask";
MaterialProperty texWorldScaleBlendMask = null;
const string kTexWorldScaleBlendMask = "_TexWorldScaleBlendMask";
MaterialProperty useMainLayerInfluence = null;
const string kkUseMainLayerInfluence = "_UseMainLayerInfluence";
MaterialProperty useHeightBasedBlend = null;
const string kUseHeightBasedBlend = "_UseHeightBasedBlend";
// Properties for multiple layers inherit from referenced lit materials
MaterialProperty[] layerTexWorldScale = new MaterialProperty[kMaxLayerCount];
MaterialProperty[] layerUVBase = new MaterialProperty[kMaxLayerCount];
MaterialProperty[] layerUVMappingMask = new MaterialProperty[kMaxLayerCount];

const string kObjectScaleAffectTile = "_ObjectScaleAffectTile";
MaterialProperty objectScaleAffectTile = null;
const string kUVBlendMask = "_UVBlendMask";
MaterialProperty UVBlendMask = null;
const string kUVMappingPlanarBlendMask = "_UVMappingPlanarBlendMask";
MaterialProperty UVMappingPlanarBlendMask = null;
const string kLayerTilingBlendMask = "_LayerTilingBlendMask";
MaterialProperty layerTilingBlendMask = null;
const string kTexWorldScaleBlendMask = "_TexWorldScaleBlendMask";
MaterialProperty texWorldScaleBlendMask = null;
// This one is specific to layer lit
MaterialProperty[] layerTiling = new MaterialProperty[kMaxLayerCount];
MaterialProperty[] layerTiling = new MaterialProperty[kMaxLayerCount];
const string kkUseMainLayerInfluence = "_UseMainLayerInfluence";
MaterialProperty useMainLayerInfluence = null;
const string kUseHeightBasedBlend = "_UseHeightBasedBlend";
MaterialProperty useHeightBasedBlend = null;
const string kUseDensityMode = "_UseDensityMode";
// Density/opacity mode
const string kOpacityAsDensity = "_OpacityAsDensity";
const string kUseDensityMode = "_UseDensityMode";
const string kOpacityAsDensity = "_OpacityAsDensity";
MaterialProperty[] minimumOpacity = new MaterialProperty[kMaxLayerCount];
MaterialProperty[] minimumOpacity = new MaterialProperty[kMaxLayerCount];
// HeightmapMode control
MaterialProperty[] heightFactor = new MaterialProperty[kMaxLayerCount];
MaterialProperty[] heightFactor = new MaterialProperty[kMaxLayerCount];
const string kHeightCenterOffset = "_HeightCenterOffset";
const string kLayerHeightAmplitude = "_LayerHeightAmplitude";
const string kHeightCenterOffset = "_HeightCenterOffset";
const string kLayerHeightAmplitude = "_LayerHeightAmplitude";
MaterialProperty[] layerCenterOffset = new MaterialProperty[kMaxLayerCount];
MaterialProperty[] layerCenterOffset = new MaterialProperty[kMaxLayerCount];
MaterialProperty[] blendUsingHeight = new MaterialProperty[kMaxLayerCount - 1]; // Only in case of influence mode
MaterialProperty[] blendUsingHeight = new MaterialProperty[kMaxLayerCount - 1];
// influence
const string kInheritBaseNormal = "_InheritBaseNormal";
// Influence
const string kInheritBaseHeight = "_InheritBaseHeight";
const string kInheritBaseNormal = "_InheritBaseNormal";
const string kInheritBaseHeight = "_InheritBaseHeight";
MaterialProperty[] inheritBaseColor = new MaterialProperty[kMaxLayerCount - 1];
MaterialProperty[] inheritBaseColor = new MaterialProperty[kMaxLayerCount - 1];
const string kInheritBaseColorThreshold = "_InheritBaseColorThreshold";
MaterialProperty layerEmissiveColor = null;
MaterialProperty layerEmissiveColorMap = null;
MaterialProperty layerEmissiveIntensity = null;
const string kInheritBaseColorThreshold = "_InheritBaseColorThreshold";
override protected void FindMaterialProperties(MaterialProperty[] props)
protected override void FindMaterialProperties(MaterialProperty[] props)
layerMaskMap = FindProperty(kLayerMaskMap, props);
// Inherit from LitUI
horizonFade = FindProperty(kHorizonFade, props);
layerMaskMap = FindProperty(kLayerMaskMap, props);
useMainLayerInfluence = FindProperty(kkUseMainLayerInfluence, props);
useHeightBasedBlend = FindProperty(kUseHeightBasedBlend, props);
useDensityMode = FindProperty(kUseDensityMode, props);
useMainLayerInfluence = FindProperty(kkUseMainLayerInfluence, props);
useHeightBasedBlend = FindProperty(kUseHeightBasedBlend, props);
useDensityMode = FindProperty(kUseDensityMode, props);
for (int i = 0; i < kMaxLayerCount; ++i)
{
layerTexWorldScale[i] = FindProperty(string.Format("{0}{1}", kTexWorldScale, i), props);

layerUVDetailsMappingMask[i] = FindProperty(string.Format("{0}{1}", kUVDetailsMappingMask, i), props);
layerTiling[i] = FindProperty(string.Format("{0}{1}", kLayerTiling, i), props);
// Density/opacity mode
opacityAsDensity[i] = FindProperty(string.Format("{0}{1}", kOpacityAsDensity, i), props);
opacityAsDensity[i] = FindProperty(string.Format("{0}{1}", kOpacityAsDensity, i), props);
// HeightmapMode control
heightFactor[i] = FindProperty(string.Format("{0}{1}", kHeightFactor, i), props);
heightCenterOffset[i] = FindProperty(string.Format("{0}{1}", kHeightCenterOffset, i), props);
layerHeightAmplitude[i] = FindProperty(string.Format("{0}{1}", kLayerHeightAmplitude, i), props);

{
blendUsingHeight[i - 1] = FindProperty(string.Format("{0}{1}", kBlendUsingHeight, i), props);
// Influence
inheritBaseNormal[i - 1] = FindProperty(string.Format("{0}{1}", kInheritBaseNormal, i), props);
inheritBaseHeight[i - 1] = FindProperty(string.Format("{0}{1}", kInheritBaseHeight, i), props);
inheritBaseColor[i - 1] = FindProperty(string.Format("{0}{1}", kInheritBaseColor, i), props);

layerEmissiveColor = FindProperty(kEmissiveColor, props);
layerEmissiveColorMap = FindProperty(kEmissiveColorMap, props);
layerEmissiveIntensity = FindProperty(kEmissiveIntensity, props);
// Reuse property from LitUI.cs
emissiveColor = FindProperty(kEmissiveColor, props);
emissiveColorMap = FindProperty(kEmissiveColorMap, props);
emissiveIntensity = FindProperty(kEmissiveIntensity, props);
}
int numLayer

}
// This function is call by a script to help artists to ahve up to date material
// that why it is static
int layerCount = (int)material.GetFloat("_LayerCount");
int layerCount = (int)material.GetFloat(kLayerCount);
for (int i = 0 ; i < layerCount ; ++i)
// We could have no userData in the assets, so test if we have load something
if (layers != null)
SynchronizeLayerProperties(material, layers, i);
for (int i = 0; i < layerCount; ++i)
{
SynchronizeLayerProperties(material, layers, i);
}
}
}

}
}
UVMappingPlanarBlendMask.floatValue = ((LayerUVBaseMapping)UVBlendMask.floatValue == LayerUVBaseMapping.Planar) ? 1.0f : 0.0f;
// We setup the masking map based on the enum for each layer.
// using mapping mask allow to reduce the number of generated combination for a very small increase in ALU
LayerUVBaseMapping layerUVBaseMapping = (LayerUVBaseMapping)layerUVBase[layerIndex].floatValue;
float X, Y, Z, W;
X = (layerUVBaseMapping == LayerUVBaseMapping.UV0) ? 1.0f : 0.0f;
Y = (layerUVBaseMapping == LayerUVBaseMapping.UV1) ? 1.0f : 0.0f;
Z = (layerUVBaseMapping == LayerUVBaseMapping.UV2) ? 1.0f : 0.0f;
W = (layerUVBaseMapping == LayerUVBaseMapping.UV3) ? 1.0f : 0.0f;
layerUVMappingMask[layerIndex].colorValue = (layerIndex == 0) ? new Color(1.0f, 0.0f, 0.0f, 0.0f) : new Color(X, Y, Z, W); // Special case for Main Layer and Blend Mask, only UV0. As Layer0 is share by both here, need to force X to 1.0 in all case
layerUVMappingPlanar[layerIndex].floatValue = (layerUVBaseMapping == LayerUVBaseMapping.Planar) ? 1.0f : 0.0f; // Planar have priority on UV0
UVDetailMapping layerUVDetailMapping = (UVDetailMapping)layerUVDetail[layerIndex].floatValue;
X = (layerUVDetailMapping == UVDetailMapping.UV0) ? 1.0f : 0.0f;
Y = (layerUVDetailMapping == UVDetailMapping.UV1) ? 1.0f : 0.0f;
Z = (layerUVDetailMapping == UVDetailMapping.UV2) ? 1.0f : 0.0f;
W = (layerUVDetailMapping == UVDetailMapping.UV3) ? 1.0f : 0.0f;
layerUVDetailsMappingMask[layerIndex].colorValue = new Color(X, Y, Z, W);
bool useDensityModeEnable = useDensityMode.floatValue != 0.0f;
if (useDensityModeEnable)
{

useHeightBasedBlend.floatValue = enabled ? 1.0f : 0.0f;
}
m_MaterialEditor.ShaderProperty(objectScaleAffectTile, mainLayerModeInfluenceEnable ? styles.objectScaleAffectTileText2 : styles.objectScaleAffectTileText);
m_MaterialEditor.ShaderProperty(objectScaleAffectTile, mainLayerModeInfluenceEnable ? styles.objectScaleAffectTileText2 : styles.objectScaleAffectTileText);
m_MaterialEditor.ShaderProperty(horizonFade, Styles.horizonFadeText);
EditorGUILayout.Space();

return layerChanged;
}
protected override void SetupMaterialKeywords(Material material)
protected override bool ShouldEmissionBeEnabled(Material mat)
SetupCommonOptionsKeywords(material);
SetupLayersMappingKeywords(material);
return mat.GetFloat(kEmissiveIntensity) > 0.0f;
}
for (int i = 0; i < kMaxLayerCount; ++i)
{
SetKeyword(material, "_NORMALMAP_TANGENT_SPACE" + i, ((NormalMapSpace)material.GetFloat(kNormalMapSpace + i)) == NormalMapSpace.TangentSpace);
SetKeyword(material, "_NORMALMAP" + i, material.GetTexture(kNormalMap + i));
SetKeyword(material, "_MASKMAP" + i, material.GetTexture(kMaskMap + i));
SetKeyword(material, "_SPECULAROCCLUSIONMAP" + i, material.GetTexture(kSpecularOcclusionMap + i));
SetKeyword(material, "_DETAIL_MAP" + i, material.GetTexture(kDetailMap + i));
SetKeyword(material, "_HEIGHTMAP0" + i, material.GetTexture(kHeightMap + i));
}
bool perPixelDisplacement = material.GetFloat(kEnablePerPixelDisplacement) == 1.0;
SetKeyword(material, "_PER_PIXEL_DISPLACEMENT", perPixelDisplacement);
SetKeyword(material, "_EMISSIVE_COLOR_MAP", material.GetTexture(kEmissiveColorMap));
SetKeyword(material, "_MAIN_LAYER_INFLUENCE_MODE", material.GetFloat(kkUseMainLayerInfluence) != 0.0f);
VertexColorMode VCMode = (VertexColorMode)vertexColorMode.floatValue;
if (VCMode == VertexColorMode.Multiply)
{
SetKeyword(material, "_LAYER_MASK_VERTEX_COLOR_MUL", true);
SetKeyword(material, "_LAYER_MASK_VERTEX_COLOR_ADD", false);
}
else if (VCMode == VertexColorMode.Add)
{
SetKeyword(material, "_LAYER_MASK_VERTEX_COLOR_MUL", false);
SetKeyword(material, "_LAYER_MASK_VERTEX_COLOR_ADD", true);
}
else
{
SetKeyword(material, "_LAYER_MASK_VERTEX_COLOR_MUL", false);
SetKeyword(material, "_LAYER_MASK_VERTEX_COLOR_ADD", false);
}
bool useHeightBasedBlend = material.GetFloat(kUseHeightBasedBlend) != 0.0f;
SetKeyword(material, "_HEIGHT_BASED_BLEND", useHeightBasedBlend);
bool useDensityModeEnable = material.GetFloat(kUseDensityMode) != 0.0f;
SetKeyword(material, "_DENSITY_MODE", useDensityModeEnable);
protected override void SetupMaterialKeywordsAndPassInternal(Material material)
{
SetupMaterialKeywordsAndPass(material);
void SetupLayersMappingKeywords(Material material)
static public void SetupLayersMappingKeywords(Material material)
LayerUVBaseMapping UVBlendMaskMapping = (LayerUVBaseMapping)material.GetFloat(kUVBlendMask);
UVMappingPlanarBlendMask.floatValue = (UVBlendMaskMapping == LayerUVBaseMapping.Planar) ? 1.0f : 0.0f;
LayerUVBaseMapping UVBlendMaskMapping = (LayerUVBaseMapping)material.GetFloat(kUVBlendMask);
int numLayer = (int)material.GetFloat(kLayerCount);
// Layer
if (numLayer == 4)

for (int i = 0 ; i < numLayer; ++i)
{
// We setup the masking map based on the enum for each layer.
// using mapping mask allow to reduce the number of generated combination for a very small increase in ALU
string layerUVDetailParam = string.Format("{0}{1}", kUVDetail, i);
UVDetailMapping layerUVDetailMapping = (UVDetailMapping)material.GetFloat(layerUVDetailParam);
float X, Y, Z, W;
X = (layerUVBaseMapping == LayerUVBaseMapping.UV0) ? 1.0f : 0.0f;
Y = (layerUVBaseMapping == LayerUVBaseMapping.UV1) ? 1.0f : 0.0f;
Z = (layerUVBaseMapping == LayerUVBaseMapping.UV2) ? 1.0f : 0.0f;
W = (layerUVBaseMapping == LayerUVBaseMapping.UV3) ? 1.0f : 0.0f;
layerUVMappingMask[i].colorValue = (i == 0) ? new Color(1.0f, 0.0f, 0.0f, 0.0f) : new Color(X, Y, Z, W); // Special case for Main Layer and Blend Mask, only UV0. As Layer0 is share by both here, need to force X to 1.0 in all case
layerUVMappingPlanar[i].floatValue = (layerUVBaseMapping == LayerUVBaseMapping.Planar) ? 1.0f : 0.0f; // Planar have priority on UV0
X = (layerUVDetailMapping == UVDetailMapping.UV0) ? 1.0f : 0.0f;
Y = (layerUVDetailMapping == UVDetailMapping.UV1) ? 1.0f : 0.0f;
Z = (layerUVDetailMapping == UVDetailMapping.UV2) ? 1.0f : 0.0f;
W = (layerUVDetailMapping == UVDetailMapping.UV3) ? 1.0f : 0.0f;
layerUVDetailsMappingMask[i].colorValue = new Color(X, Y, Z, W);
string uvBase = string.Format("{0}{1}", kUVBase, i);
string uvDetail = string.Format("{0}{1}", kUVDetail, i);

}
}
// All Setup Keyword functions must be static. It allow to create script to automatically update the shaders with a script if code change
static new public void SetupMaterialKeywordsAndPass(Material material)
{
SetupBaseLitKeywords(material);
SetupBaseLitMaterialPass(material);
SetupLayersMappingKeywords(material);
for (int i = 0; i < kMaxLayerCount; ++i)
{
SetKeyword(material, "_NORMALMAP_TANGENT_SPACE" + i, ((NormalMapSpace)material.GetFloat(kNormalMapSpace + i)) == NormalMapSpace.TangentSpace);
SetKeyword(material, "_NORMALMAP" + i, material.GetTexture(kNormalMap + i));
SetKeyword(material, "_MASKMAP" + i, material.GetTexture(kMaskMap + i));
SetKeyword(material, "_SPECULAROCCLUSIONMAP" + i, material.GetTexture(kSpecularOcclusionMap + i));
SetKeyword(material, "_DETAIL_MAP" + i, material.GetTexture(kDetailMap + i));
SetKeyword(material, "_HEIGHTMAP" + i, material.GetTexture(kHeightMap + i));
}
SetKeyword(material, "_EMISSIVE_COLOR_MAP", material.GetTexture(kEmissiveColorMap));
SetKeyword(material, "_MAIN_LAYER_INFLUENCE_MODE", material.GetFloat(kkUseMainLayerInfluence) != 0.0f);
VertexColorMode VCMode = (VertexColorMode)material.GetFloat(kVertexColorMode);
if (VCMode == VertexColorMode.Multiply)
{
SetKeyword(material, "_LAYER_MASK_VERTEX_COLOR_MUL", true);
SetKeyword(material, "_LAYER_MASK_VERTEX_COLOR_ADD", false);
}
else if (VCMode == VertexColorMode.Add)
{
SetKeyword(material, "_LAYER_MASK_VERTEX_COLOR_MUL", false);
SetKeyword(material, "_LAYER_MASK_VERTEX_COLOR_ADD", true);
}
else
{
SetKeyword(material, "_LAYER_MASK_VERTEX_COLOR_MUL", false);
SetKeyword(material, "_LAYER_MASK_VERTEX_COLOR_ADD", false);
}
bool useHeightBasedBlend = material.GetFloat(kUseHeightBasedBlend) != 0.0f;
SetKeyword(material, "_HEIGHT_BASED_BLEND", useHeightBasedBlend);
bool useDensityModeEnable = material.GetFloat(kUseDensityMode) != 0.0f;
SetKeyword(material, "_DENSITY_MODE", useDensityModeEnable);
}
FindCommonOptionProperties(props);
FindBaseMaterialProperties(props);
// We should always do this call at the beginning
m_MaterialEditor.serializedObject.Update();
Material material = m_MaterialEditor.target as Material;

bool optionsChanged = false;
EditorGUI.BeginChangeCheck();
{
ShaderOptionsGUI();
BaseMaterialPropertiesGUI();
EditorGUILayout.Space();
}
if (EditorGUI.EndChangeCheck())

EditorGUILayout.Space();
GUILayout.Label(Styles.lightingText, EditorStyles.boldLabel);
EditorGUI.indentLevel++;
m_MaterialEditor.TexturePropertySingleLine(Styles.emissiveText, layerEmissiveColorMap, layerEmissiveColor);
m_MaterialEditor.ShaderProperty(layerEmissiveIntensity, Styles.emissiveIntensityText);
m_MaterialEditor.LightmapEmissionProperty(1);
m_MaterialEditor.TexturePropertySingleLine(Styles.emissiveText, emissiveColorMap, emissiveColor);
m_MaterialEditor.ShaderProperty(emissiveIntensity, Styles.emissiveIntensityText);
DoEmissionArea(material);
m_MaterialEditor.EnableInstancingField();
SetupMaterialKeywords((Material)obj);
SetupMaterialKeywordsAndPassInternal((Material)obj);
// SaveAssetsProcessor the referenced material in the users data
// We should always do this call at the end
m_MaterialEditor.serializedObject.ApplyModifiedProperties();
}
}

39
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLit.shader


_HorizonFade("Horizon fade", Range(0.0, 5.0)) = 1.0
// Stencil state
[HideInInspector] _StencilRef("_StencilRef", Int) = 2 // StencilBits.Standard
// Blending state
[HideInInspector] _SurfaceType("__surfacetype", Float) = 0.0
[HideInInspector] _BlendMode ("__blendmode", Float) = 0.0

[HideInInspector] _CullMode("__cullmode", Float) = 2.0
[HideInInspector] _ZTestMode("_ZTestMode", Int) = 8
[Enum(None, 0, DoubleSided, 1, DoubleSidedLigthingFlip, 2, DoubleSidedLigthingMirror, 3)] _DoubleSidedMode("Double sided mode", Float) = 0
[ToggleOff] _DoubleSidedEnable("Double sided enable", Float) = 0.0
[ToggleOff] _DoubleSidedMirrorEnable("Double sided mirror enable", Float) = 1.0
[HideInInspector] _DoubleSidedConstants("_DoubleSidedConstants", Vector) = (1, 1, -1, 0)
[ToggleOff] _EnablePerPixelDisplacement("Enable per pixel displacement", Float) = 0.0
_PPDMinSamples("Min sample for POM", Range(1.0, 64.0)) = 5

// Caution: C# code in BaseLitUI.cs call LightmapEmissionFlagsProperty() which assume that there is an existing "_EmissionColor"
// value that exist to identify if the GI emission need to be enabled.
// In our case we don't use such a mechanism but need to keep the code quiet. We declare the value and always enable it.
// TODO: Fix the code in legacy unity so we can customize the beahvior for GI
_EmissionColor("Color", Color) = (1, 1, 1)
// WARNING
// All the following properties that concern the UV mapping are the same as in the Lit shader.

#pragma shader_feature _ALPHATEST_ON
#pragma shader_feature _DISTORTION_ON
#pragma shader_feature _DEPTHOFFSET_ON
#pragma shader_feature _ _DOUBLESIDED _DOUBLESIDED_LIGHTING_FLIP _DOUBLESIDED_LIGHTING_MIRROR
#pragma shader_feature _DOUBLESIDED_ON
#pragma shader_feature _PER_PIXEL_DISPLACEMENT
#pragma shader_feature _LAYER_TILING_UNIFORM_SCALE
#pragma shader_feature _LAYER_MAPPING_TRIPLANAR_BLENDMASK

#pragma shader_feature _NORMALMAP_TANGENT_SPACE1
#pragma shader_feature _NORMALMAP_TANGENT_SPACE2
#pragma shader_feature _NORMALMAP_TANGENT_SPACE3
#pragma shader_feature _PER_PIXEL_DISPLACEMENT
#pragma shader_feature _ _REQUIRE_UV2 _REQUIRE_UV3
#pragma shader_feature _EMISSIVE_COLOR

Name "GBuffer" // Name is not used
Tags { "LightMode" = "GBuffer" } // This will be only for opaque object based on the RenderQueue index
Cull [_CullMode]
Cull [_CullMode]
Stencil
{
Ref [_StencilRef]
Comp Always
Pass Replace
}
#include "../../Material/Material.hlsl"
#include "../Lit/ShaderPass/LitSharePass.hlsl"
#include "../../Material/Material.hlsl"
#include "../Lit/ShaderPass/LitSharePass.hlsl"
#include "../Lit/LitData.hlsl"
#include "../../ShaderPass/ShaderPassGBuffer.hlsl"

Name "GBufferDebugLighting" // Name is not used
Tags{ "LightMode" = "GBufferDebugLighting" } // This will be only for opaque object based on the RenderQueue index
Cull[_CullMode]
Cull [_CullMode]
Stencil
{
Ref [_StencilRef]
Comp Always
Pass Replace
}
HLSLPROGRAM

35
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLitTessellation.shader


_HorizonFade("Horizon fade", Range(0.0, 5.0)) = 1.0
// Stencil state
[HideInInspector] _StencilRef("_StencilRef", Int) = 2 // StencilBits.Standard
// Blending state
[HideInInspector] _SurfaceType("__surfacetype", Float) = 0.0
[HideInInspector] _BlendMode ("__blendmode", Float) = 0.0

[HideInInspector] _CullMode("__cullmode", Float) = 2.0
[HideInInspector] _ZTestMode("_ZTestMode", Int) = 8
[Enum(None, 0, DoubleSided, 1, DoubleSidedLigthingFlip, 2, DoubleSidedLigthingMirror, 3)] _DoubleSidedMode("Double sided mode", Float) = 0
[ToggleOff] _DoubleSidedEnable("Double sided enable", Float) = 0.0
[ToggleOff] _DoubleSidedMirrorEnable("Double sided mirror enable", Float) = 1.0
[HideInInspector] _DoubleSidedConstants("_DoubleSidedConstants", Vector) = (1, 1, -1, 0)
[ToggleOff] _EnablePerPixelDisplacement("Enable per pixel displacement", Float) = 0.0
_PPDMinSamples("Min sample for POM", Range(1.0, 64.0)) = 5

// Caution: C# code in BaseLitUI.cs call LightmapEmissionFlagsProperty() which assume that there is an existing "_EmissionColor"
// value that exist to identify if the GI emission need to be enabled.
// In our case we don't use such a mechanism but need to keep the code quiet. We declare the value and always enable it.
// TODO: Fix the code in legacy unity so we can customize the beahvior for GI
_EmissionColor("Color", Color) = (1, 1, 1)
// WARNING
// All the following properties that concern the UV mapping are the same as in the Lit shader.
// This means that they will get overridden when synchronizing the various layers.

#pragma shader_feature _ALPHATEST_ON
#pragma shader_feature _DISTORTION_ON
#pragma shader_feature _DEPTHOFFSET_ON
#pragma shader_feature _ _DOUBLESIDED _DOUBLESIDED_LIGHTING_FLIP _DOUBLESIDED_LIGHTING_MIRROR
#pragma shader_feature _DOUBLESIDED_ON
#pragma shader_feature _PER_PIXEL_DISPLACEMENT
// Default is _TESSELLATION_PHONG
#pragma shader_feature _ _TESSELLATION_DISPLACEMENT _TESSELLATION_DISPLACEMENT_PHONG
#pragma shader_feature _TESSELLATION_OBJECT_SCALE

#pragma shader_feature _NORMALMAP_TANGENT_SPACE1
#pragma shader_feature _NORMALMAP_TANGENT_SPACE2
#pragma shader_feature _NORMALMAP_TANGENT_SPACE3
#pragma shader_feature _PER_PIXEL_DISPLACEMENT
#pragma shader_feature _ _REQUIRE_UV2 _REQUIRE_UV3
#pragma shader_feature _EMISSIVE_COLOR

Name "GBuffer" // Name is not used
Tags { "LightMode" = "GBuffer" } // This will be only for opaque object based on the RenderQueue index
Cull [_CullMode]
Cull [_CullMode]
Stencil
{
Ref [_StencilRef]
Comp Always
Pass Replace
}
HLSLPROGRAM

Name "GBufferDebugLighting" // Name is not used
Tags{ "LightMode" = "GBufferDebugLighting" } // This will be only for opaque object based on the RenderQueue index
Cull[_CullMode]
Cull [_CullMode]
Stencil
{
Ref [_StencilRef]
Comp Always
Pass Replace
}
HLSLPROGRAM

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit.meta


fileFormatVersion: 2
guid: d6cadd3aaf3ad6641b86e85a0929b245
guid: 0d05f89ce69203543914d745c388e6bb
folderAsset: yes
timeCreated: 1476653183
licenseType: Pro

585
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Editor/BaseLitUI.cs


namespace UnityEditor.Experimental.Rendering.HDPipeline
{
public abstract class BaseLitGUI : ShaderGUI
// A Material can be authored from the shader graph or by hand. When written by hand we need to provide an inspector.
// Such a Material will share some properties between it various variant (shader graph variant or hand authored variant).
// This is the purpose of BaseLitGUI. It contain all properties that are common to all Material based on Lit template.
// For the default hand written Lit material see LitUI.cs that contain specific properties for our default implementation.
public abstract class BaseLitGUI : BaseUnlitGUI
protected static class Styles
protected static class StylesBaseLit
public static string optionText = "Surface options";
public static string surfaceTypeText = "Surface Type";
public static string blendModeText = "Blend Mode";
public static string detailText = "Inputs Detail";
public static string textureControlText = "Input textures control";
public static string lightingText = "Inputs Lighting";
public static GUIContent alphaCutoffEnableText = new GUIContent("Alpha Cutoff Enable", "Threshold for alpha cutoff");
public static GUIContent alphaCutoffText = new GUIContent("Alpha Cutoff", "Threshold for alpha cutoff");
public static GUIContent doubleSidedModeText = new GUIContent("Double Sided", "This will render the two face of the objects (disable backface culling)");
public static GUIContent distortionEnableText = new GUIContent("Distortion", "Enable distortion on this shader");
public static GUIContent distortionOnlyText = new GUIContent("Distortion Only", "This shader will only be use to render distortion");
public static GUIContent distortionDepthTestText = new GUIContent("Distortion Depth Test", "Enable the depth test for distortion");
public static GUIContent doubleSidedMirrorEnableText = new GUIContent("Mirror normal", "This will mirror the normal with vertex normal plane if enabled, else flip the normal");
public static GUIContent horizonFadeText = new GUIContent("Horizon Fade (Spec occlusion)", "horizon fade is use to control specular occlusion");
public static readonly string[] surfaceTypeNames = Enum.GetNames(typeof(SurfaceType));
public static readonly string[] blendModeNames = Enum.GetNames(typeof(BlendMode));
// Material ID
public static GUIContent materialIDText = new GUIContent("Material type", "Subsurface Scattering: enable for translucent materials such as skin, vegetation, fruit, marble, wax and milk.");
public static GUIContent smoothnessMapChannelText = new GUIContent("Smoothness Source", "Smoothness texture and channel");
public static GUIContent UVBaseMappingText = new GUIContent("Base UV mapping", "");
public static GUIContent texWorldScaleText = new GUIContent("World scale", "Tiling factor applied to Planar/Trilinear mapping");
public static GUIContent normalMapSpaceText = new GUIContent("Normal/Tangent Map space", "");
// Per pixel displacement
public static GUIContent ppdMinSamplesText = new GUIContent("Minimum samples", "Minimun samples to use with per pixel displacement mapping");
public static GUIContent ppdMaxSamplesText = new GUIContent("Maximum samples", "Maximum samples to use with per pxiel displacement mapping");
public static GUIContent ppdMinSamplesText = new GUIContent("Minimum samples", "Minimum samples to use with per pixel displacement mapping");
public static GUIContent ppdMaxSamplesText = new GUIContent("Maximum samples", "Maximum samples to use with per pixel displacement mapping");
public static GUIContent detailMapModeText = new GUIContent("Detail Map with Normal", "Detail Map with AO / Height");
public static GUIContent UVDetailMappingText = new GUIContent("Detail UV mapping", "");
public static GUIContent emissiveColorModeText = new GUIContent("Emissive Color Usage", "Use emissive color or emissive mask");
public static string InputsText = "Inputs";
public static string InputsMapText = "";
public static GUIContent baseColorText = new GUIContent("Base Color + Opacity", "Albedo (RGB) and Opacity (A)");
public static GUIContent baseColorSmoothnessText = new GUIContent("Base Color + Smoothness", "Albedo (RGB) and Smoothness (A)");
public static GUIContent metallicText = new GUIContent("Metallic", "Metallic scale factor");
public static GUIContent smoothnessText = new GUIContent("Smoothness", "Smoothness scale factor");
public static GUIContent maskMapESText = new GUIContent("Mask Map - M(R), AO(G), E(B), S(A)", "Mask map");
public static GUIContent maskMapSText = new GUIContent("Mask Map - M(R), AO(G), S(A)", "Mask map");
public static GUIContent specularOcclusionMapText = new GUIContent("Specular Occlusion Map (RGBA)", "Specular Occlusion Map");
public static GUIContent normalMapText = new GUIContent("Normal Map", "Normal Map (DXT5) - Need to implement BC5");
public static GUIContent heightMapText = new GUIContent("Height Map (R)", "Height Map");
public static GUIContent heightMapAmplitudeText = new GUIContent("Height Map Amplitude", "Height Map amplitude in world units.");
public static GUIContent heightMapCenterText = new GUIContent("Height Map Center", "Center of the heightmap in the texture (between 0 and 1)");
public static GUIContent tangentMapText = new GUIContent("Tangent Map", "Tangent Map (BC5) - DXT5 for test");
public static GUIContent anisotropyText = new GUIContent("Anisotropy", "Anisotropy scale factor");
public static GUIContent anisotropyMapText = new GUIContent("Anisotropy Map (B)", "Anisotropy");
public static GUIContent detailMapNormalText = new GUIContent("Detail Map A(R) Ny(G) S(B) Nx(A)", "Detail Map");
public static GUIContent detailMaskText = new GUIContent("Detail Mask (G)", "Mask for detailMap");
public static GUIContent detailAlbedoScaleText = new GUIContent("Detail AlbedoScale", "Detail Albedo Scale factor");
public static GUIContent detailNormalScaleText = new GUIContent("Detail NormalScale", "Normal Scale factor");
public static GUIContent detailSmoothnessScaleText = new GUIContent("Detail SmoothnessScale", "Smoothness Scale factor");
public static GUIContent detailHeightScaleText = new GUIContent("Detail HeightScale", "Height Scale factor");
public static GUIContent detailAOScaleText = new GUIContent("Detail AOScale", "AO Scale factor");
public static GUIContent emissiveText = new GUIContent("Emissive Color", "Emissive");
public static GUIContent emissiveIntensityText = new GUIContent("Emissive Intensity", "Emissive");
public static GUIContent emissiveWarning = new GUIContent("Emissive value is animated but the material has not been configured to support emissive. Please make sure the material itself has some amount of emissive.");
public static GUIContent emissiveColorWarning = new GUIContent("Ensure emissive color is non-black for emission to have effect.");
// Tessellation
public static string tessellationModeText = "Tessellation Mode";
public static readonly string[] tessellationModeNames = Enum.GetNames(typeof(TessellationMode));

public static GUIContent tessellationFactorTriangleSizeText = new GUIContent("Triangle size", "Desired screen space sized of triangle (in pixel). Smaller value mean smaller triangle.");
public static GUIContent tessellationShapeFactorText = new GUIContent("Shape factor", "Strength of Phong tessellation shape (lerp factor)");
public static GUIContent tessellationBackFaceCullEpsilonText = new GUIContent("Triangle culling Epsilon", "If -1.0 back face culling is enabled for tessellation, higher number mean more aggressive culling and better performance");
public static GUIContent tessellationObjectScaleText = new GUIContent("Enable object scale", "Tesselation displacement will take into account the object scale - Only work with uniform positive scale");
public static GUIContent perPixelDisplacementText = new GUIContent("Per pixel displacement", "Per pixel displacement options");
public static GUIContent materialIDText = new GUIContent("Material type", "Subsurface Scattering: enable for translucent materials such as skin, vegetation, fruit, marble, wax and milk.");
public static GUIContent subsurfaceProfileText = new GUIContent("Subsurface profile", "A profile determines the shape of the blur filter.");
public static GUIContent subsurfaceRadiusText = new GUIContent("Subsurface radius", "Determines the range of the blur.");
public static GUIContent subsurfaceRadiusMapText = new GUIContent("Subsurface radius map", "Determines the range of the blur.");
public static GUIContent thicknessText = new GUIContent("Thickness", "If subsurface scattering is enabled, low values allow some light to be transmitted through the object.");
public static GUIContent thicknessMapText = new GUIContent("Thickness map", "If subsurface scattering is enabled, low values allow some light to be transmitted through the object.");
}
public enum SurfaceType
{
Opaque,
Transparent
}
public enum BlendMode
{
Lerp,
Add,
SoftAdd,
Multiply,
Premultiply
}
public enum DoubleSidedMode
{
None,
DoubleSided,
DoubleSidedLightingFlip,
DoubleSidedLightingMirror,
public static GUIContent tessellationObjectScaleText = new GUIContent("Enable object scale", "Tessellation displacement will take into account the object scale - Only work with uniform positive scale");
}
public enum TessellationMode

DisplacementPhong,
}
void SurfaceTypePopup()
{
EditorGUI.showMixedValue = surfaceType.hasMixedValue;
var mode = (SurfaceType)surfaceType.floatValue;
protected MaterialProperty doubleSidedMirrorEnable = null;
protected const string kDoubleSidedMirrorEnable = "_DoubleSidedMirrorEnable";
protected MaterialProperty depthOffsetEnable = null;
protected const string kDepthOffsetEnable = "_DepthOffsetEnable";
EditorGUI.BeginChangeCheck();
mode = (SurfaceType)EditorGUILayout.Popup(Styles.surfaceTypeText, (int)mode, Styles.surfaceTypeNames);
if (EditorGUI.EndChangeCheck())
{
m_MaterialEditor.RegisterPropertyChangeUndo("Surface Type");
surfaceType.floatValue = (float)mode;
}
// Properties
// Material ID
protected MaterialProperty materialID = null;
protected const string kMaterialID = "_MaterialID";
EditorGUI.showMixedValue = false;
}
// Per pixel displacement params
protected MaterialProperty enablePerPixelDisplacement = null;
protected const string kEnablePerPixelDisplacement = "_EnablePerPixelDisplacement";
protected MaterialProperty ppdMinSamples = null;
protected const string kPpdMinSamples = "_PPDMinSamples";
protected MaterialProperty ppdMaxSamples = null;
protected const string kPpdMaxSamples = "_PPDMaxSamples";
protected MaterialProperty ppdLodThreshold = null;
protected const string kPpdLodThreshold = "_PPDLodThreshold";
// tessellation params
protected MaterialProperty tessellationMode = null;
protected const string kTessellationMode = "_TessellationMode";
protected MaterialProperty tessellationFactor = null;
protected const string kTessellationFactor = "_TessellationFactor";
protected MaterialProperty tessellationFactorMinDistance = null;
protected const string kTessellationFactorMinDistance = "_TessellationFactorMinDistance";
protected MaterialProperty tessellationFactorMaxDistance = null;
protected const string kTessellationFactorMaxDistance = "_TessellationFactorMaxDistance";
protected MaterialProperty tessellationFactorTriangleSize = null;
protected const string kTessellationFactorTriangleSize = "_TessellationFactorTriangleSize";
protected MaterialProperty tessellationShapeFactor = null;
protected const string kTessellationShapeFactor = "_TessellationShapeFactor";
protected MaterialProperty tessellationBackFaceCullEpsilon = null;
protected const string kTessellationBackFaceCullEpsilon = "_TessellationBackFaceCullEpsilon";
protected MaterialProperty tessellationObjectScale = null;
protected const string kTessellationObjectScale = "_TessellationObjectScale";
private void BlendModePopup()
protected override void FindBaseMaterialProperties(MaterialProperty[] props)
EditorGUI.showMixedValue = blendMode.hasMixedValue;
var mode = (BlendMode)blendMode.floatValue;
base.FindBaseMaterialProperties(props);
doubleSidedMirrorEnable = FindProperty(kDoubleSidedMirrorEnable, props);
depthOffsetEnable = FindProperty(kDepthOffsetEnable, props);
EditorGUI.BeginChangeCheck();
mode = (BlendMode)EditorGUILayout.Popup(Styles.blendModeText, (int)mode, Styles.blendModeNames);
if (EditorGUI.EndChangeCheck())
{
m_MaterialEditor.RegisterPropertyChangeUndo("Blend Mode");
blendMode.floatValue = (float)mode;
}
// MaterialID
materialID = FindProperty(kMaterialID, props, false);
// Per pixel displacement
enablePerPixelDisplacement = FindProperty(kEnablePerPixelDisplacement, props);
ppdMinSamples = FindProperty(kPpdMinSamples, props);
ppdMaxSamples = FindProperty(kPpdMaxSamples, props);
ppdLodThreshold = FindProperty(kPpdLodThreshold, props);
EditorGUI.showMixedValue = false;
// tessellation specific, silent if not found
tessellationMode = FindProperty(kTessellationMode, props, false);
tessellationFactor = FindProperty(kTessellationFactor, props, false);
tessellationFactorMinDistance = FindProperty(kTessellationFactorMinDistance, props, false);
tessellationFactorMaxDistance = FindProperty(kTessellationFactorMaxDistance, props, false);
tessellationFactorTriangleSize = FindProperty(kTessellationFactorTriangleSize, props, false);
tessellationShapeFactor = FindProperty(kTessellationShapeFactor, props, false);
tessellationBackFaceCullEpsilon = FindProperty(kTessellationBackFaceCullEpsilon, props, false);
tessellationObjectScale = FindProperty(kTessellationObjectScale, props, false);
}
void TessellationModePopup()

EditorGUI.BeginChangeCheck();
mode = (TessellationMode)EditorGUILayout.Popup(Styles.tessellationModeText, (int)mode, Styles.tessellationModeNames);
mode = (TessellationMode)EditorGUILayout.Popup(StylesBaseLit.tessellationModeText, (int)mode, StylesBaseLit.tessellationModeNames);
if (EditorGUI.EndChangeCheck())
{
m_MaterialEditor.RegisterPropertyChangeUndo("Tessellation Mode");

EditorGUI.showMixedValue = false;
}
protected void ShaderOptionsGUI()
protected override void BaseMaterialPropertiesGUI()
EditorGUI.indentLevel++;
GUILayout.Label(Styles.optionText, EditorStyles.boldLabel);
SurfaceTypePopup();
if ((SurfaceType)surfaceType.floatValue == SurfaceType.Transparent)
{
BlendModePopup();
m_MaterialEditor.ShaderProperty(distortionEnable, Styles.distortionEnableText.text);
base.BaseMaterialPropertiesGUI();
if (distortionEnable.floatValue == 1.0)
{
m_MaterialEditor.ShaderProperty(distortionOnly, Styles.distortionOnlyText.text);
m_MaterialEditor.ShaderProperty(distortionDepthTest, Styles.distortionDepthTestText.text);
}
}
m_MaterialEditor.ShaderProperty(alphaCutoffEnable, Styles.alphaCutoffEnableText.text);
if (alphaCutoffEnable.floatValue == 1.0)
// This follow double sided option
if (doubleSidedEnable.floatValue > 0.0f)
m_MaterialEditor.ShaderProperty(alphaCutoff, Styles.alphaCutoffText.text);
EditorGUI.indentLevel++;
m_MaterialEditor.ShaderProperty(doubleSidedMirrorEnable, StylesBaseLit.doubleSidedMirrorEnableText);
EditorGUI.indentLevel--;
m_MaterialEditor.ShaderProperty(doubleSidedMode, Styles.doubleSidedModeText.text);
m_MaterialEditor.ShaderProperty(enablePerPixelDisplacement, Styles.enablePerPixelDisplacementText);
if (enablePerPixelDisplacement.floatValue > 0.0)
if (materialID != null)
m_MaterialEditor.ShaderProperty(materialID, StylesBaseLit.materialIDText);
m_MaterialEditor.ShaderProperty(enablePerPixelDisplacement, StylesBaseLit.enablePerPixelDisplacementText);
if (enablePerPixelDisplacement.floatValue > 0.0f)
m_MaterialEditor.ShaderProperty(ppdMinSamples, Styles.ppdMinSamplesText);
m_MaterialEditor.ShaderProperty(ppdMaxSamples, Styles.ppdMaxSamplesText);
m_MaterialEditor.ShaderProperty(ppdMinSamples, StylesBaseLit.ppdMinSamplesText);
m_MaterialEditor.ShaderProperty(ppdMaxSamples, StylesBaseLit.ppdMaxSamplesText);
m_MaterialEditor.ShaderProperty(ppdLodThreshold, Styles.ppdLodThresholdText);
m_MaterialEditor.ShaderProperty(depthOffsetEnable, Styles.depthOffsetEnableText.text);
m_MaterialEditor.ShaderProperty(ppdLodThreshold, StylesBaseLit.ppdLodThresholdText);
m_MaterialEditor.ShaderProperty(depthOffsetEnable, StylesBaseLit.depthOffsetEnableText);
m_MaterialEditor.ShaderProperty(horizonFade, Styles.horizonFadeText);
// Display tessellation option if it exist
GUILayout.Label(Styles.tessellationText, EditorStyles.boldLabel);
GUILayout.Label(StylesBaseLit.tessellationText, EditorStyles.boldLabel);
m_MaterialEditor.ShaderProperty(tessellationFactor, Styles.tessellationFactorText);
m_MaterialEditor.ShaderProperty(tessellationFactorMinDistance, Styles.tessellationFactorMinDistanceText);
m_MaterialEditor.ShaderProperty(tessellationFactorMaxDistance, Styles.tessellationFactorMaxDistanceText);
m_MaterialEditor.ShaderProperty(tessellationFactor, StylesBaseLit.tessellationFactorText);
m_MaterialEditor.ShaderProperty(tessellationFactorMinDistance, StylesBaseLit.tessellationFactorMinDistanceText);
m_MaterialEditor.ShaderProperty(tessellationFactorMaxDistance, StylesBaseLit.tessellationFactorMaxDistanceText);
m_MaterialEditor.ShaderProperty(tessellationFactorTriangleSize, Styles.tessellationFactorTriangleSizeText);
m_MaterialEditor.ShaderProperty(tessellationFactorTriangleSize, StylesBaseLit.tessellationFactorTriangleSizeText);
m_MaterialEditor.ShaderProperty(tessellationShapeFactor, Styles.tessellationShapeFactorText);
m_MaterialEditor.ShaderProperty(tessellationShapeFactor, StylesBaseLit.tessellationShapeFactorText);
if ((DoubleSidedMode)doubleSidedMode.floatValue == DoubleSidedMode.None)
if (doubleSidedEnable.floatValue == 0.0)
m_MaterialEditor.ShaderProperty(tessellationBackFaceCullEpsilon, Styles.tessellationBackFaceCullEpsilonText);
m_MaterialEditor.ShaderProperty(tessellationBackFaceCullEpsilon, StylesBaseLit.tessellationBackFaceCullEpsilonText);
m_MaterialEditor.ShaderProperty(tessellationObjectScale, Styles.tessellationObjectScaleText);
m_MaterialEditor.ShaderProperty(tessellationObjectScale, StylesBaseLit.tessellationObjectScaleText);
protected void FindCommonOptionProperties(MaterialProperty[] props)
// All Setup Keyword functions must be static. It allow to create script to automatically update the shaders with a script if ocde change
static public void SetupBaseLitKeywords(Material material)
surfaceType = FindProperty(kSurfaceType, props);
blendMode = FindProperty(kBlendMode, props);
alphaCutoff = FindProperty(kAlphaCutoff, props);
alphaCutoffEnable = FindProperty(kAlphaCutoffEnabled, props);
doubleSidedMode = FindProperty(kDoubleSidedMode, props);
distortionEnable = FindProperty(kDistortionEnable, props);
distortionOnly = FindProperty(kDistortionOnly, props);
distortionDepthTest = FindProperty(kDistortionDepthTest, props);
depthOffsetEnable = FindProperty(kDepthOffsetEnable, props);
horizonFade = FindProperty(kHorizonFade, props);
SetupBaseUnlitKeywords(material);
// tessellation specific, silent if not found
tessellationMode = FindProperty(kTessellationMode, props, false);
tessellationFactor = FindProperty(kTessellationFactor, props, false);
tessellationFactorMinDistance = FindProperty(kTessellationFactorMinDistance, props, false);
tessellationFactorMaxDistance = FindProperty(kTessellationFactorMaxDistance, props, false);
tessellationFactorTriangleSize = FindProperty(kTessellationFactorTriangleSize, props, false);
tessellationShapeFactor = FindProperty(kTessellationShapeFactor, props, false);
tessellationBackFaceCullEpsilon = FindProperty(kTessellationBackFaceCullEpsilon, props, false);
tessellationObjectScale = FindProperty(kTessellationObjectScale, props, false);
bool doubleSidedEnable = material.GetFloat(kDoubleSidedEnable) > 0.0f;
bool doubleSidedMirrorEnable = material.GetFloat(kDoubleSidedMirrorEnable) > 0.0f;
// Per pixel displacement
enablePerPixelDisplacement = FindProperty(kEnablePerPixelDisplacement, props);
ppdMinSamples = FindProperty(kPpdMinSamples, props);
ppdMaxSamples = FindProperty(kPpdMaxSamples, props);
ppdLodThreshold = FindProperty(kPpdLodThreshold, props);
}
if (doubleSidedEnable)
{
if (doubleSidedMirrorEnable)
{
// Mirror mode (in tangent space)
material.SetVector("_DoubleSidedConstants", new Vector4(1.0f, 1.0f, -1.0f, 0.0f));
}
else
{
// Flip mode (in tangent space)
material.SetVector("_DoubleSidedConstants", new Vector4(-1.0f, -1.0f, -1.0f, 0.0f));
}
}
protected void SetupCommonOptionsKeywords(Material material)
{
bool alphaTestEnable = material.GetFloat(kAlphaCutoffEnabled) == 1.0;
SurfaceType surfaceType = (SurfaceType)material.GetFloat(kSurfaceType);
BlendMode blendMode = (BlendMode)material.GetFloat(kBlendMode);
DoubleSidedMode doubleSidedMode = (DoubleSidedMode)material.GetFloat(kDoubleSidedMode);
bool depthOffsetEnable = material.GetFloat(kDepthOffsetEnable) > 0.0f;
SetKeyword(material, "_DEPTHOFFSET_ON", depthOffsetEnable);
if (surfaceType == SurfaceType.Opaque)
{
material.SetOverrideTag("RenderType", alphaTestEnable ? "TransparentCutout" : "");
material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One);
material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.Zero);
material.SetInt("_ZWrite", 1);
material.renderQueue = alphaTestEnable ? (int)UnityEngine.Rendering.RenderQueue.AlphaTest : -1;
}
else
int stencilRef = (int)UnityEngine.Experimental.Rendering.HDPipeline.StencilBits.Standard; // See 'StencilBits'.
if (material.HasProperty(kMaterialID))
material.SetOverrideTag("RenderType", "Transparent");
material.SetInt("_ZWrite", 0);
material.renderQueue = (int)UnityEngine.Rendering.RenderQueue.Transparent;
int materialID = (int)material.GetFloat(kMaterialID);
switch (blendMode)
switch (materialID)
case BlendMode.Lerp:
material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.SrcAlpha);
material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.OneMinusSrcAlpha);
case (int)UnityEngine.Experimental.Rendering.HDPipeline.Lit.MaterialId.LitSSS:
stencilRef = (int)UnityEngine.Experimental.Rendering.HDPipeline.StencilBits.SSS;
case BlendMode.Add:
material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One);
material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.One);
break;
case BlendMode.SoftAdd:
material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.OneMinusDstColor);
material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.One);
break;
case BlendMode.Multiply:
material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.DstColor);
material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.Zero);
case (int)UnityEngine.Experimental.Rendering.HDPipeline.Lit.MaterialId.LitStandard:
stencilRef = (int)UnityEngine.Experimental.Rendering.HDPipeline.StencilBits.Standard;
case BlendMode.Premultiply:
material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One);
material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.OneMinusSrcAlpha);
default:
stencilRef = 1 + materialID;
if (doubleSidedMode == DoubleSidedMode.None)
{
material.SetInt("_CullMode", (int)UnityEngine.Rendering.CullMode.Back);
}
else
{
material.SetInt("_CullMode", (int)UnityEngine.Rendering.CullMode.Off);
}
if (doubleSidedMode == DoubleSidedMode.DoubleSidedLightingFlip)
{
material.DisableKeyword("_DOUBLESIDED");
material.EnableKeyword("_DOUBLESIDED_LIGHTING_FLIP");
material.DisableKeyword("_DOUBLESIDED_LIGHTING_MIRROR");
}
else if (doubleSidedMode == DoubleSidedMode.DoubleSidedLightingMirror)
{
material.DisableKeyword("_DOUBLESIDED");
material.DisableKeyword("_DOUBLESIDED_LIGHTING_FLIP");
material.EnableKeyword("_DOUBLESIDED_LIGHTING_MIRROR");
}
else if (doubleSidedMode == DoubleSidedMode.DoubleSided)
{
material.EnableKeyword("_DOUBLESIDED");
material.DisableKeyword("_DOUBLESIDED_LIGHTING_FLIP");
material.DisableKeyword("_DOUBLESIDED_LIGHTING_MIRROR");
}
else
{
material.DisableKeyword("_DOUBLESIDED");
material.DisableKeyword("_DOUBLESIDED_LIGHTING_FLIP");
material.DisableKeyword("_DOUBLESIDED_LIGHTING_MIRROR");
}
SetKeyword(material, "_ALPHATEST_ON", alphaTestEnable);
bool distortionEnable = material.GetFloat(kDistortionEnable) == 1.0;
bool distortionOnly = material.GetFloat(kDistortionOnly) == 1.0;
bool distortionDepthTest = material.GetFloat(kDistortionDepthTest) == 1.0;
bool depthOffsetEnable = material.GetFloat(kDepthOffsetEnable) == 1.0;
if (distortionEnable)
{
material.SetShaderPassEnabled("DistortionVectors", true);
}
else
{
material.SetShaderPassEnabled("DistortionVectors", false);
}
if (distortionEnable && distortionOnly)
{
// Disable all passes except dbug material
material.SetShaderPassEnabled("GBuffer", false);
material.SetShaderPassEnabled("DebugViewMaterial", true);
material.SetShaderPassEnabled("Meta", false);
material.SetShaderPassEnabled("ShadowCaster", false);
material.SetShaderPassEnabled("DepthOnly", false);
material.SetShaderPassEnabled("MotionVectors", false);
material.SetShaderPassEnabled("Forward", false);
}
else
{
material.SetShaderPassEnabled("GBuffer", true);
material.SetShaderPassEnabled("DebugViewMaterial", true);
material.SetShaderPassEnabled("Meta", true);
material.SetShaderPassEnabled("ShadowCaster", true);
material.SetShaderPassEnabled("DepthOnly", true);
material.SetShaderPassEnabled("MotionVectors", true);
material.SetShaderPassEnabled("Forward", true);
}
if (distortionDepthTest)
{
material.SetInt("_ZTestMode", (int)UnityEngine.Rendering.CompareFunction.LessEqual);
}
else
{
material.SetInt("_ZTestMode", (int)UnityEngine.Rendering.CompareFunction.Always);
}
SetKeyword(material, "_DISTORTION_ON", distortionEnable);
SetKeyword(material, "_DEPTHOFFSET_ON", depthOffsetEnable);
material.SetInt("_StencilRef", stencilRef);
SetupEmissionGIFlags(material);
bool enablePerPixelDisplacement = material.GetFloat(kEnablePerPixelDisplacement) > 0.0f;
SetKeyword(material, "_PER_PIXEL_DISPLACEMENT", enablePerPixelDisplacement);
if (tessellationMode != null)
if (material.HasProperty(kTessellationMode))
{
TessellationMode tessMode = (TessellationMode)material.GetFloat(kTessellationMode);

}
}
protected void SetKeyword(Material m, string keyword, bool state)
static public void SetupBaseLitMaterialPass(Material material)
if (state)
m.EnableKeyword(keyword);
else
m.DisableKeyword(keyword);
}
bool distortionEnable = material.GetFloat(kDistortionEnable) > 0.0f;
bool distortionOnly = material.GetFloat(kDistortionOnly) > 0.0f;
public void ShaderPropertiesGUI(Material material)
{
// Use default labelWidth
EditorGUIUtility.labelWidth = 0f;
// Detect any changes to the material
EditorGUI.BeginChangeCheck();
if (distortionEnable && distortionOnly)
ShaderOptionsGUI();
EditorGUILayout.Space();
EditorGUILayout.Space();
ShaderInputGUI();
// Disable all passes except debug material
material.SetShaderPassEnabled("GBuffer", false);
material.SetShaderPassEnabled("DebugViewMaterial", true);
material.SetShaderPassEnabled("Meta", false);
material.SetShaderPassEnabled("ShadowCaster", false);
material.SetShaderPassEnabled("DepthOnly", false);
material.SetShaderPassEnabled("MotionVectors", false);
material.SetShaderPassEnabled("Forward", false);
if (EditorGUI.EndChangeCheck())
{
foreach (var obj in m_MaterialEditor.targets)
SetupMaterialKeywords((Material)obj);
}
}
public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] props)
{
FindCommonOptionProperties(props); // MaterialProperties can be animated so we do not cache them but fetch them every event to ensure animated values are updated correctly
FindMaterialProperties(props);
m_MaterialEditor = materialEditor;
Material material = materialEditor.target as Material;
ShaderPropertiesGUI(material);
}
// TODO: ? or remove
bool HasValidEmissiveKeyword(Material material)
{
/*
// Material animation might be out of sync with the material keyword.
// So if the emission support is disabled on the material, but the property blocks have a value that requires it, then we need to show a warning.
// (note: (Renderer MaterialPropertyBlock applies its values to emissionColorForRendering))
bool hasEmissionKeyword = material.IsKeywordEnabled ("_EMISSION");
if (!hasEmissionKeyword && ShouldEmissionBeEnabled (material, emissionColorForRendering.colorValue))
return false;
return true;
*/
return true;
}
protected virtual void SetupEmissionGIFlags(Material material)
{
// Setup lightmap emissive flags
MaterialGlobalIlluminationFlags flags = material.globalIlluminationFlags;
if ((flags & (MaterialGlobalIlluminationFlags.BakedEmissive | MaterialGlobalIlluminationFlags.RealtimeEmissive)) != 0)
if (ShouldEmissionBeEnabled(material))
flags &= ~MaterialGlobalIlluminationFlags.EmissiveIsBlack;
else
flags |= MaterialGlobalIlluminationFlags.EmissiveIsBlack;
material.globalIlluminationFlags = flags;
material.SetShaderPassEnabled("GBuffer", true);
material.SetShaderPassEnabled("DebugViewMaterial", true);
material.SetShaderPassEnabled("Meta", true);
material.SetShaderPassEnabled("ShadowCaster", true);
material.SetShaderPassEnabled("DepthOnly", true);
material.SetShaderPassEnabled("MotionVectors", true);
material.SetShaderPassEnabled("Forward", true);
protected MaterialEditor m_MaterialEditor;
MaterialProperty surfaceType = null;
const string kSurfaceType = "_SurfaceType";
MaterialProperty alphaCutoffEnable = null;
const string kAlphaCutoffEnabled = "_AlphaCutoffEnable";
MaterialProperty blendMode = null;
const string kBlendMode = "_BlendMode";
MaterialProperty alphaCutoff = null;
const string kAlphaCutoff = "_AlphaCutoff";
MaterialProperty doubleSidedMode = null;
const string kDoubleSidedMode = "_DoubleSidedMode";
MaterialProperty distortionEnable = null;
const string kDistortionEnable = "_DistortionEnable";
MaterialProperty distortionOnly = null;
const string kDistortionOnly = "_DistortionOnly";
MaterialProperty distortionDepthTest = null;
const string kDistortionDepthTest = "_DistortionDepthTest";
MaterialProperty depthOffsetEnable = null;
const string kDepthOffsetEnable = "_DepthOffsetEnable";
protected MaterialProperty horizonFade = null;
const string kHorizonFade = "_HorizonFade";
// tessellation params
protected MaterialProperty tessellationMode = null;
const string kTessellationMode = "_TessellationMode";
MaterialProperty tessellationFactor = null;
const string kTessellationFactor = "_TessellationFactor";
MaterialProperty tessellationFactorMinDistance = null;
const string kTessellationFactorMinDistance = "_TessellationFactorMinDistance";
MaterialProperty tessellationFactorMaxDistance = null;
const string kTessellationFactorMaxDistance = "_TessellationFactorMaxDistance";
MaterialProperty tessellationFactorTriangleSize = null;
const string kTessellationFactorTriangleSize = "_TessellationFactorTriangleSize";
MaterialProperty tessellationShapeFactor = null;
const string kTessellationShapeFactor = "_TessellationShapeFactor";
MaterialProperty tessellationBackFaceCullEpsilon = null;
const string kTessellationBackFaceCullEpsilon = "_TessellationBackFaceCullEpsilon";
MaterialProperty tessellationObjectScale = null;
const string kTessellationObjectScale = "_TessellationObjectScale";
// Per pixel displacement params
protected MaterialProperty enablePerPixelDisplacement = null;
protected const string kEnablePerPixelDisplacement = "_EnablePerPixelDisplacement";
protected MaterialProperty ppdMinSamples = null;
protected const string kPpdMinSamples = "_PPDMinSamples";
protected MaterialProperty ppdMaxSamples = null;
protected const string kPpdMaxSamples = "_PPDMaxSamples";
protected MaterialProperty ppdLodThreshold = null;
protected const string kPpdLodThreshold = "_PPDLodThreshold";
protected static string[] reservedProperties = new string[] { kSurfaceType, kBlendMode, kAlphaCutoff, kAlphaCutoffEnabled, kDoubleSidedMode };
protected abstract void FindMaterialProperties(MaterialProperty[] props);
protected abstract void ShaderInputGUI();
protected abstract void SetupMaterialKeywords(Material material);
protected abstract bool ShouldEmissionBeEnabled(Material material);
}
} // namespace UnityEditor

161
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Editor/LitUI.cs


{
class LitGUI : BaseLitGUI
{
protected static class Styles
{
public static string InputsText = "Inputs";
public static GUIContent baseColorText = new GUIContent("Base Color + Opacity", "Albedo (RGB) and Opacity (A)");
public static GUIContent baseColorSmoothnessText = new GUIContent("Base Color + Smoothness", "Albedo (RGB) and Smoothness (A)");
public static GUIContent smoothnessMapChannelText = new GUIContent("Smoothness Source", "Smoothness texture and channel");
public static GUIContent metallicText = new GUIContent("Metallic", "Metallic scale factor");
public static GUIContent smoothnessText = new GUIContent("Smoothness", "Smoothness scale factor");
public static GUIContent maskMapESText = new GUIContent("Mask Map - M(R), AO(G), E(B), S(A)", "Mask map");
public static GUIContent maskMapSText = new GUIContent("Mask Map - M(R), AO(G), S(A)", "Mask map");
public static GUIContent normalMapSpaceText = new GUIContent("Normal/Tangent Map space", "");
public static GUIContent normalMapText = new GUIContent("Normal Map", "Normal Map (DXT5) - Need to implement BC5");
public static GUIContent specularOcclusionMapText = new GUIContent("Specular Occlusion Map (RGBA)", "Specular Occlusion Map");
public static GUIContent horizonFadeText = new GUIContent("Horizon Fade (Spec occlusion)", "horizon fade is use to control specular occlusion");
public static GUIContent heightMapText = new GUIContent("Height Map (R)", "Height Map");
public static GUIContent heightMapAmplitudeText = new GUIContent("Height Map Amplitude", "Height Map amplitude in world units.");
public static GUIContent heightMapCenterText = new GUIContent("Height Map Center", "Center of the heightmap in the texture (between 0 and 1)");
public static GUIContent tangentMapText = new GUIContent("Tangent Map", "Tangent Map (BC5) - DXT5 for test");
public static GUIContent anisotropyText = new GUIContent("Anisotropy", "Anisotropy scale factor");
public static GUIContent anisotropyMapText = new GUIContent("Anisotropy Map (B)", "Anisotropy");
public static string textureControlText = "Input textures control";
public static GUIContent UVBaseMappingText = new GUIContent("Base UV mapping", "");
public static GUIContent texWorldScaleText = new GUIContent("World scale", "Tiling factor applied to Planar/Trilinear mapping");
// Details
public static string detailText = "Inputs Detail";
public static GUIContent detailMapModeText = new GUIContent("Detail Map with Normal", "Detail Map with AO / Height");
public static GUIContent UVDetailMappingText = new GUIContent("Detail UV mapping", "");
public static GUIContent detailMapNormalText = new GUIContent("Detail Map A(R) Ny(G) S(B) Nx(A)", "Detail Map");
public static GUIContent detailMaskText = new GUIContent("Detail Mask (G)", "Mask for detailMap");
public static GUIContent detailAlbedoScaleText = new GUIContent("Detail AlbedoScale", "Detail Albedo Scale factor");
public static GUIContent detailNormalScaleText = new GUIContent("Detail NormalScale", "Normal Scale factor");
public static GUIContent detailSmoothnessScaleText = new GUIContent("Detail SmoothnessScale", "Smoothness Scale factor");
// Subsurface
public static GUIContent subsurfaceProfileText = new GUIContent("Subsurface profile", "A profile determines the shape of the blur filter.");
public static GUIContent subsurfaceRadiusText = new GUIContent("Subsurface radius", "Determines the range of the blur.");
public static GUIContent subsurfaceRadiusMapText = new GUIContent("Subsurface radius map", "Determines the range of the blur.");
public static GUIContent thicknessText = new GUIContent("Thickness", "If subsurface scattering is enabled, low values allow some light to be transmitted through the object.");
public static GUIContent thicknessMapText = new GUIContent("Thickness map", "If subsurface scattering is enabled, low values allow some light to be transmitted through the object.");
// Emissive
public static string lightingText = "Inputs Lighting";
public static GUIContent emissiveText = new GUIContent("Emissive Color", "Emissive");
public static GUIContent emissiveIntensityText = new GUIContent("Emissive Intensity", "Emissive");
public static GUIContent emissiveColorModeText = new GUIContent("Emissive Color Usage", "Use emissive color or emissive mask");
}
public enum UVBaseMapping
{
UV0,

protected MaterialProperty UVMappingMask = null;
protected const string kUVMappingMask = "_UVMappingMask";
protected MaterialProperty UVMappingPlanar = null;
protected const string kUVMappingPlanar = "_UVMappingPlanar";
protected MaterialProperty normalMapSpace = null;
protected const string kNormalMapSpace = "_NormalMapSpace";
protected MaterialProperty UVDetail = null;
protected const string kUVDetail = "_UVDetail";
protected MaterialProperty UVDetailsMappingMask = null;
protected const string kUVDetailsMappingMask = "_UVDetailsMappingMask";
protected MaterialProperty emissiveColorMode = null;
protected const string kEmissiveColorMode = "_EmissiveColorMode";
protected const string kUVMappingPlanar = "_UVMappingPlanar";
protected MaterialProperty baseColor = null;
protected const string kBaseColor = "_BaseColor";

protected const string kMaskMap = "_MaskMap";
protected MaterialProperty specularOcclusionMap = null;
protected const string kSpecularOcclusionMap = "_SpecularOcclusionMap";
protected MaterialProperty horizonFade = null;
protected const string kHorizonFade = "_HorizonFade";
protected MaterialProperty normalMapSpace = null;
protected const string kNormalMapSpace = "_NormalMapSpace";
protected MaterialProperty heightMap = null;
protected const string kHeightMap = "_HeightMap";
protected MaterialProperty heightAmplitude = null;

protected MaterialProperty anisotropyMap = null;
protected const string kAnisotropyMap = "_AnisotropyMap";
protected MaterialProperty UVDetail = null;
protected const string kUVDetail = "_UVDetail";
protected MaterialProperty UVDetailsMappingMask = null;
protected const string kUVDetailsMappingMask = "_UVDetailsMappingMask";
protected MaterialProperty detailMap = null;
protected const string kDetailMap = "_DetailMap";
protected MaterialProperty detailMask = null;

protected MaterialProperty detailSmoothnessScale = null;
protected const string kDetailSmoothnessScale = "_DetailSmoothnessScale";
protected MaterialProperty emissiveColor = null;
protected const string kEmissiveColor = "_EmissiveColor";
protected MaterialProperty emissiveColorMap = null;
protected const string kEmissiveColorMap = "_EmissiveColorMap";
protected MaterialProperty emissiveIntensity = null;
protected const string kEmissiveIntensity = "_EmissiveIntensity";
protected MaterialProperty materialID = null;
protected const string kMaterialID = "_MaterialID";
protected MaterialProperty subsurfaceProfile = null;
protected const string kSubsurfaceProfile = "_SubsurfaceProfile";
protected MaterialProperty subsurfaceRadius = null;

protected MaterialProperty thicknessMap = null;
protected const string kThicknessMap = "_ThicknessMap";
override protected void FindMaterialProperties(MaterialProperty[] props)
protected MaterialProperty emissiveColorMode = null;
protected const string kEmissiveColorMode = "_EmissiveColorMode";
protected MaterialProperty emissiveColor = null;
protected const string kEmissiveColor = "_EmissiveColor";
protected MaterialProperty emissiveColorMap = null;
protected const string kEmissiveColorMap = "_EmissiveColorMap";
protected MaterialProperty emissiveIntensity = null;
protected const string kEmissiveIntensity = "_EmissiveIntensity";
protected override void FindMaterialProperties(MaterialProperty[] props)
normalMapSpace = FindProperty(kNormalMapSpace, props);
emissiveColorMode = FindProperty(kEmissiveColorMode, props);
UVBase = FindProperty(kUVBase, props);
TexWorldScale = FindProperty(kTexWorldScale, props);
UVMappingMask = FindProperty(kUVMappingMask, props);
UVMappingPlanar = FindProperty(kUVMappingPlanar, props);
baseColor = FindProperty(kBaseColor, props);
baseColorMap = FindProperty(kBaseColorMap, props);

specularOcclusionMap = FindProperty(kSpecularOcclusionMap, props);
horizonFade = FindProperty(kHorizonFade, props);
normalScale = FindProperty(kNormalScale, props);
normalScale = FindProperty(kNormalScale, props);
normalMapSpace = FindProperty(kNormalMapSpace, props);
heightMap = FindProperty(kHeightMap, props);
heightAmplitude = FindProperty(kHeightAmplitude, props);
heightCenter = FindProperty(kHeightCenter, props);

UVBase = FindProperty(kUVBase, props);
// Details
TexWorldScale = FindProperty(kTexWorldScale, props);
UVMappingMask = FindProperty(kUVMappingMask, props);
UVMappingPlanar = FindProperty(kUVMappingPlanar, props);
detailMap = FindProperty(kDetailMap, props);
detailMask = FindProperty(kDetailMask, props);
detailAlbedoScale = FindProperty(kDetailAlbedoScale, props);

// Sub surface
subsurfaceProfile = FindProperty(kSubsurfaceProfile, props);
subsurfaceRadius = FindProperty(kSubsurfaceRadius, props);
subsurfaceRadiusMap = FindProperty(kSubsurfaceRadiusMap, props);
thickness = FindProperty(kThickness, props);
thicknessMap = FindProperty(kThicknessMap, props);
// Emissive
emissiveColorMode = FindProperty(kEmissiveColorMode, props);
materialID = FindProperty(kMaterialID, props);
subsurfaceProfile = FindProperty(kSubsurfaceProfile, props);
subsurfaceRadius = FindProperty(kSubsurfaceRadius, props);
subsurfaceRadiusMap = FindProperty(kSubsurfaceRadiusMap, props);
thickness = FindProperty(kThickness, props);
thicknessMap = FindProperty(kThicknessMap, props);
}
protected void ShaderSSSInputGUI()

m_MaterialEditor.TexturePropertySingleLine(Styles.anisotropyMapText, anisotropyMap);
}
override protected void ShaderInputGUI()
{
protected override void MaterialPropertiesGUI()
{
m_MaterialEditor.ShaderProperty(materialID, Styles.materialIDText);
m_MaterialEditor.TexturePropertySingleLine(Styles.baseColorText, baseColorMap, baseColor);
m_MaterialEditor.ShaderProperty(metallic, Styles.metallicText);

m_MaterialEditor.TexturePropertySingleLine(Styles.maskMapSText, maskMap);
m_MaterialEditor.TexturePropertySingleLine(Styles.specularOcclusionMapText, specularOcclusionMap);
m_MaterialEditor.ShaderProperty(horizonFade, Styles.horizonFadeText);
m_MaterialEditor.ShaderProperty(normalMapSpace, Styles.normalMapSpaceText);
m_MaterialEditor.TexturePropertySingleLine(Styles.normalMapText, normalMap, normalScale);

m_MaterialEditor.TexturePropertySingleLine(Styles.emissiveText, emissiveColorMap, emissiveColor);
}
m_MaterialEditor.ShaderProperty(emissiveIntensity, Styles.emissiveIntensityText);
m_MaterialEditor.LightmapEmissionProperty(MaterialEditor.kMiniTextureFieldLabelIndentLevel + 1);
EditorGUI.indentLevel--;
m_MaterialEditor.ShaderProperty(emissiveIntensity, Styles.emissiveIntensityText);
EditorGUILayout.Space();
// The parent Base.ShaderPropertiesGUI will call DoEmissionArea
public override void AssignNewShaderToMaterial(Material material, Shader oldShader, Shader newShader)
protected override bool ShouldEmissionBeEnabled(Material mat)
base.AssignNewShaderToMaterial(material, oldShader, newShader);
return mat.GetFloat(kEmissiveIntensity) > 0.0f;
protected override bool ShouldEmissionBeEnabled(Material mat)
protected override void SetupMaterialKeywordsAndPassInternal(Material material)
float emissiveIntensity = mat.GetFloat(kEmissiveIntensity);
var realtimeEmission = (mat.globalIlluminationFlags & MaterialGlobalIlluminationFlags.RealtimeEmissive) > 0;
return emissiveIntensity > 0.0f || realtimeEmission;
SetupMaterialKeywordsAndPass(material);
override protected void SetupMaterialKeywords(Material material)
// All Setup Keyword functions must be static. It allow to create script to automatically update the shaders with a script if code change
static public void SetupMaterialKeywordsAndPass(Material material)
SetupCommonOptionsKeywords(material);
SetupBaseLitKeywords(material);
SetupBaseLitMaterialPass(material);
bool perPixelDisplacement = material.GetFloat(kEnablePerPixelDisplacement) == 1.0;
SetKeyword(material, "_PER_PIXEL_DISPLACEMENT", perPixelDisplacement);
SetKeyword(material, "_NORMALMAP", material.GetTexture(kNormalMap) || material.GetTexture(kDetailMap)); // With details map, we always use a normal map and Unity provide a default (0, 0, 1) normal map for ir
SetKeyword(material, "_NORMALMAP", material.GetTexture(kNormalMap) || material.GetTexture(kDetailMap)); // With details map, we always use a normal map and Unity provide a default (0, 0, 1) normal map for ir
SetKeyword(material, "_MASKMAP", material.GetTexture(kMaskMap));
SetKeyword(material, "_SPECULAROCCLUSIONMAP", material.GetTexture(kSpecularOcclusionMap));
SetKeyword(material, "_EMISSIVE_COLOR_MAP", material.GetTexture(kEmissiveColorMap));

SetKeyword(material, "_DETAIL_MAP", material.GetTexture(kDetailMap));
SetKeyword(material, "_SUBSURFACE_RADIUS_MAP", material.GetTexture(kSubsurfaceRadiusMap));
SetKeyword(material, "_THICKNESS_MAP", material.GetTexture(kThicknessMap));
bool needUV2 = (UVDetailMapping)material.GetFloat(kUVDetail) == UVDetailMapping.UV2 && (UVBaseMapping)material.GetFloat(kUVBase) == UVBaseMapping.UV0;
bool needUV3 = (UVDetailMapping)material.GetFloat(kUVDetail) == UVDetailMapping.UV3 && (UVBaseMapping)material.GetFloat(kUVBase) == UVBaseMapping.UV0;

material.DisableKeyword("_REQUIRE_UV2");
material.DisableKeyword("_REQUIRE_UV3");
}
material.SetInt("_StencilRef", (int)material.GetFloat(kMaterialID)); // See 'StencilBits'.
}
}
} // namespace UnityEditor

8
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.cs


// fold into fresnel0
// SSS
public float subsurfaceRadius;
public float thickness;
public int subsurfaceProfile;
public float subsurfaceRadius;
public float thickness;
public int subsurfaceProfile;
public bool enableTransmission;
public Vector3 transmittance;
// Clearcoat
public Vector3 coatNormalWS;

8
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.cs.hlsl


#define DEBUGVIEW_LIT_BSDFDATA_SUBSURFACE_RADIUS (1042)
#define DEBUGVIEW_LIT_BSDFDATA_THICKNESS (1043)
#define DEBUGVIEW_LIT_BSDFDATA_SUBSURFACE_PROFILE (1044)
#define DEBUGVIEW_LIT_BSDFDATA_COAT_NORMAL_WS (1045)
#define DEBUGVIEW_LIT_BSDFDATA_COAT_ROUGHNESS (1046)
#define DEBUGVIEW_LIT_BSDFDATA_ENABLE_TRANSMITTANCE (1045)
#define DEBUGVIEW_LIT_BSDFDATA_TRANSMITTANCE (1046)
#define DEBUGVIEW_LIT_BSDFDATA_COAT_NORMAL_WS (1047)
#define DEBUGVIEW_LIT_BSDFDATA_COAT_ROUGHNESS (1048)
//
// UnityEngine.Experimental.Rendering.HDPipeline.Lit.GBufferMaterial: static fields

float subsurfaceRadius;
float thickness;
int subsurfaceProfile;
bool enableTransmission;
float3 transmittance;
float3 coatNormalWS;
float coatRoughness;
};

149
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.hlsl


#define LTC_DISNEY_DIFFUSE_MATRIX_INDEX 1 // RGBA
#define LTC_MULTI_GGX_FRESNEL_DISNEY_DIFFUSE_INDEX 2 // RGB, A unused
// SSS parameters
#define N_PROFILES 8
uint _TransmissionFlags; // One bit per profile; 1 = enabled
float _ThicknessScales[N_PROFILES];
float4 _HalfRcpVariancesAndLerpWeights[N_PROFILES][2]; // 2x Gaussians per color channel, A is the the associated interpolation weight
//-----------------------------------------------------------------------------
// Helper functions/variable specific to this material
//-----------------------------------------------------------------------------

#endif
}
// Evaluates transmittance for a linear combination of two normalized 2D Gaussians.
// Computes results for each color channel separately.
// Ref: Real-Time Realistic Skin Translucency (2010), equation 9 (modified).
float3 ComputeTransmittance(float3 halfRcpVariance1, float lerpWeight1,
float3 halfRcpVariance2, float lerpWeight2,
float thickness, float radiusScale)
{
// Thickness and SSS radius are decoupled for artists.
// In theory, we should modify the thickness by the inverse of the radius scale of the profile.
// thickness /= radiusScale;
thickness *= 100;
float t2 = thickness * thickness;
// TODO: 6 exponentials is kind of expensive... Should we use a LUT instead?
// lerp(exp(-t2 * halfRcpVariance1), exp(-t2 * halfRcpVariance2), lerpWeight2)
return exp(-t2 * halfRcpVariance1) * lerpWeight1 + exp(-t2 * halfRcpVariance2) * lerpWeight2;
}
//-----------------------------------------------------------------------------
// conversion function for forward
//-----------------------------------------------------------------------------

{
bsdfData.diffuseColor = surfaceData.baseColor;
bsdfData.fresnel0 = 0.028; // TODO take from subsurfaceProfile
bsdfData.subsurfaceRadius = surfaceData.subsurfaceRadius;
bsdfData.thickness = surfaceData.thickness;
bsdfData.subsurfaceRadius = surfaceData.subsurfaceRadius * 0.01;
bsdfData.thickness = surfaceData.thickness * 0.01 * _ThicknessScales[bsdfData.subsurfaceProfile];
bsdfData.enableTransmission = (1 << bsdfData.subsurfaceProfile) & _TransmissionFlags;
if (bsdfData.enableTransmission)
{
bsdfData.transmittance = ComputeTransmittance(_HalfRcpVariancesAndLerpWeights[bsdfData.subsurfaceProfile][0].xyz,
_HalfRcpVariancesAndLerpWeights[bsdfData.subsurfaceProfile][0].w,
_HalfRcpVariancesAndLerpWeights[bsdfData.subsurfaceProfile][1].xyz,
_HalfRcpVariancesAndLerpWeights[bsdfData.subsurfaceProfile][1].w,
bsdfData.thickness, bsdfData.subsurfaceRadius);
}
}
else if (bsdfData.materialId == MATERIALID_LIT_CLEAR_COAT)
{

{
bsdfData.diffuseColor = baseColor;
bsdfData.fresnel0 = 0.028; // TODO take from subsurfaceProfile
bsdfData.subsurfaceRadius = inGBuffer2.r;
bsdfData.thickness = inGBuffer2.g;
bsdfData.subsurfaceRadius = inGBuffer2.r * 0.01;
bsdfData.thickness = inGBuffer2.g * 0.01 * _ThicknessScales[bsdfData.subsurfaceProfile];
bsdfData.enableTransmission = (1 << bsdfData.subsurfaceProfile) & _TransmissionFlags;
if (bsdfData.enableTransmission)
{
bsdfData.transmittance = ComputeTransmittance(_HalfRcpVariancesAndLerpWeights[bsdfData.subsurfaceProfile][0].xyz,
_HalfRcpVariancesAndLerpWeights[bsdfData.subsurfaceProfile][0].w,
_HalfRcpVariancesAndLerpWeights[bsdfData.subsurfaceProfile][1].xyz,
_HalfRcpVariancesAndLerpWeights[bsdfData.subsurfaceProfile][1].w,
bsdfData.thickness, bsdfData.subsurfaceRadius);
}
}
else if (bsdfData.materialId == MATERIALID_LIT_CLEAR_COAT)
{

#ifdef HAS_LIGHTLOOP
//-----------------------------------------------------------------------------
// BSDF share between directional light, punctual light and area light (reference)
// BSDF share between directional light, punctual light and area light (reference)
//-----------------------------------------------------------------------------
void BSDF( float3 V, float3 L, float3 positionWS, PreLightData preLightData, BSDFData bsdfData,

float3 L = -lightData.forward; // Lights are pointing backward in Unity
float illuminance = saturate(dot(bsdfData.normalWS, L));
diffuseLighting = float3(0.0, 0.0, 0.0);
specularLighting = float3(0.0, 0.0, 0.0);
float3 cookieColor = float3(1.0, 1.0, 1.0);
diffuseLighting = float3(0.0, 0.0, 0.0);
specularLighting = float3(0.0, 0.0, 0.0);
float4 cookie = float4(1.0, 1.0, 1.0, 1.0);
float shadowAttenuation = GetDirectionalShadowAttenuation(lightLoopContext.shadowContext, positionWS, lightData.shadowIndex, L, posInput.unPositionSS);
float shadow = GetDirectionalShadowAttenuation(lightLoopContext.shadowContext, positionWS, lightData.shadowIndex, L, posInput.unPositionSS);
float shadowAttenuation = GetDirectionalShadowAttenuation(lightLoopContext, positionWS, lightData.shadowIndex, L, posInput.unPositionSS);
float shadow = GetDirectionalShadowAttenuation(lightLoopContext, positionWS, lightData.shadowIndex, L, posInput.unPositionSS);
illuminance *= shadowAttenuation;
illuminance *= shadow;
}
[branch] if (lightData.cookieIndex >= 0 && illuminance > 0.0)

coord = coord * 0.5 + 0.5;
// Tile the texture if the 'repeat' wrap mode is enabled.
if (lightData.tileCookie)
if (lightData.tileCookie)
float4 cookie = SampleCookie2D(lightLoopContext, coord, lightData.cookieIndex);
cookie = SampleCookie2D(lightLoopContext, coord, lightData.cookieIndex);
cookieColor = cookie.rgb;
illuminance *= cookie.a;
}

diffuseLighting *= (cookieColor * lightData.color) * (illuminance * lightData.diffuseScale);
specularLighting *= (cookieColor * lightData.color) * (illuminance * lightData.specularScale);
diffuseLighting *= (cookie.rgb * lightData.color) * (illuminance * lightData.diffuseScale);
specularLighting *= (cookie.rgb * lightData.color) * (illuminance * lightData.specularScale);
}
[branch] if (bsdfData.enableTransmission)
{
// Reverse the normal.
illuminance = saturate(dot(-bsdfData.normalWS, L));
[branch] if (lightData.shadowIndex >= 0 && illuminance > 0.0)
{
// TODO: factor out the biased position?
float3 biasedPositionWS = positionWS + bsdfData.normalWS * bsdfData.thickness;
float shadow = GetDirectionalShadowAttenuation(lightLoopContext, biasedPositionWS, lightData.shadowIndex, L, posInput.unPositionSS);
illuminance *= shadow;
}
illuminance *= cookie.a;
// The difference between the Disney Diffuse and the Lambertian BRDF for transmittance is negligible.
float3 backLight = (cookie.rgb * lightData.color) * (illuminance * lightData.diffuseScale * Lambert());
// TODO: multiplication by 'diffuseColor' and 'transmittance' is the same for each light.
float3 transmittedLight = backLight * bsdfData.diffuseColor * bsdfData.transmittance;
// We use diffuse lighting for accumulation since it is going to be blurred during the SSS pass.
diffuseLighting += transmittedLight;
}
}

attenuation *= GetAngleAttenuation(L, -lightData.forward, lightData.angleScale, lightData.angleOffset);
float illuminance = saturate(dot(bsdfData.normalWS, L)) * attenuation;
diffuseLighting = float3(0.0, 0.0, 0.0);
specularLighting = float3(0.0, 0.0, 0.0);
float3 cookieColor = float3(1.0, 1.0, 1.0);
diffuseLighting = float3(0.0, 0.0, 0.0);
specularLighting = float3(0.0, 0.0, 0.0);
float4 cookie = float4(1.0, 1.0, 1.0, 1.0);
// TODO: measure impact of having all these dynamic branch here and the gain (or not) of testing illuminace > 0

{
float3 offset = float3(0.0, 0.0, 0.0); // GetShadowPosOffset(nDotL, normal);
#ifdef SHADOWS_USE_SHADOWCTXT
float shadowAttenuation = GetPunctualShadowAttenuation(lightLoopContext.shadowContext, positionWS + offset, lightData.shadowIndex, L, posInput.unPositionSS);
float shadow = GetPunctualShadowAttenuation(lightLoopContext.shadowContext, positionWS + offset, lightData.shadowIndex, L, posInput.unPositionSS);
float shadowAttenuation = GetPunctualShadowAttenuation(lightLoopContext, lightData.lightType, positionWS + offset, lightData.shadowIndex, L, posInput.unPositionSS);
float shadow = GetPunctualShadowAttenuation(lightLoopContext, lightData.lightType, positionWS + offset, lightData.shadowIndex, L, posInput.unPositionSS);
shadowAttenuation = lerp(1.0, shadowAttenuation, lightData.shadowDimmer);
shadow = lerp(1.0, shadow, lightData.shadowDimmer);
illuminance *= shadowAttenuation;
illuminance *= shadow;
}
[branch] if (lightData.cookieIndex >= 0 && illuminance > 0.0)

// Rotate 'L' into the light space.
// We perform the negation because lights are oriented backwards (-Z).
float3 coord = mul(-L, transpose(lightToWorld));
float4 cookie;
[branch] if (lightData.lightType == GPULIGHTTYPE_SPOT)
{

cookie = SampleCookieCube(lightLoopContext, coord, lightData.cookieIndex);
}
cookieColor = cookie.rgb;
illuminance *= cookie.a;
}

diffuseLighting *= (cookieColor * lightData.color) * (illuminance * lightData.diffuseScale);
specularLighting *= (cookieColor * lightData.color) * (illuminance * lightData.specularScale);
diffuseLighting *= (cookie.rgb * lightData.color) * (illuminance * lightData.diffuseScale);
specularLighting *= (cookie.rgb * lightData.color) * (illuminance * lightData.specularScale);
}
[branch] if (bsdfData.enableTransmission)
{
// Reverse the normal.
illuminance = saturate(dot(-bsdfData.normalWS, L)) * attenuation;
[branch] if (lightData.shadowIndex >= 0 && illuminance > 0.0)
{
// TODO: factor out the common biased position?
float3 biasedPositionWS = positionWS + bsdfData.normalWS * bsdfData.thickness;
float3 offset = float3(0.0, 0.0, 0.0); // GetShadowPosOffset(nDotL, normal);
float shadow = GetPunctualShadowAttenuation(lightLoopContext, lightData.lightType, biasedPositionWS + offset, lightData.shadowIndex, L, posInput.unPositionSS);
shadow = lerp(1.0, shadow, lightData.shadowDimmer);
illuminance *= shadow;
}
illuminance *= cookie.a;
// The difference between the Disney Diffuse and the Lambertian BRDF for transmittance is negligible.
float3 backLight = (cookie.rgb * lightData.color) * (illuminance * lightData.diffuseScale * Lambert());
// TODO: multiplication by 'diffuseColor' and 'transmittance' is the same for each light.
float3 transmittedLight = backLight * bsdfData.diffuseColor * bsdfData.transmittance;
// We use diffuse lighting for accumulation since it is going to be blurred during the SSS pass.
diffuseLighting += transmittedLight;
}
}

37
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.shader


_Anisotropy("Anisotropy", Range(0.0, 1.0)) = 0
_AnisotropyMap("AnisotropyMap", 2D) = "white" {}
[Enum(Standard, 0, Subsurface Scattering, 1, Clear Coat, 2, Specular Color, 3)] _MaterialID("MaterialId", Int) = 0
_Thickness("Thickness", Range(0.004, 1.0)) = 0.5
_Thickness("Thickness", Range(0.004, 1.0)) = 1.0
_ThicknessMap("Thickness Map", 2D) = "white" {}
//_CoatCoverage("CoatCoverage", Range(0.0, 1.0)) = 0

_HorizonFade("Horizon fade", Range(0.0, 5.0)) = 1.0
// Stencil state
[HideInInspector] _StencilRef("_StencilRef", Int) = 0
[HideInInspector] _StencilRef("_StencilRef", Int) = 1
// Blending state
[HideInInspector] _SurfaceType("__surfacetype", Float) = 0.0

[HideInInspector] _CullMode("__cullmode", Float) = 2.0
[HideInInspector] _ZTestMode("_ZTestMode", Int) = 8
// Material Id
[HideInInspector] _MaterialId("_MaterialId", FLoat) = 0
[Enum(None, 0, DoubleSided, 1, DoubleSidedLigthingFlip, 2, DoubleSidedLigthingMirror, 3)] _DoubleSidedMode("Double sided mode", Float) = 0
[ToggleOff] _DoubleSidedEnable("Double sided enable", Float) = 0.0
[ToggleOff] _DoubleSidedMirrorEnable("Double sided mirror enable", Float) = 1.0
[HideInInspector] _DoubleSidedConstants("_DoubleSidedConstants", Vector) = (1, 1, -1, 0)
[Enum(UV0, 0, Planar, 1, TriPlanar, 2)] _UVBase("UV Set for base", Float) = 0
_TexWorldScale("Scale to apply on world coordinate", Float) = 1.0

[Enum(Standard, 0, Subsurface Scattering, 1, Clear Coat, 2, Specular Color, 3)] _MaterialID("MaterialId", Int) = 0
[ToggleOff] _EnablePerPixelDisplacement("Enable per pixel displacement", Float) = 0.0
_PPDMinSamples("Min sample for POM", Range(1.0, 64.0)) = 5
_PPDMaxSamples("Max sample for POM", Range(1.0, 64.0)) = 15

[Enum(Use Emissive Color, 0, Use Emissive Mask, 1)] _EmissiveColorMode("Emissive color mode", Float) = 1
[Enum(Use Emissive Color, 0, Use Emissive Mask, 1)] _EmissiveColorMode("Emissive color mode", Float) = 1
// Caution: C# code in BaseLitUI.cs call LightmapEmissionFlagsProperty() which assume that there is an existing "_EmissionColor"
// value that exist to identify if the GI emission need to be enabled.
// In our case we don't use such a mechanism but need to keep the code quiet. We declare the value and always enable it.
// TODO: Fix the code in legacy unity so we can customize the beahvior for GI
_EmissionColor("Color", Color) = (1, 1, 1)
}
HLSLINCLUDE

// #pragma enable_d3d11_debug_symbols
//-------------------------------------------------------------------------------------
// Variant

#pragma shader_feature _DISTORTION_ON
#pragma shader_feature _DEPTHOFFSET_ON
#pragma shader_feature _ _DOUBLESIDED _DOUBLESIDED_LIGHTING_FLIP _DOUBLESIDED_LIGHTING_MIRROR
#pragma shader_feature _DOUBLESIDED_ON
#pragma shader_feature _PER_PIXEL_DISPLACEMENT
#pragma shader_feature _PER_PIXEL_DISPLACEMENT
#pragma shader_feature _ _REQUIRE_UV2 _REQUIRE_UV3
#pragma shader_feature _EMISSIVE_COLOR

#pragma shader_feature _DETAIL_MAP
#pragma shader_feature _SUBSURFACE_RADIUS_MAP
#pragma shader_feature _THICKNESS_MAP
#pragma shader_feature _SUBSURFACE_SCATTERING
#pragma multi_compile LIGHTMAP_OFF LIGHTMAP_ON
#pragma multi_compile DIRLIGHTMAP_OFF DIRLIGHTMAP_COMBINED

Name "GBuffer" // Name is not used
Tags { "LightMode" = "GBuffer" } // This will be only for opaque object based on the RenderQueue index
Cull [_CullMode]
Cull [_CullMode]
Stencil
{

Name "GBufferDebugLighting" // Name is not used
Tags{ "LightMode" = "GBufferDebugLighting" } // This will be only for opaque object based on the RenderQueue index
Cull[_CullMode]
Cull [_CullMode]
Stencil
Stencil
Ref[_StencilRef]
Ref [_StencilRef]
Comp Always
Pass Replace
}

105
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitData.hlsl


#ifndef LAYERED_LIT_SHADER
#define SAMPLER_NORMALMAP_IDX sampler_NormalMap
#define SAMPLER_DETAILMASK_IDX sampler_DetailMask
#define SAMPLER_DETAILMAP_IDX sampler_DetailMap
#define SAMPLER_MASKMAP_IDX sampler_MaskMap
#define SAMPLER_SPECULAROCCLUSIONMAP_IDX sampler_SpecularOcclusionMap
#define SAMPLER_HEIGHTMAP_IDX sampler_HeightMap
// include LitDataInternal to define GetSurfaceData
#define LAYER_INDEX 0
#define ADD_IDX(Name) Name

#else
// Number of sampler are limited, we need to share sampler as much as possible with lit material
// for this we put the constraint that the sampler are the same in a layered material for all textures of the same type
// then we take the sampler matching the first textures use of this type
#if defined(_NORMALMAP0)
#define SAMPLER_NORMALMAP_IDX sampler_NormalMap0
#elif defined(_NORMALMAP1)
#define SAMPLER_NORMALMAP_IDX sampler_NormalMap1
#elif defined(_NORMALMAP2)
#define SAMPLER_NORMALMAP_IDX sampler_NormalMap2
#else
#define SAMPLER_NORMALMAP_IDX sampler_NormalMap3
#endif
#if defined(_DETAIL_MAP0)
#define SAMPLER_DETAILMASK_IDX sampler_DetailMask0
#define SAMPLER_DETAILMAP_IDX sampler_DetailMap0
#elif defined(_DETAIL_MAP1)
#define SAMPLER_DETAILMASK_IDX sampler_DetailMask1
#define SAMPLER_DETAILMAP_IDX sampler_DetailMap1
#elif defined(_DETAIL_MAP2)
#define SAMPLER_DETAILMASK_IDX sampler_DetailMask2
#define SAMPLER_DETAILMAP_IDX sampler_DetailMap2
#else
#define SAMPLER_DETAILMASK_IDX sampler_DetailMask3
#define SAMPLER_DETAILMAP_IDX sampler_DetailMap3
#endif
#if defined(_MASKMAP0)
#define SAMPLER_MASKMAP_IDX sampler_MaskMap0
#elif defined(_MASKMAP1)
#define SAMPLER_MASKMAP_IDX sampler_MaskMap1
#elif defined(_MASKMAP2)
#define SAMPLER_MASKMAP_IDX sampler_MaskMap2
#else
#define SAMPLER_MASKMAP_IDX sampler_MaskMap3
#endif
#if defined(_SPECULAROCCLUSIONMAP0)
#define SAMPLER_SPECULAROCCLUSIONMAP_IDX sampler_SpecularOcclusionMap0
#elif defined(_SPECULAROCCLUSIONMAP1)
#define SAMPLER_SPECULAROCCLUSIONMAP_IDX sampler_SpecularOcclusionMap1
#elif defined(_SPECULAROCCLUSIONMAP2)
#define SAMPLER_SPECULAROCCLUSIONMAP_IDX sampler_SpecularOcclusionMap2
#else
#define SAMPLER_SPECULAROCCLUSIONMAP_IDX sampler_SpecularOcclusionMap3
#endif
#if defined(_HEIGHTMAP0)
#define SAMPLER_HEIGHTMAP_IDX sampler_HeightMap0
#elif defined(_HEIGHTMAP1)
#define SAMPLER_HEIGHTMAP_IDX sampler_HeightMap1
#elif defined(_HEIGHTMAP2)
#define SAMPLER_HEIGHTMAP_IDX sampler_HeightMap2
#elif defined(_HEIGHTMAP3)
#define SAMPLER_HEIGHTMAP_IDX sampler_HeightMap3
#endif
// Define a helper macro
#define ADD_ZERO_IDX(Name) Name##0
// include LitDataInternal multiple time to define the variation of GetSurfaceData for each layer

return result;
}
#define SURFACEDATA_BLEND_VECTOR3(surfaceData, name, mask) BlendLayeredVector3(surfaceData##0.##name, surfaceData##1.##name, surfaceData##2.##name, surfaceData##3.##name, mask);
#define SURFACEDATA_BLEND_SCALAR(surfaceData, name, mask) BlendLayeredScalar(surfaceData##0.##name, surfaceData##1.##name, surfaceData##2.##name, surfaceData##3.##name, mask);
#define SURFACEDATA_BLEND_VECTOR3(surfaceData, name, mask) BlendLayeredVector3(MERGE_NAME(surfaceData, 0) MERGE_NAME(., name), MERGE_NAME(surfaceData, 1) MERGE_NAME(., name), MERGE_NAME(surfaceData, 2) MERGE_NAME(., name), MERGE_NAME(surfaceData, 3) MERGE_NAME(., name), mask);
#define SURFACEDATA_BLEND_SCALAR(surfaceData, name, mask) BlendLayeredScalar(MERGE_NAME(surfaceData, 0) MERGE_NAME(., name), MERGE_NAME(surfaceData, 1) MERGE_NAME(., name), MERGE_NAME(surfaceData, 2) MERGE_NAME(., name), MERGE_NAME(surfaceData, 3) MERGE_NAME(., name), mask);
#define PROP_BLEND_SCALAR(name, mask) BlendLayeredScalar(name##0, name##1, name##2, name##3, mask);
void GetLayerTexCoord(float2 texCoord0, float2 texCoord1, float2 texCoord2, float2 texCoord3,

positionWS, normalWS, _UVMappingPlanar3 > 0.0, isTriplanar, _TexWorldScale3, layerTexCoord, _LayerTiling3 * tileObjectScale);
}
#if defined(_HEIGHTMAP0)
#define sampler_ShareHeightMap sampler_HeightMap0
#elif defined(_HEIGHTMAP1)
#define sampler_ShareHeightMap sampler_HeightMap1
#elif defined(_HEIGHTMAP2)
#define sampler_ShareHeightMap sampler_HeightMap2
#elif defined(_HEIGHTMAP3)
#define sampler_ShareHeightMap sampler_HeightMap3
#endif
// This function is just syntaxic sugar to nullify height not used based on heightmap avaibility and layer
void SetEnabledHeightByLayer(inout float height0, inout float height1, inout float height2, inout float height3)
{

// Note: No multiply by amplitude here, this is bake into the weights and apply in BlendLayeredScalar
// The amplitude is normalize to be able to work with POM algorithm
// Tiling is automatically handled correctly here as we use 4 differents uv even if they come from the same UVSet (they include the tiling)
float height0 = SAMPLE_TEXTURE2D_LOD(_HeightMap0, sampler_ShareHeightMap, param.uv[0] + texOffsetCurrent, lod).r;
float height1 = SAMPLE_TEXTURE2D_LOD(_HeightMap1, sampler_ShareHeightMap, param.uv[1] + texOffsetCurrent, lod).r;
float height2 = SAMPLE_TEXTURE2D_LOD(_HeightMap2, sampler_ShareHeightMap, param.uv[2] + texOffsetCurrent, lod).r;
float height3 = SAMPLE_TEXTURE2D_LOD(_HeightMap3, sampler_ShareHeightMap, param.uv[3] + texOffsetCurrent, lod).r;
float height0 = SAMPLE_TEXTURE2D_LOD(_HeightMap0, SAMPLER_HEIGHTMAP_IDX, param.uv[0] + texOffsetCurrent, lod).r;
float height1 = SAMPLE_TEXTURE2D_LOD(_HeightMap1, SAMPLER_HEIGHTMAP_IDX, param.uv[1] + texOffsetCurrent, lod).r;
float height2 = SAMPLE_TEXTURE2D_LOD(_HeightMap2, SAMPLER_HEIGHTMAP_IDX, param.uv[2] + texOffsetCurrent, lod).r;
float height3 = SAMPLE_TEXTURE2D_LOD(_HeightMap3, SAMPLER_HEIGHTMAP_IDX, param.uv[3] + texOffsetCurrent, lod).r;
SetEnabledHeightByLayer(height0, height1, height2, height3); // Not needed as already put in weights but paranoid mode
return BlendLayeredScalar(height0, height1, height2, height3, param.weights) + height0 * param.mainHeightInfluence;
#else

ComputeMaskWeights(blendMasks, weights);
#if defined(_HEIGHTMAP0) || defined(_HEIGHTMAP1) || defined(_HEIGHTMAP2) || defined(_HEIGHTMAP3)
float height0 = (SAMPLE_LAYER_TEXTURE2D_LOD(_HeightMap0, sampler_ShareHeightMap, layerTexCoord.base0, lod).r - _LayerCenterOffset0) * _LayerHeightAmplitude0;
float height1 = (SAMPLE_LAYER_TEXTURE2D_LOD(_HeightMap1, sampler_ShareHeightMap, layerTexCoord.base1, lod).r - _LayerCenterOffset1) * _LayerHeightAmplitude1;
float height2 = (SAMPLE_LAYER_TEXTURE2D_LOD(_HeightMap2, sampler_ShareHeightMap, layerTexCoord.base2, lod).r - _LayerCenterOffset2) * _LayerHeightAmplitude2;
float height3 = (SAMPLE_LAYER_TEXTURE2D_LOD(_HeightMap3, sampler_ShareHeightMap, layerTexCoord.base3, lod).r - _LayerCenterOffset3) * _LayerHeightAmplitude3;
float height0 = (SAMPLE_LAYER_TEXTURE2D_LOD(_HeightMap0, SAMPLER_HEIGHTMAP_IDX, layerTexCoord.base0, lod).r - _LayerCenterOffset0) * _LayerHeightAmplitude0;
float height1 = (SAMPLE_LAYER_TEXTURE2D_LOD(_HeightMap1, SAMPLER_HEIGHTMAP_IDX, layerTexCoord.base1, lod).r - _LayerCenterOffset1) * _LayerHeightAmplitude1;
float height2 = (SAMPLE_LAYER_TEXTURE2D_LOD(_HeightMap2, SAMPLER_HEIGHTMAP_IDX, layerTexCoord.base2, lod).r - _LayerCenterOffset2) * _LayerHeightAmplitude2;
float height3 = (SAMPLE_LAYER_TEXTURE2D_LOD(_HeightMap3, SAMPLER_HEIGHTMAP_IDX, layerTexCoord.base3, lod).r - _LayerCenterOffset3) * _LayerHeightAmplitude3;
SetEnabledHeightByLayer(height0, height1, height2, height3);
float heightResult = BlendLayeredScalar(height0, height1, height2, height3, weights);

#if defined(_HEIGHT_BASED_BLEND)
#if defined(_HEIGHTMAP0) || defined(_HEIGHTMAP1) || defined(_HEIGHTMAP2) || defined(_HEIGHTMAP3)
float height0 = (SAMPLE_LAYER_TEXTURE2D(_HeightMap0, sampler_ShareHeightMap, layerTexCoord.base0).r - _LayerCenterOffset0) * _LayerHeightAmplitude0;
float height1 = (SAMPLE_LAYER_TEXTURE2D(_HeightMap1, sampler_ShareHeightMap, layerTexCoord.base1).r - _LayerCenterOffset1) * _LayerHeightAmplitude1;
float height2 = (SAMPLE_LAYER_TEXTURE2D(_HeightMap2, sampler_ShareHeightMap, layerTexCoord.base2).r - _LayerCenterOffset2) * _LayerHeightAmplitude2;
float height3 = (SAMPLE_LAYER_TEXTURE2D(_HeightMap3, sampler_ShareHeightMap, layerTexCoord.base3).r - _LayerCenterOffset3) * _LayerHeightAmplitude3;
float height0 = (SAMPLE_LAYER_TEXTURE2D(_HeightMap0, SAMPLER_HEIGHTMAP_IDX, layerTexCoord.base0).r - _LayerCenterOffset0) * _LayerHeightAmplitude0;
float height1 = (SAMPLE_LAYER_TEXTURE2D(_HeightMap1, SAMPLER_HEIGHTMAP_IDX, layerTexCoord.base1).r - _LayerCenterOffset1) * _LayerHeightAmplitude1;
float height2 = (SAMPLE_LAYER_TEXTURE2D(_HeightMap2, SAMPLER_HEIGHTMAP_IDX, layerTexCoord.base2).r - _LayerCenterOffset2) * _LayerHeightAmplitude2;
float height3 = (SAMPLE_LAYER_TEXTURE2D(_HeightMap3, SAMPLER_HEIGHTMAP_IDX, layerTexCoord.base3).r - _LayerCenterOffset3) * _LayerHeightAmplitude3;
SetEnabledHeightByLayer(height0, height1, height2, height3);
float4 heights = float4(height0, height1, height2, height3);

41
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitDataInternal.hlsl


#ifdef _NORMALMAP_TANGENT_SPACE_IDX
if (useBias)
{
normalTS = SAMPLE_LAYER_NORMALMAP_BIAS(ADD_IDX(_NormalMap), ADD_ZERO_IDX(sampler_NormalMap), ADD_IDX(layerTexCoord.base), ADD_IDX(_NormalScale), bias);
normalTS = SAMPLE_LAYER_NORMALMAP_BIAS(ADD_IDX(_NormalMap), SAMPLER_NORMALMAP_IDX, ADD_IDX(layerTexCoord.base), ADD_IDX(_NormalScale), bias);
normalTS = SAMPLE_LAYER_NORMALMAP(ADD_IDX(_NormalMap), ADD_ZERO_IDX(sampler_NormalMap), ADD_IDX(layerTexCoord.base), ADD_IDX(_NormalScale));
normalTS = SAMPLE_LAYER_NORMALMAP(ADD_IDX(_NormalMap), SAMPLER_NORMALMAP_IDX, ADD_IDX(layerTexCoord.base), ADD_IDX(_NormalScale));
}
#else // Object space
// to be able to combine object space normal with detail map we transform it to tangent space (object space normal composition is complex operation).

float3 normalOS = SAMPLE_LAYER_NORMALMAP_RGB_BIAS(ADD_IDX(_NormalMap), ADD_ZERO_IDX(sampler_NormalMap), ADD_IDX(layerTexCoord.base), ADD_IDX(_NormalScale), bias).rgb;
float3 normalOS = SAMPLE_LAYER_NORMALMAP_RGB_BIAS(ADD_IDX(_NormalMap), SAMPLER_NORMALMAP_IDX, ADD_IDX(layerTexCoord.base), ADD_IDX(_NormalScale), bias).rgb;
float3 normalOS = SAMPLE_LAYER_NORMALMAP_RGB(ADD_IDX(_NormalMap), ADD_ZERO_IDX(sampler_NormalMap), ADD_IDX(layerTexCoord.base), ADD_IDX(_NormalScale)).rgb;
float3 normalOS = SAMPLE_LAYER_NORMALMAP_RGB(ADD_IDX(_NormalMap), SAMPLER_NORMALMAP_IDX, ADD_IDX(layerTexCoord.base), ADD_IDX(_NormalScale)).rgb;
normalTS = TransformObjectToTangent(normalOS, input.tangentToWorld);
}
#endif

normalTS = float3(0.0, 0.0, 1.0);
#endif
#if defined(_DOUBLESIDED_LIGHTING_FLIP) || defined(_DOUBLESIDED_LIGHTING_MIRROR)
#ifdef _DOUBLESIDED_LIGHTING_FLIP
float3 oppositeNormalTS = -normalTS;
#else
// Mirror the normal with the plane define by vertex normal
float3 oppositeNormalTS = reflect(normalTS, float3(0.0, 0.0, 1.0)); // Reflect around vertex normal (in tangent space this is z)
#endif
#ifdef _DOUBLESIDED_ON
// _DoubleSidedMode is float3(-1, -1, -1) in flip mode and float3(1, 1, -1) in mirror mode (Mirror the normal with the plane define by vertex normal)
float3 oppositeNormalTS = normalTS * _DoubleSidedConstants.xyz;
normalTS = input.isFrontFace ?
(GetOddNegativeScale() >= 0.0 ? normalTS : oppositeNormalTS) :
(-GetOddNegativeScale() >= 0.0 ? normalTS : oppositeNormalTS);
normalTS = input.isFrontFace ? (GetOddNegativeScale() >= 0.0 ? normalTS : oppositeNormalTS) : (-GetOddNegativeScale() >= 0.0 ? normalTS : oppositeNormalTS);
#endif
return normalTS;

float3 detailNormalTS = float3(0.0, 0.0, 0.0);
float detailMask = 0.0;
#ifdef _DETAIL_MAP_IDX
detailMask = SAMPLE_LAYER_TEXTURE2D(ADD_IDX(_DetailMask), ADD_ZERO_IDX(sampler_DetailMask), ADD_IDX(layerTexCoord.base)).g;
float2 detailAlbedoAndSmoothness = SAMPLE_LAYER_TEXTURE2D(ADD_IDX(_DetailMap), ADD_ZERO_IDX(sampler_DetailMap), ADD_IDX(layerTexCoord.details)).rb;
detailMask = SAMPLE_LAYER_TEXTURE2D(ADD_IDX(_DetailMask), SAMPLER_DETAILMASK_IDX, ADD_IDX(layerTexCoord.base)).g;
float2 detailAlbedoAndSmoothness = SAMPLE_LAYER_TEXTURE2D(ADD_IDX(_DetailMap), SAMPLER_DETAILMAP_IDX, ADD_IDX(layerTexCoord.details)).rb;
detailNormalTS = SAMPLE_LAYER_NORMALMAP_AG(ADD_IDX(_DetailMap), ADD_ZERO_IDX(sampler_DetailMap), ADD_IDX(layerTexCoord.details), ADD_ZERO_IDX(_DetailNormalScale));
detailNormalTS = SAMPLE_LAYER_NORMALMAP_AG(ADD_IDX(_DetailMap), SAMPLER_DETAILMAP_IDX, ADD_IDX(layerTexCoord.details), ADD_ZERO_IDX(_DetailNormalScale));
#endif
surfaceData.baseColor = SAMPLE_LAYER_TEXTURE2D(ADD_IDX(_BaseColorMap), ADD_ZERO_IDX(sampler_BaseColorMap), ADD_IDX(layerTexCoord.base)).rgb * ADD_IDX(_BaseColor).rgb;

#ifdef _SPECULAROCCLUSIONMAP_IDX
// TODO: Do something. For now just take alpha channel
surfaceData.specularOcclusion = SAMPLE_LAYER_TEXTURE2D(ADD_IDX(_SpecularOcclusionMap), ADD_ZERO_IDX(sampler_SpecularOcclusionMap), ADD_IDX(layerTexCoord.base)).a;
surfaceData.specularOcclusion = SAMPLE_LAYER_TEXTURE2D(ADD_IDX(_SpecularOcclusionMap), SAMPLER_SPECULAROCCLUSIONMAP_IDX, ADD_IDX(layerTexCoord.base)).a;
#else
// The specular occlusion will be perform outside the internal loop
surfaceData.specularOcclusion = 1.0;

normalTS = ADD_IDX(GetNormalTS)(input, layerTexCoord, detailNormalTS, detailMask, false, 0.0);
#if defined(_MASKMAP_IDX)
surfaceData.perceptualSmoothness = SAMPLE_LAYER_TEXTURE2D(ADD_IDX(_MaskMap), ADD_ZERO_IDX(sampler_MaskMap), ADD_IDX(layerTexCoord.base)).a;
surfaceData.perceptualSmoothness = SAMPLE_LAYER_TEXTURE2D(ADD_IDX(_MaskMap), SAMPLER_MASKMAP_IDX, ADD_IDX(layerTexCoord.base)).a;
#else
surfaceData.perceptualSmoothness = 1.0;
#endif

// MaskMap is RGBA: Metallic, Ambient Occlusion (Optional), emissive Mask (Optional), Smoothness
#ifdef _MASKMAP_IDX
surfaceData.metallic = SAMPLE_LAYER_TEXTURE2D(ADD_IDX(_MaskMap), ADD_ZERO_IDX(sampler_MaskMap), ADD_IDX(layerTexCoord.base)).r;
surfaceData.ambientOcclusion = SAMPLE_LAYER_TEXTURE2D(ADD_IDX(_MaskMap), ADD_ZERO_IDX(sampler_MaskMap), ADD_IDX(layerTexCoord.base)).g;
surfaceData.metallic = SAMPLE_LAYER_TEXTURE2D(ADD_IDX(_MaskMap), SAMPLER_MASKMAP_IDX, ADD_IDX(layerTexCoord.base)).r;
surfaceData.ambientOcclusion = SAMPLE_LAYER_TEXTURE2D(ADD_IDX(_MaskMap), SAMPLER_MASKMAP_IDX, ADD_IDX(layerTexCoord.base)).g;
#else
surfaceData.metallic = 1.0;
surfaceData.ambientOcclusion = 1.0;

// This part of the code is not used in case of layered shader but we keep the same macro system for simplicity
#if !defined(LAYERED_LIT_SHADER)
#ifdef _SUBSURFACE_SCATTERING
#else
surfaceData.materialId = (_MaterialID == MATERIALID_LIT_SSS) ? 0 : _MaterialID;
#endif
// TODO: think about using BC5
#ifdef _TANGENTMAP

#else
surfaceData.subsurfaceRadius = _SubsurfaceRadius;
#endif
surfaceData.subsurfaceProfile = 0;
#ifdef _THICKNESS_MAP
surfaceData.thickness = SAMPLE_LAYER_TEXTURE2D(ADD_IDX(_ThicknessMap), ADD_ZERO_IDX(sampler_ThicknessMap), ADD_IDX(layerTexCoord.base)).r;

72
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitProperties.hlsl


// shared constant between lit and layered lit
float _AlphaCutoff;
float4 _DoubleSidedConstants;
float _HorizonFade;
float _PPDMaxSamples;
float _PPDMinSamples;
float _PPDLodThreshold;
TEXTURE2D(_DiffuseLightingMap);
SAMPLER2D(sampler_DiffuseLightingMap);
TEXTURE2D(_DistortionVectorMap);
SAMPLER2D(sampler_DistortionVectorMap);
float3 _EmissiveColor;
TEXTURE2D(_EmissiveColorMap);
SAMPLER2D(sampler_EmissiveColorMap);
float _EmissiveIntensity;
// Caution: C# code in BaseLitUI.cs call LightmapEmissionFlagsProperty() which assume that there is an existing "_EmissionColor"
// value that exist to identify if the GI emission need to be enabled.
// In our case we don't use such a mechanism but need to keep the code quiet. We declare the value and always enable it.
// TODO: Fix the code in legacy unity so we can customize the beahvior for GI
float3 _EmissionColor;
#ifndef LAYERED_LIT_SHADER
// Set of users variables

//TEXTURE2D(_CoatRoughnessMap);
//SAMPLER2D(sampler_CoatRoughnessMap);
TEXTURE2D(_DiffuseLightingMap);
SAMPLER2D(sampler_DiffuseLightingMap);
TEXTURE2D(_DistortionVectorMap);
SAMPLER2D(sampler_DistortionVectorMap);
float3 _EmissiveColor;
TEXTURE2D(_EmissiveColorMap);
SAMPLER2D(sampler_EmissiveColorMap);
float _EmissiveIntensity;
float _AlphaCutoff;
float _HorizonFade;
float _PPDMaxSamples;
float _PPDMinSamples;
float _PPDLodThreshold;
// sampler are share by texture type inside a layered material but we need to support that a particualr layer have no texture, so we take the first sampler of available texture as the share one
// mean we must declare all sampler
SAMPLER2D(sampler##name##1); \
TEXTURE2D(name##3);
SAMPLER2D(sampler##name##2); \
TEXTURE2D(name##3); \
SAMPLER2D(sampler##name##3);
// Set of users variables
PROP_DECL(float4, _BaseColor);

PROP_DECL(float, _HeightAmplitude);
PROP_DECL(float, _HeightCenter);
TEXTURE2D(_DiffuseLightingMap);
SAMPLER2D(sampler_DiffuseLightingMap);
TEXTURE2D(_DistortionVectorMap);
SAMPLER2D(sampler_DistortionVectorMap);
TEXTURE2D(_LayerMaskMap);
SAMPLER2D(sampler_LayerMaskMap);

float _LayerTilingBlendMask;
PROP_DECL(float, _LayerTiling);
float3 _EmissiveColor;
TEXTURE2D(_EmissiveColorMap);
SAMPLER2D(sampler_EmissiveColorMap);
float _EmissiveIntensity;
float _TexWorldScaleBlendMask;
PROP_DECL(float, _TexWorldScale);
float _UVMappingPlanarBlendMask;

float _AlphaCutoff;
float _HorizonFade;
float _PPDMaxSamples;
float _PPDMinSamples;
float _PPDLodThreshold;
#endif // LAYERED_LIT_SHADER

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitTessellation.hlsl


bool frustumCulled = WorldViewFrustumCull(p0, p1, p2, maxDisplacement, (float4[4])unity_CameraWorldClipPlanes);
bool faceCull = false;
#if !(defined(_DOUBLESIDED) || defined(_DOUBLESIDED_LIGHTING_FLIP) || defined(_DOUBLESIDED_LIGHTING_MIRROR))
#ifndef _DOUBLESIDED_ON
// TODO: Handle inverse culling (for mirror)!
if (_TessellationBackFaceCullEpsilon > -0.99) // Is backface culling enabled ?
{

35
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitTessellation.shader


_Anisotropy("Anisotropy", Range(0.0, 1.0)) = 0
_AnisotropyMap("AnisotropyMap", 2D) = "white" {}
[Enum(Standard, 0, Subsurface Scattering, 1, Clear Coat, 2, Specular Color, 3)] _MaterialID("MaterialId", Int) = 0
_Thickness("Thickness", Range(0.004, 1.0)) = 0.5
_Thickness("Thickness", Range(0.004, 1.0)) = 1.0
_ThicknessMap("Thickness Map", 2D) = "white" {}
//_CoatCoverage("CoatCoverage", Range(0.0, 1.0)) = 0

_HorizonFade("Horizon fade", Range(0.0, 5.0)) = 1.0
// Stencil state
[HideInInspector] _StencilRef("_StencilRef", Int) = 0
[HideInInspector] _StencilRef("_StencilRef", Int) = 1
// Blending state
[HideInInspector] _SurfaceType("__surfacetype", Float) = 0.0

[HideInInspector] _CullMode("__cullmode", Float) = 2.0
[HideInInspector] _ZTestMode("_ZTestMode", Int) = 8
// Material Id
[HideInInspector] _MaterialId("_MaterialId", FLoat) = 0
[Enum(None, 0, DoubleSided, 1, DoubleSidedLigthingFlip, 2, DoubleSidedLigthingMirror, 3)] _DoubleSidedMode("Double sided mode", Float) = 0
[ToggleOff] _DoubleSidedEnable("Double sided enable", Float) = 0.0
[ToggleOff] _DoubleSidedMirrorEnable("Double sided mirror enable", Float) = 1.0
[HideInInspector] _DoubleSidedConstants("_DoubleSidedConstants", Vector) = (1, 1, -1, 0)
[Enum(UV0, 0, Planar, 1, TriPlanar, 2)] _UVBase("UV Set for base", Float) = 0
_TexWorldScale("Scale to apply on world coordinate", Float) = 1.0

[Enum(Standard, 0, Subsurface Scattering, 1, Clear Coat, 2, Specular Color, 3)] _MaterialID("MaterialId", Int) = 0
[ToggleOff] _EnablePerPixelDisplacement("Enable per pixel displacement", Float) = 0.0
_PPDMinSamples("Min sample for POM", Range(1.0, 64.0)) = 5
_PPDMaxSamples("Max sample for POM", Range(1.0, 64.0)) = 15

[Enum(Use Emissive Color, 0, Use Emissive Mask, 1)] _EmissiveColorMode("Emissive color mode", Float) = 1
// Caution: C# code in BaseLitUI.cs call LightmapEmissionFlagsProperty() which assume that there is an existing "_EmissionColor"
// value that exist to identify if the GI emission need to be enabled.
// In our case we don't use such a mechanism but need to keep the code quiet. We declare the value and always enable it.
// TODO: Fix the code in legacy unity so we can customize the beahvior for GI
_EmissionColor("Color", Color) = (1, 1, 1)
// Tessellation specific
[Enum(Phong, 0, Displacement, 1, DisplacementPhong, 2)] _TessellationMode("Tessellation mode", Float) = 0
_TessellationFactor("Tessellation Factor", Range(0.0, 15.0)) = 4.0

#pragma shader_feature _ALPHATEST_ON
#pragma shader_feature _DISTORTION_ON
#pragma shader_feature _DEPTHOFFSET_ON
#pragma shader_feature _ _DOUBLESIDED _DOUBLESIDED_LIGHTING_FLIP _DOUBLESIDED_LIGHTING_MIRROR
#pragma shader_feature _DOUBLESIDED_ON
#pragma shader_feature _PER_PIXEL_DISPLACEMENT
// Default is _TESSELLATION_PHONG
#pragma shader_feature _ _TESSELLATION_DISPLACEMENT _TESSELLATION_DISPLACEMENT_PHONG
#pragma shader_feature _TESSELLATION_OBJECT_SCALE

#pragma shader_feature _PER_PIXEL_DISPLACEMENT
#pragma shader_feature _ _REQUIRE_UV2 _REQUIRE_UV3
#pragma shader_feature _EMISSIVE_COLOR

#pragma shader_feature _DETAIL_MAP
#pragma shader_feature _SUBSURFACE_RADIUS_MAP
#pragma shader_feature _THICKNESS_MAP
#pragma shader_feature _SUBSURFACE_SCATTERING
#pragma multi_compile LIGHTMAP_OFF LIGHTMAP_ON
#pragma multi_compile DIRLIGHTMAP_OFF DIRLIGHTMAP_COMBINED

Name "GBuffer" // Name is not used
Tags { "LightMode" = "GBuffer" } // This will be only for opaque object based on the RenderQueue index
Cull [_CullMode]
Cull [_CullMode]
Stencil
{

Name "GBufferDebugLighting" // Name is not used
Tags{ "LightMode" = "GBufferDebugLighting" } // This will be only for opaque object based on the RenderQueue index
Cull[_CullMode]
Cull [_CullMode]
Stencil
Stencil
Ref[_StencilRef]
Ref [_StencilRef]
Comp Always
Pass Replace
}

ENDHLSL
}
}
CustomEditor "Experimental.Rendering.HDPipeline.LitGUI"

9
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/CombineSubsurfaceScattering.shader


#define N_PROFILES 8
#define N_SAMPLES 7
float4 _FilterKernels[N_PROFILES][N_SAMPLES + 1]; // RGB = weights, A = radial distance
float4 _FilterKernels[N_PROFILES][N_SAMPLES]; // RGB = weights, A = radial distance
float4 _HalfRcpWeightedVariances[N_PROFILES]; // RGB for chromatic, A for achromatic
float4x4 _InvProjMatrix;
TEXTURE2D_FLOAT(_CameraDepthTexture);

#endif
float2 scaledDirection = distScale * stepSize * unitDirection;
// Load (1 / (2 * Variance)) for bilateral weighting.
// Load (1 / (2 * WeightedVariance)) for bilateral weighting.
float3 halfRcpVariance = _FilterKernels[profileID][N_SAMPLES].rgb;
float3 halfRcpVariance = _HalfRcpWeightedVariances[profileID].rgb;
float halfRcpVariance = _FilterKernels[profileID][N_SAMPLES].a;
float halfRcpVariance = _HalfRcpWeightedVariances[profileID].a;
#endif
// Take the first (central) sample.
float2 samplePosition = posInput.unPositionSS;

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/ShaderPass/LitSharePass.hlsl


#endif
#define VARYINGS_NEED_COLOR
#if defined(_DOUBLESIDED_LIGHTING_FLIP) || defined(_DOUBLESIDED_LIGHTING_MIRROR)
#ifdef _DOUBLESIDED_ON
#define VARYINGS_NEED_CULLFACE
#endif

276
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Unlit/Editor/BaseUnlitUI.cs


namespace UnityEditor.Experimental.Rendering.HDPipeline
{
// A Material can be authored from the shader graph or by hand. When written by hand we need to provide an inspector.
// Such a Material will share some properties between it various variant (shader graph variant or hand authored variant).
// This is the purpose of BaseLitGUI. It contain all properties that are common to all Material based on Lit template.
// For the default hand written Lit material see LitUI.cs that contain specific properties for our default implementation.
protected static class Styles
protected static class StylesBaseUnlit
public static string optionText = "Options";
public static string optionText = "Surface options";
public static readonly string[] surfaceTypeNames = Enum.GetNames(typeof(SurfaceType));
public static readonly string[] blendModeNames = Enum.GetNames(typeof(BlendMode));
public static GUIContent doubleSidedModeText = new GUIContent("Double Sided", "This will render the two face of the objects (disable backface culling)");
public static GUIContent doubleSidedEnableText = new GUIContent("Double Sided", "This will render the two face of the objects (disable backface culling) and flip/mirror normal");
public static readonly string[] surfaceTypeNames = Enum.GetNames(typeof(SurfaceType));
public static readonly string[] blendModeNames = Enum.GetNames(typeof(BlendMode));
public static string InputsText = "Inputs";
public static string InputsMapText = "";
public static GUIContent colorText = new GUIContent("Color + Opacity", "Albedo (RGB) and Opacity (A)");
public static GUIContent emissiveText = new GUIContent("Emissive Color", "Emissive");
public static GUIContent emissiveIntensityText = new GUIContent("Emissive Intensity", "Emissive");
}
public enum SurfaceType

}
public enum BlendMode
{
Lerp,

Premultiply
}
public enum DoubleSidedMode
protected MaterialEditor m_MaterialEditor;
// Properties
protected MaterialProperty surfaceType = null;
protected const string kSurfaceType = "_SurfaceType";
protected MaterialProperty alphaCutoffEnable = null;
protected const string kAlphaCutoffEnabled = "_AlphaCutoffEnable";
protected MaterialProperty alphaCutoff = null;
protected const string kAlphaCutoff = "_AlphaCutoff";
protected MaterialProperty doubleSidedEnable = null;
protected const string kDoubleSidedEnable = "_DoubleSidedEnable";
protected MaterialProperty blendMode = null;
protected const string kBlendMode = "_BlendMode";
protected MaterialProperty distortionEnable = null;
protected const string kDistortionEnable = "_DistortionEnable";
protected MaterialProperty distortionOnly = null;
protected const string kDistortionOnly = "_DistortionOnly";
protected MaterialProperty distortionDepthTest = null;
protected const string kDistortionDepthTest = "_DistortionDepthTest";
// See comment in LitProperties.hlsl
const string kEmissionColor = "_EmissionColor";
// The following set of functions are call by the ShaderGraph
// It will allow to display our common parameters + setup keyword correctly for them
protected abstract void FindMaterialProperties(MaterialProperty[] props);
protected abstract void SetupMaterialKeywordsAndPassInternal(Material material);
protected abstract void MaterialPropertiesGUI();
// This function will said if emissive is use or not regarding enlighten/PVR
protected abstract bool ShouldEmissionBeEnabled(Material material);
protected virtual void FindBaseMaterialProperties(MaterialProperty[] props)
None,
DoubleSided
surfaceType = FindProperty(kSurfaceType, props);
alphaCutoffEnable = FindProperty(kAlphaCutoffEnabled, props);
alphaCutoff = FindProperty(kAlphaCutoff, props);
doubleSidedEnable = FindProperty(kDoubleSidedEnable, props);
blendMode = FindProperty(kBlendMode, props);
distortionEnable = FindProperty(kDistortionEnable, props);
distortionOnly = FindProperty(kDistortionOnly, props);
distortionDepthTest = FindProperty(kDistortionDepthTest, props);
void SurfaceTypePopup()
void SurfaceTypePopup()
mode = (SurfaceType)EditorGUILayout.Popup(Styles.surfaceTypeText, (int)mode, Styles.surfaceTypeNames);
mode = (SurfaceType)EditorGUILayout.Popup(StylesBaseUnlit.surfaceTypeText, (int)mode, StylesBaseUnlit.surfaceTypeNames);
if (EditorGUI.EndChangeCheck())
{
m_MaterialEditor.RegisterPropertyChangeUndo("Surface Type");

EditorGUI.showMixedValue = false;
}
void BlendModePopup()
private void BlendModePopup()
mode = (BlendMode)EditorGUILayout.Popup(Styles.blendModeText, (int)mode, Styles.blendModeNames);
mode = (BlendMode)EditorGUILayout.Popup(StylesBaseUnlit.blendModeText, (int)mode, StylesBaseUnlit.blendModeNames);
if (EditorGUI.EndChangeCheck())
{
m_MaterialEditor.RegisterPropertyChangeUndo("Blend Mode");

EditorGUI.showMixedValue = false;
}
protected void ShaderOptionsGUI()
protected virtual void BaseMaterialPropertiesGUI()
GUILayout.Label(Styles.optionText, EditorStyles.boldLabel);
GUILayout.Label(StylesBaseUnlit.optionText, EditorStyles.boldLabel);
m_MaterialEditor.ShaderProperty(distortionEnable, Styles.distortionEnableText.text);
m_MaterialEditor.ShaderProperty(distortionEnable, StylesBaseUnlit.distortionEnableText);
if (distortionEnable.floatValue == 1.0)
if (distortionEnable.floatValue == 1.0f)
m_MaterialEditor.ShaderProperty(distortionOnly, Styles.distortionOnlyText.text);
m_MaterialEditor.ShaderProperty(distortionDepthTest, Styles.distortionDepthTestText.text);
m_MaterialEditor.ShaderProperty(distortionOnly, StylesBaseUnlit.distortionOnlyText);
m_MaterialEditor.ShaderProperty(distortionDepthTest, StylesBaseUnlit.distortionDepthTestText);
m_MaterialEditor.ShaderProperty(alphaCutoffEnable, Styles.alphaCutoffEnableText.text);
if (alphaCutoffEnable.floatValue == 1.0)
m_MaterialEditor.ShaderProperty(alphaCutoffEnable, StylesBaseUnlit.alphaCutoffEnableText);
if (alphaCutoffEnable.floatValue == 1.0f)
m_MaterialEditor.ShaderProperty(alphaCutoff, Styles.alphaCutoffText.text);
m_MaterialEditor.ShaderProperty(alphaCutoff, StylesBaseUnlit.alphaCutoffText);
m_MaterialEditor.ShaderProperty(doubleSidedMode, Styles.doubleSidedModeText.text);
EditorGUI.indentLevel--;
// This function must finish with double sided option (see LitUI.cs)
m_MaterialEditor.ShaderProperty(doubleSidedEnable, StylesBaseUnlit.doubleSidedEnableText);
public void FindCommonOptionProperties(MaterialProperty[] props)
static public void SetKeyword(Material m, string keyword, bool state)
surfaceType = FindProperty(kSurfaceType, props);
blendMode = FindProperty(kBlendMode, props);
alphaCutoff = FindProperty(kAlphaCutoff, props);
alphaCutoffEnable = FindProperty(kAlphaCutoffEnabled, props);
doubleSidedMode = FindProperty(kDoubleSidedMode, props);
distortionEnable = FindProperty(kDistortionEnable, props);
distortionOnly = FindProperty(kDistortionOnly, props);
distortionDepthTest = FindProperty(kDistortionDepthTest, props);
if (state)
m.EnableKeyword(keyword);
else
m.DisableKeyword(keyword);
protected void SetupCommonOptionsKeywords(Material material)
{
// Note: keywords must be based on Material value not on MaterialProperty due to multi-edit & material animation
// (MaterialProperty value might come from renderer material property block)
bool alphaTestEnable = material.GetFloat(kAlphaCutoffEnabled) == 1.0;
// All Setup Keyword functions must be static. It allow to create script to automatically update the shaders with a script if ocde change
static public void SetupBaseUnlitKeywords(Material material)
{
bool alphaTestEnable = material.GetFloat(kAlphaCutoffEnabled) > 0.0f;
DoubleSidedMode doubleSidedMode = (DoubleSidedMode)material.GetFloat(kDoubleSidedMode);
if (surfaceType == SurfaceType.Opaque)
{

}
}
if (doubleSidedMode == DoubleSidedMode.None)
bool doubleSidedEnable = material.GetFloat(kDoubleSidedEnable) > 0.0f;
if (doubleSidedEnable)
material.SetInt("_CullMode", (int)UnityEngine.Rendering.CullMode.Back);
material.SetInt("_CullMode", (int)UnityEngine.Rendering.CullMode.Off);
material.SetInt("_CullMode", (int)UnityEngine.Rendering.CullMode.Off);
material.SetInt("_CullMode", (int)UnityEngine.Rendering.CullMode.Back);
SetKeyword(material, "_DOUBLESIDED_ON", doubleSidedEnable);
bool distortionEnable = material.GetFloat(kDistortionEnable) == 1.0;
bool distortionOnly = material.GetFloat(kDistortionOnly) == 1.0;
bool distortionDepthTest = material.GetFloat(kDistortionDepthTest) == 1.0;
bool distortionEnable = material.GetFloat(kDistortionEnable) > 0.0f;
if (distortionEnable)
{
material.SetShaderPassEnabled("DistortionVectors", true);

material.SetShaderPassEnabled("DistortionVectors", false);
}
bool distortionDepthTest = material.GetFloat(kDistortionDepthTest) > 0.0f;
if (distortionDepthTest)
{
material.SetInt("_ZTestMode", (int)UnityEngine.Rendering.CompareFunction.LessEqual);
}
else
{
material.SetInt("_ZTestMode", (int)UnityEngine.Rendering.CompareFunction.Always);
}
SetKeyword(material, "_DISTORTION_ON", distortionEnable);
}
static public void SetupBaseUnlitMaterialPass(Material material)
{
bool distortionEnable = material.GetFloat(kDistortionEnable) > 0.0f;
bool distortionOnly = material.GetFloat(kDistortionOnly) > 0.0f;
// Disable all passes except dbug material
// Disable all passes except debug material
material.SetShaderPassEnabled("GBuffer", false);
material.SetShaderPassEnabled("ShadowCaster", false);
material.SetShaderPassEnabled("DepthOnly", false);
material.SetShaderPassEnabled("MotionVectors", false);
material.SetShaderPassEnabled("ForwardOnlyOpaque", false);
material.SetShaderPassEnabled("GBuffer", true);
material.SetShaderPassEnabled("ShadowCaster", true);
material.SetShaderPassEnabled("DepthOnly", true);
material.SetShaderPassEnabled("MotionVectors", true);
material.SetShaderPassEnabled("ForwardOnlyOpaque", true);
}
if (distortionDepthTest)
// Dedicated to emissive - for emissive Enlighten/PVR
protected void DoEmissionArea(Material material)
{
// Emission for GI?
if (ShouldEmissionBeEnabled(material))
material.SetInt("_ZTestMode", (int)UnityEngine.Rendering.CompareFunction.LessEqual);
if (m_MaterialEditor.EmissionEnabledProperty())
{
// change the GI flag and fix it up with emissive as black if necessary
m_MaterialEditor.LightmapEmissionFlagsProperty(MaterialEditor.kMiniTextureFieldLabelIndentLevel, true);
}
else
{
material.SetInt("_ZTestMode", (int)UnityEngine.Rendering.CompareFunction.Always);
}
SetKeyword(material, "_DISTORTION_ON", distortionEnable);
SetupEmissionGIFlags(material);
}
protected void SetKeyword(Material m, string keyword, bool state)
{
if (state)
m.EnableKeyword(keyword);
else
m.DisableKeyword(keyword);
}
public void ShaderPropertiesGUI(Material material)

// Detect any changes to the material
EditorGUI.BeginChangeCheck();
{
ShaderOptionsGUI();
BaseMaterialPropertiesGUI();
ShaderInputGUI();
MaterialPropertiesGUI();
DoEmissionArea(material);
m_MaterialEditor.EnableInstancingField();
SetupMaterialKeywords((Material)obj);
SetupMaterialKeywordsAndPassInternal((Material)obj);
// This is call by the inspector
FindCommonOptionProperties(props); // MaterialProperties can be animated so we do not cache them but fetch them every event to ensure animated values are updated correctly
m_MaterialEditor = materialEditor;
// We should always do this call at the beginning
m_MaterialEditor.serializedObject.Update();
// MaterialProperties can be animated so we do not cache them but fetch them every event to ensure animated values are updated correctly
FindBaseMaterialProperties(props);
m_MaterialEditor = materialEditor;
}
// TODO: ? or remove
bool HasValidEmissiveKeyword(Material material)
{
/*
// Material animation might be out of sync with the material keyword.
// So if the emission support is disabled on the material, but the property blocks have a value that requires it, then we need to show a warning.
// (note: (Renderer MaterialPropertyBlock applies its values to emissionColorForRendering))
bool hasEmissionKeyword = material.IsKeywordEnabled ("_EMISSION");
if (!hasEmissionKeyword && ShouldEmissionBeEnabled (material, emissionColorForRendering.colorValue))
return false;
else
return true;
*/
return true;
// We should always do this call at the end
m_MaterialEditor.serializedObject.ApplyModifiedProperties();
protected virtual void SetupEmissionGIFlags(Material material)
{
// Setup lightmap emissive flags
MaterialGlobalIlluminationFlags flags = material.globalIlluminationFlags;
if ((flags & (MaterialGlobalIlluminationFlags.BakedEmissive | MaterialGlobalIlluminationFlags.RealtimeEmissive)) != 0)
{
if (ShouldEmissionBeEnabled(material))
flags &= ~MaterialGlobalIlluminationFlags.EmissiveIsBlack;
else
flags |= MaterialGlobalIlluminationFlags.EmissiveIsBlack;
material.globalIlluminationFlags = flags;
}
}
protected MaterialEditor m_MaterialEditor;
MaterialProperty surfaceType = null;
protected const string kSurfaceType = "_SurfaceType";
MaterialProperty blendMode = null;
protected const string kBlendMode = "_BlendMode";
MaterialProperty alphaCutoff = null;
protected const string kAlphaCutoff = "_AlphaCutoff";
MaterialProperty alphaCutoffEnable = null;
protected const string kAlphaCutoffEnabled = "_AlphaCutoffEnable";
MaterialProperty doubleSidedMode = null;
protected const string kDoubleSidedMode = "_DoubleSidedMode";
MaterialProperty distortionEnable = null;
const string kDistortionEnable = "_DistortionEnable";
MaterialProperty distortionOnly = null;
const string kDistortionOnly = "_DistortionOnly";
MaterialProperty distortionDepthTest = null;
const string kDistortionDepthTest = "_DistortionDepthTest";
protected static string[] reservedProperties = new string[] { kSurfaceType, kBlendMode, kAlphaCutoff, kAlphaCutoffEnabled, kDoubleSidedMode };
protected abstract void FindMaterialProperties(MaterialProperty[] props);
protected abstract void ShaderInputGUI();
protected abstract void SetupMaterialKeywords(Material material);
protected abstract bool ShouldEmissionBeEnabled(Material material);
}

58
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Unlit/Editor/UnlitUI.cs


{
class UnlitGUI : BaseUnlitGUI
{
MaterialProperty color = null;
MaterialProperty colorMap = null;
MaterialProperty emissiveColor = null;
MaterialProperty emissiveColorMap = null;
MaterialProperty emissiveIntensity = null;
protected static class Styles
{
public static string InputsText = "Inputs";
public static GUIContent colorText = new GUIContent("Color", "Color");
public static GUIContent emissiveText = new GUIContent("Emissive Color", "Emissive");
public static GUIContent emissiveIntensityText = new GUIContent("Emissive Intensity", "Emissive");
public static GUIContent emissiveColorModeText = new GUIContent("Emissive Color Usage", "Use emissive color or emissive mask");
}
protected MaterialProperty color = null;
protected const string kColor = "_Color";
protected MaterialProperty colorMap = null;
protected const string kColorMap = "_ColorMap";
protected MaterialProperty emissiveColor = null;
protected const string kEmissiveColor = "_EmissiveColor";
protected MaterialProperty emissiveColorMap = null;
protected MaterialProperty emissiveIntensity = null;
color = FindProperty("_Color", props);
colorMap = FindProperty("_ColorMap", props);
emissiveColor = FindProperty("_EmissiveColor", props);
color = FindProperty(kColor, props);
colorMap = FindProperty(kColorMap, props);
emissiveColor = FindProperty(kEmissiveColor, props);
emissiveIntensity = FindProperty("_EmissiveIntensity", props);
emissiveIntensity = FindProperty(kEmissiveIntensity, props);
override protected void ShaderInputGUI()
protected override void MaterialPropertiesGUI()
EditorGUI.indentLevel++;
GUILayout.Label(Styles.InputsText, EditorStyles.boldLabel);
m_MaterialEditor.TexturePropertySingleLine(Styles.colorText, colorMap, color);

m_MaterialEditor.LightmapEmissionProperty(MaterialEditor.kMiniTextureFieldLabelIndentLevel + 1);
}
EditorGUI.indentLevel--;
protected override bool ShouldEmissionBeEnabled(Material mat)
{
return mat.GetFloat(kEmissiveIntensity) > 0.0f;
protected override void SetupMaterialKeywords(Material material)
protected override void SetupMaterialKeywordsAndPassInternal(Material material)
SetupCommonOptionsKeywords(material);
SetKeyword(material, "_EMISSIVE_COLOR_MAP", material.GetTexture(kEmissiveColorMap));
SetupMaterialKeywordsAndPass(material);
protected override bool ShouldEmissionBeEnabled(Material mat)
// All Setup Keyword functions must be static. It allow to create script to automatically update the shaders with a script if code change
static public void SetupMaterialKeywordsAndPass(Material material)
float emissiveIntensity = mat.GetFloat(kEmissiveIntensity);
var realtimeEmission = (mat.globalIlluminationFlags & MaterialGlobalIlluminationFlags.RealtimeEmissive) > 0;
return emissiveIntensity > 0.0f || realtimeEmission;
SetupBaseUnlitKeywords(material);
SetupBaseUnlitMaterialPass(material);
SetKeyword(material, "_EMISSIVE_COLOR_MAP", material.GetTexture(kEmissiveColorMap));
}
} // namespace UnityEditor

10
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Unlit/Unlit.shader


[HideInInspector] _CullMode("__cullmode", Float) = 2.0
[HideInInspector] _ZTestMode("_ZTestMode", Int) = 8
[Enum(None, 0, DoubleSided, 1)] _DoubleSidedMode("Double sided mode", Float) = 0
[ToggleOff] _DoubleSidedEnable("Double sided enable", Float) = 0.0
// Caution: C# code in BaseLitUI.cs call LightmapEmissionFlagsProperty() which assume that there is an existing "_EmissionColor"
// value that exist to identify if the GI emission need to be enabled.
// In our case we don't use such a mechanism but need to keep the code quiet. We declare the value and always enable it.
// TODO: Fix the code in legacy unity so we can customize the beahvior for GI
_EmissionColor("Color", Color) = (1, 1, 1)
}
HLSLINCLUDE

#pragma shader_feature _ALPHATEST_ON
#pragma shader_feature _DISTORTION_ON
#pragma shader_feature _ _DOUBLESIDED
// #pragma shader_feature _DOUBLESIDED_ON - We have no lighting, so no need to have this combination for shader, the option will just disable backface culling
#pragma shader_feature _EMISSIVE_COLOR_MAP

6
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Unlit/UnlitProperties.hlsl


float _EmissiveIntensity;
float _AlphaCutoff;
// Caution: C# code in BaseLitUI.cs call LightmapEmissionFlagsProperty() which assume that there is an existing "_EmissionColor"
// value that exist to identify if the GI emission need to be enabled.
// In our case we don't use such a mechanism but need to keep the code quiet. We declare the value and always enable it.
// TODO: Fix the code in legacy unity so we can customize the beahvior for GI
float3 _EmissionColor;

48
Assets/ScriptableRenderPipeline/HDRenderPipeline/PostProcess/Editor/PostProcessingEditor.cs


public SerializedProperty intensity;
public SerializedProperty smoothness;
}
public class BloomSettings
{
public SerializedProperty enabled;
public SerializedProperty intensity;
public SerializedProperty threshold;
public SerializedProperty softKnee;
public SerializedProperty radius;
public SerializedProperty lensTexture;
public SerializedProperty lensIntensity;
}
#endregion
public ColorGradingSettings colorGrading;

public BloomSettings bloomSettings;
public SerializedProperty globalDithering;
SerializedProperty FindProperty<TValue>(Expression<Func<PostProcessing, TValue>> expr)

smoothness = FindProperty(x => x.vignetteSettings.smoothness)
};
bloomSettings = new BloomSettings
{
enabled = FindProperty(x => x.bloomSettings.enabled),
intensity = FindProperty(x => x.bloomSettings.intensity),
threshold = FindProperty(x => x.bloomSettings.threshold),
softKnee = FindProperty(x => x.bloomSettings.softKnee),
radius = FindProperty(x => x.bloomSettings.radius),
lensTexture = FindProperty(x => x.bloomSettings.lensTexture),
lensIntensity = FindProperty(x => x.bloomSettings.lensIntensity)
};
globalDithering = FindProperty(x => x.globalDithering);
}

Do("Color Grading", ColorGradingUI);
Do("Eye Adaptation", EyeAdaptationUI);
Do("Bloom", BloomUI);
Do("Chromatic Aberration", ChromaticAberrationUI);
Do("Vignette", VignetteUI);

EditorGUILayout.PropertyField(eyeAdaptation.speedDown);
EditorGUI.indentLevel--;
}
}
}
void BloomUI()
{
EditorGUILayout.PropertyField(bloomSettings.enabled);
if (bloomSettings.enabled.boolValue)
{
EditorGUILayout.PropertyField(bloomSettings.intensity);
EditorGUILayout.PropertyField(bloomSettings.threshold);
EditorGUILayout.PropertyField(bloomSettings.softKnee);
EditorGUILayout.PropertyField(bloomSettings.radius);
EditorGUILayout.PropertyField(bloomSettings.lensTexture);
EditorGUILayout.PropertyField(bloomSettings.lensIntensity);
bloomSettings.intensity.floatValue = Mathf.Max(0f, bloomSettings.intensity.floatValue);
bloomSettings.threshold.floatValue = Mathf.Max(0f, bloomSettings.threshold.floatValue);
bloomSettings.lensIntensity.floatValue = Mathf.Max(0f, bloomSettings.lensIntensity.floatValue);
}
}

17
Assets/ScriptableRenderPipeline/HDRenderPipeline/PostProcess/PostProcessing.Settings.cs


using System;
using System;
namespace UnityEngine.Experimental.Rendering.HDPipeline
{

[Range(0f, 1f)] public float intensity = 0.3f;
[Range(0f, 1f)] public float smoothness = 0.3f;
}
[Serializable]
public sealed class BloomSettings
{
public bool enabled = false;
public float intensity = 0.5f;
public float threshold = 1.1f;
[Range(0f, 1f)] public float softKnee = 0.5f;
[Range(1f, 7f)] public float radius = 5f;
public Texture lensTexture;
public float lensIntensity = 3f;
}
}
}

151
Assets/ScriptableRenderPipeline/HDRenderPipeline/PostProcess/PostProcessing.cs


[RequireComponent(typeof(Camera))]
public sealed partial class PostProcessing : MonoBehaviour
{
// Quick & very dirty temporary wrapper used for bloom (easy porting from old school render
// texture blitting to command buffers)
struct RenderTextureWrapper
{
static int s_Counter = 0;
public int id;
public RenderTargetIdentifier identifier;
public int width;
public int height;
public int depth;
public FilterMode filter;
public RenderTextureFormat format;
internal void Release(CommandBuffer cmd)
{
cmd.ReleaseTemporaryRT(id);
id = 0;
}
internal static RenderTextureWrapper Create(CommandBuffer cmd, int width, int height, int depth = 0, FilterMode filter = FilterMode.Bilinear, RenderTextureFormat format = RenderTextureFormat.DefaultHDR)
{
s_Counter++;
int id = Shader.PropertyToID("_TempRenderTexture_" + s_Counter);
cmd.GetTemporaryRT(id, width, height, depth, filter, format);
return new RenderTextureWrapper
{
id = id,
identifier = new RenderTargetIdentifier(id),
width = width,
height = height,
depth = depth,
filter = filter,
format = format
};
}
}
public BloomSettings bloomSettings = new BloomSettings();
Material m_BloomMaterial;
Material m_FinalPassMaterial;
ComputeShader m_EyeCompute;

static uint[] s_EmptyHistogramBuffer = new uint[k_HistogramBins];
const int k_MaxPyramidBlurLevel = 16;
readonly RenderTextureWrapper[] m_BlurBuffer1 = new RenderTextureWrapper[k_MaxPyramidBlurLevel];
readonly RenderTextureWrapper[] m_BlurBuffer2 = new RenderTextureWrapper[k_MaxPyramidBlurLevel];
RenderTextureWrapper m_BloomTex;
bool m_FirstFrame = true;
// Don't forget to update 'EyeAdaptation.cginc' if you change these values !

void OnEnable()
{
m_EyeAdaptationMaterial = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/EyeAdaptation");
m_BloomMaterial = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/Bloom");
m_FinalPassMaterial = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/FinalPass");
m_EyeCompute = Resources.Load<ComputeShader>("EyeHistogram");

void OnDisable()
{
Utilities.Destroy(m_EyeAdaptationMaterial);
Utilities.Destroy(m_BloomMaterial);
Utilities.Destroy(m_FinalPassMaterial);
foreach (var rt in m_AutoExposurePool)

Utilities.SafeRelease(m_HistogramBuffer);
m_EyeAdaptationMaterial = null;
m_BloomMaterial = null;
m_FinalPassMaterial = null;
}

if (eyeAdaptation.enabled)
DoEyeAdaptation(camera, cmd, source);
if (bloomSettings.enabled)
DoBloom(camera, cmd, source);
if (chromaSettings.enabled)
DoChromaticAberration();

DoColorGrading();
cmd.Blit(source, destination, m_FinalPassMaterial, 0);
if (bloomSettings.enabled)
m_BloomTex.Release(cmd);
context.ExecuteCommandBuffer(cmd);
cmd.Dispose();

m_FirstFrame = false;
}
void DoBloom(Camera camera, CommandBuffer cmd, RenderTargetIdentifier source)
{
m_BloomMaterial.shaderKeywords = null;
// Apply auto exposure before the prefiltering pass if needed
if (eyeAdaptation.enabled)
{
m_BloomMaterial.EnableKeyword("EYE_ADAPTATION");
m_BloomMaterial.SetTexture(Uniforms._AutoExposure, m_CurrentAutoExposure);
}
// Do bloom on a half-res buffer, full-res doesn't bring much and kills performances on
// fillrate limited platforms
int tw = camera.pixelWidth / 2;
int th = camera.pixelHeight / 2;
// Determine the iteration count
float logh = Mathf.Log(th, 2f) + bloomSettings.radius - 8f;
int logh_i = (int)logh;
int iterations = Mathf.Clamp(logh_i, 1, k_MaxPyramidBlurLevel);
// Uupdate the shader properties
float lthresh = Mathf.GammaToLinearSpace(bloomSettings.threshold);;
m_BloomMaterial.SetFloat(Uniforms._Threshold, lthresh);
float knee = lthresh * bloomSettings.softKnee + 1e-5f;
var curve = new Vector3(lthresh - knee, knee * 2f, 0.25f / knee);
m_BloomMaterial.SetVector(Uniforms._Curve, curve);
float sampleScale = 0.5f + logh - logh_i;
m_BloomMaterial.SetFloat(Uniforms._SampleScale, sampleScale);
// Prefilter pass
var prefiltered = RenderTextureWrapper.Create(cmd, tw, th, 0, FilterMode.Point);
cmd.Blit(source, prefiltered.identifier, m_BloomMaterial, 0);
var last = prefiltered;
// Construct a mip pyramid
for (int level = 0; level < iterations; level++)
{
m_BlurBuffer1[level] = RenderTextureWrapper.Create(cmd, last.width / 2, last.height / 2);
cmd.Blit(last.identifier, m_BlurBuffer1[level].identifier, m_BloomMaterial, level == 0 ? 1 : 2);
last = m_BlurBuffer1[level];
}
// Upsample and combine loop
for (int level = iterations - 2; level >= 0; level--)
{
var baseTex = m_BlurBuffer1[level];
cmd.SetGlobalTexture(Uniforms._BaseTex, baseTex.identifier); // Boooo
m_BlurBuffer2[level] = RenderTextureWrapper.Create(cmd, baseTex.width, baseTex.height);
cmd.Blit(last.identifier, m_BlurBuffer2[level].identifier, m_BloomMaterial, 3);
last = m_BlurBuffer2[level];
}
m_BloomTex = last;
// Release the temporary buffers
for (int i = 0; i < k_MaxPyramidBlurLevel; i++)
{
if (m_BlurBuffer1[i].id != 0)
m_BlurBuffer1[i].Release(cmd);
if (m_BlurBuffer2[i].id != 0 && m_BlurBuffer2[i].id != m_BloomTex.id)
m_BlurBuffer2[i].Release(cmd);
}
prefiltered.Release(cmd);
// Push everything to the uber material
m_FinalPassMaterial.EnableKeyword("BLOOM");
cmd.SetGlobalTexture(Uniforms._BloomTex, m_BloomTex.identifier);
cmd.SetGlobalVector(Uniforms._Bloom_Settings, new Vector2(sampleScale, bloomSettings.intensity));
if (bloomSettings.lensIntensity > 0f && bloomSettings.lensTexture != null)
{
m_FinalPassMaterial.EnableKeyword("BLOOM_LENS_DIRT");
cmd.SetGlobalTexture(Uniforms._Bloom_DirtTex, bloomSettings.lensTexture);
cmd.SetGlobalFloat(Uniforms._Bloom_DirtIntensity, bloomSettings.lensIntensity);
}
}
void DoChromaticAberration()
{
var spectralLut = chromaSettings.spectralTexture == null

internal static readonly int _AutoExposure = Shader.PropertyToID("_AutoExposure");
internal static readonly int _DebugWidth = Shader.PropertyToID("_DebugWidth");
internal static readonly int _Threshold = Shader.PropertyToID("_Threshold");
internal static readonly int _Curve = Shader.PropertyToID("_Curve");
internal static readonly int _SampleScale = Shader.PropertyToID("_SampleScale");
internal static readonly int _BaseTex = Shader.PropertyToID("_BaseTex");
internal static readonly int _BloomTex = Shader.PropertyToID("_BloomTex");
internal static readonly int _Bloom_Settings = Shader.PropertyToID("_Bloom_Settings");
internal static readonly int _Bloom_DirtTex = Shader.PropertyToID("_Bloom_DirtTex");
internal static readonly int _Bloom_DirtIntensity = Shader.PropertyToID("_Bloom_DirtIntensity");
internal static readonly int _ChromaticAberration_Amount = Shader.PropertyToID("_ChromaticAberration_Amount");
internal static readonly int _ChromaticAberration_Lut = Shader.PropertyToID("_ChromaticAberration_Lut");

26
Assets/ScriptableRenderPipeline/HDRenderPipeline/PostProcess/Resources/FinalPass.shader


#include "ShaderLibrary/Common.hlsl"
#include "HDRenderPipeline/ShaderVariables.hlsl"
#include "ColorGrading.hlsl"
#include "Bloom.hlsl"
TEXTURE2D(_MainTex);
SAMPLER2D(sampler_MainTex);

float4 _LogLut_Params;
float _Exposure;
TEXTURE2D(_BloomTex);
SAMPLER2D(sampler_BloomTex);
float4 _BloomTex_TexelSize;
float2 _Bloom_Settings; // x: sampleScale, y: bloom.intensity
TEXTURE2D(_Bloom_DirtTex);
SAMPLER2D(sampler_Bloom_DirtTex);
float _Bloom_DirtIntensity;
float4 _NeutralTonemapperParams1;
float4 _NeutralTonemapperParams2;

}
#endif
#if BLOOM
{
float3 bloom = UpsampleFilter(TEXTURE2D_PARAM(_BloomTex, sampler_BloomTex), uv, _BloomTex_TexelSize.xy, _Bloom_Settings.x) * _Bloom_Settings.y; // Flipped
color += bloom;
#if BLOOM_LENS_DIRT
{
float3 dirt = SAMPLE_TEXTURE2D(_Bloom_DirtTex, sampler_Bloom_DirtTex, uv).rgb * _Bloom_DirtIntensity; // Flipped
color += bloom * dirt;
}
#endif
}
#endif
#if VIGNETTE
{
float2 d = abs(uv - _Vignette_Settings.zw) * _Vignette_Settings.x;

#pragma fragment Frag
#pragma multi_compile __ NEUTRAL_GRADING CUSTOM_GRADING
#pragma multi_compile __ EYE_ADAPTATION
#pragma multi_compile __ BLOOM
#pragma multi_compile __ BLOOM_LENS_DIRT
#pragma multi_compile __ CHROMATIC_ABERRATION
#pragma multi_compile __ VIGNETTE
#pragma multi_compile __ DITHERING

403
Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/SubsurfaceScatteringParameters.cs


using System;
using UnityEngine.Rendering;
#if UNITY_EDITOR
using UnityEditor;
#endif

public class SubsurfaceScatteringProfile
{
public const int numSamples = 7; // Must be an odd number
public const int numVectors = 8; // numSamples + 1 for (1 / (2 * WeightedVariance))
Color m_StdDev1;
public Color stdDev1;
Color m_StdDev2;
public Color stdDev2;
float m_LerpWeight;
public float lerpWeight;
Vector4[] m_FilterKernel;
public bool enableTransmission;
public bool m_KernelNeedsUpdate;
public float thicknessScale;
[SerializeField] [HideInInspector]
Vector4[] m_FilterKernel;
[SerializeField] [HideInInspector]
Vector3[] m_HalfRcpVariances;
[SerializeField] [HideInInspector]
Vector4 m_HalfRcpWeightedVariances;
m_StdDev1 = new Color(0.3f, 0.3f, 0.3f, 0.0f);
m_StdDev2 = new Color(1.0f, 1.0f, 1.0f, 0.0f);
m_LerpWeight = 0.5f;
ComputeKernel();
}
stdDev1 = new Color(0.3f, 0.3f, 0.3f, 0.0f);
stdDev2 = new Color(0.6f, 0.6f, 0.6f, 0.0f);
lerpWeight = 0.5f;
enableTransmission = false;
thicknessScale = 3.0f;
public Color stdDev1
{
get { return m_StdDev1; }
set { if (m_StdDev1 != value) { m_StdDev1 = value; m_KernelNeedsUpdate = true; } }
}
public Color stdDev2
{
get { return m_StdDev2; }
set { if (m_StdDev2 != value) { m_StdDev2 = value; m_KernelNeedsUpdate = true; } }
}
public float lerpWeight
{
get { return m_LerpWeight; }
set { if (m_LerpWeight != value) { m_LerpWeight = value; m_KernelNeedsUpdate = true; } }
UpdateKernelAndVarianceData();
get { if (m_KernelNeedsUpdate) ComputeKernel(); return m_FilterKernel; }
// Set via UpdateKernelAndVarianceData().
get { return m_FilterKernel; }
public void SetDirtyFlag()
public Vector3[] halfRcpVariances
m_KernelNeedsUpdate = true;
// Set via UpdateKernelAndVarianceData().
get { return m_HalfRcpVariances; }
// --- Private Methods ---
static float Gaussian(float x, float stdDev)
public Vector4 halfRcpWeightedVariances
float variance = stdDev * stdDev;
return Mathf.Exp(-x * x / (2 * variance)) / Mathf.Sqrt(2 * Mathf.PI * variance);
// Set via UpdateKernelAndVarianceData().
get { return m_HalfRcpWeightedVariances; }
static float GaussianCombination(float x, float stdDev1, float stdDev2, float lerpWeight)
{
return Mathf.Lerp(Gaussian(x, stdDev1), Gaussian(x, stdDev2), lerpWeight);
}
static float RationalApproximation(float t)
{
// Abramowitz and Stegun formula 26.2.23.
// The absolute value of the error should be less than 4.5 e-4.
float[] c = {2.515517f, 0.802853f, 0.010328f};
float[] d = {1.432788f, 0.189269f, 0.001308f};
return t - ((c[2] * t + c[1]) * t + c[0]) / (((d[2] * t + d[1]) * t + d[0]) * t + 1.0f);
}
// Ref: https://www.johndcook.com/blog/csharp_phi_inverse/
static float NormalCdfInverse(float p, float stdDev)
public void UpdateKernelAndVarianceData()
float x;
if (p < 0.5)
if (m_FilterKernel == null)
// F^-1(p) = - G^-1(p)
x = -RationalApproximation(Mathf.Sqrt(-2.0f * Mathf.Log(p)));
}
else
{
// F^-1(p) = G^-1(1-p)
x = RationalApproximation(Mathf.Sqrt(-2.0f * Mathf.Log(1.0f - p)));
m_FilterKernel = new Vector4[numSamples];
return x * stdDev;
}
static float GaussianCombinationCdfInverse(float p, float stdDev1, float stdDev2, float lerpWeight)
{
return Mathf.Lerp(NormalCdfInverse(p, stdDev1), NormalCdfInverse(p, stdDev2), lerpWeight);
}
void ComputeKernel()
{
if (m_FilterKernel == null || m_FilterKernel.Length != numVectors)
if (m_HalfRcpVariances == null)
m_FilterKernel = new Vector4[numVectors];
m_HalfRcpVariances = new Vector3[2];
}
// Our goal is to blur the image using a filter which is represented

// It is separable by design, but generally not radially symmetric.
// Find the widest Gaussian across 3 color channels.
float maxStdDev1 = Mathf.Max(m_StdDev1.r, m_StdDev1.g, m_StdDev1.b);
float maxStdDev2 = Mathf.Max(m_StdDev2.r, m_StdDev2.g, m_StdDev2.b);
float maxStdDev1 = Mathf.Max(stdDev1.r, stdDev1.g, stdDev1.b);
float maxStdDev2 = Mathf.Max(stdDev2.r, stdDev2.g, stdDev2.b);
Vector3 weightSum = new Vector3(0, 0, 0);
Vector3 weightSum = new Vector3(0, 0, 0);
float pos = GaussianCombinationCdfInverse(u, maxStdDev1, maxStdDev2, m_LerpWeight);
float pdf = GaussianCombination(pos, maxStdDev1, maxStdDev2, m_LerpWeight);
float pos = GaussianCombinationCdfInverse(u, maxStdDev1, maxStdDev2, lerpWeight);
float pdf = GaussianCombination(pos, maxStdDev1, maxStdDev2, lerpWeight);
val.x = GaussianCombination(pos, m_StdDev1.r, m_StdDev2.r, m_LerpWeight);
val.y = GaussianCombination(pos, m_StdDev1.g, m_StdDev2.g, m_LerpWeight);
val.z = GaussianCombination(pos, m_StdDev1.b, m_StdDev2.b, m_LerpWeight);
val.x = GaussianCombination(pos, stdDev1.r, stdDev2.r, lerpWeight);
val.y = GaussianCombination(pos, stdDev1.g, stdDev2.g, lerpWeight);
val.z = GaussianCombination(pos, stdDev1.b, stdDev2.b, lerpWeight);
// We do not divide by 'numSamples' since we will renormalize, anyway.
m_FilterKernel[i].x = val.x * (1 / pdf);

m_FilterKernel[i].z *= 1 / weightSum.z;
}
// Store (1 / (2 * Variance)) per color channel per Gaussian.
m_HalfRcpVariances[0].x = 0.5f / (stdDev1.r * stdDev1.r);
m_HalfRcpVariances[0].y = 0.5f / (stdDev1.g * stdDev1.g);
m_HalfRcpVariances[0].z = 0.5f / (stdDev1.b * stdDev1.b);
m_HalfRcpVariances[1].x = 0.5f / (stdDev2.r * stdDev2.r);
m_HalfRcpVariances[1].y = 0.5f / (stdDev2.g * stdDev2.g);
m_HalfRcpVariances[1].z = 0.5f / (stdDev2.b * stdDev2.b);
weightedStdDev.x = Mathf.Lerp(m_StdDev1.r, m_StdDev2.r, m_LerpWeight);
weightedStdDev.y = Mathf.Lerp(m_StdDev1.g, m_StdDev2.g, m_LerpWeight);
weightedStdDev.z = Mathf.Lerp(m_StdDev1.b, m_StdDev2.b, m_LerpWeight);
weightedStdDev.w = Mathf.Lerp(maxStdDev1, maxStdDev2, m_LerpWeight);
weightedStdDev.x = Mathf.Lerp(stdDev1.r, stdDev2.r, lerpWeight);
weightedStdDev.y = Mathf.Lerp(stdDev1.g, stdDev2.g, lerpWeight);
weightedStdDev.z = Mathf.Lerp(stdDev1.b, stdDev2.b, lerpWeight);
weightedStdDev.w = Mathf.Lerp(maxStdDev1, maxStdDev2, lerpWeight);
// Store (1 / (2 * WeightedVariance)) per color channel.
m_HalfRcpWeightedVariances.x = 0.5f / (weightedStdDev.x * weightedStdDev.x);
m_HalfRcpWeightedVariances.y = 0.5f / (weightedStdDev.y * weightedStdDev.y);
m_HalfRcpWeightedVariances.z = 0.5f / (weightedStdDev.z * weightedStdDev.z);
m_HalfRcpWeightedVariances.w = 0.5f / (weightedStdDev.w * weightedStdDev.w);
}
// --- Private Methods ---
static float Gaussian(float x, float stdDev)
{
float variance = stdDev * stdDev;
return Mathf.Exp(-x * x / (2 * variance)) / Mathf.Sqrt(2 * Mathf.PI * variance);
}
static float GaussianCombination(float x, float stdDev1, float stdDev2, float lerpWeight)
{
return Mathf.Lerp(Gaussian(x, stdDev1), Gaussian(x, stdDev2), lerpWeight);
}
// Store (1 / (2 * Variance)) per color channel.
m_FilterKernel[numSamples].x = 0.5f / (weightedStdDev.x * weightedStdDev.x);
m_FilterKernel[numSamples].y = 0.5f / (weightedStdDev.y * weightedStdDev.y);
m_FilterKernel[numSamples].z = 0.5f / (weightedStdDev.z * weightedStdDev.z);
m_FilterKernel[numSamples].w = 0.5f / (weightedStdDev.w * weightedStdDev.w);
static float RationalApproximation(float t)
{
// Abramowitz and Stegun formula 26.2.23.
// The absolute value of the error should be less than 4.5 e-4.
float[] c = {2.515517f, 0.802853f, 0.010328f};
float[] d = {1.432788f, 0.189269f, 0.001308f};
return t - ((c[2] * t + c[1]) * t + c[0]) / (((d[2] * t + d[1]) * t + d[0]) * t + 1.0f);
}
// Ref: https://www.johndcook.com/blog/csharp_phi_inverse/
static float NormalCdfInverse(float p, float stdDev)
{
float x;
if (p < 0.5)
{
// F^-1(p) = - G^-1(p)
x = -RationalApproximation(Mathf.Sqrt(-2.0f * Mathf.Log(p)));
}
else
{
// F^-1(p) = G^-1(1-p)
x = RationalApproximation(Mathf.Sqrt(-2.0f * Mathf.Log(1.0f - p)));
}
return x * stdDev;
}
static float GaussianCombinationCdfInverse(float p, float stdDev1, float stdDev2, float lerpWeight)
{
return Mathf.Lerp(NormalCdfInverse(p, stdDev1), NormalCdfInverse(p, stdDev2), lerpWeight);
}
}

int m_NumProfiles;
bool m_EnableSSS;
[SerializeField]
int m_NumProfiles;
[SerializeField]
int m_TransmissionFlags;
[SerializeField]
float[] m_ThicknessScales;
[SerializeField]
Vector4[] m_HalfRcpVariancesAndLerpWeights;
[SerializeField]
Vector4[] m_HalfRcpWeightedVariances;
[SerializeField]
Vector4[] m_FilterKernels;
m_EnableSSS = true;
m_NumProfiles = 1;
m_Profiles = new SubsurfaceScatteringProfile[m_NumProfiles];

}
OnValidate();
public SubsurfaceScatteringProfile[] profiles { set { m_Profiles = value; OnValidate(); } get { return m_Profiles; } }
public bool enableSSS {
// Set via serialization.
get { return m_EnableSSS; }
}
public SubsurfaceScatteringProfile[] profiles {
// Set via serialization.
get { return m_Profiles; }
}
// Returns a bit mask s.t. the i-th bit indicates whether the i-th profile requires transmittance evaluation.
// Supplies '_TransmissionFlags' to Lit.hlsl.
public int transmissionFlags {
// Set during OnValidate().
get { return m_TransmissionFlags; }
}
public void SetDirtyFlag()
// Supplies '_ThicknessScales' to Lit.hlsl.
public float[] thicknessScales
for (int i = 0; i < m_Profiles.Length; i++)
{
m_Profiles[i].SetDirtyFlag();
}
// Set during OnValidate().
get { return m_ThicknessScales; }
}
// Supplies '_HalfRcpVariancesAndLerpWeights' to Lit.hlsl.
public Vector4[] halfRcpVariancesAndLerpWeights {
// Set during OnValidate().
get { return m_HalfRcpVariancesAndLerpWeights; }
}
// Supplies '_HalfRcpWeightedVariances' to CombineSubsurfaceScattering.shader.
public Vector4[] halfRcpWeightedVariances {
// Set during OnValidate().
get { return m_HalfRcpWeightedVariances; }
// --- Private Methods ---
// Supplies '_FilterKernels' to CombineSubsurfaceScattering.shader.
public Vector4[] filterKernels
{
// Set during OnValidate().
get { return m_FilterKernels; }
}
void OnValidate()
public void OnValidate()
{
if (m_Profiles.Length > maxNumProfiles)
{

m_NumProfiles = m_Profiles.Length;
m_NumProfiles = m_Profiles.Length;
m_TransmissionFlags = 0;
if (m_ThicknessScales == null)
{
m_ThicknessScales = new float[maxNumProfiles];
}
if (m_HalfRcpVariancesAndLerpWeights == null)
{
m_HalfRcpVariancesAndLerpWeights = new Vector4[maxNumProfiles * 2];
}
if (m_HalfRcpWeightedVariances == null)
{
m_HalfRcpWeightedVariances = new Vector4[maxNumProfiles];
}
if (m_FilterKernels == null)
{
m_FilterKernels = new Vector4[maxNumProfiles * SubsurfaceScatteringProfile.numSamples];
}
m_TransmissionFlags |= (m_Profiles[i].enableTransmission ? 1 : 0) << i;
c.r = Mathf.Clamp(m_Profiles[i].stdDev1.r, 0.05f, 2.0f);
c.g = Mathf.Clamp(m_Profiles[i].stdDev1.g, 0.05f, 2.0f);
c.b = Mathf.Clamp(m_Profiles[i].stdDev1.b, 0.05f, 2.0f);

m_Profiles[i].stdDev2 = c;
m_Profiles[i].lerpWeight = Mathf.Clamp01(m_Profiles[i].lerpWeight);
m_Profiles[i].thicknessScale = Mathf.Max(0.0f, m_Profiles[i].thicknessScale);
m_Profiles[i].UpdateKernelAndVarianceData();
}
// Use the updated data to fill the cache.
for (int i = 0; i < m_NumProfiles; i++)
{
m_ThicknessScales[i] = m_Profiles[i].thicknessScale;
m_HalfRcpVariancesAndLerpWeights[2 * i] = m_Profiles[i].halfRcpVariances[0];
m_HalfRcpVariancesAndLerpWeights[2 * i].w = 1.0f - m_Profiles[i].lerpWeight;
m_HalfRcpVariancesAndLerpWeights[2 * i + 1] = m_Profiles[i].halfRcpVariances[1];
m_HalfRcpVariancesAndLerpWeights[2 * i + 1].w = m_Profiles[i].lerpWeight;
m_HalfRcpWeightedVariances[i] = m_Profiles[i].halfRcpWeightedVariances;
for (int j = 0, n = SubsurfaceScatteringProfile.numSamples; j < n; j++)
{
m_FilterKernels[n * i + j] = m_Profiles[i].filterKernel[j];
}
}
}
}

{
private class Styles
{
public readonly GUIContent sssCategory = new GUIContent("Subsurface scattering");
public readonly GUIContent sssProfileStdDev1 = new GUIContent("SSS profile standard deviation #1", "Determines the shape of the 1st Gaussian filter. Increases the strength and the radius of the blur of the corresponding color channel.");
public readonly GUIContent sssProfileStdDev2 = new GUIContent("SSS profile standard deviation #2", "Determines the shape of the 2nd Gaussian filter. Increases the strength and the radius of the blur of the corresponding color channel.");
public readonly GUIContent sssProfileLerpWeight = new GUIContent("SSS profile filter interpolation", "Controls linear interpolation between the two Gaussian filters.");
public readonly GUIContent category = new GUIContent("Subsurface scattering parameters");
public readonly GUIContent[] profiles = new GUIContent[SubsurfaceScatteringParameters.maxNumProfiles] { new GUIContent("Profile #0"), new GUIContent("Profile #1"), new GUIContent("Profile #2"), new GUIContent("Profile #3"), new GUIContent("Profile #4"), new GUIContent("Profile #5"), new GUIContent("Profile #6"), new GUIContent("Profile #7") };
public readonly GUIContent profilePreview = new GUIContent("Profile preview. Note that the intensity of the region in the center may be clamped.");
public readonly GUIContent numProfiles = new GUIContent("Number of profiles");
public readonly GUIContent profileStdDev1 = new GUIContent("Standard deviation #1", "Determines the shape of the 1st Gaussian filter. Increases the strength and the radius of the blur of the corresponding color channel.");
public readonly GUIContent profileStdDev2 = new GUIContent("Standard deviation #2", "Determines the shape of the 2nd Gaussian filter. Increases the strength and the radius of the blur of the corresponding color channel.");
public readonly GUIContent profileLerpWeight = new GUIContent("Filter interpolation", "Controls linear interpolation between the two Gaussian filters.");
public readonly GUIContent profileTransmission = new GUIContent("Enable transmission", "Toggles simulation of light passing through thin objects. Depends on the thickness of the material.");
public readonly GUIContent profileThicknessScale = new GUIContent("Thickness scale", "Linearly scales the object thickness which affects the amount of transmitted lighting.");
private static Styles s_Styles;
private SerializedProperty m_Profiles;
private static Styles s_Styles;
private SerializedProperty m_EnableSSS, m_Profiles, m_NumProfiles;
private Material m_ProfileMaterial;
private RenderTexture[] m_ProfileImages;
// --- Public Methods ---

}
}
void OnEnable()
{
m_EnableSSS = serializedObject.FindProperty("m_EnableSSS");
m_Profiles = serializedObject.FindProperty("m_Profiles");
m_NumProfiles = m_Profiles.FindPropertyRelative("Array.size");
m_ProfileMaterial = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/DrawGaussianProfile");
m_ProfileImages = new RenderTexture[SubsurfaceScatteringParameters.maxNumProfiles];
for (int i = 0; i < SubsurfaceScatteringParameters.maxNumProfiles; i++)
{
m_ProfileImages[i] = new RenderTexture(256, 256, 0, RenderTextureFormat.DefaultHDR);
}
}
EditorGUILayout.PropertyField(m_Profiles, true);
// Validate the data before displaying it.
((SubsurfaceScatteringParameters)serializedObject.targetObject).OnValidate();
EditorGUILayout.LabelField(styles.category, EditorStyles.boldLabel);
EditorGUILayout.PropertyField(m_EnableSSS);
EditorGUILayout.PropertyField(m_NumProfiles, styles.numProfiles);
EditorGUILayout.PropertyField(m_Profiles);
if (m_Profiles.isExpanded)
{
EditorGUI.indentLevel++;
for (int i = 0, n = Math.Min(m_Profiles.arraySize, SubsurfaceScatteringParameters.maxNumProfiles); i < n; i++)
{
SerializedProperty profile = m_Profiles.GetArrayElementAtIndex(i);
EditorGUILayout.PropertyField(profile, styles.profiles[i]);
if (profile.isExpanded)
{
EditorGUI.indentLevel++;
SerializedProperty profileStdDev1 = profile.FindPropertyRelative("stdDev1");
SerializedProperty profileStdDev2 = profile.FindPropertyRelative("stdDev2");
SerializedProperty profileLerpWeight = profile.FindPropertyRelative("lerpWeight");
SerializedProperty profileTransmission = profile.FindPropertyRelative("enableTransmission");
SerializedProperty profileThicknessScale = profile.FindPropertyRelative("thicknessScale");
EditorGUILayout.PropertyField(profileStdDev1, styles.profileStdDev1);
EditorGUILayout.PropertyField(profileStdDev2, styles.profileStdDev2);
EditorGUILayout.PropertyField(profileLerpWeight, styles.profileLerpWeight);
EditorGUILayout.PropertyField(profileTransmission, styles.profileTransmission);
EditorGUILayout.PropertyField(profileThicknessScale, styles.profileThicknessScale);
EditorGUILayout.Space();
// Draw the profile.
m_ProfileMaterial.SetColor("_StdDev1", profileStdDev1.colorValue);
m_ProfileMaterial.SetColor("_StdDev2", profileStdDev2.colorValue);
m_ProfileMaterial.SetFloat("_LerpWeight", profileLerpWeight.floatValue);
EditorGUI.DrawPreviewTexture(GUILayoutUtility.GetRect(256, 256), m_ProfileImages[i], m_ProfileMaterial, ScaleMode.ScaleToFit);
EditorGUILayout.Space();
EditorGUILayout.LabelField(styles.profilePreview, EditorStyles.centeredGreyMiniLabel);
EditorGUILayout.Space();
EditorGUI.indentLevel--;
}
}
EditorGUI.indentLevel--;
}
// Serialization does not invoke setters, but does call OnValidate().
// Serialization ignores setters.
((SubsurfaceScatteringParameters)target).SetDirtyFlag();
}
// --- Private Methods ---
void OnEnable()
{
m_Profiles = serializedObject.FindProperty("m_Profiles");
}
}
#endif

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/ShaderPass.meta


fileFormatVersion: 2
guid: e3b3ad4462341ec4b86566ec1fd82c7c
guid: 057d8506536500045b3047320a4d6122
folderAsset: yes
timeCreated: 1476885561
licenseType: Pro

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky.meta


fileFormatVersion: 2
guid: 066ab4d03bd03384f81c9d82b479f8dd
guid: 99e8d5bd81663624399d10e3fc27571c
folderAsset: yes
timeCreated: 1479239906
licenseType: Pro

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/HDRISky/Editor/HDRISkyEditor.cs


namespace UnityEngine.Experimental.Rendering.HDPipeline
{
[CanEditMultipleObjects]
[CustomEditor(typeof(HDRISkyParameters))]
[CustomEditor(typeof(HDRISkySettings))]
public class HDRISkyParametersEditor
: Editor
{

6
Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/HDRISky/HDRISkyRenderer.cs


public class HDRISkyRenderer : SkyRenderer
{
Material m_SkyHDRIMaterial; // Renders a cubemap into a render texture (can be cube or 2D)
private HDRISkyParameters m_HdriSkyParams;
private HDRISkySettings m_HdriSkyParams;
public HDRISkyRenderer(HDRISkyParameters hdriSkyParams)
public HDRISkyRenderer(HDRISkySettings hdriSkyParams)
{
m_HdriSkyParams = hdriSkyParams;
}

}
}
public override void RenderSky(BuiltinSkyParameters builtinParams, SkyParameters skyParameters, bool renderForCubemap)
public override void RenderSky(BuiltinSkyParameters builtinParams, SkySettings skyParameters, bool renderForCubemap)
{
m_SkyHDRIMaterial.SetTexture("_Cubemap", m_HdriSkyParams.skyHDRI);
m_SkyHDRIMaterial.SetVector("_SkyParam", new Vector4(m_HdriSkyParams.exposure, m_HdriSkyParams.multiplier, m_HdriSkyParams.rotation, 0.0f));

26
Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/ProceduralSky/ProceduralSkyRenderer.cs


public class ProceduralSkyRenderer : SkyRenderer
{
Material m_ProceduralSkyMaterial = null; // Renders a cubemap into a render texture (can be cube or 2D)
private ProceduralSkyParameters m_ProceduralSkyParameters;
private ProceduralSkySettings m_ProceduralSkySettings;
public ProceduralSkyRenderer(ProceduralSkyParameters proceduralSkyParameters)
public ProceduralSkyRenderer(ProceduralSkySettings proceduralSkySettings)
m_ProceduralSkyParameters = proceduralSkyParameters;
m_ProceduralSkySettings = proceduralSkySettings;
}
public override void Build()

public override bool IsSkyValid()
{
if (m_ProceduralSkyMaterial == null || m_ProceduralSkyParameters == null)
if (m_ProceduralSkyMaterial == null || m_ProceduralSkySettings == null)
return m_ProceduralSkyParameters.skyHDRI != null &&
m_ProceduralSkyParameters.worldMieColorRamp != null &&
m_ProceduralSkyParameters.worldRayleighColorRamp != null;
return m_ProceduralSkySettings.skyHDRI != null &&
m_ProceduralSkySettings.worldMieColorRamp != null &&
m_ProceduralSkySettings.worldRayleighColorRamp != null;
}
public override void SetRenderTargets(BuiltinSkyParameters builtinParams)

Utilities.SetRenderTarget(builtinParams.renderContext, builtinParams.colorBuffer);
}
void SetKeywords(BuiltinSkyParameters builtinParams, ProceduralSkyParameters param, bool renderForCubemap)
void SetKeywords(BuiltinSkyParameters builtinParams, ProceduralSkySettings param, bool renderForCubemap)
{
// Ensure that all preprocessor symbols are initially undefined.
m_ProceduralSkyMaterial.DisableKeyword("ATMOSPHERICS");

m_ProceduralSkyMaterial.EnableKeyword("PERFORM_SKY_OCCLUSION_TEST");
}
if (param.debugMode != ProceduralSkyParameters.ScatterDebugMode.None)
if (param.debugMode != ProceduralSkySettings.ScatterDebugMode.None)
void SetUniforms(BuiltinSkyParameters builtinParams, ProceduralSkyParameters param, bool renderForCubemap, ref MaterialPropertyBlock properties)
void SetUniforms(BuiltinSkyParameters builtinParams, ProceduralSkySettings param, bool renderForCubemap, ref MaterialPropertyBlock properties)
{
properties.SetTexture("_Cubemap", param.skyHDRI);
properties.SetVector("_SkyParam", new Vector4(param.exposure, param.multiplier, param.rotation, 0.0f));

properties.SetFloat("_HeightMieDensity", renderForCubemap ? -0.0f : -param.heightMieDensity / 100000f);
}
override public void RenderSky(BuiltinSkyParameters builtinParams, SkyParameters skyParameters, bool renderForCubemap)
override public void RenderSky(BuiltinSkyParameters builtinParams, SkySettings skyParameters, bool renderForCubemap)
SetKeywords(builtinParams, m_ProceduralSkyParameters, renderForCubemap);
SetKeywords(builtinParams, m_ProceduralSkySettings, renderForCubemap);
SetUniforms(builtinParams, m_ProceduralSkyParameters, renderForCubemap, ref properties);
SetUniforms(builtinParams, m_ProceduralSkySettings, renderForCubemap, ref properties);
var cmd = new CommandBuffer { name = "" };

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/ProceduralSky/ProceduralSkySettings.cs


{
[ExecuteInEditMode]
[DisallowMultipleComponent]
public class ProceduralSkyParameters : SkyParameters
public class ProceduralSkySettings : SkySettings
{
public enum OcclusionDownscale { x1 = 1, x2 = 2, x4 = 4 }
public enum OcclusionSamples { x64 = 0, x164 = 1, x244 = 2 }

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/Resources.meta


fileFormatVersion: 2
guid: 4cdc45a9a65126a42aca158413a5b089
guid: 920208451db81a846ae1c2d55f7b50b4
folderAsset: yes
timeCreated: 1479239906
licenseType: Pro

44
Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/SkyManager.cs


bool m_useMIS = false;
private SkyParameters m_SkyParameters;
public SkyParameters skyParameters
private SkySettings m_SkySettings;
public SkySettings skySettings
if (m_SkyParameters == value)
if (m_SkySettings == value)
return;
if (m_Renderer != null)

}
m_SkyParametersHash = 0;
m_SkyParameters = value;
m_SkySettings = value;
{
m_Renderer.Build();
}
get { return m_SkyParameters; }
get { return m_SkySettings; }
}
protected Mesh BuildSkyMesh(Vector3 cameraPosition, Matrix4x4 cameraInvViewProjectionMatrix, bool forceUVBottom)

};
}
void RebuildTextures(SkyParameters skyParameters)
void RebuildTextures(SkySettings skySettings)
if (skyParameters != null)
resolution = (int)skyParameters.resolution;
if (skySettings != null)
resolution = (int)skySettings.resolution;
if ((m_SkyboxCubemapRT != null) && (m_SkyboxCubemapRT.width != resolution))
{

public void Resize(float nearPlane, float farPlane)
{
// When loading RenderDoc, RenderTextures will go null
RebuildTextures(skyParameters);
RebuildTextures(skySettings);
if (m_Renderer != null)
m_Renderer.Build();
// Create unititialized. Lazy initialization is performed later.
m_iblFilterGgx = new IBLFilterGGX();

return m_Renderer != null && m_Renderer.IsSkyValid();
}
private void RenderSkyToCubemap(BuiltinSkyParameters builtinParams, SkyParameters skyParameters, RenderTexture target)
private void RenderSkyToCubemap(BuiltinSkyParameters builtinParams, SkySettings skySettings, RenderTexture target)
{
for (int i = 0; i < 6; ++i)
{

builtinParams.depthBuffer = BuiltinSkyParameters.nullRT;
Utilities.SetRenderTarget(builtinParams.renderContext, target, ClearFlag.ClearNone, 0, (CubemapFace)i);
m_Renderer.RenderSky(builtinParams, skyParameters, true);
m_Renderer.RenderSky(builtinParams, skySettings, true);
private void RenderCubemapGGXConvolution(ScriptableRenderContext renderContext, BuiltinSkyParameters builtinParams, SkyParameters skyParams, Texture input, RenderTexture target)
private void RenderCubemapGGXConvolution(ScriptableRenderContext renderContext, BuiltinSkyParameters builtinParams, SkySettings skyParams, Texture input, RenderTexture target)
{
using (new Utilities.ProfilingSample("Sky Pass: GGX Convolution", renderContext))
{

}
if (
(skyParameters.updateMode == EnvironementUpdateMode.OnDemand && m_UpdateRequired) ||
(skyParameters.updateMode == EnvironementUpdateMode.OnChanged && skyParameters.GetHash() != m_SkyParametersHash) ||
(skyParameters.updateMode == EnvironementUpdateMode.Realtime && m_CurrentUpdateTime > skyParameters.updatePeriod)
(skySettings.updateMode == EnvironementUpdateMode.OnDemand && m_UpdateRequired) ||
(skySettings.updateMode == EnvironementUpdateMode.OnChanged && skySettings.GetHash() != m_SkyParametersHash) ||
(skySettings.updateMode == EnvironementUpdateMode.Realtime && m_CurrentUpdateTime > skySettings.updatePeriod)
RenderSkyToCubemap(m_BuiltinParameters, skyParameters, m_SkyboxCubemapRT);
RenderSkyToCubemap(m_BuiltinParameters, skySettings, m_SkyboxCubemapRT);
RenderCubemapGGXConvolution(renderContext, m_BuiltinParameters, skyParameters, m_SkyboxCubemapRT, m_SkyboxGGXCubemapRT);
RenderCubemapGGXConvolution(renderContext, m_BuiltinParameters, skySettings, m_SkyboxCubemapRT, m_SkyboxGGXCubemapRT);
m_SkyParametersHash = skyParameters.GetHash();
m_SkyParametersHash = skySettings.GetHash();
m_CurrentUpdateTime = 0.0f;
}
}

m_BuiltinParameters.depthBuffer = depthBuffer;
m_Renderer.SetRenderTargets(m_BuiltinParameters);
m_Renderer.RenderSky(m_BuiltinParameters, skyParameters, false);
m_Renderer.RenderSky(m_BuiltinParameters, skySettings, false);
}
}
}

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/SkyRenderer.cs


public abstract void Cleanup();
public abstract void SetRenderTargets(BuiltinSkyParameters builtinParams);
// renderForCubemap: When rendering into a cube map, no depth buffer is available so user has to make sure not to use depth testing or the depth texture.
public abstract void RenderSky(BuiltinSkyParameters builtinParams, SkyParameters skyParameters, bool renderForCubemap);
public abstract void RenderSky(BuiltinSkyParameters builtinParams, SkySettings skyParameters, bool renderForCubemap);
public abstract bool IsSkyValid();
}
}

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/SkySettings.cs


namespace UnityEngine.Experimental.Rendering.HDPipeline
{
[ExecuteInEditMode]
public abstract class SkyParameters : ScriptableObject
public abstract class SkySettings : ScriptableObject
{
protected class Unhashed : System.Attribute {}

7
Assets/ScriptableRenderPipeline/HDRenderPipeline/Utilities.cs


[Flags]
public enum StencilBits
{
None = Lit.MaterialId.LitStandard,
SSS = Lit.MaterialId.LitSSS,
ClearCoat = Lit.MaterialId.LitClearCoat,
None = 0,
SSS = 0 + Lit.MaterialId.LitSSS, // 1
Standard = 2 + Lit.MaterialId.LitStandard, // 2
ClearCoat = 1 + Lit.MaterialId.LitClearCoat, // 3
All = 255 // 0xff
}

4
Assets/ScriptableRenderPipeline/ShaderLibrary/Common.hlsl


#endif
#include "API/Validate.hlsl"
// Some shader compiler don't support to do multiple ## for concatenation inside the same macro, it require an indirection.
// This is the purpose of this macro
#define MERGE_NAME(X, Y) X##Y
// ----------------------------------------------------------------------------
// Common intrinsic (general implementation of intrinsic available on some platform)
// ----------------------------------------------------------------------------

6
Assets/ScriptableRenderPipeline/fptl/FptlLighting.cs


// render shadow maps (for mobile shadow map rendering should happen before we render g-buffer).
// on GCN it needs to be after to leverage async compute since we need the depth-buffer for optimal light list building.
if(k_UseAsyncCompute) RenderShadowMaps(cullResults, loop);
if(k_UseAsyncCompute)
{
RenderShadowMaps(cullResults, loop);
loop.SetupCameraProperties(camera);
}
// Push all global params
var numDirLights = UpdateDirectionalLights(camera, cullResults.visibleLights);

2
Assets/ScriptableRenderPipeline/fptl/lightlistbuild-bigtile.compute


// sort lights
SORTLIST(lightsListLDS, iNrCoarseLights, MAX_NR_BIGTILE_LIGHTS_PLUSONE, t, NR_THREADS);
lightOffs = 0;
if(t==0) lightOffs = 0;
GroupMemoryBarrierWithGroupSync();
for(int i=t; i<iNrCoarseLights; i+=NR_THREADS) if(lightsListLDS[i]<g_iNrVisibLights) InterlockedAdd(lightOffs, 1);
GroupMemoryBarrierWithGroupSync();

2
Assets/ScriptableRenderPipeline/fptl/lightlistbuild-clustered.compute


}
#ifdef ENABLE_DEPTH_TEXTURE_BACKPLANE
g_logBaseBuffer[tileIDX.y*nrTilesX + tileIDX.x] = suggestedBase;
if(threadID==0) g_logBaseBuffer[tileIDX.y*nrTilesX + tileIDX.x] = suggestedBase;
#endif
}

2
Assets/ScriptableRenderPipeline/fptl/lightlistbuild.compute


#ifdef PERFORM_SPHERICAL_INTERSECTION_TESTS
int SphericalIntersectionTests(uint threadID, int iNrCoarseLights, float2 screenCoordinate)
{
lightOffsSph = 0;
if(threadID==0) lightOffsSph = 0;
// make a copy of coarseList in prunedList.
for(int l=threadID; l<iNrCoarseLights; l+=NR_THREADS)

122
Assets/TestScenes/FPTL/Materials/Custom_NewSurfaceShader.mat


m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Custom_NewSurfaceShader
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_Shader: {fileID: 0}
m_EnableInstancingVariants: 0
disabledShaderPasses: []
serializedVersion: 2
serializedVersion: 3
- first:
name: _BumpMap
second:
- _BumpMap:
- first:
name: _DetailAlbedoMap
second:
- _DetailAlbedoMap:
- first:
name: _DetailMask
second:
- _DetailMask:
- first:
name: _DetailNormalMap
second:
- _DetailNormalMap:
- first:
name: _EmissionMap
second:
- _EmissionMap:
- first:
name: _MainTex
second:
- _MainTex:
- first:
name: _MetallicGlossMap
second:
- _MetallicGlossMap:
- first:
name: _OcclusionMap
second:
- _OcclusionMap:
- first:
name: _ParallaxMap
second:
- _ParallaxMap:
- first:
name: _SpecGlossMap
second:
- _SpecGlossMap:
- first:
name: _BumpScale
second: 1
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DstBlend
second: 0
- first:
name: _GlossMapScale
second: 1
- first:
name: _Glossiness
second: 0.258
- first:
name: _GlossyReflections
second: 1
- first:
name: _Metallic
second: 0
- first:
name: _Mode
second: 0
- first:
name: _OcclusionStrength
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _SmoothnessTextureChannel
second: 0
- first:
name: _SpecularHighlights
second: 1
- first:
name: _SrcBlend
second: 1
- first:
name: _UVSec
second: 0
- first:
name: _ZWrite
second: 1
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.258
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
- first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _SpecColor
second: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 1, g: 1, b: 1, a: 1}

206
Assets/TestScenes/FPTL/Materials/gray.mat


m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: gray
m_Shader: {fileID: 45, guid: 0000000000000000f000000000000000, type: 0}
m_Shader: {fileID: 0}
m_EnableInstancingVariants: 0
disabledShaderPasses: []
serializedVersion: 2
serializedVersion: 3
- first:
name: _AlternateLightMap
second:
- _AlternateLightMap:
- first:
name: _BumpMap
second:
- _BumpMap:
- first:
name: _DetailAlbedoMap
second:
- _DetailAlbedoMap:
- first:
name: _DetailMask
second:
- _DetailMask:
- first:
name: _DetailNormalMap
second:
- _DetailNormalMap:
- first:
name: _EmissionMap
second:
- _EmissionMap:
- first:
name: _MainTex
second:
- _MainTex:
- first:
name: _MetallicGlossMap
second:
- _MetallicGlossMap:
- first:
name: _OcclusionMap
second:
- _OcclusionMap:
- first:
name: _ParallaxMap
second:
- _ParallaxMap:
- first:
name: _SpecGlossMap
second:
- _SpecGlossMap:
- first:
name: g_tOverrideLightmap
second:
- g_tOverrideLightmap:
- first:
name: _BumpScale
second: 1
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DstBlend
second: 0
- first:
name: _GlossMapScale
second: 1
- first:
name: _Glossiness
second: 0.825
- first:
name: _GlossyReflections
second: 1
- first:
name: _Metallic
second: 0
- first:
name: _Mode
second: 0
- first:
name: _OcclusionStrength
second: 1
- first:
name: _OcclusionStrengthDirectDiffuse
second: 1
- first:
name: _OcclusionStrengthDirectSpecular
second: 1
- first:
name: _OcclusionStrengthIndirectDiffuse
second: 1
- first:
name: _OcclusionStrengthIndirectSpecular
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _SmoothnessTextureChannel
second: 0
- first:
name: _SpecularHighlights
second: 1
- first:
name: _SpecularMode
second: 2
- first:
name: _SrcBlend
second: 1
- first:
name: _UVSec
second: 0
- first:
name: _ZWrite
second: 1
- first:
name: g_bEnableMetallic
second: 0
- first:
name: g_bReceiveShadows
second: 1
- first:
name: g_bUnlit
second: 0
- first:
name: g_bWorldAlignedTexture
second: 0
- first:
name: g_flCubeMapScalar
second: 1
- first:
name: g_flReflectanceBias
second: 0
- first:
name: g_flReflectanceMax
second: 1
- first:
name: g_flReflectanceMin
second: 0
- first:
name: g_flReflectanceScale
second: 1
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.825
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _OcclusionStrengthDirectDiffuse: 1
- _OcclusionStrengthDirectSpecular: 1
- _OcclusionStrengthIndirectDiffuse: 1
- _OcclusionStrengthIndirectSpecular: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SpecularMode: 2
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
- g_bEnableMetallic: 0
- g_bReceiveShadows: 1
- g_bUnlit: 0
- g_bWorldAlignedTexture: 0
- g_flCubeMapScalar: 1
- g_flReflectanceBias: 0
- g_flReflectanceMax: 1
- g_flReflectanceMin: 0
- g_flReflectanceScale: 1
- first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _SpecColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: g_vWorldAlignedNormalTangentU
second: {r: -1, g: 0, b: 0, a: 0}
- first:
name: g_vWorldAlignedNormalTangentV
second: {r: 0, g: 0, b: 1, a: 0}
- first:
name: g_vWorldAlignedTextureNormal
second: {r: 0, g: 1, b: 0, a: 0}
- first:
name: g_vWorldAlignedTexturePosition
second: {r: 0, g: 0, b: 0, a: 0}
- first:
name: g_vWorldAlignedTextureSize
second: {r: 1, g: 1, b: 1, a: 0}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 1, g: 1, b: 1, a: 1}
- g_vWorldAlignedNormalTangentU: {r: -1, g: 0, b: 0, a: 0}
- g_vWorldAlignedNormalTangentV: {r: 0, g: 0, b: 1, a: 0}
- g_vWorldAlignedTextureNormal: {r: 0, g: 1, b: 0, a: 0}
- g_vWorldAlignedTexturePosition: {r: 0, g: 0, b: 0, a: 0}
- g_vWorldAlignedTextureSize: {r: 1, g: 1, b: 1, a: 0}

4
Assets/TestScenes/HDTest/CascadedShadowsTest/Lit_Gray.mat


- _GlossyReflections: 1
- _HeightAmplitude: 0.01
- _HeightCenter: 0.5
- _MaterialId: 0
- _MaterialID: 0
- _StencilRef: 1
- _Metallic: 0
- _Mode: 0
- _NormalMapSpace: 0

- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SubSurfaceRadius: 0
- _SurfaceType: 0
- _TexWorldScale: 1
- _UVBase: 0

4
Assets/TestScenes/HDTest/GlobalIlluminationTest/Material/Chrome.mat


- _GlossyReflections: 1
- _HeightAmplitude: 0.01
- _HeightCenter: 0.5
- _MaterialId: 0
- _MaterialID: 0
- _StencilRef: 1
- _Metallic: 1
- _Mode: 0
- _NormalMapSpace: 0

- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SubSurfaceRadius: 0
- _SurfaceType: 0
- _TexWorldScale: 1
- _UVBase: 0

20
Assets/TestScenes/HDTest/GlobalIlluminationTest/Material/Lit_Green.mat


m_EnableInstancingVariants: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
disabledShaderPasses:
- DistortionVectors
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:

m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ThicknessMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}

- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSided: 1
- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _DstBlend: 0
- _EmissiveColorMode: 1

- _HeightCenter: 0.5
- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialId: 0
- _Metalic: 0
- _Metallic: 0
- _Mettalic: 0

- _OcclusionStrength: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02

- _SrcBlend: 1
- _StencilRef: 1
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _Thickness: 0.5
- _UVBase: 0
- _UVDetail: 0
- _UVMappingPlanar: 0

23
Assets/TestScenes/HDTest/GlobalIlluminationTest/Material/Lit_Grey.mat


m_Name: Lit_Grey
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DEPTHOFFSETENABLE_OFF _DISTORTIONDEPTHTEST_OFF
_DISTORTIONENABLE_OFF _DISTORTIONONLY_OFF _ENABLEPERPIXELDISPLACEMENT_OFF
_DISTORTIONENABLE_OFF _DISTORTIONONLY_OFF _ENABLEPERPIXELDISPLACEMENT_OFF _NORMALMAP_TANGENT_SPACE
disabledShaderPasses: []
disabledShaderPasses:
- DistortionVectors
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:

m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ThicknessMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}

- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _DstBlend: 0
- _EmissiveColorMode: 1

- _GlossyReflections: 1
- _HeightAmplitude: 0.01
- _HeightCenter: 0.5
- _MaterialId: 0
- _HorizonFade: 1
- _MaterialID: 0
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02

- _SrcBlend: 1
- _StencilRef: 1
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _Thickness: 0.5
- _UVBase: 0
- _UVDetail: 0
- _UVMappingPlanar: 0

4
Assets/TestScenes/HDTest/GlobalIlluminationTest/Material/Lit_Red.mat


- _HeightMapMode: 0
- _HeightScale: 1
- _MaterialID: 0
- _MaterialId: 0
- _StencilRef: 1
- _Mettalic: 0
- _Mode: 0
- _NormalMapSpace: 0
- _NormalScale: 1

- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SubSurfaceRadius: 0
- _SurfaceType: 0
- _TexWorldScale: 1
- _UVBase: 0

2
Assets/TestScenes/HDTest/GlobalIlluminationTest/TestRealtime.cs


void Update () {
if (m_SceneSettings != null)
{
HDRISkyParameters skyParams = m_SceneSettings.GetComponent<HDRISkyParameters>();
HDRISkySettings skyParams = m_SceneSettings.GetComponent<HDRISkySettings>();
if (skyParams)
skyParams.rotation = (skyParams.rotation + Time.deltaTime * m_RotationSpeed) % 360.0f;
}

4
Assets/TestScenes/HDTest/GraphicTest/Common/Dragon/DragonStatue.mat


- _HeightAmplitude: 0
- _HeightCenter: 0
- _HorizonFade: 1
- _MaterialId: 0
- _MaterialID: 0
- _StencilRef: 1
- _Metallic: 0
- _Mode: 0
- _NormalDetailMul: 0.347

- _SmoothnessVar: 0.491
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SubSurfaceRadius: 0
- _SurfaceType: 0
- _Tess: 8
- _TessFar: 1

25
Assets/TestScenes/HDTest/GraphicTest/Common/Material/Lit_Blue.mat


m_PrefabInternal: {fileID: 0}
m_Name: Lit_Blue
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DETAIL_MAP_WITH_NORMAL _DISTORTIONDEPTHTEST_OFF
_DISTORTIONONLY_OFF _EMISSION _NORMALMAP_TANGENT_SPACE
m_ShaderKeywords: _NORMALMAP_TANGENT_SPACE
disabledShaderPasses: []
disabledShaderPasses:
- DistortionVectors
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:

m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ThicknessMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0

- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _DstBlend: 0
- _EmissiveColorMode: 1

- _HeightCenter: 0.5
- _HeightMapMode: 0
- _HeightScale: 1
- _MaterialId: 0
- _HorizonFade: 1
- _MaterialID: 0
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02

- _SrcBlend: 1
- _StencilRef: 2
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _Thickness: 0.5
- _UVBase: 0
- _UVDetail: 0
- _UVMappingPlanar: 0

m_Colors:
- _BaseColor: {r: 0, g: 0, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}

25
Assets/TestScenes/HDTest/GraphicTest/Common/Material/Lit_Green.mat


m_PrefabInternal: {fileID: 0}
m_Name: Lit_Green
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DETAIL_MAP_WITH_NORMAL _DISTORTIONDEPTHTEST_OFF
_DISTORTIONONLY_OFF _EMISSION _NORMALMAP_TANGENT_SPACE
m_ShaderKeywords: _NORMALMAP_TANGENT_SPACE
disabledShaderPasses: []
disabledShaderPasses:
- DistortionVectors
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:

m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ThicknessMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0

- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _DstBlend: 0
- _EmissiveColorMode: 1

- _HeightCenter: 0.5
- _HeightMapMode: 0
- _HeightScale: 1
- _MaterialId: 0
- _HorizonFade: 1
- _MaterialID: 0
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02

- _SrcBlend: 1
- _StencilRef: 2
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _Thickness: 0.5
- _UVBase: 0
- _UVDetail: 0
- _UVMappingPlanar: 0

m_Colors:
- _BaseColor: {r: 0, g: 1, b: 0, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}

23
Assets/TestScenes/HDTest/GraphicTest/Common/Material/Lit_Red.mat


m_PrefabInternal: {fileID: 0}
m_Name: Lit_Red
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DETAIL_MAP_WITH_NORMAL _DISTORTIONDEPTHTEST_OFF
_DISTORTIONONLY_OFF _EMISSION _NORMALMAP_TANGENT_SPACE _SPECULAROCCLUSIONMAP
m_ShaderKeywords: _NORMALMAP_TANGENT_SPACE _SPECULAROCCLUSIONMAP
m_LightmapFlags: 1
m_EnableInstancingVariants: 0
m_CustomRenderQueue: -1

m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ThicknessMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}

- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _DstBlend: 0
- _EmissiveColorMode: 1

- _HeightCenter: 0.5
- _HeightMapMode: 0
- _HeightScale: 1
- _MaterialId: 0
- _HorizonFade: 1
- _MaterialID: 0
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02

- _SrcBlend: 1
- _SubSurfaceRadius: 0
- _StencilRef: 2
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _Thickness: 1
- _UVBase: 0
- _UVDetail: 0
- _UVMappingPlanar: 0

m_Colors:
- _BaseColor: {r: 1, g: 0, b: 0, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}

23
Assets/TestScenes/HDTest/GraphicTest/Common/Material/Lit_White.mat


m_PrefabInternal: {fileID: 0}
m_Name: Lit_White
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DETAIL_MAP_WITH_NORMAL _DISTORTIONDEPTHTEST_OFF
_DISTORTIONONLY_OFF _EMISSION _NORMALMAP_TANGENT_SPACE
m_ShaderKeywords: _NORMALMAP_TANGENT_SPACE
m_LightmapFlags: 1
m_EnableInstancingVariants: 0
m_CustomRenderQueue: -1

m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ThicknessMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}

- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _DstBlend: 0
- _EmissiveColorMode: 1

- _HeightCenter: 0.5
- _HeightMapMode: 0
- _HeightScale: 1
- _MaterialId: 0
- _HorizonFade: 1
- _MaterialID: 0
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02

- _SrcBlend: 1
- _SubSurfaceRadius: 0
- _StencilRef: 2
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _Thickness: 1
- _UVBase: 0
- _UVDetail: 0
- _UVMappingPlanar: 0

m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}

280
Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_0.mat


m_PrefabInternal: {fileID: 0}
m_Name: Mat_smooth0_0
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DISTORTIONDEPTHTEST_OFF _DISTORTIONONLY_OFF
_EMISSION _NORMALMAP_TANGENT_SPACE
m_ShaderKeywords: _NORMALMAP_TANGENT_SPACE
m_EnableInstancingVariants: 0
disabledShaderPasses:
- DistortionVectors
serializedVersion: 2
serializedVersion: 3
- first:
name: _BaseColorMap
second:
- _AnisotropyMap:
- first:
name: _BumpMap
second:
- _BaseColorMap:
- first:
name: _DetailAlbedoMap
second:
- _BumpMap:
- first:
name: _DetailMask
second:
- _DetailAlbedoMap:
- first:
name: _DetailNormalMap
second:
- _DetailMap:
- first:
name: _DiffuseLightingMap
second:
- _DetailMask:
- first:
name: _EmissionMap
second:
- _DetailNormalMap:
- first:
name: _EmissiveColorMap
second:
- _DiffuseLightingMap:
- first:
name: _HeightMap
second:
- _DistortionVectorMap:
- first:
name: _MainTex
second:
- _EmissionMap:
- first:
name: _MaskMap
second:
- _EmissiveColorMap:
- first:
name: _MetallicGlossMap
second:
- _HeightMap:
- first:
name: _NormalMap
second:
- _MainTex:
- first:
name: _OcclusionMap
second:
- _MaskMap:
- first:
name: _ParallaxMap
second:
- _MetallicGlossMap:
- first:
name: _SpecularOcclusionMap
second:
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularOcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubSurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
- first:
name: _SubSurfaceRadiusMap
second:
- _ThicknessMap:
- first:
name: _AlphaCutoff
second: 0.5
- first:
name: _AlphaCutoffEnable
second: 0
- first:
name: _BlendMode
second: 0
- first:
name: _BumpScale
second: 1
- first:
name: _CullMode
second: 2
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DistortionDepthTest
second: 0
- first:
name: _DistortionOnly
second: 0
- first:
name: _DoubleSidedMode
second: 0
- first:
name: _DstBlend
second: 0
- first:
name: _EmissiveColorMode
second: 1
- first:
name: _EmissiveIntensity
second: 0
- first:
name: _GlossMapScale
second: 1
- first:
name: _Glossiness
second: 0
- first:
name: _GlossyReflections
second: 1
- first:
name: _HeightBias
second: 0
- first:
name: _HeightMapMode
second: 0
- first:
name: _HeightScale
second: 1
- first:
name: _MaterialId
second: 0
- first:
name: _Metalic
second: 1
- first:
name: _Metallic
second: 1
- first:
name: _Mode
second: 0
- first:
name: _NormalMapSpace
second: 0
- first:
name: _OcclusionStrength
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _Smoothness
second: 0
- first:
name: _SmoothnessTextureChannel
second: 0
- first:
name: _SpecularHighlights
second: 1
- first:
name: _SrcBlend
second: 1
- first:
name: _SubSurfaceRadius
second: 0
- first:
name: _SurfaceType
second: 0
- first:
name: _UVSec
second: 0
- first:
name: _ZWrite
second: 1
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5
- _DepthOffsetEnable: 0
- _DetailAlbedoScale: 1
- _DetailNormalMapScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnablePerPixelDisplacement: 0
- _GlossMapScale: 1
- _Glossiness: 0
- _GlossyReflections: 1
- _HeightAmplitude: 0.01
- _HeightBias: 0
- _HeightCenter: 0.5
- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _Metalic: 1
- _Metallic: 1
- _Mode: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _OcclusionStrength: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _Smoothness: 0
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _StencilRef: 2
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 0
- _TexWorldScale: 1
- _Thickness: 0.5
- _UVBase: 0
- _UVDetail: 0
- _UVMappingPlanar: 0
- _UVSec: 0
- _ZTestMode: 8
- _ZWrite: 1
- first:
name: _BaseColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _EmissiveColor
second: {r: 0, g: 0, b: 0, a: 1}
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

280
Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_1.mat


m_PrefabInternal: {fileID: 0}
m_Name: Mat_smooth0_1
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DISTORTIONDEPTHTEST_OFF _DISTORTIONONLY_OFF
_EMISSION _NORMALMAP_TANGENT_SPACE
m_ShaderKeywords: _NORMALMAP_TANGENT_SPACE
m_EnableInstancingVariants: 0
disabledShaderPasses:
- DistortionVectors
serializedVersion: 2
serializedVersion: 3
- first:
name: _BaseColorMap
second:
- _AnisotropyMap:
- first:
name: _BumpMap
second:
- _BaseColorMap:
- first:
name: _DetailAlbedoMap
second:
- _BumpMap:
- first:
name: _DetailMask
second:
- _DetailAlbedoMap:
- first:
name: _DetailNormalMap
second:
- _DetailMap:
- first:
name: _DiffuseLightingMap
second:
- _DetailMask:
- first:
name: _EmissionMap
second:
- _DetailNormalMap:
- first:
name: _EmissiveColorMap
second:
- _DiffuseLightingMap:
- first:
name: _HeightMap
second:
- _DistortionVectorMap:
- first:
name: _MainTex
second:
- _EmissionMap:
- first:
name: _MaskMap
second:
- _EmissiveColorMap:
- first:
name: _MetallicGlossMap
second:
- _HeightMap:
- first:
name: _NormalMap
second:
- _MainTex:
- first:
name: _OcclusionMap
second:
- _MaskMap:
- first:
name: _ParallaxMap
second:
- _MetallicGlossMap:
- first:
name: _SpecularOcclusionMap
second:
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularOcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubSurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
- first:
name: _SubSurfaceRadiusMap
second:
- _ThicknessMap:
- first:
name: _AlphaCutoff
second: 0.5
- first:
name: _AlphaCutoffEnable
second: 0
- first:
name: _BlendMode
second: 0
- first:
name: _BumpScale
second: 1
- first:
name: _CullMode
second: 2
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DistortionDepthTest
second: 0
- first:
name: _DistortionOnly
second: 0
- first:
name: _DoubleSidedMode
second: 0
- first:
name: _DstBlend
second: 0
- first:
name: _EmissiveColorMode
second: 1
- first:
name: _EmissiveIntensity
second: 0
- first:
name: _GlossMapScale
second: 1
- first:
name: _Glossiness
second: 0.1
- first:
name: _GlossyReflections
second: 1
- first:
name: _HeightBias
second: 0
- first:
name: _HeightMapMode
second: 0
- first:
name: _HeightScale
second: 1
- first:
name: _MaterialId
second: 0
- first:
name: _Metalic
second: 1
- first:
name: _Metallic
second: 1
- first:
name: _Mode
second: 0
- first:
name: _NormalMapSpace
second: 0
- first:
name: _OcclusionStrength
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _Smoothness
second: 0.1
- first:
name: _SmoothnessTextureChannel
second: 0
- first:
name: _SpecularHighlights
second: 1
- first:
name: _SrcBlend
second: 1
- first:
name: _SubSurfaceRadius
second: 0
- first:
name: _SurfaceType
second: 0
- first:
name: _UVSec
second: 0
- first:
name: _ZWrite
second: 1
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5
- _DepthOffsetEnable: 0
- _DetailAlbedoScale: 1
- _DetailNormalMapScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnablePerPixelDisplacement: 0
- _GlossMapScale: 1
- _Glossiness: 0.1
- _GlossyReflections: 1
- _HeightAmplitude: 0.01
- _HeightBias: 0
- _HeightCenter: 0.5
- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _Metalic: 1
- _Metallic: 1
- _Mode: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _OcclusionStrength: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _Smoothness: 0.1
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _StencilRef: 2
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 0
- _TexWorldScale: 1
- _Thickness: 0.5
- _UVBase: 0
- _UVDetail: 0
- _UVMappingPlanar: 0
- _UVSec: 0
- _ZTestMode: 8
- _ZWrite: 1
- first:
name: _BaseColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _EmissiveColor
second: {r: 0, g: 0, b: 0, a: 1}
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

280
Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_2.mat


m_PrefabInternal: {fileID: 0}
m_Name: Mat_smooth0_2
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DISTORTIONDEPTHTEST_OFF _DISTORTIONONLY_OFF
_EMISSION _NORMALMAP_TANGENT_SPACE
m_ShaderKeywords: _NORMALMAP_TANGENT_SPACE
m_EnableInstancingVariants: 0
disabledShaderPasses:
- DistortionVectors
serializedVersion: 2
serializedVersion: 3
- first:
name: _BaseColorMap
second:
- _AnisotropyMap:
- first:
name: _BumpMap
second:
- _BaseColorMap:
- first:
name: _DetailAlbedoMap
second:
- _BumpMap:
- first:
name: _DetailMask
second:
- _DetailAlbedoMap:
- first:
name: _DetailNormalMap
second:
- _DetailMap:
- first:
name: _DiffuseLightingMap
second:
- _DetailMask:
- first:
name: _EmissionMap
second:
- _DetailNormalMap:
- first:
name: _EmissiveColorMap
second:
- _DiffuseLightingMap:
- first:
name: _HeightMap
second:
- _DistortionVectorMap:
- first:
name: _MainTex
second:
- _EmissionMap:
- first:
name: _MaskMap
second:
- _EmissiveColorMap:
- first:
name: _MetallicGlossMap
second:
- _HeightMap:
- first:
name: _NormalMap
second:
- _MainTex:
- first:
name: _OcclusionMap
second:
- _MaskMap:
- first:
name: _ParallaxMap
second:
- _MetallicGlossMap:
- first:
name: _SpecularOcclusionMap
second:
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularOcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubSurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
- first:
name: _SubSurfaceRadiusMap
second:
- _ThicknessMap:
- first:
name: _AlphaCutoff
second: 0.5
- first:
name: _AlphaCutoffEnable
second: 0
- first:
name: _BlendMode
second: 0
- first:
name: _BumpScale
second: 1
- first:
name: _CullMode
second: 2
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DistortionDepthTest
second: 0
- first:
name: _DistortionOnly
second: 0
- first:
name: _DoubleSidedMode
second: 0
- first:
name: _DstBlend
second: 0
- first:
name: _EmissiveColorMode
second: 1
- first:
name: _EmissiveIntensity
second: 0
- first:
name: _GlossMapScale
second: 1
- first:
name: _Glossiness
second: 0.2
- first:
name: _GlossyReflections
second: 1
- first:
name: _HeightBias
second: 0
- first:
name: _HeightMapMode
second: 0
- first:
name: _HeightScale
second: 1
- first:
name: _MaterialId
second: 0
- first:
name: _Metalic
second: 1
- first:
name: _Metallic
second: 1
- first:
name: _Mode
second: 0
- first:
name: _NormalMapSpace
second: 0
- first:
name: _OcclusionStrength
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _Smoothness
second: 0.2
- first:
name: _SmoothnessTextureChannel
second: 0
- first:
name: _SpecularHighlights
second: 1
- first:
name: _SrcBlend
second: 1
- first:
name: _SubSurfaceRadius
second: 0
- first:
name: _SurfaceType
second: 0
- first:
name: _UVSec
second: 0
- first:
name: _ZWrite
second: 1
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5
- _DepthOffsetEnable: 0
- _DetailAlbedoScale: 1
- _DetailNormalMapScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnablePerPixelDisplacement: 0
- _GlossMapScale: 1
- _Glossiness: 0.2
- _GlossyReflections: 1
- _HeightAmplitude: 0.01
- _HeightBias: 0
- _HeightCenter: 0.5
- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _Metalic: 1
- _Metallic: 1
- _Mode: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _OcclusionStrength: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _Smoothness: 0.2
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _StencilRef: 2
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 0
- _TexWorldScale: 1
- _Thickness: 0.5
- _UVBase: 0
- _UVDetail: 0
- _UVMappingPlanar: 0
- _UVSec: 0
- _ZTestMode: 8
- _ZWrite: 1
- first:
name: _BaseColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _EmissiveColor
second: {r: 0, g: 0, b: 0, a: 1}
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

280
Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_3.mat


m_PrefabInternal: {fileID: 0}
m_Name: Mat_smooth0_3
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DISTORTIONDEPTHTEST_OFF _DISTORTIONONLY_OFF
_EMISSION _NORMALMAP_TANGENT_SPACE
m_ShaderKeywords: _NORMALMAP_TANGENT_SPACE
m_EnableInstancingVariants: 0
disabledShaderPasses:
- DistortionVectors
serializedVersion: 2
serializedVersion: 3
- first:
name: _BaseColorMap
second:
- _AnisotropyMap:
- first:
name: _BumpMap
second:
- _BaseColorMap:
- first:
name: _DetailAlbedoMap
second:
- _BumpMap:
- first:
name: _DetailMask
second:
- _DetailAlbedoMap:
- first:
name: _DetailNormalMap
second:
- _DetailMap:
- first:
name: _DiffuseLightingMap
second:
- _DetailMask:
- first:
name: _EmissionMap
second:
- _DetailNormalMap:
- first:
name: _EmissiveColorMap
second:
- _DiffuseLightingMap:
- first:
name: _HeightMap
second:
- _DistortionVectorMap:
- first:
name: _MainTex
second:
- _EmissionMap:
- first:
name: _MaskMap
second:
- _EmissiveColorMap:
- first:
name: _MetallicGlossMap
second:
- _HeightMap:
- first:
name: _NormalMap
second:
- _MainTex:
- first:
name: _OcclusionMap
second:
- _MaskMap:
- first:
name: _ParallaxMap
second:
- _MetallicGlossMap:
- first:
name: _SpecularOcclusionMap
second:
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularOcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubSurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
- first:
name: _SubSurfaceRadiusMap
second:
- _ThicknessMap:
- first:
name: _AlphaCutoff
second: 0.5
- first:
name: _AlphaCutoffEnable
second: 0
- first:
name: _BlendMode
second: 0
- first:
name: _BumpScale
second: 1
- first:
name: _CullMode
second: 2
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DistortionDepthTest
second: 0
- first:
name: _DistortionOnly
second: 0
- first:
name: _DoubleSidedMode
second: 0
- first:
name: _DstBlend
second: 0
- first:
name: _EmissiveColorMode
second: 1
- first:
name: _EmissiveIntensity
second: 0
- first:
name: _GlossMapScale
second: 1
- first:
name: _Glossiness
second: 0.3
- first:
name: _GlossyReflections
second: 1
- first:
name: _HeightBias
second: 0
- first:
name: _HeightMapMode
second: 0
- first:
name: _HeightScale
second: 1
- first:
name: _MaterialId
second: 0
- first:
name: _Metalic
second: 1
- first:
name: _Metallic
second: 1
- first:
name: _Mode
second: 0
- first:
name: _NormalMapSpace
second: 0
- first:
name: _OcclusionStrength
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _Smoothness
second: 0.3
- first:
name: _SmoothnessTextureChannel
second: 0
- first:
name: _SpecularHighlights
second: 1
- first:
name: _SrcBlend
second: 1
- first:
name: _SubSurfaceRadius
second: 0
- first:
name: _SurfaceType
second: 0
- first:
name: _UVSec
second: 0
- first:
name: _ZWrite
second: 1
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5
- _DepthOffsetEnable: 0
- _DetailAlbedoScale: 1
- _DetailNormalMapScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnablePerPixelDisplacement: 0
- _GlossMapScale: 1
- _Glossiness: 0.3
- _GlossyReflections: 1
- _HeightAmplitude: 0.01
- _HeightBias: 0
- _HeightCenter: 0.5
- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _Metalic: 1
- _Metallic: 1
- _Mode: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _OcclusionStrength: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _Smoothness: 0.3
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _StencilRef: 2
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 0
- _TexWorldScale: 1
- _Thickness: 0.5
- _UVBase: 0
- _UVDetail: 0
- _UVMappingPlanar: 0
- _UVSec: 0
- _ZTestMode: 8
- _ZWrite: 1
- first:
name: _BaseColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _EmissiveColor
second: {r: 0, g: 0, b: 0, a: 1}
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

280
Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_4.mat


m_PrefabInternal: {fileID: 0}
m_Name: Mat_smooth0_4
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DISTORTIONDEPTHTEST_OFF _DISTORTIONONLY_OFF
_EMISSION _NORMALMAP_TANGENT_SPACE
m_ShaderKeywords: _NORMALMAP_TANGENT_SPACE
m_EnableInstancingVariants: 0
disabledShaderPasses:
- DistortionVectors
serializedVersion: 2
serializedVersion: 3
- first:
name: _BaseColorMap
second:
- _AnisotropyMap:
- first:
name: _BumpMap
second:
- _BaseColorMap:
- first:
name: _DetailAlbedoMap
second:
- _BumpMap:
- first:
name: _DetailMask
second:
- _DetailAlbedoMap:
- first:
name: _DetailNormalMap
second:
- _DetailMap:
- first:
name: _DiffuseLightingMap
second:
- _DetailMask:
- first:
name: _EmissionMap
second:
- _DetailNormalMap:
- first:
name: _EmissiveColorMap
second:
- _DiffuseLightingMap:
- first:
name: _HeightMap
second:
- _DistortionVectorMap:
- first:
name: _MainTex
second:
- _EmissionMap:
- first:
name: _MaskMap
second:
- _EmissiveColorMap:
- first:
name: _MetallicGlossMap
second:
- _HeightMap:
- first:
name: _NormalMap
second:
- _MainTex:
- first:
name: _OcclusionMap
second:
- _MaskMap:
- first:
name: _ParallaxMap
second:
- _MetallicGlossMap:
- first:
name: _SpecularOcclusionMap
second:
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularOcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubSurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
- first:
name: _SubSurfaceRadiusMap
second:
- _ThicknessMap:
- first:
name: _AlphaCutoff
second: 0.5
- first:
name: _AlphaCutoffEnable
second: 0
- first:
name: _BlendMode
second: 0
- first:
name: _BumpScale
second: 1
- first:
name: _CullMode
second: 2
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DistortionDepthTest
second: 0
- first:
name: _DistortionOnly
second: 0
- first:
name: _DoubleSidedMode
second: 0
- first:
name: _DstBlend
second: 0
- first:
name: _EmissiveColorMode
second: 1
- first:
name: _EmissiveIntensity
second: 0
- first:
name: _GlossMapScale
second: 1
- first:
name: _Glossiness
second: 0.4
- first:
name: _GlossyReflections
second: 1
- first:
name: _HeightBias
second: 0
- first:
name: _HeightMapMode
second: 0
- first:
name: _HeightScale
second: 1
- first:
name: _MaterialId
second: 0
- first:
name: _Metalic
second: 1
- first:
name: _Metallic
second: 1
- first:
name: _Mode
second: 0
- first:
name: _NormalMapSpace
second: 0
- first:
name: _OcclusionStrength
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _Smoothness
second: 0.4
- first:
name: _SmoothnessTextureChannel
second: 0
- first:
name: _SpecularHighlights
second: 1
- first:
name: _SrcBlend
second: 1
- first:
name: _SubSurfaceRadius
second: 0
- first:
name: _SurfaceType
second: 0
- first:
name: _UVSec
second: 0
- first:
name: _ZWrite
second: 1
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5
- _DepthOffsetEnable: 0
- _DetailAlbedoScale: 1
- _DetailNormalMapScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnablePerPixelDisplacement: 0
- _GlossMapScale: 1
- _Glossiness: 0.4
- _GlossyReflections: 1
- _HeightAmplitude: 0.01
- _HeightBias: 0
- _HeightCenter: 0.5
- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _Metalic: 1
- _Metallic: 1
- _Mode: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _OcclusionStrength: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _Smoothness: 0.4
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _StencilRef: 2
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 0
- _TexWorldScale: 1
- _Thickness: 0.5
- _UVBase: 0
- _UVDetail: 0
- _UVMappingPlanar: 0
- _UVSec: 0
- _ZTestMode: 8
- _ZWrite: 1
- first:
name: _BaseColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _EmissiveColor
second: {r: 0, g: 0, b: 0, a: 1}
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

280
Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_5.mat


m_PrefabInternal: {fileID: 0}
m_Name: Mat_smooth0_5
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DISTORTIONDEPTHTEST_OFF _DISTORTIONONLY_OFF
_EMISSION _NORMALMAP_TANGENT_SPACE
m_ShaderKeywords: _NORMALMAP_TANGENT_SPACE
m_EnableInstancingVariants: 0
disabledShaderPasses:
- DistortionVectors
serializedVersion: 2
serializedVersion: 3
- first:
name: _BaseColorMap
second:
- _AnisotropyMap:
- first:
name: _BumpMap
second:
- _BaseColorMap:
- first:
name: _DetailAlbedoMap
second:
- _BumpMap:
- first:
name: _DetailMask
second:
- _DetailAlbedoMap:
- first:
name: _DetailNormalMap
second:
- _DetailMap:
- first:
name: _DiffuseLightingMap
second:
- _DetailMask:
- first:
name: _EmissionMap
second:
- _DetailNormalMap:
- first:
name: _EmissiveColorMap
second:
- _DiffuseLightingMap:
- first:
name: _HeightMap
second:
- _DistortionVectorMap:
- first:
name: _MainTex
second:
- _EmissionMap:
- first:
name: _MaskMap
second:
- _EmissiveColorMap:
- first:
name: _MetallicGlossMap
second:
- _HeightMap:
- first:
name: _NormalMap
second:
- _MainTex:
- first:
name: _OcclusionMap
second:
- _MaskMap:
- first:
name: _ParallaxMap
second:
- _MetallicGlossMap:
- first:
name: _SpecularOcclusionMap
second:
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularOcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubSurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
- first:
name: _SubSurfaceRadiusMap
second:
- _ThicknessMap:
- first:
name: _AlphaCutoff
second: 0.5
- first:
name: _AlphaCutoffEnable
second: 0
- first:
name: _BlendMode
second: 0
- first:
name: _BumpScale
second: 1
- first:
name: _CullMode
second: 2
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DistortionDepthTest
second: 0
- first:
name: _DistortionOnly
second: 0
- first:
name: _DoubleSidedMode
second: 0
- first:
name: _DstBlend
second: 0
- first:
name: _EmissiveColorMode
second: 1
- first:
name: _EmissiveIntensity
second: 0
- first:
name: _GlossMapScale
second: 1
- first:
name: _Glossiness
second: 0.5
- first:
name: _GlossyReflections
second: 1
- first:
name: _HeightBias
second: 0
- first:
name: _HeightMapMode
second: 0
- first:
name: _HeightScale
second: 1
- first:
name: _MaterialId
second: 0
- first:
name: _Metalic
second: 1
- first:
name: _Metallic
second: 1
- first:
name: _Mode
second: 0
- first:
name: _NormalMapSpace
second: 0
- first:
name: _OcclusionStrength
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _Smoothness
second: 0.5
- first:
name: _SmoothnessTextureChannel
second: 0
- first:
name: _SpecularHighlights
second: 1
- first:
name: _SrcBlend
second: 1
- first:
name: _SubSurfaceRadius
second: 0
- first:
name: _SurfaceType
second: 0
- first:
name: _UVSec
second: 0
- first:
name: _ZWrite
second: 1
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5
- _DepthOffsetEnable: 0
- _DetailAlbedoScale: 1
- _DetailNormalMapScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnablePerPixelDisplacement: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _HeightAmplitude: 0.01
- _HeightBias: 0
- _HeightCenter: 0.5
- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _Metalic: 1
- _Metallic: 1
- _Mode: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _OcclusionStrength: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _StencilRef: 2
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 0
- _TexWorldScale: 1
- _Thickness: 0.5
- _UVBase: 0
- _UVDetail: 0
- _UVMappingPlanar: 0
- _UVSec: 0
- _ZTestMode: 8
- _ZWrite: 1
- first:
name: _BaseColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _EmissiveColor
second: {r: 0, g: 0, b: 0, a: 1}
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

280
Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_6.mat


m_PrefabInternal: {fileID: 0}
m_Name: Mat_smooth0_6
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DISTORTIONDEPTHTEST_OFF _DISTORTIONONLY_OFF
_EMISSION _NORMALMAP_TANGENT_SPACE
m_ShaderKeywords: _NORMALMAP_TANGENT_SPACE
m_EnableInstancingVariants: 0
disabledShaderPasses:
- DistortionVectors
serializedVersion: 2
serializedVersion: 3
- first:
name: _BaseColorMap
second:
- _AnisotropyMap:
- first:
name: _BumpMap
second:
- _BaseColorMap:
- first:
name: _DetailAlbedoMap
second:
- _BumpMap:
- first:
name: _DetailMask
second:
- _DetailAlbedoMap:
- first:
name: _DetailNormalMap
second:
- _DetailMap:
- first:
name: _DiffuseLightingMap
second:
- _DetailMask:
- first:
name: _EmissionMap
second:
- _DetailNormalMap:
- first:
name: _EmissiveColorMap
second:
- _DiffuseLightingMap:
- first:
name: _HeightMap
second:
- _DistortionVectorMap:
- first:
name: _MainTex
second:
- _EmissionMap:
- first:
name: _MaskMap
second:
- _EmissiveColorMap:
- first:
name: _MetallicGlossMap
second:
- _HeightMap:
- first:
name: _NormalMap
second:
- _MainTex:
- first:
name: _OcclusionMap
second:
- _MaskMap:
- first:
name: _ParallaxMap
second:
- _MetallicGlossMap:
- first:
name: _SpecularOcclusionMap
second:
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularOcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubSurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
- first:
name: _SubSurfaceRadiusMap
second:
- _ThicknessMap:
- first:
name: _AlphaCutoff
second: 0.5
- first:
name: _AlphaCutoffEnable
second: 0
- first:
name: _BlendMode
second: 0
- first:
name: _BumpScale
second: 1
- first:
name: _CullMode
second: 2
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DistortionDepthTest
second: 0
- first:
name: _DistortionOnly
second: 0
- first:
name: _DoubleSidedMode
second: 0
- first:
name: _DstBlend
second: 0
- first:
name: _EmissiveColorMode
second: 1
- first:
name: _EmissiveIntensity
second: 0
- first:
name: _GlossMapScale
second: 1
- first:
name: _Glossiness
second: 0.6
- first:
name: _GlossyReflections
second: 1
- first:
name: _HeightBias
second: 0
- first:
name: _HeightMapMode
second: 0
- first:
name: _HeightScale
second: 1
- first:
name: _MaterialId
second: 0
- first:
name: _Metalic
second: 1
- first:
name: _Metallic
second: 1
- first:
name: _Mode
second: 0
- first:
name: _NormalMapSpace
second: 0
- first:
name: _OcclusionStrength
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _Smoothness
second: 0.6
- first:
name: _SmoothnessTextureChannel
second: 0
- first:
name: _SpecularHighlights
second: 1
- first:
name: _SrcBlend
second: 1
- first:
name: _SubSurfaceRadius
second: 0
- first:
name: _SurfaceType
second: 0
- first:
name: _UVSec
second: 0
- first:
name: _ZWrite
second: 1
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5
- _DepthOffsetEnable: 0
- _DetailAlbedoScale: 1
- _DetailNormalMapScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnablePerPixelDisplacement: 0
- _GlossMapScale: 1
- _Glossiness: 0.6
- _GlossyReflections: 1
- _HeightAmplitude: 0.01
- _HeightBias: 0
- _HeightCenter: 0.5
- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _Metalic: 1
- _Metallic: 1
- _Mode: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _OcclusionStrength: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _Smoothness: 0.6
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _StencilRef: 2
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 0
- _TexWorldScale: 1
- _Thickness: 0.5
- _UVBase: 0
- _UVDetail: 0
- _UVMappingPlanar: 0
- _UVSec: 0
- _ZTestMode: 8
- _ZWrite: 1
- first:
name: _BaseColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _EmissiveColor
second: {r: 0, g: 0, b: 0, a: 1}
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

280
Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_7.mat


m_PrefabInternal: {fileID: 0}
m_Name: Mat_smooth0_7
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DISTORTIONDEPTHTEST_OFF _DISTORTIONONLY_OFF
_EMISSION _NORMALMAP_TANGENT_SPACE
m_ShaderKeywords: _NORMALMAP_TANGENT_SPACE
m_EnableInstancingVariants: 0
disabledShaderPasses:
- DistortionVectors
serializedVersion: 2
serializedVersion: 3
- first:
name: _BaseColorMap
second:
- _AnisotropyMap:
- first:
name: _BumpMap
second:
- _BaseColorMap:
- first:
name: _DetailAlbedoMap
second:
- _BumpMap:
- first:
name: _DetailMask
second:
- _DetailAlbedoMap:
- first:
name: _DetailNormalMap
second:
- _DetailMap:
- first:
name: _DiffuseLightingMap
second:
- _DetailMask:
- first:
name: _EmissionMap
second:
- _DetailNormalMap:
- first:
name: _EmissiveColorMap
second:
- _DiffuseLightingMap:
- first:
name: _HeightMap
second:
- _DistortionVectorMap:
- first:
name: _MainTex
second:
- _EmissionMap:
- first:
name: _MaskMap
second:
- _EmissiveColorMap:
- first:
name: _MetallicGlossMap
second:
- _HeightMap:
- first:
name: _NormalMap
second:
- _MainTex:
- first:
name: _OcclusionMap
second:
- _MaskMap:
- first:
name: _ParallaxMap
second:
- _MetallicGlossMap:
- first:
name: _SpecularOcclusionMap
second:
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularOcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubSurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
- first:
name: _SubSurfaceRadiusMap
second:
- _ThicknessMap:
- first:
name: _AlphaCutoff
second: 0.5
- first:
name: _AlphaCutoffEnable
second: 0
- first:
name: _BlendMode
second: 0
- first:
name: _BumpScale
second: 1
- first:
name: _CullMode
second: 2
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DistortionDepthTest
second: 0
- first:
name: _DistortionOnly
second: 0
- first:
name: _DoubleSidedMode
second: 0
- first:
name: _DstBlend
second: 0
- first:
name: _EmissiveColorMode
second: 1
- first:
name: _EmissiveIntensity
second: 0
- first:
name: _GlossMapScale
second: 1
- first:
name: _Glossiness
second: 0.7
- first:
name: _GlossyReflections
second: 1
- first:
name: _HeightBias
second: 0
- first:
name: _HeightMapMode
second: 0
- first:
name: _HeightScale
second: 1
- first:
name: _MaterialId
second: 0
- first:
name: _Metalic
second: 1
- first:
name: _Metallic
second: 1
- first:
name: _Mode
second: 0
- first:
name: _NormalMapSpace
second: 0
- first:
name: _OcclusionStrength
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _Smoothness
second: 0.7
- first:
name: _SmoothnessTextureChannel
second: 0
- first:
name: _SpecularHighlights
second: 1
- first:
name: _SrcBlend
second: 1
- first:
name: _SubSurfaceRadius
second: 0
- first:
name: _SurfaceType
second: 0
- first:
name: _UVSec
second: 0
- first:
name: _ZWrite
second: 1
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5
- _DepthOffsetEnable: 0
- _DetailAlbedoScale: 1
- _DetailNormalMapScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnablePerPixelDisplacement: 0
- _GlossMapScale: 1
- _Glossiness: 0.7
- _GlossyReflections: 1
- _HeightAmplitude: 0.01
- _HeightBias: 0
- _HeightCenter: 0.5
- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _Metalic: 1
- _Metallic: 1
- _Mode: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _OcclusionStrength: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _Smoothness: 0.7
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _StencilRef: 2
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 0
- _TexWorldScale: 1
- _Thickness: 0.5
- _UVBase: 0
- _UVDetail: 0
- _UVMappingPlanar: 0
- _UVSec: 0
- _ZTestMode: 8
- _ZWrite: 1
- first:
name: _BaseColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _EmissiveColor
second: {r: 0, g: 0, b: 0, a: 1}
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

280
Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_8.mat


m_PrefabInternal: {fileID: 0}
m_Name: Mat_smooth0_8
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DISTORTIONDEPTHTEST_OFF _DISTORTIONONLY_OFF
_EMISSION _NORMALMAP_TANGENT_SPACE
m_ShaderKeywords: _NORMALMAP_TANGENT_SPACE
m_EnableInstancingVariants: 0
disabledShaderPasses:
- DistortionVectors
serializedVersion: 2
serializedVersion: 3
- first:
name: _BaseColorMap
second:
- _AnisotropyMap:
- first:
name: _BumpMap
second:
- _BaseColorMap:
- first:
name: _DetailAlbedoMap
second:
- _BumpMap:
- first:
name: _DetailMask
second:
- _DetailAlbedoMap:
- first:
name: _DetailNormalMap
second:
- _DetailMap:
- first:
name: _DiffuseLightingMap
second:
- _DetailMask:
- first:
name: _EmissionMap
second:
- _DetailNormalMap:
- first:
name: _EmissiveColorMap
second:
- _DiffuseLightingMap:
- first:
name: _HeightMap
second:
- _DistortionVectorMap:
- first:
name: _MainTex
second:
- _EmissionMap:
- first:
name: _MaskMap
second:
- _EmissiveColorMap:
- first:
name: _MetallicGlossMap
second:
- _HeightMap:
- first:
name: _NormalMap
second:
- _MainTex:
- first:
name: _OcclusionMap
second:
- _MaskMap:
- first:
name: _ParallaxMap
second:
- _MetallicGlossMap:
- first:
name: _SpecularOcclusionMap
second:
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularOcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubSurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
- first:
name: _SubSurfaceRadiusMap
second:
- _ThicknessMap:
- first:
name: _AlphaCutoff
second: 0.5
- first:
name: _AlphaCutoffEnable
second: 0
- first:
name: _BlendMode
second: 0
- first:
name: _BumpScale
second: 1
- first:
name: _CullMode
second: 2
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DistortionDepthTest
second: 0
- first:
name: _DistortionOnly
second: 0
- first:
name: _DoubleSidedMode
second: 0
- first:
name: _DstBlend
second: 0
- first:
name: _EmissiveColorMode
second: 1
- first:
name: _EmissiveIntensity
second: 0
- first:
name: _GlossMapScale
second: 1
- first:
name: _Glossiness
second: 0.8
- first:
name: _GlossyReflections
second: 1
- first:
name: _HeightBias
second: 0
- first:
name: _HeightMapMode
second: 0
- first:
name: _HeightScale
second: 1
- first:
name: _MaterialId
second: 0
- first:
name: _Metalic
second: 1
- first:
name: _Metallic
second: 1
- first:
name: _Mode
second: 0
- first:
name: _NormalMapSpace
second: 0
- first:
name: _OcclusionStrength
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _Smoothness
second: 0.8
- first:
name: _SmoothnessTextureChannel
second: 0
- first:
name: _SpecularHighlights
second: 1
- first:
name: _SrcBlend
second: 1
- first:
name: _SubSurfaceRadius
second: 0
- first:
name: _SurfaceType
second: 0
- first:
name: _UVSec
second: 0
- first:
name: _ZWrite
second: 1
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5
- _DepthOffsetEnable: 0
- _DetailAlbedoScale: 1
- _DetailNormalMapScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnablePerPixelDisplacement: 0
- _GlossMapScale: 1
- _Glossiness: 0.8
- _GlossyReflections: 1
- _HeightAmplitude: 0.01
- _HeightBias: 0
- _HeightCenter: 0.5
- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _Metalic: 1
- _Metallic: 1
- _Mode: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _OcclusionStrength: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _Smoothness: 0.8
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _StencilRef: 2
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 0
- _TexWorldScale: 1
- _Thickness: 0.5
- _UVBase: 0
- _UVDetail: 0
- _UVMappingPlanar: 0
- _UVSec: 0
- _ZTestMode: 8
- _ZWrite: 1
- first:
name: _BaseColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _EmissiveColor
second: {r: 0, g: 0, b: 0, a: 1}
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

280
Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_9.mat


m_PrefabInternal: {fileID: 0}
m_Name: Mat_smooth0_9
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DISTORTIONDEPTHTEST_OFF _DISTORTIONONLY_OFF
_EMISSION _NORMALMAP_TANGENT_SPACE
m_ShaderKeywords: _NORMALMAP_TANGENT_SPACE
m_EnableInstancingVariants: 0
disabledShaderPasses:
- DistortionVectors
serializedVersion: 2
serializedVersion: 3
- first:
name: _BaseColorMap
second:
- _AnisotropyMap:
- first:
name: _BumpMap
second:
- _BaseColorMap:
- first:
name: _DetailAlbedoMap
second:
- _BumpMap:
- first:
name: _DetailMask
second:
- _DetailAlbedoMap:
- first:
name: _DetailNormalMap
second:
- _DetailMap:
- first:
name: _DiffuseLightingMap
second:
- _DetailMask:
- first:
name: _EmissionMap
second:
- _DetailNormalMap:
- first:
name: _EmissiveColorMap
second:
- _DiffuseLightingMap:
- first:
name: _HeightMap
second:
- _DistortionVectorMap:
- first:
name: _MainTex
second:
- _EmissionMap:
- first:
name: _MaskMap
second:
- _EmissiveColorMap:
- first:
name: _MetallicGlossMap
second:
- _HeightMap:
- first:
name: _NormalMap
second:
- _MainTex:
- first:
name: _OcclusionMap
second:
- _MaskMap:
- first:
name: _ParallaxMap
second:
- _MetallicGlossMap:
- first:
name: _SpecularOcclusionMap
second:
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularOcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubSurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
- first:
name: _SubSurfaceRadiusMap
second:
- _ThicknessMap:
- first:
name: _AlphaCutoff
second: 0.5
- first:
name: _AlphaCutoffEnable
second: 0
- first:
name: _BlendMode
second: 0
- first:
name: _BumpScale
second: 1
- first:
name: _CullMode
second: 2
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DistortionDepthTest
second: 0
- first:
name: _DistortionOnly
second: 0
- first:
name: _DoubleSidedMode
second: 0
- first:
name: _DstBlend
second: 0
- first:
name: _EmissiveColorMode
second: 1
- first:
name: _EmissiveIntensity
second: 0
- first:
name: _GlossMapScale
second: 1
- first:
name: _Glossiness
second: 0.9
- first:
name: _GlossyReflections
second: 1
- first:
name: _HeightBias
second: 0
- first:
name: _HeightMapMode
second: 0
- first:
name: _HeightScale
second: 1
- first:
name: _MaterialId
second: 0
- first:
name: _Metalic
second: 1
- first:
name: _Metallic
second: 1
- first:
name: _Mode
second: 0
- first:
name: _NormalMapSpace
second: 0
- first:
name: _OcclusionStrength
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _Smoothness
second: 0.9
- first:
name: _SmoothnessTextureChannel
second: 0
- first:
name: _SpecularHighlights
second: 1
- first:
name: _SrcBlend
second: 1
- first:
name: _SubSurfaceRadius
second: 0
- first:
name: _SurfaceType
second: 0
- first:
name: _UVSec
second: 0
- first:
name: _ZWrite
second: 1
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5
- _DepthOffsetEnable: 0
- _DetailAlbedoScale: 1
- _DetailNormalMapScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnablePerPixelDisplacement: 0
- _GlossMapScale: 1
- _Glossiness: 0.9
- _GlossyReflections: 1
- _HeightAmplitude: 0.01
- _HeightBias: 0
- _HeightCenter: 0.5
- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _Metalic: 1
- _Metallic: 1
- _Mode: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _OcclusionStrength: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _Smoothness: 0.9
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _StencilRef: 2
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 0
- _TexWorldScale: 1
- _Thickness: 0.5
- _UVBase: 0
- _UVDetail: 0
- _UVMappingPlanar: 0
- _UVSec: 0
- _ZTestMode: 8
- _ZWrite: 1
- first:
name: _BaseColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _EmissiveColor
second: {r: 0, g: 0, b: 0, a: 1}
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

280
Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth1_1.mat


m_PrefabInternal: {fileID: 0}
m_Name: Mat_smooth1_1
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DISTORTIONDEPTHTEST_OFF _DISTORTIONONLY_OFF
_EMISSION _NORMALMAP_TANGENT_SPACE
m_ShaderKeywords: _NORMALMAP_TANGENT_SPACE
m_EnableInstancingVariants: 0
disabledShaderPasses:
- DistortionVectors
serializedVersion: 2
serializedVersion: 3
- first:
name: _BaseColorMap
second:
- _AnisotropyMap:
- first:
name: _BumpMap
second:
- _BaseColorMap:
- first:
name: _DetailAlbedoMap
second:
- _BumpMap:
- first:
name: _DetailMask
second:
- _DetailAlbedoMap:
- first:
name: _DetailNormalMap
second:
- _DetailMap:
- first:
name: _DiffuseLightingMap
second:
- _DetailMask:
- first:
name: _EmissionMap
second:
- _DetailNormalMap:
- first:
name: _EmissiveColorMap
second:
- _DiffuseLightingMap:
- first:
name: _HeightMap
second:
- _DistortionVectorMap:
- first:
name: _MainTex
second:
- _EmissionMap:
- first:
name: _MaskMap
second:
- _EmissiveColorMap:
- first:
name: _MetallicGlossMap
second:
- _HeightMap:
- first:
name: _NormalMap
second:
- _MainTex:
- first:
name: _OcclusionMap
second:
- _MaskMap:
- first:
name: _ParallaxMap
second:
- _MetallicGlossMap:
- first:
name: _SpecularOcclusionMap
second:
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularOcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubSurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
- first:
name: _SubSurfaceRadiusMap
second:
- _ThicknessMap:
- first:
name: _AlphaCutoff
second: 0.5
- first:
name: _AlphaCutoffEnable
second: 0
- first:
name: _BlendMode
second: 0
- first:
name: _BumpScale
second: 1
- first:
name: _CullMode
second: 2
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DistortionDepthTest
second: 0
- first:
name: _DistortionOnly
second: 0
- first:
name: _DoubleSidedMode
second: 0
- first:
name: _DstBlend
second: 0
- first:
name: _EmissiveColorMode
second: 1
- first:
name: _EmissiveIntensity
second: 0
- first:
name: _GlossMapScale
second: 1
- first:
name: _Glossiness
second: 1
- first:
name: _GlossyReflections
second: 1
- first:
name: _HeightBias
second: 0
- first:
name: _HeightMapMode
second: 0
- first:
name: _HeightScale
second: 1
- first:
name: _MaterialId
second: 0
- first:
name: _Metalic
second: 1
- first:
name: _Metallic
second: 1
- first:
name: _Mode
second: 0
- first:
name: _NormalMapSpace
second: 0
- first:
name: _OcclusionStrength
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _Smoothness
second: 1
- first:
name: _SmoothnessTextureChannel
second: 0
- first:
name: _SpecularHighlights
second: 1
- first:
name: _SrcBlend
second: 1
- first:
name: _SubSurfaceRadius
second: 0
- first:
name: _SurfaceType
second: 0
- first:
name: _UVSec
second: 0
- first:
name: _ZWrite
second: 1
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5
- _DepthOffsetEnable: 0
- _DetailAlbedoScale: 1
- _DetailNormalMapScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnablePerPixelDisplacement: 0
- _GlossMapScale: 1
- _Glossiness: 1
- _GlossyReflections: 1
- _HeightAmplitude: 0.01
- _HeightBias: 0
- _HeightCenter: 0.5
- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _Metalic: 1
- _Metallic: 1
- _Mode: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _OcclusionStrength: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _Smoothness: 1
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _StencilRef: 2
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 0
- _TexWorldScale: 1
- _Thickness: 0.5
- _UVBase: 0
- _UVDetail: 0
- _UVMappingPlanar: 0
- _UVSec: 0
- _ZTestMode: 8
- _ZWrite: 1
- first:
name: _BaseColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _EmissiveColor
second: {r: 0, g: 0, b: 0, a: 1}
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

280
Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric0_0.mat


m_PrefabInternal: {fileID: 0}
m_Name: Mat_smoothdielectric0_0
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DISTORTIONDEPTHTEST_OFF _DISTORTIONONLY_OFF
_EMISSION _NORMALMAP_TANGENT_SPACE
m_ShaderKeywords: _NORMALMAP_TANGENT_SPACE
m_EnableInstancingVariants: 0
disabledShaderPasses:
- DistortionVectors
serializedVersion: 2
serializedVersion: 3
- first:
name: _BaseColorMap
second:
- _AnisotropyMap:
- first:
name: _BumpMap
second:
- _BaseColorMap:
- first:
name: _DetailAlbedoMap
second:
- _BumpMap:
- first:
name: _DetailMask
second:
- _DetailAlbedoMap:
- first:
name: _DetailNormalMap
second:
- _DetailMap:
- first:
name: _DiffuseLightingMap
second:
- _DetailMask:
- first:
name: _EmissionMap
second:
- _DetailNormalMap:
- first:
name: _EmissiveColorMap
second:
- _DiffuseLightingMap:
- first:
name: _HeightMap
second:
- _DistortionVectorMap:
- first:
name: _MainTex
second:
- _EmissionMap:
- first:
name: _MaskMap
second:
- _EmissiveColorMap:
- first:
name: _MetallicGlossMap
second:
- _HeightMap:
- first:
name: _NormalMap
second:
- _MainTex:
- first:
name: _OcclusionMap
second:
- _MaskMap:
- first:
name: _ParallaxMap
second:
- _MetallicGlossMap:
- first:
name: _SpecularOcclusionMap
second:
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularOcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubSurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
- first:
name: _SubSurfaceRadiusMap
second:
- _ThicknessMap:
- first:
name: _AlphaCutoff
second: 0.5
- first:
name: _AlphaCutoffEnable
second: 0
- first:
name: _BlendMode
second: 0
- first:
name: _BumpScale
second: 1
- first:
name: _CullMode
second: 2
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DistortionDepthTest
second: 0
- first:
name: _DistortionOnly
second: 0
- first:
name: _DoubleSidedMode
second: 0
- first:
name: _DstBlend
second: 0
- first:
name: _EmissiveColorMode
second: 1
- first:
name: _EmissiveIntensity
second: 0
- first:
name: _GlossMapScale
second: 1
- first:
name: _Glossiness
second: 0
- first:
name: _GlossyReflections
second: 1
- first:
name: _HeightBias
second: 0
- first:
name: _HeightMapMode
second: 0
- first:
name: _HeightScale
second: 1
- first:
name: _MaterialId
second: 0
- first:
name: _Metalic
second: 0
- first:
name: _Metallic
second: 0
- first:
name: _Mode
second: 0
- first:
name: _NormalMapSpace
second: 0
- first:
name: _OcclusionStrength
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _Smoothness
second: 0
- first:
name: _SmoothnessTextureChannel
second: 0
- first:
name: _SpecularHighlights
second: 1
- first:
name: _SrcBlend
second: 1
- first:
name: _SubSurfaceRadius
second: 0
- first:
name: _SurfaceType
second: 0
- first:
name: _UVSec
second: 0
- first:
name: _ZWrite
second: 1
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5
- _DepthOffsetEnable: 0
- _DetailAlbedoScale: 1
- _DetailNormalMapScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnablePerPixelDisplacement: 0
- _GlossMapScale: 1
- _Glossiness: 0
- _GlossyReflections: 1
- _HeightAmplitude: 0.01
- _HeightBias: 0
- _HeightCenter: 0.5
- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _Metalic: 0
- _Metallic: 0
- _Mode: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _OcclusionStrength: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _Smoothness: 0
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _StencilRef: 2
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 0
- _TexWorldScale: 1
- _Thickness: 0.5
- _UVBase: 0
- _UVDetail: 0
- _UVMappingPlanar: 0
- _UVSec: 0
- _ZTestMode: 8
- _ZWrite: 1
- first:
name: _BaseColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _Color
second: {r: 0.7176471, g: 0.7176471, b: 0.7176471, a: 1}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _EmissiveColor
second: {r: 0, g: 0, b: 0, a: 1}
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 0.7176471, g: 0.7176471, b: 0.7176471, a: 1}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

280
Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric0_1.mat


m_PrefabInternal: {fileID: 0}
m_Name: Mat_smoothdielectric0_1
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DISTORTIONDEPTHTEST_OFF _DISTORTIONONLY_OFF
_EMISSION _NORMALMAP_TANGENT_SPACE
m_ShaderKeywords: _NORMALMAP_TANGENT_SPACE
m_EnableInstancingVariants: 0
disabledShaderPasses:
- DistortionVectors
serializedVersion: 2
serializedVersion: 3
- first:
name: _BaseColorMap
second:
- _AnisotropyMap:
- first:
name: _BumpMap
second:
- _BaseColorMap:
- first:
name: _DetailAlbedoMap
second:
- _BumpMap:
- first:
name: _DetailMask
second:
- _DetailAlbedoMap:
- first:
name: _DetailNormalMap
second:
- _DetailMap:
- first:
name: _DiffuseLightingMap
second:
- _DetailMask:
- first:
name: _EmissionMap
second:
- _DetailNormalMap:
- first:
name: _EmissiveColorMap
second:
- _DiffuseLightingMap:
- first:
name: _HeightMap
second:
- _DistortionVectorMap:
- first:
name: _MainTex
second:
- _EmissionMap:
- first:
name: _MaskMap
second:
- _EmissiveColorMap:
- first:
name: _MetallicGlossMap
second:
- _HeightMap:
- first:
name: _NormalMap
second:
- _MainTex:
- first:
name: _OcclusionMap
second:
- _MaskMap:
- first:
name: _ParallaxMap
second:
- _MetallicGlossMap:
- first:
name: _SpecularOcclusionMap
second:
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularOcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubSurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
- first:
name: _SubSurfaceRadiusMap
second:
- _ThicknessMap:
- first:
name: _AlphaCutoff
second: 0.5
- first:
name: _AlphaCutoffEnable
second: 0
- first:
name: _BlendMode
second: 0
- first:
name: _BumpScale
second: 1
- first:
name: _CullMode
second: 2
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DistortionDepthTest
second: 0
- first:
name: _DistortionOnly
second: 0
- first:
name: _DoubleSidedMode
second: 0
- first:
name: _DstBlend
second: 0
- first:
name: _EmissiveColorMode
second: 1
- first:
name: _EmissiveIntensity
second: 0
- first:
name: _GlossMapScale
second: 1
- first:
name: _Glossiness
second: 0.1
- first:
name: _GlossyReflections
second: 1
- first:
name: _HeightBias
second: 0
- first:
name: _HeightMapMode
second: 0
- first:
name: _HeightScale
second: 1
- first:
name: _MaterialId
second: 0
- first:
name: _Metalic
second: 0
- first:
name: _Metallic
second: 0
- first:
name: _Mode
second: 0
- first:
name: _NormalMapSpace
second: 0
- first:
name: _OcclusionStrength
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _Smoothness
second: 0.1
- first:
name: _SmoothnessTextureChannel
second: 0
- first:
name: _SpecularHighlights
second: 1
- first:
name: _SrcBlend
second: 1
- first:
name: _SubSurfaceRadius
second: 0
- first:
name: _SurfaceType
second: 0
- first:
name: _UVSec
second: 0
- first:
name: _ZWrite
second: 1
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5
- _DepthOffsetEnable: 0
- _DetailAlbedoScale: 1
- _DetailNormalMapScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnablePerPixelDisplacement: 0
- _GlossMapScale: 1
- _Glossiness: 0.1
- _GlossyReflections: 1
- _HeightAmplitude: 0.01
- _HeightBias: 0
- _HeightCenter: 0.5
- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _Metalic: 0
- _Metallic: 0
- _Mode: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _OcclusionStrength: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _Smoothness: 0.1
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _StencilRef: 2
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 0
- _TexWorldScale: 1
- _Thickness: 0.5
- _UVBase: 0
- _UVDetail: 0
- _UVMappingPlanar: 0
- _UVSec: 0
- _ZTestMode: 8
- _ZWrite: 1
- first:
name: _BaseColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _Color
second: {r: 0.7176471, g: 0.7176471, b: 0.7176471, a: 1}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _EmissiveColor
second: {r: 0, g: 0, b: 0, a: 1}
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 0.7176471, g: 0.7176471, b: 0.7176471, a: 1}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

280
Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric0_2.mat


m_PrefabInternal: {fileID: 0}
m_Name: Mat_smoothdielectric0_2
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DISTORTIONDEPTHTEST_OFF _DISTORTIONONLY_OFF
_EMISSION _NORMALMAP_TANGENT_SPACE
m_ShaderKeywords: _NORMALMAP_TANGENT_SPACE
m_EnableInstancingVariants: 0
disabledShaderPasses:
- DistortionVectors
serializedVersion: 2
serializedVersion: 3
- first:
name: _BaseColorMap
second:
- _AnisotropyMap:
- first:
name: _BumpMap
second:
- _BaseColorMap:
- first:
name: _DetailAlbedoMap
second:
- _BumpMap:
- first:
name: _DetailMask
second:
- _DetailAlbedoMap:
- first:
name: _DetailNormalMap
second:
- _DetailMap:
- first:
name: _DiffuseLightingMap
second:
- _DetailMask:
- first:
name: _EmissionMap
second:
- _DetailNormalMap:
- first:
name: _EmissiveColorMap
second:
- _DiffuseLightingMap:
- first:
name: _HeightMap
second:
- _DistortionVectorMap:
- first:
name: _MainTex
second:
- _EmissionMap:
- first:
name: _MaskMap
second:
- _EmissiveColorMap:
- first:
name: _MetallicGlossMap
second:
- _HeightMap:
- first:
name: _NormalMap
second:
- _MainTex:
- first:
name: _OcclusionMap
second:
- _MaskMap:
- first:
name: _ParallaxMap
second:
- _MetallicGlossMap:
- first:
name: _SpecularOcclusionMap
second:
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularOcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubSurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
- first:
name: _SubSurfaceRadiusMap
second:
- _ThicknessMap:
- first:
name: _AlphaCutoff
second: 0.5
- first:
name: _AlphaCutoffEnable
second: 0
- first:
name: _BlendMode
second: 0
- first:
name: _BumpScale
second: 1
- first:
name: _CullMode
second: 2
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DistortionDepthTest
second: 0
- first:
name: _DistortionOnly
second: 0
- first:
name: _DoubleSidedMode
second: 0
- first:
name: _DstBlend
second: 0
- first:
name: _EmissiveColorMode
second: 1
- first:
name: _EmissiveIntensity
second: 0
- first:
name: _GlossMapScale
second: 1
- first:
name: _Glossiness
second: 0.2
- first:
name: _GlossyReflections
second: 1
- first:
name: _HeightBias
second: 0
- first:
name: _HeightMapMode
second: 0
- first:
name: _HeightScale
second: 1
- first:
name: _MaterialId
second: 0
- first:
name: _Metalic
second: 0
- first:
name: _Metallic
second: 0
- first:
name: _Mode
second: 0
- first:
name: _NormalMapSpace
second: 0
- first:
name: _OcclusionStrength
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _Smoothness
second: 0.2
- first:
name: _SmoothnessTextureChannel
second: 0
- first:
name: _SpecularHighlights
second: 1
- first:
name: _SrcBlend
second: 1
- first:
name: _SubSurfaceRadius
second: 0
- first:
name: _SurfaceType
second: 0
- first:
name: _UVSec
second: 0
- first:
name: _ZWrite
second: 1
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5
- _DepthOffsetEnable: 0
- _DetailAlbedoScale: 1
- _DetailNormalMapScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnablePerPixelDisplacement: 0
- _GlossMapScale: 1
- _Glossiness: 0.2
- _GlossyReflections: 1
- _HeightAmplitude: 0.01
- _HeightBias: 0
- _HeightCenter: 0.5
- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _Metalic: 0
- _Metallic: 0
- _Mode: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _OcclusionStrength: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _Smoothness: 0.2
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _StencilRef: 2
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 0
- _TexWorldScale: 1
- _Thickness: 0.5
- _UVBase: 0
- _UVDetail: 0
- _UVMappingPlanar: 0
- _UVSec: 0
- _ZTestMode: 8
- _ZWrite: 1
- first:
name: _BaseColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _Color
second: {r: 0.7176471, g: 0.7176471, b: 0.7176471, a: 1}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _EmissiveColor
second: {r: 0, g: 0, b: 0, a: 1}
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 0.7176471, g: 0.7176471, b: 0.7176471, a: 1}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

280
Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric0_3.mat


m_PrefabInternal: {fileID: 0}
m_Name: Mat_smoothdielectric0_3
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DISTORTIONDEPTHTEST_OFF _DISTORTIONONLY_OFF
_EMISSION _NORMALMAP_TANGENT_SPACE
m_ShaderKeywords: _NORMALMAP_TANGENT_SPACE
m_EnableInstancingVariants: 0
disabledShaderPasses:
- DistortionVectors
serializedVersion: 2
serializedVersion: 3
- first:
name: _BaseColorMap
second:
- _AnisotropyMap:
- first:
name: _BumpMap
second:
- _BaseColorMap:
- first:
name: _DetailAlbedoMap
second:
- _BumpMap:
- first:
name: _DetailMask
second:
- _DetailAlbedoMap:
- first:
name: _DetailNormalMap
second:
- _DetailMap:
- first:
name: _DiffuseLightingMap
second:
- _DetailMask:
- first:
name: _EmissionMap
second:
- _DetailNormalMap:
- first:
name: _EmissiveColorMap
second:
- _DiffuseLightingMap:
- first:
name: _HeightMap
second:
- _DistortionVectorMap:
- first:
name: _MainTex
second:
- _EmissionMap:
- first:
name: _MaskMap
second:
- _EmissiveColorMap:
- first:
name: _MetallicGlossMap
second:
- _HeightMap:
- first:
name: _NormalMap
second:
- _MainTex:
- first:
name: _OcclusionMap
second:
- _MaskMap:
- first:
name: _ParallaxMap
second:
- _MetallicGlossMap:
- first:
name: _SpecularOcclusionMap
second:
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularOcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubSurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
- first:
name: _SubSurfaceRadiusMap
second:
- _ThicknessMap:
- first:
name: _AlphaCutoff
second: 0.5
- first:
name: _AlphaCutoffEnable
second: 0
- first:
name: _BlendMode
second: 0
- first:
name: _BumpScale
second: 1
- first:
name: _CullMode
second: 2
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DistortionDepthTest
second: 0
- first:
name: _DistortionOnly
second: 0
- first:
name: _DoubleSidedMode
second: 0
- first:
name: _DstBlend
second: 0
- first:
name: _EmissiveColorMode
second: 1
- first:
name: _EmissiveIntensity
second: 0
- first:
name: _GlossMapScale
second: 1
- first:
name: _Glossiness
second: 0.3
- first:
name: _GlossyReflections
second: 1
- first:
name: _HeightBias
second: 0
- first:
name: _HeightMapMode
second: 0
- first:
name: _HeightScale
second: 1
- first:
name: _MaterialId
second: 0
- first:
name: _Metalic
second: 0
- first:
name: _Metallic
second: 0
- first:
name: _Mode
second: 0
- first:
name: _NormalMapSpace
second: 0
- first:
name: _OcclusionStrength
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _Smoothness
second: 0.3
- first:
name: _SmoothnessTextureChannel
second: 0
- first:
name: _SpecularHighlights
second: 1
- first:
name: _SrcBlend
second: 1
- first:
name: _SubSurfaceRadius
second: 0
- first:
name: _SurfaceType
second: 0
- first:
name: _UVSec
second: 0
- first:
name: _ZWrite
second: 1
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5
- _DepthOffsetEnable: 0
- _DetailAlbedoScale: 1
- _DetailNormalMapScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnablePerPixelDisplacement: 0
- _GlossMapScale: 1
- _Glossiness: 0.3
- _GlossyReflections: 1
- _HeightAmplitude: 0.01
- _HeightBias: 0
- _HeightCenter: 0.5
- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _Metalic: 0
- _Metallic: 0
- _Mode: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _OcclusionStrength: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _Smoothness: 0.3
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _StencilRef: 2
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 0
- _TexWorldScale: 1
- _Thickness: 0.5
- _UVBase: 0
- _UVDetail: 0
- _UVMappingPlanar: 0
- _UVSec: 0
- _ZTestMode: 8
- _ZWrite: 1
- first:
name: _BaseColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _Color
second: {r: 0.7176471, g: 0.7176471, b: 0.7176471, a: 1}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _EmissiveColor
second: {r: 0, g: 0, b: 0, a: 1}
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 0.7176471, g: 0.7176471, b: 0.7176471, a: 1}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

280
Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric0_4.mat


m_PrefabInternal: {fileID: 0}
m_Name: Mat_smoothdielectric0_4
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DISTORTIONDEPTHTEST_OFF _DISTORTIONONLY_OFF
_EMISSION _NORMALMAP_TANGENT_SPACE
m_ShaderKeywords: _NORMALMAP_TANGENT_SPACE
m_EnableInstancingVariants: 0
disabledShaderPasses:
- DistortionVectors
serializedVersion: 2
serializedVersion: 3
- first:
name: _BaseColorMap
second:
- _AnisotropyMap:
- first:
name: _BumpMap
second:
- _BaseColorMap:
- first:
name: _DetailAlbedoMap
second:
- _BumpMap:
- first:
name: _DetailMask
second:
- _DetailAlbedoMap:
- first:
name: _DetailNormalMap
second:
- _DetailMap:
- first:
name: _DiffuseLightingMap
second:
- _DetailMask:
- first:
name: _EmissionMap
second:
- _DetailNormalMap:
- first:
name: _EmissiveColorMap
second:
- _DiffuseLightingMap:
- first:
name: _HeightMap
second:
- _DistortionVectorMap:
- first:
name: _MainTex
second:
- _EmissionMap:
- first:
name: _MaskMap
second:
- _EmissiveColorMap:
- first:
name: _MetallicGlossMap
second:
- _HeightMap:
- first:
name: _NormalMap
second:
- _MainTex:
- first:
name: _OcclusionMap
second:
- _MaskMap:
- first:
name: _ParallaxMap
second:
- _MetallicGlossMap:
- first:
name: _SpecularOcclusionMap
second:
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularOcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubSurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
- first:
name: _SubSurfaceRadiusMap
second:
- _ThicknessMap:
- first:
name: _AlphaCutoff
second: 0.5
- first:
name: _AlphaCutoffEnable
second: 0
- first:
name: _BlendMode
second: 0
- first:
name: _BumpScale
second: 1
- first:
name: _CullMode
second: 2
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DistortionDepthTest
second: 0
- first:
name: _DistortionOnly
second: 0
- first:
name: _DoubleSidedMode
second: 0
- first:
name: _DstBlend
second: 0
- first:
name: _EmissiveColorMode
second: 1
- first:
name: _EmissiveIntensity
second: 0
- first:
name: _GlossMapScale
second: 1
- first:
name: _Glossiness
second: 0.4
- first:
name: _GlossyReflections
second: 1
- first:
name: _HeightBias
second: 0
- first:
name: _HeightMapMode
second: 0
- first:
name: _HeightScale
second: 1
- first:
name: _MaterialId
second: 0
- first:
name: _Metalic
second: 0
- first:
name: _Metallic
second: 0
- first:
name: _Mode
second: 0
- first:
name: _NormalMapSpace
second: 0
- first:
name: _OcclusionStrength
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _Smoothness
second: 0.4
- first:
name: _SmoothnessTextureChannel
second: 0
- first:
name: _SpecularHighlights
second: 1
- first:
name: _SrcBlend
second: 1
- first:
name: _SubSurfaceRadius
second: 0
- first:
name: _SurfaceType
second: 0
- first:
name: _UVSec
second: 0
- first:
name: _ZWrite
second: 1
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5
- _DepthOffsetEnable: 0
- _DetailAlbedoScale: 1
- _DetailNormalMapScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnablePerPixelDisplacement: 0
- _GlossMapScale: 1
- _Glossiness: 0.4
- _GlossyReflections: 1
- _HeightAmplitude: 0.01
- _HeightBias: 0
- _HeightCenter: 0.5
- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _Metalic: 0
- _Metallic: 0
- _Mode: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _OcclusionStrength: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _Smoothness: 0.4
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _StencilRef: 2
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 0
- _TexWorldScale: 1
- _Thickness: 0.5
- _UVBase: 0
- _UVDetail: 0
- _UVMappingPlanar: 0
- _UVSec: 0
- _ZTestMode: 8
- _ZWrite: 1
- first:
name: _BaseColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _Color
second: {r: 0.7176471, g: 0.7176471, b: 0.7176471, a: 1}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _EmissiveColor
second: {r: 0, g: 0, b: 0, a: 1}
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 0.7176471, g: 0.7176471, b: 0.7176471, a: 1}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

280
Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric0_5.mat


m_PrefabInternal: {fileID: 0}
m_Name: Mat_smoothdielectric0_5
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DISTORTIONDEPTHTEST_OFF _DISTORTIONONLY_OFF
_EMISSION
m_ShaderKeywords: _NORMALMAP_TANGENT_SPACE
m_EnableInstancingVariants: 0
disabledShaderPasses:
- DistortionVectors
serializedVersion: 2
serializedVersion: 3
- first:
name: _BaseColorMap
second:
- _AnisotropyMap:
- first:
name: _BumpMap
second:
- _BaseColorMap:
- first:
name: _DetailAlbedoMap
second:
- _BumpMap:
- first:
name: _DetailMask
second:
- _DetailAlbedoMap:
- first:
name: _DetailNormalMap
second:
- _DetailMap:
- first:
name: _DiffuseLightingMap
second:
- _DetailMask:
- first:
name: _EmissionMap
second:
- _DetailNormalMap:
- first:
name: _EmissiveColorMap
second:
- _DiffuseLightingMap:
- first:
name: _HeightMap
second:
- _DistortionVectorMap:
- first:
name: _MainTex
second:
- _EmissionMap:
- first:
name: _MaskMap
second:
- _EmissiveColorMap:
- first:
name: _MetallicGlossMap
second:
- _HeightMap:
- first:
name: _NormalMap
second:
- _MainTex:
- first:
name: _OcclusionMap
second:
- _MaskMap:
- first:
name: _ParallaxMap
second:
- _MetallicGlossMap:
- first:
name: _SpecularOcclusionMap
second:
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularOcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubSurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
- first:
name: _SubSurfaceRadiusMap
second:
- _ThicknessMap:
- first:
name: _AlphaCutoff
second: 0.5
- first:
name: _AlphaCutoffEnable
second: 0
- first:
name: _BlendMode
second: 0
- first:
name: _BumpScale
second: 1
- first:
name: _CullMode
second: 2
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DistortionDepthTest
second: 0
- first:
name: _DistortionOnly
second: 0
- first:
name: _DoubleSidedMode
second: 0
- first:
name: _DstBlend
second: 0
- first:
name: _EmissiveColorMode
second: 1
- first:
name: _EmissiveIntensity
second: 0
- first:
name: _GlossMapScale
second: 1
- first:
name: _Glossiness
second: 0.5
- first:
name: _GlossyReflections
second: 1
- first:
name: _HeightBias
second: 0
- first:
name: _HeightMapMode
second: 0
- first:
name: _HeightScale
second: 1
- first:
name: _MaterialId
second: 0
- first:
name: _Metalic
second: 0
- first:
name: _Metallic
second: 0
- first:
name: _Mode
second: 0
- first:
name: _NormalMapSpace
second: 0
- first:
name: _OcclusionStrength
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _Smoothness
second: 0.5
- first:
name: _SmoothnessTextureChannel
second: 0
- first:
name: _SpecularHighlights
second: 1
- first:
name: _SrcBlend
second: 1
- first:
name: _SubSurfaceRadius
second: 0
- first:
name: _SurfaceType
second: 0
- first:
name: _UVSec
second: 0
- first:
name: _ZWrite
second: 1
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5
- _DepthOffsetEnable: 0
- _DetailAlbedoScale: 1
- _DetailNormalMapScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnablePerPixelDisplacement: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _HeightAmplitude: 0.01
- _HeightBias: 0
- _HeightCenter: 0.5
- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _Metalic: 0
- _Metallic: 0
- _Mode: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _OcclusionStrength: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _StencilRef: 2
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 0
- _TexWorldScale: 1
- _Thickness: 0.5
- _UVBase: 0
- _UVDetail: 0
- _UVMappingPlanar: 0
- _UVSec: 0
- _ZTestMode: 8
- _ZWrite: 1
- first:
name: _BaseColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _Color
second: {r: 0.7176471, g: 0.7176471, b: 0.7176471, a: 1}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _EmissiveColor
second: {r: 0, g: 0, b: 0, a: 1}
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 0.7176471, g: 0.7176471, b: 0.7176471, a: 1}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

280
Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric0_6.mat


m_PrefabInternal: {fileID: 0}
m_Name: Mat_smoothdielectric0_6
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DISTORTIONDEPTHTEST_OFF _DISTORTIONONLY_OFF
_EMISSION _NORMALMAP_TANGENT_SPACE
m_ShaderKeywords: _NORMALMAP_TANGENT_SPACE
m_EnableInstancingVariants: 0
disabledShaderPasses:
- DistortionVectors
serializedVersion: 2
serializedVersion: 3
- first:
name: _BaseColorMap
second:
- _AnisotropyMap:
- first:
name: _BumpMap
second:
- _BaseColorMap:
- first:
name: _DetailAlbedoMap
second:
- _BumpMap:
- first:
name: _DetailMask
second:
- _DetailAlbedoMap:
- first:
name: _DetailNormalMap
second:
- _DetailMap:
- first:
name: _DiffuseLightingMap
second:
- _DetailMask:
- first:
name: _EmissionMap
second:
- _DetailNormalMap:
- first:
name: _EmissiveColorMap
second:
- _DiffuseLightingMap:
- first:
name: _HeightMap
second:
- _DistortionVectorMap:
- first:
name: _MainTex
second:
- _EmissionMap:
- first:
name: _MaskMap
second:
- _EmissiveColorMap:
- first:
name: _MetallicGlossMap
second:
- _HeightMap:
- first:
name: _NormalMap
second:
- _MainTex:
- first:
name: _OcclusionMap
second:
- _MaskMap:
- first:
name: _ParallaxMap
second:
- _MetallicGlossMap:
- first:
name: _SpecularOcclusionMap
second:
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularOcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubSurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
- first:
name: _SubSurfaceRadiusMap
second:
- _ThicknessMap:
- first:
name: _AlphaCutoff
second: 0.5
- first:
name: _AlphaCutoffEnable
second: 0
- first:
name: _BlendMode
second: 0
- first:
name: _BumpScale
second: 1
- first:
name: _CullMode
second: 2
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DistortionDepthTest
second: 0
- first:
name: _DistortionOnly
second: 0
- first:
name: _DoubleSidedMode
second: 0
- first:
name: _DstBlend
second: 0
- first:
name: _EmissiveColorMode
second: 1
- first:
name: _EmissiveIntensity
second: 0
- first:
name: _GlossMapScale
second: 1
- first:
name: _Glossiness
second: 0.6
- first:
name: _GlossyReflections
second: 1
- first:
name: _HeightBias
second: 0
- first:
name: _HeightMapMode
second: 0
- first:
name: _HeightScale
second: 1
- first:
name: _MaterialId
second: 0
- first:
name: _Metalic
second: 0
- first:
name: _Metallic
second: 0
- first:
name: _Mode
second: 0
- first:
name: _NormalMapSpace
second: 0
- first:
name: _OcclusionStrength
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _Smoothness
second: 0.6
- first:
name: _SmoothnessTextureChannel
second: 0
- first:
name: _SpecularHighlights
second: 1
- first:
name: _SrcBlend
second: 1
- first:
name: _SubSurfaceRadius
second: 0
- first:
name: _SurfaceType
second: 0
- first:
name: _UVSec
second: 0
- first:
name: _ZWrite
second: 1
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5
- _DepthOffsetEnable: 0
- _DetailAlbedoScale: 1
- _DetailNormalMapScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnablePerPixelDisplacement: 0
- _GlossMapScale: 1
- _Glossiness: 0.6
- _GlossyReflections: 1
- _HeightAmplitude: 0.01
- _HeightBias: 0
- _HeightCenter: 0.5
- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _Metalic: 0
- _Metallic: 0
- _Mode: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _OcclusionStrength: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _Smoothness: 0.6
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _StencilRef: 2
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 0
- _TexWorldScale: 1
- _Thickness: 0.5
- _UVBase: 0
- _UVDetail: 0
- _UVMappingPlanar: 0
- _UVSec: 0
- _ZTestMode: 8
- _ZWrite: 1
- first:
name: _BaseColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _Color
second: {r: 0.7176471, g: 0.7176471, b: 0.7176471, a: 1}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _EmissiveColor
second: {r: 0, g: 0, b: 0, a: 1}
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 0.7176471, g: 0.7176471, b: 0.7176471, a: 1}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

280
Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric0_7.mat


m_PrefabInternal: {fileID: 0}
m_Name: Mat_smoothdielectric0_7
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DISTORTIONDEPTHTEST_OFF _DISTORTIONONLY_OFF
_EMISSION _NORMALMAP_TANGENT_SPACE
m_ShaderKeywords: _NORMALMAP_TANGENT_SPACE
m_EnableInstancingVariants: 0
disabledShaderPasses:
- DistortionVectors
serializedVersion: 2
serializedVersion: 3
- first:
name: _BaseColorMap
second:
- _AnisotropyMap:
- first:
name: _BumpMap
second:
- _BaseColorMap:
- first:
name: _DetailAlbedoMap
second:
- _BumpMap:
- first:
name: _DetailMask
second:
- _DetailAlbedoMap:
- first:
name: _DetailNormalMap
second:
- _DetailMap:
- first:
name: _DiffuseLightingMap
second:
- _DetailMask:
- first:
name: _EmissionMap
second:
- _DetailNormalMap:
- first:
name: _EmissiveColorMap
second:
- _DiffuseLightingMap:
- first:
name: _HeightMap
second:
- _DistortionVectorMap:
- first:
name: _MainTex
second:
- _EmissionMap:
- first:
name: _MaskMap
second:
- _EmissiveColorMap:
- first:
name: _MetallicGlossMap
second:
- _HeightMap:
- first:
name: _NormalMap
second:
- _MainTex:
- first:
name: _OcclusionMap
second:
- _MaskMap:
- first:
name: _ParallaxMap
second:
- _MetallicGlossMap:
- first:
name: _SpecularOcclusionMap
second:
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularOcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubSurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
- first:
name: _SubSurfaceRadiusMap
second:
- _ThicknessMap:
- first:
name: _AlphaCutoff
second: 0.5
- first:
name: _AlphaCutoffEnable
second: 0
- first:
name: _BlendMode
second: 0
- first:
name: _BumpScale
second: 1
- first:
name: _CullMode
second: 2
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DistortionDepthTest
second: 0
- first:
name: _DistortionOnly
second: 0
- first:
name: _DoubleSidedMode
second: 0
- first:
name: _DstBlend
second: 0
- first:
name: _EmissiveColorMode
second: 1
- first:
name: _EmissiveIntensity
second: 0
- first:
name: _GlossMapScale
second: 1
- first:
name: _Glossiness
second: 0.7
- first:
name: _GlossyReflections
second: 1
- first:
name: _HeightBias
second: 0
- first:
name: _HeightMapMode
second: 0
- first:
name: _HeightScale
second: 1
- first:
name: _MaterialId
second: 0
- first:
name: _Metalic
second: 0
- first:
name: _Metallic
second: 0
- first:
name: _Mode
second: 0
- first:
name: _NormalMapSpace
second: 0
- first:
name: _OcclusionStrength
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _Smoothness
second: 0.7
- first:
name: _SmoothnessTextureChannel
second: 0
- first:
name: _SpecularHighlights
second: 1
- first:
name: _SrcBlend
second: 1
- first:
name: _SubSurfaceRadius
second: 0
- first:
name: _SurfaceType
second: 0
- first:
name: _UVSec
second: 0
- first:
name: _ZWrite
second: 1
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5
- _DepthOffsetEnable: 0
- _DetailAlbedoScale: 1
- _DetailNormalMapScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnablePerPixelDisplacement: 0
- _GlossMapScale: 1
- _Glossiness: 0.7
- _GlossyReflections: 1
- _HeightAmplitude: 0.01
- _HeightBias: 0
- _HeightCenter: 0.5
- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _Metalic: 0
- _Metallic: 0
- _Mode: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _OcclusionStrength: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _Smoothness: 0.7
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _StencilRef: 2
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 0
- _TexWorldScale: 1
- _Thickness: 0.5
- _UVBase: 0
- _UVDetail: 0
- _UVMappingPlanar: 0
- _UVSec: 0
- _ZTestMode: 8
- _ZWrite: 1
- first:
name: _BaseColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _Color
second: {r: 0.7176471, g: 0.7176471, b: 0.7176471, a: 1}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _EmissiveColor
second: {r: 0, g: 0, b: 0, a: 1}
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 0.7176471, g: 0.7176471, b: 0.7176471, a: 1}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

280
Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric0_8.mat


m_PrefabInternal: {fileID: 0}
m_Name: Mat_smoothdielectric0_8
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DISTORTIONDEPTHTEST_OFF _DISTORTIONONLY_OFF
_EMISSION _NORMALMAP_TANGENT_SPACE
m_ShaderKeywords: _NORMALMAP_TANGENT_SPACE
m_EnableInstancingVariants: 0
disabledShaderPasses:
- DistortionVectors
serializedVersion: 2
serializedVersion: 3
- first:
name: _BaseColorMap
second:
- _AnisotropyMap:
- first:
name: _BumpMap
second:
- _BaseColorMap:
- first:
name: _DetailAlbedoMap
second:
- _BumpMap:
- first:
name: _DetailMask
second:
- _DetailAlbedoMap:
- first:
name: _DetailNormalMap
second:
- _DetailMap:
- first:
name: _DiffuseLightingMap
second:
- _DetailMask:
- first:
name: _EmissionMap
second:
- _DetailNormalMap:
- first:
name: _EmissiveColorMap
second:
- _DiffuseLightingMap:
- first:
name: _HeightMap
second:
- _DistortionVectorMap:
- first:
name: _MainTex
second:
- _EmissionMap:
- first:
name: _MaskMap
second:
- _EmissiveColorMap:
- first:
name: _MetallicGlossMap
second:
- _HeightMap:
- first:
name: _NormalMap
second:
- _MainTex:
- first:
name: _OcclusionMap
second:
- _MaskMap:
- first:
name: _ParallaxMap
second:
- _MetallicGlossMap:
- first:
name: _SpecularOcclusionMap
second:
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularOcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubSurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
- first:
name: _SubSurfaceRadiusMap
second:
- _ThicknessMap:
- first:
name: _AlphaCutoff
second: 0.5
- first:
name: _AlphaCutoffEnable
second: 0
- first:
name: _BlendMode
second: 0
- first:
name: _BumpScale
second: 1
- first:
name: _CullMode
second: 2
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DistortionDepthTest
second: 0
- first:
name: _DistortionOnly
second: 0
- first:
name: _DoubleSidedMode
second: 0
- first:
name: _DstBlend
second: 0
- first:
name: _EmissiveColorMode
second: 1
- first:
name: _EmissiveIntensity
second: 0
- first:
name: _GlossMapScale
second: 1
- first:
name: _Glossiness
second: 0.8
- first:
name: _GlossyReflections
second: 1
- first:
name: _HeightBias
second: 0
- first:
name: _HeightMapMode
second: 0
- first:
name: _HeightScale
second: 1
- first:
name: _MaterialId
second: 0
- first:
name: _Metalic
second: 0
- first:
name: _Metallic
second: 0
- first:
name: _Mode
second: 0
- first:
name: _NormalMapSpace
second: 0
- first:
name: _OcclusionStrength
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _Smoothness
second: 0.8
- first:
name: _SmoothnessTextureChannel
second: 0
- first:
name: _SpecularHighlights
second: 1
- first:
name: _SrcBlend
second: 1
- first:
name: _SubSurfaceRadius
second: 0
- first:
name: _SurfaceType
second: 0
- first:
name: _UVSec
second: 0
- first:
name: _ZWrite
second: 1
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5
- _DepthOffsetEnable: 0
- _DetailAlbedoScale: 1
- _DetailNormalMapScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnablePerPixelDisplacement: 0
- _GlossMapScale: 1
- _Glossiness: 0.8
- _GlossyReflections: 1
- _HeightAmplitude: 0.01
- _HeightBias: 0
- _HeightCenter: 0.5
- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _Metalic: 0
- _Metallic: 0
- _Mode: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _OcclusionStrength: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _Smoothness: 0.8
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _StencilRef: 2
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 0
- _TexWorldScale: 1
- _Thickness: 0.5
- _UVBase: 0
- _UVDetail: 0
- _UVMappingPlanar: 0
- _UVSec: 0
- _ZTestMode: 8
- _ZWrite: 1
- first:
name: _BaseColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _Color
second: {r: 0.7176471, g: 0.7176471, b: 0.7176471, a: 1}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _EmissiveColor
second: {r: 0, g: 0, b: 0, a: 1}
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 0.7176471, g: 0.7176471, b: 0.7176471, a: 1}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

280
Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric0_9.mat


m_PrefabInternal: {fileID: 0}
m_Name: Mat_smoothdielectric0_9
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DISTORTIONDEPTHTEST_OFF _DISTORTIONONLY_OFF
_EMISSION _NORMALMAP_TANGENT_SPACE
m_ShaderKeywords: _NORMALMAP_TANGENT_SPACE
m_EnableInstancingVariants: 0
disabledShaderPasses:
- DistortionVectors
serializedVersion: 2
serializedVersion: 3
- first:
name: _BaseColorMap
second:
- _AnisotropyMap:
- first:
name: _BumpMap
second:
- _BaseColorMap:
- first:
name: _DetailAlbedoMap
second:
- _BumpMap:
- first:
name: _DetailMask
second:
- _DetailAlbedoMap:
- first:
name: _DetailNormalMap
second:
- _DetailMap:
- first:
name: _DiffuseLightingMap
second:
- _DetailMask:
- first:
name: _EmissionMap
second:
- _DetailNormalMap:
- first:
name: _EmissiveColorMap
second:
- _DiffuseLightingMap:
- first:
name: _HeightMap
second:
- _DistortionVectorMap:
- first:
name: _MainTex
second:
- _EmissionMap:
- first:
name: _MaskMap
second:
- _EmissiveColorMap:
- first:
name: _MetallicGlossMap
second:
- _HeightMap:
- first:
name: _NormalMap
second:
- _MainTex:
- first:
name: _OcclusionMap
second:
- _MaskMap:
- first:
name: _ParallaxMap
second:
- _MetallicGlossMap:
- first:
name: _SpecularOcclusionMap
second:
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularOcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubSurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
- first:
name: _SubSurfaceRadiusMap
second:
- _ThicknessMap:
- first:
name: _AlphaCutoff
second: 0.5
- first:
name: _AlphaCutoffEnable
second: 0
- first:
name: _BlendMode
second: 0
- first:
name: _BumpScale
second: 1
- first:
name: _CullMode
second: 2
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DistortionDepthTest
second: 0
- first:
name: _DistortionOnly
second: 0
- first:
name: _DoubleSidedMode
second: 0
- first:
name: _DstBlend
second: 0
- first:
name: _EmissiveColorMode
second: 1
- first:
name: _EmissiveIntensity
second: 0
- first:
name: _GlossMapScale
second: 1
- first:
name: _Glossiness
second: 0.9
- first:
name: _GlossyReflections
second: 1
- first:
name: _HeightBias
second: 0
- first:
name: _HeightMapMode
second: 0
- first:
name: _HeightScale
second: 1
- first:
name: _MaterialId
second: 0
- first:
name: _Metalic
second: 0
- first:
name: _Metallic
second: 0
- first:
name: _Mode
second: 0
- first:
name: _NormalMapSpace
second: 0
- first:
name: _OcclusionStrength
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _Smoothness
second: 0.9
- first:
name: _SmoothnessTextureChannel
second: 0
- first:
name: _SpecularHighlights
second: 1
- first:
name: _SrcBlend
second: 1
- first:
name: _SubSurfaceRadius
second: 0
- first:
name: _SurfaceType
second: 0
- first:
name: _UVSec
second: 0
- first:
name: _ZWrite
second: 1
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5
- _DepthOffsetEnable: 0
- _DetailAlbedoScale: 1
- _DetailNormalMapScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnablePerPixelDisplacement: 0
- _GlossMapScale: 1
- _Glossiness: 0.9
- _GlossyReflections: 1
- _HeightAmplitude: 0.01
- _HeightBias: 0
- _HeightCenter: 0.5
- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _Metalic: 0
- _Metallic: 0
- _Mode: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _OcclusionStrength: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _Smoothness: 0.9
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _StencilRef: 2
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 0
- _TexWorldScale: 1
- _Thickness: 0.5
- _UVBase: 0
- _UVDetail: 0
- _UVMappingPlanar: 0
- _UVSec: 0
- _ZTestMode: 8
- _ZWrite: 1
- first:
name: _BaseColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _Color
second: {r: 0.7176471, g: 0.7176471, b: 0.7176471, a: 1}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _EmissiveColor
second: {r: 0, g: 0, b: 0, a: 1}
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 0.7176471, g: 0.7176471, b: 0.7176471, a: 1}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

280
Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric1_0.mat


m_PrefabInternal: {fileID: 0}
m_Name: Mat_smoothdielectric1_0
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DISTORTIONDEPTHTEST_OFF _DISTORTIONONLY_OFF
_EMISSION _NORMALMAP_TANGENT_SPACE
m_ShaderKeywords: _NORMALMAP_TANGENT_SPACE
m_EnableInstancingVariants: 0
disabledShaderPasses:
- DistortionVectors
serializedVersion: 2
serializedVersion: 3
- first:
name: _BaseColorMap
second:
- _AnisotropyMap:
- first:
name: _BumpMap
second:
- _BaseColorMap:
- first:
name: _DetailAlbedoMap
second:
- _BumpMap:
- first:
name: _DetailMask
second:
- _DetailAlbedoMap:
- first:
name: _DetailNormalMap
second:
- _DetailMap:
- first:
name: _DiffuseLightingMap
second:
- _DetailMask:
- first:
name: _EmissionMap
second:
- _DetailNormalMap:
- first:
name: _EmissiveColorMap
second:
- _DiffuseLightingMap:
- first:
name: _HeightMap
second:
- _DistortionVectorMap:
- first:
name: _MainTex
second:
- _EmissionMap:
- first:
name: _MaskMap
second:
- _EmissiveColorMap:
- first:
name: _MetallicGlossMap
second:
- _HeightMap:
- first:
name: _NormalMap
second:
- _MainTex:
- first:
name: _OcclusionMap
second:
- _MaskMap:
- first:
name: _ParallaxMap
second:
- _MetallicGlossMap:
- first:
name: _SpecularOcclusionMap
second:
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularOcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubSurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
- first:
name: _SubSurfaceRadiusMap
second:
- _ThicknessMap:
- first:
name: _AlphaCutoff
second: 0.5
- first:
name: _AlphaCutoffEnable
second: 0
- first:
name: _BlendMode
second: 0
- first:
name: _BumpScale
second: 1
- first:
name: _CullMode
second: 2
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DistortionDepthTest
second: 0
- first:
name: _DistortionOnly
second: 0
- first:
name: _DoubleSidedMode
second: 0
- first:
name: _DstBlend
second: 0
- first:
name: _EmissiveColorMode
second: 1
- first:
name: _EmissiveIntensity
second: 0
- first:
name: _GlossMapScale
second: 1
- first:
name: _Glossiness
second: 1
- first:
name: _GlossyReflections
second: 1
- first:
name: _HeightBias
second: 0
- first:
name: _HeightMapMode
second: 0
- first:
name: _HeightScale
second: 1
- first:
name: _MaterialId
second: 0
- first:
name: _Metalic
second: 0
- first:
name: _Metallic
second: 0
- first:
name: _Mode
second: 0
- first:
name: _NormalMapSpace
second: 0
- first:
name: _OcclusionStrength
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _Smoothness
second: 1
- first:
name: _SmoothnessTextureChannel
second: 0
- first:
name: _SpecularHighlights
second: 1
- first:
name: _SrcBlend
second: 1
- first:
name: _SubSurfaceRadius
second: 0
- first:
name: _SurfaceType
second: 0
- first:
name: _UVSec
second: 0
- first:
name: _ZWrite
second: 1
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5
- _DepthOffsetEnable: 0
- _DetailAlbedoScale: 1
- _DetailNormalMapScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnablePerPixelDisplacement: 0
- _GlossMapScale: 1
- _Glossiness: 1
- _GlossyReflections: 1
- _HeightAmplitude: 0.01
- _HeightBias: 0
- _HeightCenter: 0.5
- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _Metalic: 0
- _Metallic: 0
- _Mode: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _OcclusionStrength: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _Smoothness: 1
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _StencilRef: 2
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 0
- _TexWorldScale: 1
- _Thickness: 0.5
- _UVBase: 0
- _UVDetail: 0
- _UVMappingPlanar: 0
- _UVSec: 0
- _ZTestMode: 8
- _ZWrite: 1
- first:
name: _BaseColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _Color
second: {r: 0.7176471, g: 0.7176471, b: 0.7176471, a: 1}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _EmissiveColor
second: {r: 0, g: 0, b: 0, a: 1}
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 0.7176471, g: 0.7176471, b: 0.7176471, a: 1}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

16
Assets/TestScenes/HDTest/GraphicTest/LayeredTessellation/Layer-2-woord-rock.mat


m_PrefabInternal: {fileID: 0}
m_Name: Layer-2-woord-rock
m_Shader: {fileID: 4800000, guid: eab0538d9d5746246806a9611c04ac4d, type: 3}
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DEPTHOFFSETENABLE_OFF _DETAIL_MAP_WITH_NORMAL
_DISTORTIONDEPTHTEST_OFF _DISTORTIONENABLE_OFF _DISTORTIONONLY_OFF _ENABLEPERPIXELDISPLACEMENT_OFF
_HEIGHTMAP _HEIGHTMAP0 _HEIGHTMAP1 _LAYERMASKVERTEXCOLOR_OFF _NORMALMAP _NORMALMAP_TANGENT_SPACE
_OBJECTSCALEAFFECTTILE_OFF _TESSELLATIONOBJECTSCALE_OFF _TESSELLATION_DISPLACEMENT
_USEDENSITYMODE_OFF _USEHEIGHTBASEDBLENDV2_OFF _USEHEIGHTBASEDBLEND_OFF _USEMAINLAYERINFLUENCE_OFF
m_ShaderKeywords: _HEIGHTMAP0 _HEIGHTMAP1 _NORMALMAP0 _NORMALMAP1 _NORMALMAP_TANGENT_SPACE0
_NORMALMAP_TANGENT_SPACE1 _NORMALMAP_TANGENT_SPACE2 _NORMALMAP_TANGENT_SPACE3
_TESSELLATION_DISPLACEMENT
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_CustomRenderQueue: -1

- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _DstBlend: 0
- _EmissiveColorMode: 0

- _MinimumOpacity3: 1
- _Mode: 0
- _NormalMapSpace: 0
- _NormalMapSpace0: 0
- _NormalMapSpace1: 0
- _NormalMapSpace2: 0
- _NormalMapSpace3: 0
- _NormalScale0: 1
- _NormalScale1: 1
- _NormalScale2: 1

- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _StencilRef: 2
- _SurfaceType: 0
- _TessellationBackFaceCullEpsilon: -0.25
- _TessellationFactor: 4

- _BaseColor2: {r: 1, g: 1, b: 1, a: 1}
- _BaseColor3: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _UVDetailsMappingMask0: {r: 1, g: 0, b: 0, a: 0}

2
Assets/TestScenes/HDTest/GraphicTest/LayeredTessellation/Layer-2-woord-rock.mat.meta


fileFormatVersion: 2
guid: 2ebfc83bd8b60ca479682b22f411906a
timeCreated: 1485267495
timeCreated: 1487270827
licenseType: Pro
NativeFormatImporter:
mainObjectFileID: 2100000

24
Assets/TestScenes/HDTest/GraphicTest/Parallax Occlusion Mapping/Material/POM - Rock.mat


m_PrefabInternal: {fileID: 0}
m_Name: POM - Rock
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DEPTHOFFSETENABLE_OFF _DETAIL_MAP_WITH_NORMAL
_DISTORTIONDEPTHTEST_OFF _DISTORTIONENABLE_OFF _DISTORTIONONLY_OFF _HEIGHTMAP
_NORMALMAP _NORMALMAP_TANGENT_SPACE _PER_PIXEL_DISPLACEMENT
m_ShaderKeywords: _HEIGHTMAP _NORMALMAP _NORMALMAP_TANGENT_SPACE _PER_PIXEL_DISPLACEMENT
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_CustomRenderQueue: -1

m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ThicknessMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}

- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _DstBlend: 0
- _EmissiveColorMode: 1

- _GlossyReflections: 1
- _HeightAmplitude: 0.09
- _HeightCenter: 0.5
- _MaterialId: 0
- _HorizonFade: 1
- _MaterialID: 0
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02

- _SrcBlend: 1
- _SubSurfaceRadius: 0
- _StencilRef: 2
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _Thickness: 1
- _UVBase: 0
- _UVDetail: 0
- _UVMappingPlanar: 0

m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}

部分文件因为文件数量过多而无法显示

正在加载...
取消
保存