Evgenii Golubev 8 年前
当前提交
0d763678
共有 467 个文件被更改,包括 1575 次插入1229 次删除
  1. 117
      Assets/ScriptableRenderPipeline/AdditionalLightData.cs
  2. 40
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Editor/HDRenderPipelineMenuItems.cs
  3. 42
      Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs
  4. 16
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightDefinition.cs
  5. 40
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightDefinition.cs.hlsl
  6. 8
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop.cs
  7. 4
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/Lighting.hlsl
  8. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TileLightLoopProducer.cs
  9. 248
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/Resources/shadeopaque.compute
  10. 470
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.cs
  11. 120
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.hlsl
  12. 20
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePassLoop.hlsl
  13. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLit.shader
  14. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLitTessellation.shader
  15. 26
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Editor/BaseLitUI.cs
  16. 31
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Editor/LitUI.cs
  17. 19
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.cs
  18. 8
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.cs.hlsl
  19. 23
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.hlsl
  20. 4
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.shader
  21. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitData.hlsl
  22. 4
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitDataInternal.hlsl
  23. 4
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitTessellation.shader
  24. 7
      Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/SceneSettings.cs
  25. 15
      Assets/ScriptableRenderPipeline/HDRenderPipeline/ShaderPass/ShaderPassLightTransport.hlsl
  26. 1
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/ProceduralSky/ProceduralSkyRenderer.cs
  27. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/ProceduralSky/ProceduralSkySettings.cs
  28. 13
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/ProceduralSky/Resources/SkyProcedural.shader
  29. 12
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/SkyManager.cs
  30. 8
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Utilities.cs
  31. 5
      Assets/ScriptableRenderPipeline/LowEndMobilePipeline/Editor/LowendMobilePipelineMaterialEditor.cs
  32. 18
      Assets/ScriptableRenderPipeline/LowEndMobilePipeline/Editor/LowendPipelineAssetInspector.cs
  33. 18
      Assets/ScriptableRenderPipeline/LowEndMobilePipeline/Editor/LowendUpgraders.cs
  34. 35
      Assets/ScriptableRenderPipeline/LowEndMobilePipeline/LowEndMobilePipeline.cs
  35. 16
      Assets/ScriptableRenderPipeline/LowEndMobilePipeline/LowEndMobilePipelineAsset.cs
  36. 151
      Assets/ScriptableRenderPipeline/LowEndMobilePipeline/Shaders/LowEndMobilePipeline.shader
  37. 106
      Assets/ScriptableRenderPipeline/LowEndMobilePipeline/Shaders/LowEndMobilePipelineCore.cginc
  38. 2
      Assets/ScriptableRenderPipeline/ShaderLibrary/ImageBasedLighting.hlsl
  39. 18
      Assets/ScriptableRenderPipeline/common/TextureCache.cs
  40. 258
      Assets/ScriptableRenderPipeline/fptl/FptlLighting.cs
  41. 161
      Assets/ScriptableRenderPipeline/fptl/LightingTemplate.hlsl
  42. 2
      Assets/ScriptableRenderPipeline/fptl/RegularForwardLightingUtils.hlsl
  43. 2
      Assets/TestScenes/HDTest/GraphicTest/Common/Dragon/DragonStatue.mat
  44. 13
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Lit_Blue.mat
  45. 13
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Lit_Green.mat
  46. 13
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Lit_Red.mat
  47. 13
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Lit_White.mat
  48. 13
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_0.mat
  49. 13
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_1.mat
  50. 13
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_2.mat
  51. 13
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_3.mat
  52. 13
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_4.mat
  53. 13
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_5.mat
  54. 13
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_6.mat
  55. 13
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_7.mat
  56. 13
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_8.mat
  57. 13
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_9.mat
  58. 13
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth1_1.mat
  59. 13
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric0_0.mat
  60. 13
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric0_1.mat
  61. 13
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric0_2.mat
  62. 13
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric0_3.mat
  63. 13
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric0_4.mat
  64. 13
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric0_5.mat
  65. 13
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric0_6.mat
  66. 13
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric0_7.mat
  67. 13
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric0_8.mat
  68. 13
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric0_9.mat
  69. 13
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric1_0.mat
  70. 13
      Assets/TestScenes/HDTest/GraphicTest/Parallax Occlusion Mapping/Material/POM - Rock.mat
  71. 13
      Assets/TestScenes/HDTest/GraphicTest/Parallax Occlusion Mapping/Material/POM - Wood triplanar.mat
  72. 13
      Assets/TestScenes/HDTest/GraphicTest/Parallax Occlusion Mapping/Material/POM - Wood.mat
  73. 2
      Assets/TestScenes/HDTest/GraphicTest/SSS/InifiniteRealityHead.mat
  74. 13
      Assets/TestScenes/HDTest/GraphicTest/Tessellation/Material/Tessellation - Rock.mat
  75. 13
      Assets/TestScenes/HDTest/GraphicTest/Tessellation/Material/Tessellation - Wood.mat
  76. 13
      Assets/TestScenes/HDTest/GraphicTest/Triplanar/Material/Wood triplanar.mat
  77. 13
      Assets/TestScenes/HDTest/GraphicTest/Two Sided/Material/GroundLeaf_DoubleSidedFlip.mat
  78. 7
      Assets/TestScenes/HDTest/GraphicTest/Two Sided/Material/GroundLeaf_DoubleSidedFlipSSS.mat
  79. 13
      Assets/TestScenes/HDTest/GraphicTest/Two Sided/Material/GroundLeaf_DoubleSidedMirror.mat
  80. 2
      Assets/TestScenes/HDTest/GraphicTest/Two Sided/Prefabs/Materials.meta
  81. 2
      Assets/TestScenes/HDTest/LayeredLitTest/Mesh/Materials.meta
  82. 13
      Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/CubeTransparent.mat
  83. 13
      Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/GGX Test/GGX_a00_s00.mat
  84. 13
      Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/GGX Test/GGX_a00_s01.mat
  85. 13
      Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/GGX Test/GGX_a00_s02.mat
  86. 13
      Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/GGX Test/GGX_a00_s03.mat
  87. 13
      Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/GGX Test/GGX_a00_s04.mat
  88. 13
      Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/GGX Test/GGX_a00_s05.mat
  89. 13
      Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/GGX Test/GGX_a00_s06.mat
  90. 13
      Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/GGX Test/GGX_a00_s07.mat
  91. 13
      Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/GGX Test/GGX_a00_s08.mat
  92. 13
      Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/GGX Test/GGX_a00_s09.mat
  93. 13
      Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/GGX Test/GGX_a00_s10.mat
  94. 13
      Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/GGX Test/GGX_a02_s00.mat
  95. 13
      Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/GGX Test/GGX_a02_s01.mat
  96. 13
      Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/GGX Test/GGX_a02_s02.mat
  97. 13
      Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/GGX Test/GGX_a02_s03.mat
  98. 13
      Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/GGX Test/GGX_a02_s04.mat
  99. 13
      Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/GGX Test/GGX_a02_s05.mat
  100. 13
      Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/GGX Test/GGX_a02_s06.mat

117
Assets/ScriptableRenderPipeline/AdditionalLightData.cs


namespace UnityEngine.Experimental.Rendering
namespace UnityEngine.Experimental.Rendering
{
public enum LightArchetype { Punctual, Area, Projector };

[Range(0.0f, 20.0f)]
public float lightWidth = 0.0f; // Area & projector lights
// shadow related parameters
[System.Serializable]
public struct ShadowData
{
public int format;
public int[] data;
};
[HideInInspector, SerializeField] private int shadowAlgorithm;
[HideInInspector, SerializeField] private int shadowVariant;
[HideInInspector, SerializeField] private int shadowPrecision;
[HideInInspector, SerializeField] private ShadowData shadowData;
[HideInInspector, SerializeField] private ShadowData[] shadowDatas = new ShadowData[0];
public void GetShadowAlgorithm( out int algorithm, out int variant, out int precision ) { algorithm = shadowAlgorithm; variant = shadowVariant; precision = shadowPrecision; }
public void SetShadowAlgorithm( int algorithm, int variant, int precision, int format, int[] data )
{
shadowAlgorithm = algorithm;
shadowVariant = variant;
shadowPrecision = precision;
shadowData.format = format;
shadowData.data = data;
int idx = FindShadowData( format );
if( idx < 0 )
{
idx = shadowDatas.Length;
ShadowData[] tmp = new ShadowData[idx+1];
for( int i = 0; i < idx; ++i )
tmp[i] = shadowDatas[i];
shadowDatas = tmp;
}
shadowDatas[idx].format = format;
shadowDatas[idx].data = data != null ? data : new int[0];
}
// Load a specific shadow data. Returns null if requested data is not present.
public int[] GetShadowData( int shadowDataFormat )
{
if( shadowData.format == shadowDataFormat )
return shadowData.data;
int idx = FindShadowData( shadowDataFormat );
return idx >= 0 ? shadowDatas[idx].data : null;
}
// Returns the currently set shadow data and format. Can return null.
public int[] GetShadowData( out int shadowDataFormat )
{
shadowDataFormat = shadowData.format;
return shadowData.data;
}
#if UNITY_EDITOR
public void CompactShadowData()
{
shadowDatas = new ShadowData[0];
UnityEditor.EditorUtility.SetDirty(this);
}
#endif
private int FindShadowData( int shadowDataFormat )
{
for( int i = 0; i < shadowDatas.Length; ++i )
{
if( shadowDatas[i].format == shadowDataFormat )
return i;
}
return -1;
}
#if UNITY_EDITOR
[UnityEditor.CustomEditor(typeof(AdditionalLightData))]
[UnityEditor.CanEditMultipleObjects]
public class AdditionalLightDataEditor : UnityEditor.Editor
{
static ShadowRegistry m_ShadowRegistry;
#pragma warning disable 414 // CS0414 The private field '...' is assigned but its value is never used
UnityEditor.SerializedProperty m_ShadowAlgorithm;
UnityEditor.SerializedProperty m_ShadowVariant;
UnityEditor.SerializedProperty m_ShadowData;
UnityEditor.SerializedProperty m_ShadowDatas;
#pragma warning restore 414
public static void SetRegistry( ShadowRegistry registry ) { m_ShadowRegistry = registry; }
void OnEnable()
{
m_ShadowAlgorithm = serializedObject.FindProperty( "shadowAlgorithm" );
m_ShadowVariant = serializedObject.FindProperty( "shadowVariant" );
m_ShadowData = serializedObject.FindProperty( "shadowData" );
m_ShadowDatas = serializedObject.FindProperty( "shadowDatas" );
}
public override void OnInspectorGUI()
{
base.OnInspectorGUI();
if( m_ShadowRegistry == null )
return;
AdditionalLightData ald = (AdditionalLightData) target;
if( ald == null )
return;
UnityEditor.EditorGUI.BeginChangeCheck();
m_ShadowRegistry.Draw( ald.gameObject.GetComponent<Light>() );
serializedObject.Update();
if( UnityEditor.EditorGUI.EndChangeCheck() )
{
UnityEditor.EditorUtility.SetDirty( ald );
UnityEditor.SceneManagement.EditorSceneManager.MarkAllScenesDirty();
UnityEditor.SceneView.RepaintAll();
}
serializedObject.ApplyModifiedProperties();
}
}
#endif
}

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


}
}
[MenuItem("HDRenderPipeline/Swap standard and SSS material IDs")]
static void SwapStandardAndSssMaterialIds()
{
try
{
Object[] materials = Resources.FindObjectsOfTypeAll<Material>();
for (int i = 0, length = materials.Length; i < length; i++)
{
Material mat = materials[i] as Material;
EditorUtility.DisplayProgressBar(
"Updating materials...",
string.Format("{0} / {1}", i, length),
i / (float)(length - 1));
if (mat.shader.name == "HDRenderPipeline/Lit" || mat.shader.name == "HDRenderPipeline/LitTessellation")
{
int matID = (int)mat.GetFloat("_MaterialID");
if (matID == 0)
{
matID = 1;
mat.SetInt("_MaterialID", matID);
EditorUtility.SetDirty(mat);
}
else if (matID == 1)
{
matID = 0;
mat.SetInt("_MaterialID", matID);
EditorUtility.SetDirty(mat);
}
}
}
}
finally
{
EditorUtility.ClearProgressBar();
}
}
[MenuItem("HDRenderPipeline/Debug/Remove tessellation materials (not reversible)")]
static void RemoveTessellationMaterials()
{

42
Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs


int m_CurrentWidth;
int m_CurrentHeight;
ShadowRenderPass m_ShadowPass;
ShadowOutput m_ShadowsResult = new ShadowOutput();
public int GetCurrentShadowCount() { return m_ShadowsResult.shadowLights == null ? 0 : m_ShadowsResult.shadowLights.Length; }
public int GetCurrentShadowCount() { return m_LightLoop.GetCurrentShadowCount(); }
readonly SkyManager m_SkyManager = new SkyManager();
private readonly BaseLightLoop m_LightLoop;

m_FilterAndCombineSubsurfaceScattering.SetFloat("_DstBlend", (float)BlendMode.One);
InitializeDebugMaterials();
m_ShadowPass = new ShadowRenderPass(owner.shadowSettings);
// Init Gbuffer description
m_gbufferManager.gbufferCount = m_LitRenderLoop.GetMaterialGBufferCount();

m_DebugDisplayShadowMap = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/DebugDisplayShadowMap");
m_DebugViewMaterialGBuffer = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/DebugViewMaterialGBuffer");
m_DebugDisplayLatlong = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/DebugDisplayLatlong");
}
public void OnSceneLoad()
{
// Recreate the textures which went NULL, and set 'isInit' to 'false'.
m_LitRenderLoop.Build();
}
public override void Dispose()

// select the most main camera!
Camera camera = cameras.OrderByDescending(x => x.tag == "MainCamera").FirstOrDefault();
if (camera == null)
if (camera == null)
return;
return;
}
// Set camera constant buffer

if (!CullResults.GetCullingParameters(camera, out cullingParams))
if (!CullResults.GetCullingParameters(camera, out cullingParams))
return;
return;
m_ShadowPass.UpdateCullingParameters(ref cullingParams);
m_LightLoop.UpdateCullingParameters( ref cullingParams );
var cullResults = CullResults.Cull(ref cullingParams, renderContext);

}
else
{
using (new Utilities.ProfilingSample("Shadow", renderContext))
{
m_ShadowPass.Render(renderContext, cullResults, out m_ShadowsResult);
}
renderContext.SetupCameraProperties(camera); // Need to recall SetupCameraProperties after m_ShadowPass.Render
m_LightLoop.PrepareLightsForGPU(m_Owner.shadowSettings, cullResults, camera, ref m_ShadowsResult);
m_LightLoop.PrepareLightsForGPU(m_Owner.shadowSettings, cullResults, camera);
m_LightLoop.RenderShadows(renderContext, cullResults);
renderContext.SetupCameraProperties(camera); // Need to recall SetupCameraProperties after m_ShadowPass.Render
m_LightLoop.BuildGPULightLists(camera, renderContext, m_CameraDepthStencilBufferRT); // TODO: Use async compute here to run light culling during shadow

{
if (lightingDebug.shadowDebugMode == ShadowMapDebugMode.VisualizeShadowMap)
{
#if SHADOWS_OLD
uint visualizeShadowIndex = Math.Min(lightingDebug.shadowMapIndex, (uint)(GetCurrentShadowCount() - 1));
ShadowLight shadowLight = m_ShadowsResult.shadowLights[visualizeShadowIndex];
for (int slice = 0; slice < shadowLight.shadowSliceCount; ++slice)

NextOverlayCoord(ref x, ref y, overlaySize, camera.pixelWidth);
}
#endif
}
else if (lightingDebug.shadowDebugMode == ShadowMapDebugMode.VisualizeAtlas)
{

}
renderContext.ExecuteCommandBuffer(debugCB);
}
// Function to prepare light structure for GPU lighting
void PrepareLightsForGPU(ShadowSettings shadowSettings, CullResults cullResults, Camera camera, ref ShadowOutput shadowOutput)
{
// build per tile light lists
if (m_LightLoop != null)
m_LightLoop.PrepareLightsForGPU(shadowSettings, cullResults, camera, ref shadowOutput);
}
void InitAndClearBuffer(Camera camera, ScriptableRenderContext renderContext)

16
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightDefinition.cs


};
// TODO: we may have to add various parameters here for shadow - was suppose to be coupled with a light loop
// A point light is 6x PunctualShadowData
[GenerateHLSL]
public struct ShadowData
{
// World to ShadowMap matrix
// Include scale and bias for shadow atlas if any
public Matrix4x4 worldToShadow;
public float bias;
public float quality;
public float unused;
public float unused2;
public Vector4 invResolution;
};
[GenerateHLSL]
public enum EnvShapeType
{

40
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightDefinition.cs.hlsl


int cookieIndex;
};
// Generated from UnityEngine.Experimental.Rendering.HDPipeline.ShadowData
// PackingRules = Exact
struct ShadowData
{
float4x4 worldToShadow;
float bias;
float quality;
float unused;
float unused2;
float4 invResolution;
};
// Generated from UnityEngine.Experimental.Rendering.HDPipeline.EnvLightData
// PackingRules = Exact
struct EnvLightData

int GetCookieIndex(DirectionalLightData value)
{
return value.cookieIndex;
}
//
// Accessors for UnityEngine.Experimental.Rendering.HDPipeline.ShadowData
//
float4x4 GetWorldToShadow(ShadowData value)
{
return value.worldToShadow;
}
float GetBias(ShadowData value)
{
return value.bias;
}
float GetQuality(ShadowData value)
{
return value.quality;
}
float GetUnused(ShadowData value)
{
return value.unused;
}
float GetUnused2(ShadowData value)
{
return value.unused2;
}
float4 GetInvResolution(ShadowData value)
{
return value.invResolution;
}
//

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


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

public virtual void NewFrame() {}
public virtual void PrepareLightsForGPU(ShadowSettings shadowSettings, CullResults cullResults, Camera camera, ref ShadowOutput shadowOutput) {}
public virtual int GetCurrentShadowCount() { return 0; }
public virtual void UpdateCullingParameters( ref CullingParameters cullingParams ) {}
public virtual void PrepareLightsForGPU(ShadowSettings shadowSettings, CullResults cullResults, Camera camera) {}
// TODO: this should not be part of the interface but for now make something working
public virtual void BuildGPULightLists(Camera camera, ScriptableRenderContext loop, RenderTargetIdentifier cameraDepthBufferRT) {}

4
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/Lighting.hlsl


#include "../Lighting/LightDefinition.cs.hlsl"
#include "../Lighting/LightUtilities.hlsl"
#include "../Shadow/Shadow.hlsl"
#define SHADOW_TILEPASS
#include "../../ShaderLibrary/Shadow/Shadow.hlsl"
#undef SHADOW_TILEPASS
#if defined(LIGHTLOOP_SINGLE_PASS) || defined(LIGHTLOOP_TILE_PASS)
#include "../Lighting/TilePass/TilePass.hlsl"

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TileLightLoopProducer.cs


public enum TileDebug : int { None = 0, Punctual = 1, Area = 2, AreaAndPunctual = 3, Projector = 4, ProjectorAndPunctual = 5, ProjectorAndArea = 6, ProjectorAndAreaAndPunctual = 7,
Environment = 8, EnvironmentAndPunctual = 9, EnvironmentAndArea = 10, EnvironemntAndAreaAndPunctual = 11,
EnvironmentAndProjector = 12, EnvironmentAndProjectorAndPunctual = 13, EnvironmentAndProjectorAndArea = 14, EnvironmentAndProjectorAndAreaAndPunctual = 15,
EnvironmentAndProjector = 12, EnvironmentAndProjectorAndPunctual = 13, EnvironmentAndProjectorAndArea = 14, EnvironmentAndProjectorAndAreaAndPunctual = 15,
FeatureVariants = 16 }; //TODO: we should probably make this checkboxes
public TileDebug tileDebugByCategory;

248
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/Resources/shadeopaque.compute


#pragma kernel ShadeOpaque_Direct_Fptl SHADE_OPAQUE_ENTRY=ShadeOpaque_Direct_Fptl USE_FPTL_LIGHTLIST
#pragma kernel ShadeOpaque_Direct_Fptl_DebugDisplay SHADE_OPAQUE_ENTRY=ShadeOpaque_Direct_Fptl_DebugDisplay USE_FPTL_LIGHTLIST DEBUG_DISPLAY
#pragma kernel ShadeOpaque_Direct_Clustered SHADE_OPAQUE_ENTRY=ShadeOpaque_Direct_Clustered USE_CLUSTERED_LIGHTLIST
#pragma kernel ShadeOpaque_Direct_Clustered_DebugDisplay SHADE_OPAQUE_ENTRY=ShadeOpaque_Direct_Clustered_DebugDisplay USE_CLUSTERED_LIGHTLIST DEBUG_DISPLAY
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant0 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant0 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=0
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant1 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant1 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=1
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant2 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant2 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=2
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant3 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant3 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=3
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant4 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant4 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=4
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant5 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant5 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=5
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant6 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant6 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=6
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant7 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant7 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=7
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant8 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant8 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=8
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant9 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant9 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=9
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant10 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant10 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=10
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant11 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant11 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=11
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant12 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant12 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=12
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant13 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant13 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=13
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant14 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant14 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=14
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant15 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant15 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=15
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant0 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant0 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=0
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant1 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant1 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=1
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant2 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant2 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=2
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant3 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant3 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=3
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant4 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant4 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=4
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant5 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant5 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=5
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant6 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant6 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=6
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant7 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant7 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=7
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant8 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant8 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=8
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant9 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant9 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=9
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant10 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant10 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=10
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant11 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant11 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=11
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant12 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant12 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=12
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant13 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant13 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=13
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant14 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant14 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=14
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant15 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant15 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=15
#pragma #pragma enable_d3d11_debug_symbols
// Split lighting is required for the SSS pass.
// Not currently possible since we need to access the stencil buffer from the compute shader.
// #pragma multi_compile _ OUTPUT_SPLIT_LIGHTING
#define LIGHTLOOP_TILE_PASS 1
#define LIGHTLOOP_TILE_DIRECT 1
#define LIGHTLOOP_TILE_INDIRECT 1
#define LIGHTLOOP_TILE_ALL 1
//-------------------------------------------------------------------------------------
// Include
//-------------------------------------------------------------------------------------
#include "../../../../ShaderLibrary/Common.hlsl"
#include "../../../Debug/DebugDisplay.hlsl"
// Note: We have fix as guidelines that we have only one deferred material (with control of GBuffer enabled). Mean a users that add a new
// deferred material must replace the old one here. If in the future we want to support multiple layout (cause a lot of consistency problem),
// the deferred shader will require to use multicompile.
#define UNITY_MATERIAL_LIT // Need to be define before including Material.hlsl
#include "../../../ShaderConfig.cs.hlsl"
#include "../../../ShaderVariables.hlsl"
#include "../../../Lighting/Lighting.hlsl" // This include Material.hlsl
#include "../../../Lighting/TilePass/FeatureFlags.hlsl"
//-------------------------------------------------------------------------------------
// variable declaration
//-------------------------------------------------------------------------------------
DECLARE_GBUFFER_TEXTURE(_GBufferTexture);
#ifdef OUTPUT_SPLIT_LIGHTING
RWTexture2D<float4> specularLightingUAV;
RWTexture2D<float3> diffuseLightingUAV;
#else
RWTexture2D<float4> combinedLightingUAV;
#endif
#if USE_INDIRECT
uint g_TileListOffset;
StructuredBuffer<uint> g_TileList;
// Indirect
[numthreads(16, 16, 1)]
void SHADE_OPAQUE_ENTRY(uint2 groupThreadId : SV_GroupThreadID, uint groupId : SV_GroupID)
{
uint tileIndex = g_TileList[g_TileListOffset + groupId];
uint2 tileCoord = uint2(tileIndex & 0xFFFF, tileIndex >> 16);
uint2 pixelCoord = tileCoord * GetTileSize() + groupThreadId;
PositionInputs posInput = GetPositionInput(pixelCoord.xy, _ScreenSize.zw, tileCoord);
uint featureFlags = TileVariantToFeatureFlags(VARIANT);
#else
// Direct
[numthreads(16, 16, 1)]
void SHADE_OPAQUE_ENTRY(uint2 dispatchThreadId : SV_DispatchThreadID, uint2 groupId : SV_GroupID)
{
uint2 pixelCoord = dispatchThreadId;
PositionInputs posInput = GetPositionInput(pixelCoord.xy, _ScreenSize.zw, groupId);
uint featureFlags = 0xFFFFFFFF;
#endif
float depth = LOAD_TEXTURE2D(_MainDepthTexture, posInput.unPositionSS).x;
UpdatePositionInput(depth, _InvViewProjMatrix, _ViewProjMatrix, posInput);
float3 V = GetWorldSpaceNormalizeViewDir(posInput.positionWS);
FETCH_GBUFFER(gbuffer, _GBufferTexture, posInput.unPositionSS);
BSDFData bsdfData;
float3 bakeDiffuseLighting;
DECODE_FROM_GBUFFER(gbuffer, featureFlags, bsdfData, bakeDiffuseLighting);
PreLightData preLightData = GetPreLightData(V, posInput, bsdfData);
float3 diffuseLighting;
float3 specularLighting;
LightLoop(V, posInput, preLightData, bsdfData, bakeDiffuseLighting, featureFlags, diffuseLighting, specularLighting);
#ifdef OUTPUT_SPLIT_LIGHTING
specularLightingUAV[pixelCoord] = float4(specularLighting, 1.0);
diffuseLightingUAV[pixelCoord] = diffuseLighting;
#else
combinedLightingUAV[pixelCoord] = float4(diffuseLighting + specularLighting, 1.0);
#endif
}
#pragma kernel ShadeOpaque_Direct_Fptl SHADE_OPAQUE_ENTRY=ShadeOpaque_Direct_Fptl USE_FPTL_LIGHTLIST
#pragma kernel ShadeOpaque_Direct_Fptl_DebugDisplay SHADE_OPAQUE_ENTRY=ShadeOpaque_Direct_Fptl_DebugDisplay USE_FPTL_LIGHTLIST DEBUG_DISPLAY
#pragma kernel ShadeOpaque_Direct_Clustered SHADE_OPAQUE_ENTRY=ShadeOpaque_Direct_Clustered USE_CLUSTERED_LIGHTLIST
#pragma kernel ShadeOpaque_Direct_Clustered_DebugDisplay SHADE_OPAQUE_ENTRY=ShadeOpaque_Direct_Clustered_DebugDisplay USE_CLUSTERED_LIGHTLIST DEBUG_DISPLAY
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant0 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant0 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=0
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant1 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant1 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=1
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant2 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant2 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=2
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant3 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant3 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=3
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant4 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant4 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=4
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant5 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant5 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=5
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant6 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant6 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=6
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant7 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant7 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=7
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant8 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant8 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=8
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant9 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant9 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=9
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant10 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant10 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=10
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant11 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant11 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=11
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant12 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant12 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=12
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant13 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant13 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=13
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant14 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant14 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=14
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant15 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant15 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=15
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant0 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant0 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=0
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant1 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant1 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=1
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant2 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant2 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=2
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant3 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant3 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=3
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant4 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant4 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=4
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant5 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant5 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=5
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant6 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant6 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=6
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant7 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant7 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=7
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant8 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant8 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=8
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant9 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant9 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=9
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant10 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant10 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=10
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant11 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant11 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=11
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant12 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant12 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=12
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant13 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant13 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=13
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant14 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant14 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=14
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant15 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant15 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=15
#pragma #pragma enable_d3d11_debug_symbols
// Split lighting is required for the SSS pass.
// Not currently possible since we need to access the stencil buffer from the compute shader.
// #pragma multi_compile _ OUTPUT_SPLIT_LIGHTING
#define LIGHTLOOP_TILE_PASS 1
#define LIGHTLOOP_TILE_DIRECT 1
#define LIGHTLOOP_TILE_INDIRECT 1
#define LIGHTLOOP_TILE_ALL 1
//-------------------------------------------------------------------------------------
// Include
//-------------------------------------------------------------------------------------
#include "../../../../ShaderLibrary/Common.hlsl"
#include "../../../Debug/DebugDisplay.hlsl"
// Note: We have fix as guidelines that we have only one deferred material (with control of GBuffer enabled). Mean a users that add a new
// deferred material must replace the old one here. If in the future we want to support multiple layout (cause a lot of consistency problem),
// the deferred shader will require to use multicompile.
#define UNITY_MATERIAL_LIT // Need to be define before including Material.hlsl
#include "../../../ShaderConfig.cs.hlsl"
#include "../../../ShaderVariables.hlsl"
#include "../../../Lighting/Lighting.hlsl" // This include Material.hlsl
#include "../../../Lighting/TilePass/FeatureFlags.hlsl"
//-------------------------------------------------------------------------------------
// variable declaration
//-------------------------------------------------------------------------------------
DECLARE_GBUFFER_TEXTURE(_GBufferTexture);
#ifdef OUTPUT_SPLIT_LIGHTING
RWTexture2D<float4> specularLightingUAV;
RWTexture2D<float3> diffuseLightingUAV;
#else
RWTexture2D<float4> combinedLightingUAV;
#endif
#if USE_INDIRECT
uint g_TileListOffset;
StructuredBuffer<uint> g_TileList;
// Indirect
[numthreads(16, 16, 1)]
void SHADE_OPAQUE_ENTRY(uint2 groupThreadId : SV_GroupThreadID, uint groupId : SV_GroupID)
{
uint tileIndex = g_TileList[g_TileListOffset + groupId];
uint2 tileCoord = uint2(tileIndex & 0xFFFF, tileIndex >> 16);
uint2 pixelCoord = tileCoord * GetTileSize() + groupThreadId;
PositionInputs posInput = GetPositionInput(pixelCoord.xy, _ScreenSize.zw, tileCoord);
uint featureFlags = TileVariantToFeatureFlags(VARIANT);
#else
// Direct
[numthreads(16, 16, 1)]
void SHADE_OPAQUE_ENTRY(uint2 dispatchThreadId : SV_DispatchThreadID, uint2 groupId : SV_GroupID)
{
uint2 pixelCoord = dispatchThreadId;
PositionInputs posInput = GetPositionInput(pixelCoord.xy, _ScreenSize.zw, groupId);
uint featureFlags = 0xFFFFFFFF;
#endif
float depth = LOAD_TEXTURE2D(_MainDepthTexture, posInput.unPositionSS).x;
UpdatePositionInput(depth, _InvViewProjMatrix, _ViewProjMatrix, posInput);
float3 V = GetWorldSpaceNormalizeViewDir(posInput.positionWS);
FETCH_GBUFFER(gbuffer, _GBufferTexture, posInput.unPositionSS);
BSDFData bsdfData;
float3 bakeDiffuseLighting;
DECODE_FROM_GBUFFER(gbuffer, featureFlags, bsdfData, bakeDiffuseLighting);
PreLightData preLightData = GetPreLightData(V, posInput, bsdfData);
float3 diffuseLighting;
float3 specularLighting;
LightLoop(V, posInput, preLightData, bsdfData, bakeDiffuseLighting, featureFlags, diffuseLighting, specularLighting);
#ifdef OUTPUT_SPLIT_LIGHTING
specularLightingUAV[pixelCoord] = float4(specularLighting, 1.0);
diffuseLightingUAV[pixelCoord] = diffuseLighting;
#else
combinedLightingUAV[pixelCoord] = float4(diffuseLighting + specularLighting, 1.0);
#endif
}

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


//#define SHADOWS_ENABLED
//#define SHADOWS_FIXSHADOWIDX
using UnityEngine.Rendering;
using UnityEngine.Rendering;
#if SHADOWS_ENABLED
using ShadowExp;
class ShadowSetup : IDisposable
{
// shadow related stuff

public ShadowSetup(ShadowSettings shadowSettings, out IShadowManager shadowManager)
{
s_ShadowDataBuffer = new ComputeBuffer(k_MaxShadowDataSlots, System.Runtime.InteropServices.Marshal.SizeOf(typeof(ShadowExp.ShadowData)));
s_ShadowPayloadBuffer = new ComputeBuffer(k_MaxShadowDataSlots * k_MaxPayloadSlotsPerShadowData, System.Runtime.InteropServices.Marshal.SizeOf(typeof(ShadowExp.ShadowData)));
s_ShadowDataBuffer = new ComputeBuffer( k_MaxShadowDataSlots, System.Runtime.InteropServices.Marshal.SizeOf( typeof( ShadowData ) ) );
s_ShadowPayloadBuffer = new ComputeBuffer( k_MaxShadowDataSlots * k_MaxPayloadSlotsPerShadowData, System.Runtime.InteropServices.Marshal.SizeOf( typeof( ShadowPayload ) ) );
ShadowAtlas.AtlasInit atlasInit;
atlasInit.baseInit.width = (uint)shadowSettings.shadowAtlasWidth;
atlasInit.baseInit.height = (uint)shadowSettings.shadowAtlasHeight;

atlasInit.baseInit.clearColor = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
atlasInit.baseInit.samplerState = SamplerState.Default();
atlasInit.baseInit.comparisonSamplerState = ComparisonSamplerState.Default();
atlasInit.baseInit.clearColor = new Vector4( 0.0f, 0.0f, 0.0f, 0.0f );
atlasInit.baseInit.shadowSupport = ShadowmapBase.ShadowSupport.Directional;
atlasInit.baseInit.shadowSupport = ShadowmapBase.ShadowSupport.Directional | ShadowmapBase.ShadowSupport.Point | ShadowmapBase.ShadowSupport.Spot;
var atlasInit2 = atlasInit;
atlasInit2.baseInit.shadowSupport = ShadowmapBase.ShadowSupport.Point | ShadowmapBase.ShadowSupport.Spot;
m_Shadowmaps = new ShadowmapBase[] { new ShadowExp.ShadowAtlas(ref atlasInit), new ShadowExp.ShadowAtlas(ref atlasInit2) };
var varianceInit = atlasInit;
varianceInit.baseInit.shadowmapFormat = ShadowVariance.GetFormat( false, false, true );
var varianceInit2 = varianceInit;
varianceInit2.baseInit.shadowmapFormat = ShadowVariance.GetFormat( true, true, false );
var varianceInit3 = varianceInit;
varianceInit3.baseInit.shadowmapFormat = ShadowVariance.GetFormat( true, false, true );
m_Shadowmaps = new ShadowmapBase[] { new ShadowVariance( ref varianceInit ), new ShadowVariance( ref varianceInit2 ), new ShadowVariance( ref varianceInit3 ), new ShadowAtlas( ref atlasInit ) };
ShadowExp.ShadowData[] sds;
ShadowData[] sds;
sc.GetShadowDatas(out sds, out offset, out count);
Debug.Assert(offset == 0);
s_ShadowDataBuffer.SetData(sds); // unfortunately we can't pass an offset or count to this function

// bind textures
uint offset, count;
RenderTargetIdentifier[] tex;
sc.GetTex2DArrays(out tex, out offset, out count);
cb.SetGlobalTexture("_ShadowmapExp_Dir", tex[0]);
cb.SetGlobalTexture("_ShadowmapExp_PointSpot", tex[1]);
sc.GetTex2DArrays( out tex, out offset, out count );
cb.SetGlobalTexture( "_ShadowmapExp_VSM_0", tex[0] );
cb.SetGlobalTexture( "_ShadowmapExp_VSM_1", tex[1] );
cb.SetGlobalTexture( "_ShadowmapExp_VSM_2", tex[2] );
cb.SetGlobalTexture( "_ShadowmapExp_PCF" , tex[3] );
// TODO: Currently samplers are hard coded in ShadowContext.hlsl, so we can't really set them here
};

scInit.storage.maxTex2DArraySlots = 4;
scInit.storage.maxTexCubeArraySlots = 2;
scInit.storage.maxComparisonSamplerSlots = 2;
scInit.storage.maxSamplerSlots = 2;
scInit.storage.maxTexCubeArraySlots = 0;
scInit.storage.maxComparisonSamplerSlots = 1;
scInit.storage.maxSamplerSlots = 4;
m_ShadowMgr = new ShadowExp.ShadowManager(shadowSettings, ref scInit, m_Shadowmaps);
m_ShadowMgr = new ShadowManager(shadowSettings, ref scInit, m_Shadowmaps);
// set global overrides - these need to match the override specified in ShadowDispatch.hlsl
bool useGlobalOverrides = true;
m_ShadowMgr.SetGlobalShadowOverride( GPUShadowType.Point , ShadowAlgorithm.PCF, ShadowVariant.V4, ShadowPrecision.High, useGlobalOverrides );
m_ShadowMgr.SetGlobalShadowOverride( GPUShadowType.Spot , ShadowAlgorithm.PCF, ShadowVariant.V4, ShadowPrecision.High, useGlobalOverrides );
m_ShadowMgr.SetGlobalShadowOverride( GPUShadowType.Directional , ShadowAlgorithm.PCF, ShadowVariant.V4, ShadowPrecision.High, useGlobalOverrides );
shadowManager = m_ShadowMgr;
}

{
(m_Shadowmaps[0] as ShadowAtlas).Dispose();
(m_Shadowmaps[1] as ShadowAtlas).Dispose();
(m_Shadowmaps[2] as ShadowAtlas).Dispose();
(m_Shadowmaps[3] as ShadowAtlas).Dispose();
Utilities.SafeRelease(s_ShadowDataBuffer);
Utilities.SafeRelease(s_ShadowPayloadBuffer);
if (s_ShadowDataBuffer != null)
s_ShadowDataBuffer.Release();
if (s_ShadowPayloadBuffer != null)
s_ShadowPayloadBuffer.Release();
#endif
namespace TilePass
{

Material m_SingleDeferredMaterialSRT = null;
Material m_SingleDeferredMaterialMRT = null;
#if (SHADOWS_ENABLED)
FrameId m_FrameId;
FrameId m_FrameId = new FrameId();
ShadowSetup m_ShadowSetup; // doesn't actually have to reside here, it would be enough to pass the IShadowManager in from the outside
IShadowManager m_ShadowMgr;
List<int> m_ShadowRequests = new List<int>();

m_ShadowMgr = null;
}
}
#endif
int GetNumTileFtplX(Camera camera)

Utilities.SelectKeyword(m_DeferredDirectMaterialSRT, tileKeywords, 0);
m_DeferredDirectMaterialSRT.EnableKeyword("LIGHTLOOP_TILE_PASS");
m_DeferredDirectMaterialSRT.DisableKeyword("OUTPUT_SPLIT_LIGHTING");
m_DeferredDirectMaterialSRT.SetInt("_StencilRef", (int)StencilBits.Standard);
m_DeferredDirectMaterialSRT.SetInt("_StencilCmp", 4 /* LEqual */);
m_DeferredDirectMaterialSRT.SetInt("_StencilRef", (int)StencilBits.SSS);
m_DeferredDirectMaterialSRT.SetInt("_StencilCmp", 2 /* Less */); // Shade if stencil is not 0 and not SSS
m_DeferredDirectMaterialSRT.SetInt("_SrcBlend", (int)BlendMode.One);
m_DeferredDirectMaterialSRT.SetInt("_DstBlend", (int)BlendMode.Zero);

Utilities.SelectKeyword(m_DeferredIndirectMaterialSRT, tileKeywords, 1);
m_DeferredIndirectMaterialSRT.EnableKeyword("LIGHTLOOP_TILE_PASS");
m_DeferredIndirectMaterialSRT.DisableKeyword("OUTPUT_SPLIT_LIGHTING");
m_DeferredIndirectMaterialSRT.SetInt("_StencilRef", (int)StencilBits.Standard);
m_DeferredIndirectMaterialSRT.SetInt("_StencilCmp", 4 /* LEqual */);
m_DeferredIndirectMaterialSRT.SetInt("_StencilRef", (int)StencilBits.SSS);
m_DeferredIndirectMaterialSRT.SetInt("_StencilCmp", 2 /* Less */); // Shade if stencil is not 0 and not SSS
m_DeferredIndirectMaterialSRT.SetInt("_SrcBlend", (int)BlendMode.One);
m_DeferredIndirectMaterialSRT.SetInt("_DstBlend", (int)BlendMode.One); // Additive color & alpha source

Utilities.SelectKeyword(m_DeferredAllMaterialSRT, tileKeywords, 2);
m_DeferredAllMaterialSRT.EnableKeyword("LIGHTLOOP_TILE_PASS");
m_DeferredAllMaterialSRT.DisableKeyword("OUTPUT_SPLIT_LIGHTING");
m_DeferredAllMaterialSRT.SetInt("_StencilRef", (int)StencilBits.Standard);
m_DeferredAllMaterialSRT.SetInt("_StencilCmp", 4 /* LEqual */);
m_DeferredAllMaterialSRT.SetInt("_StencilRef", (int)StencilBits.SSS);
m_DeferredAllMaterialSRT.SetInt("_StencilCmp", 2 /* Less */); // Shade if stencil is not 0 and not SSS
m_DeferredAllMaterialSRT.SetInt("_SrcBlend", (int)BlendMode.One);
m_DeferredAllMaterialSRT.SetInt("_DstBlend", (int)BlendMode.Zero);

m_SingleDeferredMaterialSRT = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/Deferred");
m_SingleDeferredMaterialSRT.EnableKeyword("LIGHTLOOP_SINGLE_PASS");
m_SingleDeferredMaterialSRT.DisableKeyword("OUTPUT_SPLIT_LIGHTING");
m_SingleDeferredMaterialSRT.SetInt("_StencilRef", (int)StencilBits.Standard);
m_SingleDeferredMaterialSRT.SetInt("_StencilCmp", 4 /* LEqual */);
m_SingleDeferredMaterialSRT.SetInt("_StencilRef", (int)StencilBits.SSS);
m_SingleDeferredMaterialSRT.SetInt("_StencilCmp", 2 /* Less */); // Shade if stencil is not 0 and not SSS
m_SingleDeferredMaterialSRT.SetInt("_SrcBlend", (int)BlendMode.One);
m_SingleDeferredMaterialSRT.SetInt("_DstBlend", (int)BlendMode.Zero);

UnityEditor.SceneView.onSceneGUIDelegate += OnSceneGUI;
#endif
#if (SHADOWS_ENABLED)
#endif
DeinitShadowSystem();
#if UNITY_EDITOR
UnityEditor.SceneView.onSceneGUIDelegate -= OnSceneGUI;
#endif

return new Vector3(light.finalColor.r, light.finalColor.g, light.finalColor.b);
}
// Return number of added shadow
public int GetShadows(VisibleLight light, int lightIndex, ref ShadowOutput shadowOutput, ShadowSettings shadowSettings)
{
for (int sliceIndex = 0; sliceIndex < shadowOutput.GetShadowSliceCountLightIndex(lightIndex); ++sliceIndex)
{
ShadowData shadowData = new ShadowData();
int shadowSliceIndex = shadowOutput.GetShadowSliceIndex(lightIndex, sliceIndex);
shadowData.worldToShadow = shadowOutput.shadowSlices[shadowSliceIndex].shadowTransform.transpose; // Transpose for hlsl reading ?
shadowData.bias = light.light.shadowBias;
shadowData.invResolution = new Vector4(1.0f / shadowSettings.shadowAtlasWidth, 1.0f / shadowSettings.shadowAtlasHeight, 0.0f, 0.0f);
m_lightList.shadows.Add(shadowData);
}
return shadowOutput.GetShadowSliceCountLightIndex(lightIndex);
}
public bool GetDirectionalLightData(ShadowSettings shadowSettings, GPULightType gpuLightType, VisibleLight light, AdditionalLightData additionalData, int lightIndex, ref ShadowOutput shadowOutput, ref int directionalShadowcount)
public bool GetDirectionalLightData(ShadowSettings shadowSettings, GPULightType gpuLightType, VisibleLight light, AdditionalLightData additionalData, int lightIndex)
{
var directionalLightData = new DirectionalLightData();

directionalLightData.tileCookie = (light.light.cookie.wrapMode == TextureWrapMode.Repeat);
directionalLightData.cookieIndex = m_CookieTexArray.FetchSlice(light.light.cookie);
}
bool hasDirectionalShadows = light.light.shadows != LightShadows.None && shadowOutput.GetShadowSliceCountLightIndex(lightIndex) != 0;
bool hasDirectionalNotReachMaxLimit = directionalShadowcount == 0; // Only one cascade shadow allowed
// If we have not found a directional shadow casting light yet, we register the last directional anyway as "sun".
if (directionalShadowcount == 0)
// fix up shadow information
int shadowIdx;
if (m_ShadowIndices.TryGetValue(lightIndex, out shadowIdx))
directionalLightData.shadowIndex = shadowIdx;
if (hasDirectionalShadows && hasDirectionalNotReachMaxLimit) // Note < MaxShadows should be check at shadowOutput creation
{
// Always choose the directional shadow casting light if it exists.
m_CurrentSunLight = light.light;
directionalLightData.shadowIndex = m_lightList.shadows.Count;
directionalShadowcount += GetShadows(light, lightIndex, ref shadowOutput, shadowSettings);
// Fill split information for shaders
for (int s = 0; s < k_MaxCascadeCount; ++s)
{
m_lightList.directionalShadowSplitSphereSqr[s] = shadowOutput.directionalShadowSplitSphereSqr[s];
}
}
m_CurrentSunLight = m_CurrentSunLight == null ? light.light : m_CurrentSunLight;
m_lightList.directionalLights.Add(directionalLightData);

return 1.0f - Mathf.Clamp01((distanceToCamera - distanceFadeNear) / (fadeDistance - distanceFadeNear));
}
public bool GetLightData(ShadowSettings shadowSettings, Camera camera, GPULightType gpuLightType, VisibleLight light, AdditionalLightData additionalData, int lightIndex, ref ShadowOutput shadowOutput, ref int shadowCount)
public bool GetLightData(ShadowSettings shadowSettings, Camera camera, GPULightType gpuLightType, VisibleLight light, AdditionalLightData additionalData, int lightIndex)
{
var lightData = new LightData();

lightData.cookieIndex = m_CookieTexArray.FetchSlice(light.light.cookie);
}
}
// Setup shadow data arrays
// In case lightData.shadowDimmer == 0.0 we need to avoid rendering the shadow map... see how it can be done with the culling (and more specifically, how can we do that BEFORE sending for shadows)
bool hasShadows = lightData.shadowDimmer > 0.0f && distanceToCamera < shadowSettings.maxShadowDistance && light.light.shadows != LightShadows.None && shadowOutput.GetShadowSliceCountLightIndex(lightIndex) != 0;
bool hasNotReachMaxLimit = shadowCount + (lightData.lightType == GPULightType.Point ? 6 : 1) <= k_MaxShadowOnScreen;
// TODO: Read the comment about shadow limit/management at the beginning of this loop
if (hasShadows && hasNotReachMaxLimit)
// fix up shadow information
int shadowIdx;
if (m_ShadowIndices.TryGetValue(lightIndex, out shadowIdx))
// When we have a point light, we assumed that there is 6 consecutive PunctualShadowData
lightData.shadowIndex = m_lightList.shadows.Count;
shadowCount += GetShadows(light, lightIndex, ref shadowOutput, shadowSettings);
lightData.shadowIndex = shadowIdx;
if (additionalData.archetype != LightArchetype.Punctual)
{
lightData.size = new Vector2(additionalData.lightLength, additionalData.lightWidth);

m_lightList.bounds.Add(bound);
m_lightList.lightVolumes.Add(lightVolumeData);
}
public override int GetCurrentShadowCount()
{
return m_ShadowRequests.Count;
}
public override void PrepareLightsForGPU(ShadowSettings shadowSettings, CullResults cullResults, Camera camera, ref ShadowOutput shadowOutput)
public override void UpdateCullingParameters(ref CullingParameters cullingParams)
{
m_ShadowMgr.UpdateCullingParameters( ref cullingParams );
}
public override void PrepareLightsForGPU(ShadowSettings shadowSettings, CullResults cullResults, Camera camera)
#if (SHADOWS_ENABLED)
// 0. deal with shadows
{
m_FrameId.frameCount++;

int lcnt = cullResults.visibleLights.Length;
for (int i = 0; i < lcnt; ++i)
{
if (cullResults.visibleLights[i].light.shadows != LightShadows.None)
m_ShadowRequests.Add(i);
VisibleLight vl = cullResults.visibleLights[i];
AdditionalLightData ald = vl.light.GetComponent<AdditionalLightData>();
if( vl.light.shadows != LightShadows.None && ald != null && ald.shadowDimmer > 0.0f )
m_ShadowRequests.Add( i );
uint originalRequestCount = shadowRequestCount;
m_ShadowMgr.ProcessShadowRequests(m_FrameId, cullResults, camera, cullResults.visibleLights,
ref shadowRequestCount, shadowRequests, out shadowDataIndices);

m_ShadowIndices.Add(shadowRequests[i], shadowDataIndices[i]);
}
}
#endif
float oldSpecularGlobalDimmer = m_PassSettings.specularGlobalDimmer;
// Change some parameters in case of "special" rendering (can be preview, reflection, etc.
if (camera.cameraType == CameraType.Reflection)

var additionalData = light.light.GetComponent<AdditionalLightData>();
if (additionalData == null)
{
// Don't display warning for the preview windows
if (camera.cameraType != CameraType.Preview)
{
Debug.LogWarningFormat(light.light, "Light entity {0} has no additional data, will be rendered using default values.", light.light.name);
}
}
// Note: LightType.Area is offline only, use for baking, no need to test it
if (additionalData.archetype == LightArchetype.Punctual)
{
switch (light.lightType)
// Note: LightType.Area is offline only, use for baking, no need to test it
if (additionalData.archetype == LightArchetype.Punctual)
case LightType.Point:
if (punctualLightcount >= k_MaxPunctualLightsOnScreen)
continue;
lightCategory = LightCategory.Punctual;
gpuLightType = GPULightType.Point;
lightVolumeType = LightVolumeType.Sphere;
break;
switch (light.lightType)
{
case LightType.Point:
if (punctualLightcount >= k_MaxPunctualLightsOnScreen)
continue;
lightCategory = LightCategory.Punctual;
gpuLightType = GPULightType.Point;
lightVolumeType = LightVolumeType.Sphere;
break;
case LightType.Spot:
if (punctualLightcount >= k_MaxPunctualLightsOnScreen)
continue;
lightCategory = LightCategory.Punctual;
gpuLightType = GPULightType.Spot;
lightVolumeType = LightVolumeType.Cone;
break;
case LightType.Spot:
if (punctualLightcount >= k_MaxPunctualLightsOnScreen)
continue;
lightCategory = LightCategory.Punctual;
gpuLightType = GPULightType.Spot;
lightVolumeType = LightVolumeType.Cone;
break;
case LightType.Directional:
if (directionalLightcount >= k_MaxDirectionalLightsOnScreen)
continue;
lightCategory = LightCategory.Punctual;
gpuLightType = GPULightType.Directional;
// No need to add volume, always visible
lightVolumeType = LightVolumeType.Count; // Count is none
break;
case LightType.Directional:
if (directionalLightcount >= k_MaxDirectionalLightsOnScreen)
continue;
lightCategory = LightCategory.Punctual;
gpuLightType = GPULightType.Directional;
// No need to add volume, always visible
lightVolumeType = LightVolumeType.Count; // Count is none
break;
default:
Debug.Assert(false, "TODO: encountered an unknown LightType.");
break;
default:
Debug.Assert(false, "TODO: encountered an unknown LightType.");
break;
}
}
else
{
switch (additionalData.archetype)
else
case LightArchetype.Area:
if (areaLightCount >= k_MaxAreaLightsOnScreen) { continue; }
lightCategory = LightCategory.Area;
gpuLightType = (additionalData.lightWidth > 0) ? GPULightType.Rectangle : GPULightType.Line;
lightVolumeType = LightVolumeType.Box;
break;
case LightArchetype.Projector:
if (projectorLightCount >= k_MaxProjectorLightsOnScreen) { continue; }
lightCategory = LightCategory.Projector;
switch (light.lightType)
{
case LightType.Directional:
gpuLightType = GPULightType.ProjectorOrtho;
lightVolumeType = LightVolumeType.Box;
break;
case LightType.Spot:
gpuLightType = GPULightType.ProjectorPyramid;
lightVolumeType = LightVolumeType.Cone;
break;
default:
Debug.Assert(false, "Projectors can only be Spot or Directional lights.");
break;
}
break;
default:
Debug.Assert(false, "TODO: encountered an unknown LightArchetype.");
break;
switch (additionalData.archetype)
{
case LightArchetype.Area:
if (areaLightCount >= k_MaxAreaLightsOnScreen) { continue; }
lightCategory = LightCategory.Area;
gpuLightType = (additionalData.lightWidth > 0) ? GPULightType.Rectangle : GPULightType.Line;
lightVolumeType = LightVolumeType.Box;
break;
case LightArchetype.Projector:
if (projectorLightCount >= k_MaxProjectorLightsOnScreen) { continue; }
lightCategory = LightCategory.Projector;
switch (light.lightType)
{
case LightType.Directional:
gpuLightType = GPULightType.ProjectorOrtho;
lightVolumeType = LightVolumeType.Box;
break;
case LightType.Spot:
gpuLightType = GPULightType.ProjectorPyramid;
lightVolumeType = LightVolumeType.Cone;
break;
default:
Debug.Assert(false, "Projectors can only be Spot or Directional lights.");
break;
}
break;
default:
Debug.Assert(false, "TODO: encountered an unknown LightArchetype.");
break;
}
}
#if (SHADOWS_ENABLED)
uint shadow = m_ShadowIndices.ContainsKey(lightIndex) ? 1u : 0;
// 5 bit (0x1F) light category, 5 bit (0x1F) GPULightType, 5 bit (0x1F) lightVolume, 1 bit for shadow casting, 16 bit index
sortKeys[sortCount++] = (uint)lightCategory << 27 | (uint)gpuLightType << 22 | (uint)lightVolumeType << 17 | shadow << 16 | (uint)lightIndex;
#else
// 5 bit (0x1F) light category, 5 bit (0x1F) GPULightType, 6 bit (0x3F) lightVolume, 16 bit index
sortKeys[sortCount++] = (uint)lightCategory << 27 | (uint)gpuLightType << 22 | (uint)lightVolumeType << 16 | (uint)lightIndex;
#endif
uint shadow = m_ShadowIndices.ContainsKey(lightIndex) ? 1u : 0;
// 5 bit (0x1F) light category, 5 bit (0x1F) GPULightType, 5 bit (0x1F) lightVolume, 1 bit for shadow casting, 16 bit index
sortKeys[sortCount++] = (uint)lightCategory << 27 | (uint)gpuLightType << 22 | (uint)lightVolumeType << 17 | shadow << 16 | (uint)lightIndex;
}
Array.Sort(sortKeys);

// will be use...)
// The lightLoop is in charge, not the shadow pass.
// For now we will still apply the maximum of shadow here but we don't apply the sorting by priority + slot allocation yet
int directionalShadowcount = 0;
int shadowCount = 0;
m_CurrentSunLight = null;
// 2. Go thought all lights, convert them to GPU format.
// Create simultaneously data for culling (LigthVolumeData and rendering)

uint sortKey = sortKeys[sortIndex];
LightCategory lightCategory = (LightCategory)((sortKey >> 27) & 0x1F);
GPULightType gpuLightType = (GPULightType)((sortKey >> 22) & 0x1F);
#if (SHADOWS_ENABLED)
#else
LightVolumeType lightVolumeType = (LightVolumeType)((sortKey >> 16) & 0x3F);
#endif
int lightIndex = (int)(sortKey & 0xFFFF);
var light = cullResults.visibleLights[lightIndex];

if (gpuLightType == GPULightType.Directional)
{
if (GetDirectionalLightData(shadowSettings, gpuLightType, light, additionalData, lightIndex, ref shadowOutput, ref directionalShadowcount))
if (GetDirectionalLightData(shadowSettings, gpuLightType, light, additionalData, lightIndex))
#if (SHADOWS_ENABLED && SHADOWS_FIXSHADOWIDX)
// fix up shadow information
int shadowIdxDir;
if (m_ShadowIndices.TryGetValue(lightIndex, out shadowIdxDir))
{
var lightData = m_lightList.directionalLights[m_lightList.directionalLights.Count - 1];
lightData.shadowIndex = shadowIdxDir;
m_lightList.directionalLights[m_lightList.directionalLights.Count - 1] = lightData;
}
#endif
if (GetLightData(shadowSettings, camera, gpuLightType, light, additionalData, lightIndex, ref shadowOutput, ref shadowCount))
if(GetLightData(shadowSettings, camera, gpuLightType, light, additionalData, lightIndex))
{
switch (lightCategory)
{

// Then culling side. Must be call in this order as we pass the created Light data to the function
GetLightVolumeDataAndBound(lightCategory, gpuLightType, lightVolumeType, light, m_lightList.lights[m_lightList.lights.Count - 1], worldToView);
}
#if (SHADOWS_ENABLED && SHADOWS_FIXSHADOWIDX)
// fix up shadow information
int shadowIdx;
if (m_ShadowIndices.TryGetValue(lightIndex, out shadowIdx))
{
var lightData = m_lightList.lights[m_lightList.lights.Count - 1];
lightData.shadowIndex = shadowIdx;
m_lightList.lights[m_lightList.lights.Count - 1] = lightData;
}
#endif
}
// Sanity check

private void BindGlobalParams(CommandBuffer cmd, ComputeShader computeShader, int kernelIndex, Camera camera, ScriptableRenderContext loop)
{
#if (SHADOWS_ENABLED)
#endif
SetGlobalBuffer("g_vLightListGlobal", !usingFptl ? s_PerVoxelLightLists : s_LightList); // opaques list (unless MSAA possibly)
SetGlobalTexture("_CookieTextures", m_CookieTexArray.GetTexCache());

{
var cmd = new CommandBuffer { name = "Push Global Parameters" };
#if (SHADOWS_ENABLED)
#endif
SetGlobalPropertyRedirect(computeShader, kernelIndex, cmd);
BindGlobalParams(cmd, computeShader, kernelIndex, camera, loop);
SetGlobalPropertyRedirect(null, 0, null);

public override void RenderShadows(ScriptableRenderContext renderContext, CullResults cullResults)
{
#if (SHADOWS_ENABLED)
#endif
}
private void SetupDebugDisplayMode(bool debugDisplayEnable)

Utilities.SetKeyword(m_SingleDeferredMaterialMRT, "DEBUG_DISPLAY", debugDisplayEnable);
}
public override void RenderLightingDebug(HDCamera hdCamera, ScriptableRenderContext renderContext, RenderTargetIdentifier colorBuffer)
public override void RenderLightingDebug(HDCamera hdCamera, ScriptableRenderContext renderContext, RenderTargetIdentifier colorBuffer)
var cmd = new CommandBuffer();
var cmd = new CommandBuffer();
bool bUseClusteredForDeferred = !usingFptl;
bool bUseClusteredForDeferred = !usingFptl;
int w = hdCamera.camera.pixelWidth;
int h = hdCamera.camera.pixelHeight;
int numTilesX = (w + 15) / 16;
int numTilesY = (h + 15) / 16;
int numTiles = numTilesX * numTilesY;
int w = hdCamera.camera.pixelWidth;
int h = hdCamera.camera.pixelHeight;
int numTilesX = (w + 15) / 16;
int numTilesY = (h + 15) / 16;
int numTiles = numTilesX * numTilesY;
Vector2 mousePixelCoord = Input.mousePosition;
#if UNITY_EDITOR
if (!UnityEditor.EditorApplication.isPlayingOrWillChangePlaymode)

}
#endif
// Debug tiles
PushGlobalParams(hdCamera.camera, renderContext, null, 0);
if (m_PassSettings.tileDebugByCategory == TileLightLoopProducer.TileSettings.TileDebug.FeatureVariants)
{
if (GetFeatureVariantsEnabled())
{
// featureVariants
Utilities.SetupMaterialHDCamera(hdCamera, m_DebugViewTilesMaterial);
m_DebugViewTilesMaterial.SetInt("_NumTiles", numTiles);
m_DebugViewTilesMaterial.SetInt("_ViewTilesFlags", (int)m_PassSettings.tileDebugByCategory);
m_DebugViewTilesMaterial.SetVector("_MousePixelCoord", mousePixelCoord);
m_DebugViewTilesMaterial.SetBuffer("g_TileList", s_TileList);
m_DebugViewTilesMaterial.SetBuffer("g_DispatchIndirectBuffer", s_DispatchIndirectBuffer);
m_DebugViewTilesMaterial.EnableKeyword(bUseClusteredForDeferred ? "USE_CLUSTERED_LIGHTLIST" : "USE_FPTL_LIGHTLIST");
m_DebugViewTilesMaterial.DisableKeyword(!bUseClusteredForDeferred ? "USE_CLUSTERED_LIGHTLIST" : "USE_FPTL_LIGHTLIST");
m_DebugViewTilesMaterial.DisableKeyword("SHOW_LIGHT_CATEGORIES");
m_DebugViewTilesMaterial.EnableKeyword("SHOW_FEATURE_VARIANTS");
cmd.SetRenderTarget(colorBuffer);
cmd.DrawProcedural(Matrix4x4.identity, m_DebugViewTilesMaterial, 0, MeshTopology.Triangles, numTiles * 6);
}
}
else if (m_PassSettings.tileDebugByCategory != TileLightLoopProducer.TileSettings.TileDebug.None)
{
// lightCategories
Utilities.SetupMaterialHDCamera(hdCamera, m_DebugViewTilesMaterial);
m_DebugViewTilesMaterial.SetInt("_ViewTilesFlags", (int)m_PassSettings.tileDebugByCategory);
m_DebugViewTilesMaterial.SetVector("_MousePixelCoord", mousePixelCoord);
m_DebugViewTilesMaterial.EnableKeyword(bUseClusteredForDeferred ? "USE_CLUSTERED_LIGHTLIST" : "USE_FPTL_LIGHTLIST");
m_DebugViewTilesMaterial.DisableKeyword(!bUseClusteredForDeferred ? "USE_CLUSTERED_LIGHTLIST" : "USE_FPTL_LIGHTLIST");
m_DebugViewTilesMaterial.EnableKeyword("SHOW_LIGHT_CATEGORIES");
m_DebugViewTilesMaterial.DisableKeyword("SHOW_FEATURE_VARIANTS");
cmd.Blit(null, colorBuffer, m_DebugViewTilesMaterial, 0);
// Debug tiles
PushGlobalParams(hdCamera.camera, renderContext, null, 0);
if (m_PassSettings.tileDebugByCategory == TileLightLoopProducer.TileSettings.TileDebug.FeatureVariants)
{
if (GetFeatureVariantsEnabled())
{
// featureVariants
Utilities.SetupMaterialHDCamera(hdCamera, m_DebugViewTilesMaterial);
m_DebugViewTilesMaterial.SetInt("_NumTiles", numTiles);
m_DebugViewTilesMaterial.SetInt("_ViewTilesFlags", (int)m_PassSettings.tileDebugByCategory);
m_DebugViewTilesMaterial.SetVector("_MousePixelCoord", mousePixelCoord);
m_DebugViewTilesMaterial.SetBuffer("g_TileList", s_TileList);
m_DebugViewTilesMaterial.SetBuffer("g_DispatchIndirectBuffer", s_DispatchIndirectBuffer);
m_DebugViewTilesMaterial.EnableKeyword(bUseClusteredForDeferred ? "USE_CLUSTERED_LIGHTLIST" : "USE_FPTL_LIGHTLIST");
m_DebugViewTilesMaterial.DisableKeyword(!bUseClusteredForDeferred ? "USE_CLUSTERED_LIGHTLIST" : "USE_FPTL_LIGHTLIST");
m_DebugViewTilesMaterial.DisableKeyword("SHOW_LIGHT_CATEGORIES");
m_DebugViewTilesMaterial.EnableKeyword("SHOW_FEATURE_VARIANTS");
cmd.SetRenderTarget(colorBuffer);
cmd.DrawProcedural(Matrix4x4.identity, m_DebugViewTilesMaterial, 0, MeshTopology.Triangles, numTiles * 6);
}
}
else if (m_PassSettings.tileDebugByCategory != TileLightLoopProducer.TileSettings.TileDebug.None)
{
// lightCategories
Utilities.SetupMaterialHDCamera(hdCamera, m_DebugViewTilesMaterial);
m_DebugViewTilesMaterial.SetInt("_ViewTilesFlags", (int)m_PassSettings.tileDebugByCategory);
m_DebugViewTilesMaterial.SetVector("_MousePixelCoord", mousePixelCoord);
m_DebugViewTilesMaterial.EnableKeyword(bUseClusteredForDeferred ? "USE_CLUSTERED_LIGHTLIST" : "USE_FPTL_LIGHTLIST");
m_DebugViewTilesMaterial.DisableKeyword(!bUseClusteredForDeferred ? "USE_CLUSTERED_LIGHTLIST" : "USE_FPTL_LIGHTLIST");
m_DebugViewTilesMaterial.EnableKeyword("SHOW_LIGHT_CATEGORIES");
m_DebugViewTilesMaterial.DisableKeyword("SHOW_FEATURE_VARIANTS");
cmd.Blit(null, colorBuffer, m_DebugViewTilesMaterial, 0);
SetGlobalPropertyRedirect(null, 0, null);
renderContext.ExecuteCommandBuffer(cmd);
cmd.Dispose();
SetGlobalPropertyRedirect(null, 0, null);
renderContext.ExecuteCommandBuffer(cmd);
cmd.Dispose();
}
public override void RenderDeferredLighting(HDCamera hdCamera, ScriptableRenderContext renderContext,

}
else
{
// Note: in the enum StencilBits, Standard is before SSS and the stencil is setup to greater equal. So the code below is draw all stencil bit except SSS
m_SingleDeferredMaterialSRT.SetInt("_StencilRef", (int)(debugDisplaySettings.renderingDebugSettings.enableSSS ? StencilBits.Standard : StencilBits.SSS));
// The stencil test uses a LESS comparison mode.
// If asked to disable SSS, we set the material ID of SSS materials to Standard, and shade all pixels with non-zero stencil values.
m_SingleDeferredMaterialSRT.SetInt("_StencilRef", (int)(debugDisplaySettings.renderingDebugSettings.enableSSS ? StencilBits.SSS : 0));
Utilities.DrawFullScreen(cmd, m_SingleDeferredMaterialSRT, hdCamera, colorBuffers[0], depthStencilBuffer);
}
}

}
else
{
// Note: in the enum StencilBits, Standard is before SSS and the stencil is setup to greater equal. So the code below is draw all stencil bit except SSS
m_DeferredDirectMaterialSRT.SetInt("_StencilRef", (int)(debugDisplaySettings.renderingDebugSettings.enableSSS ? StencilBits.Standard : StencilBits.SSS));
// The stencil test uses a LESS comparison mode.
// If asked to disable SSS, we set the material ID of SSS materials to Standard, and shade all pixels with non-zero stencil values.
m_DeferredDirectMaterialSRT.SetInt("_StencilRef", (int)(debugDisplaySettings.renderingDebugSettings.enableSSS ? StencilBits.SSS : 0));
m_DeferredIndirectMaterialSRT.SetInt("_StencilRef", (int)(debugDisplaySettings.renderingDebugSettings.enableSSS ? StencilBits.SSS : 0));
m_DeferredIndirectMaterialSRT.SetInt("_StencilRef", (int)(debugDisplaySettings.renderingDebugSettings.enableSSS ? StencilBits.Standard : StencilBits.SSS));
Utilities.SelectKeyword(m_DeferredIndirectMaterialSRT, "USE_CLUSTERED_LIGHTLIST", "USE_FPTL_LIGHTLIST", bUseClusteredForDeferred);
Utilities.DrawFullScreen(cmd, m_DeferredIndirectMaterialSRT, hdCamera, colorBuffers[0], depthStencilBuffer);
}

}
else
{
// Note: in the enum StencilBits, Standard is before SSS and the stencil is setup to greater equal. So the code below is draw all stencil bit except SSS
m_DeferredAllMaterialSRT.SetInt("_StencilRef", (int)(debugDisplaySettings.renderingDebugSettings.enableSSS ? StencilBits.Standard : StencilBits.SSS));
// The stencil test uses a LESS comparison mode.
// If asked to disable SSS, we set the material ID of SSS materials to Standard, and shade all pixels with non-zero stencil values.
m_DeferredAllMaterialSRT.SetInt("_StencilRef", (int)(debugDisplaySettings.renderingDebugSettings.enableSSS ? StencilBits.NonSSS : StencilBits.SSS));
Utilities.SelectKeyword(m_DeferredAllMaterialSRT, "USE_CLUSTERED_LIGHTLIST", "USE_FPTL_LIGHTLIST", bUseClusteredForDeferred);
Utilities.DrawFullScreen(cmd, m_DeferredAllMaterialSRT, hdCamera, colorBuffers[0], depthStencilBuffer);
}

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


{
int sampleShadow;
int sampleReflection;
#ifdef SHADOWS_USE_SHADOWCTXT
#endif
#ifndef SHADOWS_USE_SHADOWCTXT
//-----------------------------------------------------------------------------
// Shadow sampling function
// ----------------------------------------------------------------------------
float GetPunctualShadowAttenuation(LightLoopContext lightLoopContext, uint lightType, float3 positionWS, int index, float3 L, float2 unPositionSS)
{
int faceIndex = 0;
if (lightType == GPULIGHTTYPE_POINT)
{
GetCubeFaceID(L, faceIndex);
}
ShadowData shadowData = _ShadowDatas[index + faceIndex];
// 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;
positionTXS.z -= 0.001; // Apply a linear bias
#if UNITY_REVERSED_Z
positionTXS.z = 1.0 - positionTXS.z;
#endif
// float3 shadowPosDX = ddx_fine(positionTXS);
// float3 shadowPosDY = ddy_fine(positionTXS);
return SAMPLE_TEXTURE2D_SHADOW(g_tShadowBuffer, samplerg_tShadowBuffer, positionTXS);
}
// Gets the cascade weights based on the world position of the fragment and the positions of the split spheres for each cascade.
// Returns an invalid split index if past shadowDistance (ie 4 is invalid for cascade)
int GetSplitSphereIndexForDirshadows(float3 positionWS, float4 dirShadowSplitSpheres[4])
{
float3 fromCenter0 = positionWS.xyz - dirShadowSplitSpheres[0].xyz;
float3 fromCenter1 = positionWS.xyz - dirShadowSplitSpheres[1].xyz;
float3 fromCenter2 = positionWS.xyz - dirShadowSplitSpheres[2].xyz;
float3 fromCenter3 = positionWS.xyz - dirShadowSplitSpheres[3].xyz;
float4 distances2 = float4(dot(fromCenter0, fromCenter0), dot(fromCenter1, fromCenter1), dot(fromCenter2, fromCenter2), dot(fromCenter3, fromCenter3));
float4 dirShadowSplitSphereSqRadii;
dirShadowSplitSphereSqRadii.x = dirShadowSplitSpheres[0].w;
dirShadowSplitSphereSqRadii.y = dirShadowSplitSpheres[1].w;
dirShadowSplitSphereSqRadii.z = dirShadowSplitSpheres[2].w;
dirShadowSplitSphereSqRadii.w = dirShadowSplitSpheres[3].w;
if (distances2.w > dirShadowSplitSphereSqRadii.w)
return -1;
float4 weights = float4(distances2 < dirShadowSplitSphereSqRadii);
weights.yzw = saturate(weights.yzw - weights.xyz);
return int(4.0 - dot(weights, float4(4.0, 3.0, 2.0, 1.0)));
}
float GetDirectionalShadowAttenuation(LightLoopContext lightLoopContext, float3 positionWS, int index, float3 L, float2 unPositionSS)
{
// Note Index is 0 for now, but else we need to provide the correct index in _DirShadowSplitSpheres and _ShadowDatas
int shadowSplitIndex = GetSplitSphereIndexForDirshadows(positionWS, _DirShadowSplitSpheres);
if (shadowSplitIndex == -1)
return 1.0;
ShadowData shadowData = _ShadowDatas[shadowSplitIndex];
// 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;
positionTXS.z -= 0.003; // Apply a linear bias
#if UNITY_REVERSED_Z
positionTXS.z = 1.0 - positionTXS.z;
#endif
float4 vShadow3x3PCFTerms0;
float4 vShadow3x3PCFTerms1;
float4 vShadow3x3PCFTerms2;
float4 vShadow3x3PCFTerms3;
float flTexelEpsilonX = shadowData.invResolution.x;
float flTexelEpsilonY = shadowData.invResolution.y;
vShadow3x3PCFTerms0 = float4(20.0f / 267.0f, 33.0f / 267.0f, 55.0f / 267.0f, 0.0f);
vShadow3x3PCFTerms1 = float4(flTexelEpsilonX, flTexelEpsilonY, -flTexelEpsilonX, -flTexelEpsilonY);
vShadow3x3PCFTerms2 = float4(flTexelEpsilonX, flTexelEpsilonY, 0.0f, 0.0f);
vShadow3x3PCFTerms3 = float4(-flTexelEpsilonX, -flTexelEpsilonY, 0.0f, 0.0f);
// float3 shadowPosDX = ddx_fine(positionTXS);
// float3 shadowPosDY = ddy_fine(positionTXS);
//return SAMPLE_TEXTURE2D_SHADOW(g_tShadowBuffer, samplerg_tShadowBuffer, positionTXS);
float4 v20Taps;
v20Taps.x = SAMPLE_TEXTURE2D_SHADOW(g_tShadowBuffer, samplerg_tShadowBuffer, float3(positionTXS.xy + vShadow3x3PCFTerms1.xy, positionTXS.z)).x; // 1 1
v20Taps.y = SAMPLE_TEXTURE2D_SHADOW(g_tShadowBuffer, samplerg_tShadowBuffer, float3(positionTXS.xy + vShadow3x3PCFTerms1.zy, positionTXS.z)).x; // -1 1
v20Taps.z = SAMPLE_TEXTURE2D_SHADOW(g_tShadowBuffer, samplerg_tShadowBuffer, float3(positionTXS.xy + vShadow3x3PCFTerms1.xw, positionTXS.z)).x; // 1 -1
v20Taps.w = SAMPLE_TEXTURE2D_SHADOW(g_tShadowBuffer, samplerg_tShadowBuffer, float3(positionTXS.xy + vShadow3x3PCFTerms1.zw, positionTXS.z)).x; // -1 -1
float flSum = dot(v20Taps.xyzw, float4(0.25, 0.25, 0.25, 0.25));
if ((flSum == 0.0) || (flSum == 1.0))
return flSum;
flSum *= vShadow3x3PCFTerms0.x * 4.0;
float4 v33Taps;
v33Taps.x = SAMPLE_TEXTURE2D_SHADOW(g_tShadowBuffer, samplerg_tShadowBuffer, float3(positionTXS.xy + vShadow3x3PCFTerms2.xz, positionTXS.z)).x; // 1 0
v33Taps.y = SAMPLE_TEXTURE2D_SHADOW(g_tShadowBuffer, samplerg_tShadowBuffer, float3(positionTXS.xy + vShadow3x3PCFTerms3.xz, positionTXS.z)).x; // -1 0
v33Taps.z = SAMPLE_TEXTURE2D_SHADOW(g_tShadowBuffer, samplerg_tShadowBuffer, float3(positionTXS.xy + vShadow3x3PCFTerms3.zy, positionTXS.z)).x; // 0 -1
v33Taps.w = SAMPLE_TEXTURE2D_SHADOW(g_tShadowBuffer, samplerg_tShadowBuffer, float3(positionTXS.xy + vShadow3x3PCFTerms2.zy, positionTXS.z)).x; // 0 1
flSum += dot(v33Taps.xyzw, vShadow3x3PCFTerms0.yyyy);
flSum += SAMPLE_TEXTURE2D_SHADOW(g_tShadowBuffer, samplerg_tShadowBuffer, positionTXS).x * vShadow3x3PCFTerms0.z;
return flSum;
}
#endif
//-----------------------------------------------------------------------------
// Cookie sampling functions

20
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePassLoop.hlsl


//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// LightLoop
// ----------------------------------------------------------------------------

float3(1.0, 1.0, 0.0)
};
#ifdef SHADOWS_USE_SHADOWCTXT
float shadow = GetDirectionalShadowAttenuation(lightLoopContext.shadowContext, positionWS, 0, float3(0.0, 0.0, 0.0), float2(0.0, 0.0));
#else
float shadow = GetDirectionalShadowAttenuation(lightLoopContext, positionWS, 0, float3(0.0, 0.0, 0.0), float2(0.0, 0.0));
#endif
float shadow = GetDirectionalShadowAttenuation(lightLoopContext.shadowContext, positionWS, float3(0.0, 1.0, 0.0 ), 0, float3(0.0, 0.0, 0.0), float2(0.0, 0.0));
float4 dirShadowSplitSpheres[4];
uint payloadOffset = EvalShadow_LoadSplitSpheres(lightLoopContext.shadowContext, 0, dirShadowSplitSpheres);
int shadowSplitIndex = EvalShadow_GetSplitSphereIndexForDirshadows(positionWS, dirShadowSplitSpheres);
int shadowSplitIndex = GetSplitSphereIndexForDirshadows(positionWS, _DirShadowSplitSpheres);
if (shadowSplitIndex == -1)
diffuseLighting = float3(0.0, 0.0, 0.0);
else

out float3 specularLighting)
{
LightLoopContext context;
#ifndef SHADOWS_USE_SHADOWCTXT
ZERO_INITIALIZE(LightLoopContext, context);
#else
#endif
diffuseLighting = float3(0.0, 0.0, 0.0);
specularLighting = float3(0.0, 0.0, 0.0);

out float3 specularLighting)
{
LightLoopContext context;
#ifndef SHADOWS_USE_SHADOWCTXT
ZERO_INITIALIZE(LightLoopContext, context);
#else
#endif
diffuseLighting = float3(0.0, 0.0, 0.0);
specularLighting = float3(0.0, 0.0, 0.0);

2
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
[HideInInspector] _StencilRef("_StencilRef", Int) = 2 // StencilBits.NonSSS (fixed at compile time)
// Blending state
[HideInInspector] _SurfaceType("__surfacetype", Float) = 0.0

2
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
[HideInInspector] _StencilRef("_StencilRef", Int) = 2 // StencilBits.NonSSS (fixed at compile time)
// Blending state
[HideInInspector] _SurfaceType("__surfacetype", Float) = 0.0

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


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

// Properties
// Material ID
protected MaterialProperty materialID = null;
protected const string kMaterialID = "_MaterialID";
protected MaterialProperty materialID = null;
protected const string kMaterialID = "_MaterialID";
protected const string kStencilRef = "_StencilRef";
// Wind
protected MaterialProperty windEnable = null;

bool depthOffsetEnable = material.GetFloat(kDepthOffsetEnable) > 0.0f;
SetKeyword(material, "_DEPTHOFFSET_ON", depthOffsetEnable);
int stencilRef = (int)UnityEngine.Experimental.Rendering.HDPipeline.StencilBits.Standard; // See 'StencilBits'.
// Set the reference value for the stencil test.
int stencilRef = (int)StencilBits.NonSSS;
int materialID = (int)material.GetFloat(kMaterialID);
switch (materialID)
if ((int)material.GetFloat(kMaterialID) == (int)UnityEngine.Experimental.Rendering.HDPipeline.Lit.MaterialId.LitSSS)
case (int)UnityEngine.Experimental.Rendering.HDPipeline.Lit.MaterialId.LitSSS:
stencilRef = (int)UnityEngine.Experimental.Rendering.HDPipeline.StencilBits.SSS;
break;
case (int)UnityEngine.Experimental.Rendering.HDPipeline.Lit.MaterialId.LitStandard:
stencilRef = (int)UnityEngine.Experimental.Rendering.HDPipeline.StencilBits.Standard;
break;
default:
stencilRef = 1 + materialID;
break;
stencilRef = (int)StencilBits.SSS;
material.SetInt("_StencilRef", stencilRef);
material.SetInt(kStencilRef, stencilRef);
bool enablePerPixelDisplacement = material.GetFloat(kEnablePerPixelDisplacement) > 0.0f;
SetKeyword(material, "_PER_PIXEL_DISPLACEMENT", enablePerPixelDisplacement);

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


using UnityEngine.Rendering;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Experimental.Rendering.HDPipeline;
using UnityEngine.Experimental.Rendering.HDPipeline.Lit;
namespace UnityEditor.Experimental.Rendering.HDPipeline
{

{
UseEmissiveColor,
UseEmissiveMask,
}
public enum MaterialIDType
{
Standard = 0,
SubsurfaceScattering = 1,
SpecularColor = 2
}
protected MaterialProperty UVBase = null;

EditorGUI.indentLevel--;
}
if ((MaterialIDType)materialID.floatValue == MaterialIDType.Standard)
switch ((MaterialId)materialID.floatValue)
ShaderStandardInputGUI();
}
else if ((MaterialIDType)materialID.floatValue == MaterialIDType.SubsurfaceScattering)
{
ShaderSSSInputGUI(material);
}
else if ((MaterialIDType)materialID.floatValue == MaterialIDType.SpecularColor)
{
m_MaterialEditor.TexturePropertySingleLine(Styles.specularColorText, specularColorMap, specularColor);
case MaterialId.LitSSS:
ShaderSSSInputGUI(material);
break;
case MaterialId.LitStandard:
ShaderStandardInputGUI();
break;
case MaterialId.LitSpecular:
m_MaterialEditor.TexturePropertySingleLine(Styles.specularColorText, specularColorMap, specularColor);
break;
default:
Debug.Assert(false, "Encountered an unsupported MaterialID.");
break;
}
EditorGUILayout.Space();

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


[GenerateHLSL(PackingRules.Exact)]
public enum MaterialId
{
LitStandard = 0,
LitSSS = 1,
LitSSS = 0,
LitStandard = 1,
LitUnused = 3,
LitAniso = 4 // Should be the last as it is not setup by the users but generated based on anisotropy property
LitUnused = 3,
LitAniso = 4 // Should be the last as it is not setup by the users but generated based on anisotropy property
public static uint FEATURE_FLAG_MATERIAL_LIT_STANDARD = 1 << 12;
public static uint FEATURE_FLAG_MATERIAL_LIT_SSS = 1 << 13;
public static uint FEATURE_FLAG_MATERIAL_LIT_SSS = 1 << 12;
public static uint FEATURE_FLAG_MATERIAL_LIT_STANDARD = 1 << 13;
public static uint FEATURE_FLAG_MATERIAL_LIT_ANISO = 1 << 15;
public static uint FEATURE_FLAG_MATERIAL_LIT_ANISO = 1 << 15;
}
//-----------------------------------------------------------------------------

{
m_InitPreFGD = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/PreIntegratedFGD");
// TODO: switch to RGBA64 when it becomes available.
m_PreIntegratedFGD = new RenderTexture(128, 128, 0, RenderTextureFormat.ARGBHalf, RenderTextureReadWrite.Linear);
// Value for DisneyDiffuse integration are slightly above one (1.05)
m_PreIntegratedFGD = new RenderTexture(128, 128, 0, RenderTextureFormat.RGB111110Float, RenderTextureReadWrite.Linear);
m_PreIntegratedFGD.hideFlags = HideFlags.DontSave;
m_PreIntegratedFGD.Create();
m_LtcData = new Texture2DArray(k_LtcLUTResolution, k_LtcLUTResolution, 3, TextureFormat.RGBAHalf, false /*mipmap*/, true /* linear */)

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


//
// UnityEngine.Experimental.Rendering.HDPipeline.Lit.MaterialId: static fields
//
#define MATERIALID_LIT_STANDARD (0)
#define MATERIALID_LIT_SSS (1)
#define MATERIALID_LIT_SSS (0)
#define MATERIALID_LIT_STANDARD (1)
#define MATERIALID_LIT_SPECULAR (2)
#define MATERIALID_LIT_UNUSED (3)
#define MATERIALID_LIT_ANISO (4)

//
#define FEATURE_FLAG_MATERIAL_LIT_STANDARD (4096)
#define FEATURE_FLAG_MATERIAL_LIT_SSS (8192)
#define FEATURE_FLAG_MATERIAL_LIT_SSS (4096)
#define FEATURE_FLAG_MATERIAL_LIT_STANDARD (8192)
#define FEATURE_FLAG_MATERIAL_LIT_SPECULAR (16384)
#define FEATURE_FLAG_MATERIAL_LIT_ANISO (32768)

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


#define SSS_N_SAMPLES 11
#define SSS_LOW_THICKNESS 0.005 // 0.5 cm
#define SSS_DISTANCE_SCALE 3 // SSS distance units per centimeter
#define CENTIMETERS_TO_METERS 0.001
#define CENTIMETERS_TO_METERS 0.01
uint _EnableSSS; // Globally toggles subsurface scattering on/off
uint _TransmissionFlags; // 1 bit/profile; 0 = inf. thick, 1 = supports transmission

// into function like GetSpecularDominantDir(). However modified normal is just a hack. The goal is just to stretch a cubemap, no accuracy here.
// With this in mind and for performance reasons we chose to only use modified normal to calculate R.
iblR = reflect(-V, anisoIblNormalWS);
// @Sébastien: I preserved the original behavior by creating 'anisoIblNormalWS', but,
// from the performance standpoint, it would be best to store the value in 'iblNormalWS'
// and then use it in GetSpecularDominantDir(). Please reconsider. :-) -Evgenii
}
// IBL

[branch] if (lightData.shadowIndex >= 0)
{
#ifdef SHADOWS_USE_SHADOWCTXT
shadow = GetDirectionalShadowAttenuation(lightLoopContext.shadowContext, positionWS, lightData.shadowIndex, L, posInput.unPositionSS);
#else
shadow = GetDirectionalShadowAttenuation(lightLoopContext, positionWS, lightData.shadowIndex, L, posInput.unPositionSS);
#endif
float shadow = GetDirectionalShadowAttenuation(lightLoopContext.shadowContext, positionWS, bsdfData.normalWS, lightData.shadowIndex, L, posInput.unPositionSS);
illuminance *= shadow;
}

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

[branch] if (lightData.shadowIndex >= 0)
{
#ifdef SHADOWS_USE_SHADOWCTXT
shadow = GetDirectionalShadowAttenuation(lightLoopContext.shadowContext, positionWS, lightData.shadowIndex, L, posInput.unPositionSS);
#else
shadow = GetDirectionalShadowAttenuation(lightLoopContext, positionWS, lightData.shadowIndex, L, posInput.unPositionSS);
#endif
float shadow = GetDirectionalShadowAttenuation(lightLoopContext.shadowContext, positionWS, bsdfData.normalWS, lightData.shadowIndex, L, posInput.unPositionSS);
illuminance *= shadow;
}

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


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

[HideInInspector] _UVMappingMask("_UVMappingMask", Color) = (1, 0, 0, 0)
[Enum(TangentSpace, 0, ObjectSpace, 1)] _NormalMapSpace("NormalMap space", Float) = 0
[Enum(Standard, 0, Subsurface Scattering, 1, Specular Color, 2)] _MaterialID("MaterialId", Int) = 0
[Enum(Subsurface Scattering, 0, Standard, 1, Specular Color, 2)] _MaterialID("MaterialId", Int) = 1 // MaterialId.LitStandard
[ToggleOff] _EnablePerPixelDisplacement("Enable per pixel displacement", Float) = 0.0
_PPDMinSamples("Min sample for POM", Range(1.0, 64.0)) = 5

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


surfaceData.tangentWS = input.worldToTangent[0].xyz;
#endif
// Init other parameters
surfaceData.materialId = 0;
surfaceData.materialId = 1; // MaterialId.LitStandard
surfaceData.anisotropy = 0;
surfaceData.specular = 0.04;
surfaceData.subsurfaceRadius = 1.0;

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


// Mandatory to setup value to keep compiler quiet
// Layered shader only support materialId 0
surfaceData.materialId = 0;
// Layered shader only supports the standard material
surfaceData.materialId = 1; // MaterialId.LitStandard
// All these parameters are ignore as they are re-setup outside of the layers function
surfaceData.tangentWS = float3(0.0, 0.0, 0.0);

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


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

[HideInInspector] _UVMappingMask("_UVMappingMask", Color) = (1, 0, 0, 0)
[Enum(TangentSpace, 0, ObjectSpace, 1)] _NormalMapSpace("NormalMap space", Float) = 0
[Enum(Standard, 0, Subsurface Scattering, 1, Specular Color, 2)] _MaterialID("MaterialId", Int) = 0
[Enum(Subsurface Scattering, 0, Standard, 1, Specular Color, 2)] _MaterialID("MaterialId", Int) = 1 // MaterialId.LitStandard
[ToggleOff] _EnablePerPixelDisplacement("Enable per pixel displacement", Float) = 0.0
_PPDMinSamples("Min sample for POM", Range(1.0, 64.0)) = 5

7
Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/SceneSettings.cs


void OnEnable()
{
SceneSettingsManager.instance.AddSceneSettings(this);
HDRenderPipelineInstance hdPipeline = RenderPipelineManager.currentPipeline as HDRenderPipelineInstance;
if (hdPipeline != null)
{
hdPipeline.OnSceneLoad();
}
}
void OnDisable()

15
Assets/ScriptableRenderPipeline/HDRenderPipeline/ShaderPass/ShaderPassLightTransport.hlsl


// Output UV coordinate in vertex shader
if (unity_MetaVertexControl.x)
{
// OpenGL right now needs to actually use incoming vertex position,
// so use it in a very dummy way
//v.positionOS.z = vertex.z > 0 ? 1.0e-4 : 0.0;
}
{
// OpenGL right now needs to actually use incoming vertex position,
// so use it in a very dummy way
//v.positionOS.z = vertex.z > 0 ? 1.0e-4 : 0.0;
}
// Zero out the Z component. However, OpenGL right now needs to actually use the incoming vertex
// position, so also take this opportunity to create a dependence on it.
inputMesh.positionOS.z = inputMesh.positionOS.z > 0 ? 1.0e-4 : 0.0;
float3 positionWS = TransformObjectToWorld(inputMesh.positionOS);
output.vmesh.positionCS = TransformWorldToHClip(positionWS);

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


m_ProceduralSkyMaterial.SetFloat("_WorldRayleighNearScatterPush", -Mathf.Pow(Mathf.Abs(param.worldRayleighNearScatterPush), param.worldScaleExponent) * Mathf.Sign(param.worldRayleighNearScatterPush));
m_ProceduralSkyMaterial.SetFloat("_WorldRayleighDensity", -param.worldRayleighDensity / 100000f);
m_ProceduralSkyMaterial.SetFloat("_WorldMieDensity", -param.worldMieDensity / 100000f);
m_ProceduralSkyMaterial.SetFloat("_SkyDepth", 1.0f / param.maxSkyDistance);
var rayleighColorM20 = param.worldRayleighColorRamp.Evaluate(0.00f);
var rayleighColorM10 = param.worldRayleighColorRamp.Evaluate(0.25f);

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


// public Shader atmosphericShader = null;
// public Shader occlusionShader = null;
public float worldScaleExponent = 1.0f;
public float maxSkyDistance = 4000.0f;
public ScatterDebugMode debugMode = ScatterDebugMode.None;
// Camera m_currentCamera;

heightRayleighNearScatterPush = Mathf.Clamp(heightRayleighNearScatterPush, -200f, 300f);
worldScaleExponent = Mathf.Clamp(worldScaleExponent, 1f, 2f);
maxSkyDistance = Mathf.Clamp(maxSkyDistance, 1.0f, 1000000.0f);
/*
occlusionBias = Mathf.Clamp01(occlusionBias);

13
Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/ProceduralSky/Resources/SkyProcedural.shader


float4x4 _InvViewProjMatrix;
float _SkyDepth;
float _DisableSkyOcclusionTest;
float _FlipY;

// input.positionCS is SV_Position
PositionInputs posInput = GetPositionInput(input.positionCS.xy, _ScreenSize.zw);
// An arbitrary value attempting to match the size of the sky mesh from the Blacksmith demo.
const float skyDepth = 0.00025;
float depthRaw = max(skyDepth, LOAD_TEXTURE2D(_MainDepthTexture, posInput.unPositionSS).r);
float skyTexWeight = (depthRaw > skyDepth) ? 0.0 : 1.0;
float depthRaw = max(_SkyDepth, LOAD_TEXTURE2D(_MainDepthTexture, posInput.unPositionSS).r);
float skyTexWeight = (depthRaw > _SkyDepth) ? 0.0 : 1.0;
float depthRaw = skyDepth;
float depthRaw = _SkyDepth;
depthRaw = skyDepth;
depthRaw = _SkyDepth;
skyTexWeight = 1.0;
}

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


SkyRenderer m_Renderer = null;
int m_SkyParametersHash = -1;
bool m_NeedLowLevelUpdateEnvironment = false;
bool m_UpdateRequired = true;
int m_UpdatedFramesRequired = 2; // The first frame after the scene load is currently not rendered correctly
float m_CurrentUpdateTime = 0.0f;
bool m_useMIS = false;

m_SkyParametersHash = -1;
m_SkySettings = value;
m_UpdateRequired = true;
m_UpdatedFramesRequired = 2;
if (value != null)
{

m_SkyboxConditionalCdfRT.Create();
}
m_UpdateRequired = true; // Special case. Even if update mode is set to OnDemand, we need to regenerate the environment after destroying the texture.
m_UpdatedFramesRequired = 2; // Special case. Even if update mode is set to OnDemand, we need to regenerate the environment after destroying the texture.
}
m_CubemapScreenSize = new Vector4((float)resolution, (float)resolution, 1.0f / (float)resolution, 1.0f / (float)resolution);

public void RequestEnvironmentUpdate()
{
m_UpdateRequired = true;
m_UpdatedFramesRequired = Math.Max(m_UpdatedFramesRequired, 1);
}
public void UpdateEnvironment(HDCamera camera, Light sunLight, ScriptableRenderContext renderContext)

m_BuiltinParameters.sunLight = sunLight;
if (
(skySettings.updateMode == EnvironementUpdateMode.OnDemand && m_UpdateRequired) ||
m_UpdatedFramesRequired > 0 ||
(skySettings.updateMode == EnvironementUpdateMode.OnChanged && skySettings.GetHash() != m_SkyParametersHash) ||
(skySettings.updateMode == EnvironementUpdateMode.Realtime && m_CurrentUpdateTime > skySettings.updatePeriod)
)

RenderCubemapGGXConvolution(renderContext, m_BuiltinParameters, skySettings, m_SkyboxCubemapRT, m_SkyboxGGXCubemapRT);
m_NeedLowLevelUpdateEnvironment = true;
m_UpdateRequired = false;
m_UpdatedFramesRequired--;
m_SkyParametersHash = skySettings.GetHash();
m_CurrentUpdateTime = 0.0f;
}

8
Assets/ScriptableRenderPipeline/HDRenderPipeline/Utilities.cs


[Flags]
public enum StencilBits
{
None = 0,
SSS = 0 + Lit.MaterialId.LitSSS, // 1
Standard = 2 + Lit.MaterialId.LitStandard, // 2
All = 255 // 0xff
None = 0, // 0
SSS = 1 + Lit.MaterialId.LitSSS, // 1
NonSSS = 2 + Lit.MaterialId.LitSSS, // 2
All = 255 // 0xFF
}
public class Utilities

5
Assets/ScriptableRenderPipeline/LowEndMobilePipeline/Editor/LowendMobilePipelineMaterialEditor.cs


private MaterialProperty emissionMapProp = null;
private MaterialProperty emissionColorProp = null;
private MaterialProperty reflectionMapProp = null;
private MaterialProperty reflectionColorProp = null;
private MaterialEditor m_MaterialEditor = null;

emissionMapProp = FindProperty("_EmissionMap", properties);
emissionColorProp = FindProperty("_EmissionColor", properties);
reflectionMapProp = FindProperty("_Cube", properties);
reflectionColorProp = FindProperty("_ReflectColor", properties);
reflectionSourceProp = FindProperty("_ReflectionSource", properties);
}

EditorGUILayout.Space();
ReflectionSource reflectionSource = (ReflectionSource)reflectionSourceProp.floatValue;
if (reflectionSource == ReflectionSource.Cubemap)
m_MaterialEditor.TexturePropertySingleLine(Styles.reflectionMapLabel, reflectionMapProp,
reflectionColorProp);
m_MaterialEditor.TexturePropertySingleLine(Styles.reflectionMapLabel, reflectionMapProp);
}
private void ConvertFromLegacy(Material material, string oldShaderName)

18
Assets/ScriptableRenderPipeline/LowEndMobilePipeline/Editor/LowendPipelineAssetInspector.cs


public static GUIContent enableLightmap = new GUIContent("Enable Lightmap",
"Only non-directional lightmaps are supported");
public static GUIContent enableAmbientProbe = new GUIContent("Enable Ambient Probe",
"Uses light probes as ambient light source for non-lightmapped objects.");
public static GUIContent enableAmbientProbe = new GUIContent("Enable Light Probes",
"Enables/Disabled light probe support.");
public static GUIContent shadowType = new GUIContent("Shadow Type",
"Single directional shadow supported. SOFT_SHADOWS applies shadow filtering.");

public static GUIContent shadowDistante = new GUIContent("Shadow Distance", "Max shadow drawing distance");
public static GUIContent shadowBias = new GUIContent("Shadow Bias");
public static GUIContent shadowMinBias = new GUIContent("Shadow Min Normal Bias Offset", "Minimum value of normal bias offset applied");
public static GUIContent shadowBias = new GUIContent("Shadow Normal Bias", "Normal bias offset value.");
public static GUIContent shadowAtlasResolution = new GUIContent("Shadow Map Resolution",
"Resolution of shadow map texture. If cascades are enabled all cascades will be packed into this texture resolution.");

private SerializedProperty m_EnableAmbientProbeProp;
private SerializedProperty m_ShadowTypeProp;
private SerializedProperty m_ShadowNearPlaneOffsetProp;
private SerializedProperty m_ShadowBiasProperty;
private SerializedProperty m_ShadowMinNormalBiasProperty;
private SerializedProperty m_ShadowNormalBiasProperty;
private SerializedProperty m_ShadowDistanceProp;
private SerializedProperty m_ShadowAtlasResolutionProp;
private SerializedProperty m_ShadowCascadesProp;

m_EnableAmbientProbeProp = serializedObject.FindProperty("m_EnableAmbientProbe");
m_ShadowTypeProp = serializedObject.FindProperty("m_ShadowType");
m_ShadowNearPlaneOffsetProp = serializedObject.FindProperty("m_ShadowNearPlaneOffset");
m_ShadowBiasProperty = serializedObject.FindProperty("m_ShadowBias");
m_ShadowMinNormalBiasProperty = serializedObject.FindProperty("m_MinShadowNormalBias");
m_ShadowNormalBiasProperty = serializedObject.FindProperty("m_ShadowNormalBias");
m_ShadowDistanceProp = serializedObject.FindProperty("m_ShadowDistance");
m_ShadowAtlasResolutionProp = serializedObject.FindProperty("m_ShadowAtlasResolution");
m_ShadowCascadesProp = serializedObject.FindProperty("m_ShadowCascades");

public override void OnInspectorGUI()
{
LowEndMobilePipelineAsset pipeAsset = target as LowEndMobilePipelineAsset;
serializedObject.Update();
EditorGUILayout.Space();

EditorGUILayout.PropertyField(m_ShadowTypeProp, Styles.shadowType);
EditorGUILayout.PropertyField(m_ShadowAtlasResolutionProp, Styles.shadowAtlasResolution);
EditorGUILayout.PropertyField(m_ShadowNearPlaneOffsetProp, Styles.shadowNearPlaneOffset);
EditorGUILayout.PropertyField(m_ShadowBiasProperty, Styles.shadowBias);
EditorGUILayout.PropertyField(m_ShadowMinNormalBiasProperty, Styles.shadowMinBias);
EditorGUILayout.PropertyField(m_ShadowNormalBiasProperty, Styles.shadowBias);
EditorGUILayout.PropertyField(m_ShadowDistanceProp, Styles.shadowDistante);
EditorGUILayout.PropertyField(m_ShadowCascadesProp, Styles.shadowCascades);

18
Assets/ScriptableRenderPipeline/LowEndMobilePipeline/Editor/LowendUpgraders.cs


private static void UpdateMaterialReflectionSource(Material material)
{
SetKeyword(material, "_REFLECTION_CUBEMAP", false);
SetKeyword(material, "_REFLECTION_PROBE", false);
if (reflectionSource == ReflectionSource.NoReflection)
{
SetKeyword(material, "_CUBEMAP_REFLECTION", false);
}
else if (reflectionSource == ReflectionSource.Cubemap && material.GetTexture("_Cube"))
if (reflectionSource == ReflectionSource.Cubemap && material.GetTexture("_Cube"))
SetKeyword(material, "_CUBEMAP_REFLECTION", true);
SetKeyword(material, "_REFLECTION_CUBEMAP", true);
Debug.LogWarning("Reflection probe not implemented yet");
SetKeyword(material, "_CUBEMAP_REFLECTION", false);
}
else
{
SetKeyword(material, "_CUBEMAP_REFLECTION", false);
SetKeyword(material, "_REFLECTION_PROBE", true);
}
}

35
Assets/ScriptableRenderPipeline/LowEndMobilePipeline/LowEndMobilePipeline.cs


int pixelLightsCount, vertexLightsCount;
GetMaxSupportedLights(visibleLights.Length, out pixelLightsCount, out vertexLightsCount);
// TODO: handle shader keywords when no lights are present
SortLights(ref visibleLights, pixelLightsCount);
// TODO: Add remaining lights to SH

settings.sorting.flags = SortFlags.CommonOpaque;
settings.inputFilter.SetQueuesOpaque();
settings.rendererConfiguration = RendererConfiguration.PerObjectReflectionProbes;
if (m_Asset.EnableLightmap)
settings.rendererConfiguration |= RendererConfiguration.PerObjectLightmaps;

vertexLightsCount = (m_Asset.SupportsVertexLight) ? Mathf.Min(lightsCount - pixelLightsCount, kMaxVertexLights) : 0;
}
private void InitializeLightData()
{
for (int i = 0; i < kMaxLights; ++i)
{
m_LightPositions[i] = Vector4.zero;
m_LightColors[i] = Vector4.zero;
m_LightAttenuations[i] = new Vector4(0.0f, 1.0f, 0.0f, 0.0f);
m_LightSpotDirections[i] = new Vector4(0.0f, 0.0f, 1.0f, 0.0f);
}
}
if (lights.Length <= 0)
return;
InitializeLightData();
for (int i = 0; i < totalLightCount; ++i)
{

cmd.SetGlobalVectorArray("globalLightColor", m_LightColors);
cmd.SetGlobalVectorArray("globalLightAtten", m_LightAttenuations);
cmd.SetGlobalVectorArray("globalLightSpotDir", m_LightSpotDirections);
cmd.SetGlobalVector("globalLightCount", new Vector4(pixelLightCount, totalLightCount, 0.0f, 0.0f));
SetShaderKeywords(cmd);
float shadowMinNormalBias = m_Asset.ShadowMinNormalBias;
float shadowNormalBias = m_Asset.ShadowNormalBias;
cmd.SetGlobalVector("globalLightData", new Vector4(pixelLightCount, totalLightCount, shadowMinNormalBias, shadowNormalBias));
SetShaderKeywords(cmd, vertexLightCount > 0);
context.ExecuteCommandBuffer(cmd);
cmd.Dispose();
}

buffer.SetViewport(new Rect(m_ShadowSlices[cascadeIndex].atlasX, m_ShadowSlices[cascadeIndex].atlasY,
m_ShadowSlices[cascadeIndex].shadowResolution, m_ShadowSlices[cascadeIndex].shadowResolution));
buffer.SetViewProjectionMatrices(view, proj);
buffer.SetGlobalVector("_WorldLightDirAndBias",
new Vector4(-lightDir.x, -lightDir.y, -lightDir.z, m_Asset.ShadowBias));
context.ExecuteCommandBuffer(buffer);
buffer.Dispose();

setupShadow.Dispose();
}
void SetShaderKeywords(CommandBuffer cmd)
void SetShaderKeywords(CommandBuffer cmd, bool vertexLightSupport)
if (m_Asset.SupportsVertexLight)
if (vertexLightSupport)
cmd.EnableShaderKeyword("_VERTEX_LIGHTS");
else
cmd.DisableShaderKeyword("_VERTEX_LIGHTS");

cmd.DisableShaderKeyword(shadowKeywords[i]);
if (m_ShadowLightIndex != -1 || m_Asset.CurrShadowType != ShadowType.NO_SHADOW)
if (m_ShadowLightIndex != -1 && m_Asset.CurrShadowType != ShadowType.NO_SHADOW)
{
int keywordIndex = (int)m_Asset.CurrShadowType - 1;
if (m_Asset.CascadeCount > 1)

if (m_Asset.EnableAmbientProbe)
cmd.EnableShaderKeyword("_LIGHT_PROBES_ON");
else
cmd.DisableShaderKeyword("_LIGHT_PROBES_ON");
}
// Finds main light and main shadow casters and places them in the beginning of array.

16
Assets/ScriptableRenderPipeline/LowEndMobilePipeline/LowEndMobilePipelineAsset.cs


[SerializeField] private float m_ShadowDistance = 50.0f;
[SerializeField] private float m_ShadowBias = 0.0005f;
[SerializeField] private float m_MinShadowNormalBias = 0.0005f;
[SerializeField] private float m_ShadowNormalBias = 0.05f;
[SerializeField] private ShadowCascades m_ShadowCascades = ShadowCascades.NO_CASCADES;

private set { m_ShadowDistance = value; }
}
public float ShadowBias
public float ShadowMinNormalBias
get { return m_ShadowBias; }
private set { m_ShadowBias = value; }
get { return m_MinShadowNormalBias; }
private set { m_MinShadowNormalBias = value; }
}
public float ShadowNormalBias
{
get { return m_ShadowNormalBias; }
private set { m_ShadowNormalBias = value; }
}
public int CascadeCount

151
Assets/ScriptableRenderPipeline/LowEndMobilePipeline/Shaders/LowEndMobilePipeline.shader


[Enum(Specular Alpha,0,Albedo Alpha,1)] _SmoothnessTextureChannel("Smoothness texture channel", Float) = 0
_Cube ("Reflection Cubemap", CUBE) = "" {}
_ReflectColor("Reflection Color", Color) = (1, 1, 1, 1)
_ReflectionSource("Reflection Source", Float) = 0
[HideInInspector] _SpecSource("Specular Color Source", Float) = 0.0

#pragma shader_feature _ _SPECGLOSSMAP _SPECGLOSSMAP_BASE_ALPHA _SPECULAR_COLOR
#pragma shader_feature _NORMALMAP
#pragma shader_feature _EMISSION_MAP
#pragma shader_feature _CUBEMAP_REFLECTION
#pragma shader_feature _ _REFLECTION_CUBEMAP _REFLECTION_PROBE
#pragma multi_compile _ _LIGHT_PROBES_ON
#pragma multi_compile _ _HARD_SHADOWS _SOFT_SHADOWS _HARD_SHADOWS_CASCADES _SOFT_SHADOWS_CASCADES
#pragma multi_compile _ _VERTEX_LIGHTS
#pragma multi_compile_fog

o.normal = normal;
#endif
#if _VERTEX_LIGHTS
#if defined(_VERTEX_LIGHTS)
for (int lightIndex = globalLightCount.x; lightIndex < globalLightCount.y; ++lightIndex)
for (int lightIndex = globalLightData.x; lightIndex < globalLightData.y; ++lightIndex)
half NdotL;
o.fogCoord.yzw += EvaluateOneLight(lightInput, diffuseAndSpecular.rgb, diffuseAndSpecular, normal, o.posWS, o.viewDir.xyz);
o.fogCoord.yzw += EvaluateOneLight(lightInput, diffuseAndSpecular.rgb, diffuseAndSpecular, normal, o.posWS, o.viewDir.xyz, NdotL);
#ifndef _SHADOW_CASCADES
o.shadowCoord = mul(_WorldToShadow[0], float4(o.posWS, 1.0));
#ifdef _LIGHT_PROBES_ON
o.fogCoord.yzw += max(half3(0, 0, 0), ShadeSH9(half4(normal, 1)));
o.fogCoord.yzw += max(half3(0, 0, 0), ShadeSH9(half4(normal, 1)));
UNITY_TRANSFER_FOG(o, o.hpos);
return o;

half4 specularGloss;
SpecularGloss(i.uv01.xy, diffuse, alpha, specularGloss);
// Indirect Light Contribution
half3 indirect;
Indirect(i, diffuse, normal, alpha, indirect);
half3 viewDir = i.viewDir.xyz;
// TODO: Restrict pixel lights by 4. This way we can keep moderate constrain for most LD project
// and can benefit from better data layout/avoid branching by doing vec math.
half3 color = half3(0, 0, 0);
for (int lightIndex = 0; lightIndex < globalLightData.x; ++lightIndex)
{
LightInput lightData;
half NdotL;
INITIALIZE_LIGHT(lightData, lightIndex);
color += EvaluateOneLight(lightData, diffuse, specularGloss, normal, i.posWS, viewDir, NdotL);
#ifdef _SHADOWS
if (lightIndex == 0)
{
#if _NORMALMAP
float3 vertexNormal = float3(i.tangentToWorld0.z, i.tangentToWorld1.z, i.tangentToWorld2.z);
#else
float3 vertexNormal = i.normal;
#endif
float bias = max(globalLightData.z, (1.0 - NdotL) * globalLightData.w);
color *= ComputeShadowAttenuation(i, vertexNormal * bias);
}
#endif
}
color += emissionColor;
// Compute direct contribution from main directional light.
// Only a single directional shadow caster is supported.
LightInput mainLight;
INITIALIZE_LIGHT(mainLight, 0);
half3 viewDir = i.viewDir.xyz;
half3 directColor = EvaluateOneLight(mainLight, diffuse, specularGloss, normal, i.posWS, viewDir);
#ifdef _SHADOWS
directColor *= ComputeShadowAttenuation(i);
#if defined(LIGHTMAP_ON)
color += (DecodeLightmap(UNITY_SAMPLE_TEX2D(unity_Lightmap, i.uv01.zw)) + i.fogCoord.yzw) * diffuse;
#elif defined(_VERTEX_LIGHTS) || defined(_LIGHT_PROBES_ON)
color += i.fogCoord.yzw * diffuse;
// Compute direct contribution from additional lights.
for (int lightIndex = 1; lightIndex < globalLightCount.x; ++lightIndex)
{
LightInput additionalLight;
INITIALIZE_LIGHT(additionalLight, lightIndex);
directColor += EvaluateOneLight(additionalLight, diffuse, specularGloss, normal, i.posWS, viewDir);
}
#if _REFLECTION_CUBEMAP
// TODO: we can use reflect vec to compute specular instead of half when computing cubemap reflection
half3 reflectVec = reflect(-i.viewDir.xyz, normal);
color += texCUBE(_Cube, reflectVec).rgb * specularGloss.rgb;
#elif defined(_REFLECTION_PROBE)
half3 reflectVec = reflect(-i.viewDir.xyz, normal);
half4 reflectionProbe = UNITY_SAMPLE_TEXCUBE(unity_SpecCube0, reflectVec);
color += reflectionProbe.rgb * (reflectionProbe.a * unity_SpecCube0_HDR.x) * specularGloss.rgb;
#endif
half3 color = directColor + indirect + emissionColor;
UNITY_APPLY_FOG(i.fogCoord, color);
return OutputColor(color, alpha);

#pragma vertex vert
#pragma fragment frag
float4 _WorldLightDirAndBias;
struct VertexInput
float4 vert(float4 pos : POSITION) : SV_POSITION
float4 pos : POSITION;
float3 normal : NORMAL;
};
// Similar to UnityClipSpaceShadowCasterPos but using LDPipeline lightdir and bias and applying near plane clamp
float4 ClipSpaceShadowCasterPos(float4 vertex, float3 normal)
{
float4 wPos = mul(unity_ObjectToWorld, vertex);
if (_WorldLightDirAndBias.w > 0.0)
{
float3 wNormal = UnityObjectToWorldNormal(normal);
// apply normal offset bias (inset position along the normal)
// bias needs to be scaled by sine between normal and light direction
// (http://the-witness.net/news/2013/09/shadow-mapping-summary-part-1/)
//
// _WorldLightDirAndBias.w shadow bias defined in LRRenderPipeline asset
float shadowCos = dot(wNormal, _WorldLightDirAndBias.xyz);
float shadowSine = sqrt(1 - shadowCos*shadowCos);
float normalBias = _WorldLightDirAndBias.w * shadowSine;
wPos.xyz -= wNormal * normalBias;
}
float4 clipPos = mul(UNITY_MATRIX_VP, wPos);
float4 clipPos = UnityObjectToClipPos(pos);
#if defined(UNITY_REVERSED_Z)
clipPos.z = min(clipPos.z, UNITY_NEAR_CLIP_VALUE);
#else

}
float4 vert(VertexInput i) : SV_POSITION
{
return ClipSpaceShadowCasterPos(i.pos, i.normal);
}
half4 frag() : SV_TARGET
{
return 0;

// This pass it not used during regular rendering, only for lightmap baking.
Pass
{
Name "LD_META"
Tags{ "LightMode" = "Meta" }
// This pass it not used during regular rendering, only for lightmap baking.
Pass
{
Name "LD_META"
Tags{ "LightMode" = "Meta" }
Cull Off
Cull Off
CGPROGRAM
#pragma vertex vert_meta
#pragma fragment frag_meta
CGPROGRAM
#pragma vertex vert_meta
#pragma fragment frag_meta
#pragma shader_feature _EMISSION
#pragma shader_feature _METALLICGLOSSMAP
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
#pragma shader_feature ___ _DETAIL_MULX2
#pragma shader_feature EDITOR_VISUALIZATION
#pragma shader_feature _EMISSION
#pragma shader_feature _METALLICGLOSSMAP
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
#pragma shader_feature ___ _DETAIL_MULX2
#pragma shader_feature EDITOR_VISUALIZATION
#include "UnityStandardMeta.cginc"
ENDCG
}
#include "UnityStandardMeta.cginc"
ENDCG
Fallback "Standard (Specular setup)"
CustomEditor "LowendMobilePipelineMaterialEditor"
}
Fallback "Standard (Specular setup)"
CustomEditor "LowendMobilePipelineMaterialEditor"
}

106
Assets/ScriptableRenderPipeline/LowEndMobilePipeline/Shaders/LowEndMobilePipelineCore.cginc


#define DEBUG_CASCADES 0
#define MAX_SHADOW_CASCADES 4
#define MAX_LIGHTS 8
#define INITIALIZE_LIGHT(light, lightIndex) \

#endif
half4 viewDir : TEXCOORD5; // xyz: viewDir
UNITY_FOG_COORDS_PACKED(6, half4) // x: fogCoord, yzw: vertexColor
#ifndef _SHADOW_CASCADES
float4 shadowCoord : TEXCOORD7;
#endif
float4 hpos : SV_POSITION;
};

float4 globalLightPos[MAX_LIGHTS];
half4 globalLightSpotDir[MAX_LIGHTS];
half4 globalLightAtten[MAX_LIGHTS];
int4 globalLightCount; // x: pixelLightCount, y = totalLightCount (pixel + vert)
sampler2D_float _ShadowMap;
float _PCFKernel[8];
float4 globalLightData; // x: pixelLightCount, y = totalLightCount (pixel + vert), z = minShadowNormalBiasOffset, w = shadowNormalBiasOffset
half4x4 _WorldToShadow[MAX_SHADOW_CASCADES];
float4 _DirShadowSplitSpheres[MAX_SHADOW_CASCADES];
#ifdef _SHADOWS
#include "LowEndMobilePipelineShadows.cginc"
#endif
inline void NormalMap(v2f i, out half3 normal)
{
#if _NORMALMAP

#endif
}
inline void Indirect(v2f i, half3 diffuse, half3 normal, half glossiness, out half3 indirect)
{
#ifdef LIGHTMAP_ON
indirect = (DecodeLightmap(UNITY_SAMPLE_TEX2D(unity_Lightmap, i.uv01.zw)) + i.fogCoord.yzw) * diffuse;
#else
indirect = i.fogCoord.yzw * diffuse;
#endif
// TODO: we can use reflect vec to compute specular instead of half when computing cubemap reflection
#ifdef _CUBEMAP_REFLECTION
half3 reflectVec = reflect(-i.viewDir.xyz, normal);
half3 indirectSpecular = texCUBE(_Cube, reflectVec) * _ReflectColor * glossiness;
indirect += indirectSpecular;
#endif
}
half4 OutputColor(half3 color, half alpha)
{
#ifdef _ALPHABLEND_ON

#endif
}
inline half ComputeCascadeIndex(float3 wpos)
{
float3 fromCenter0 = wpos.xyz - _DirShadowSplitSpheres[0].xyz;
float3 fromCenter1 = wpos.xyz - _DirShadowSplitSpheres[1].xyz;
float3 fromCenter2 = wpos.xyz - _DirShadowSplitSpheres[2].xyz;
float3 fromCenter3 = wpos.xyz - _DirShadowSplitSpheres[3].xyz;
float4 distances2 = float4(dot(fromCenter0, fromCenter0), dot(fromCenter1, fromCenter1), dot(fromCenter2, fromCenter2), dot(fromCenter3, fromCenter3));
float4 vDirShadowSplitSphereSqRadii;
vDirShadowSplitSphereSqRadii.x = _DirShadowSplitSpheres[0].w;
vDirShadowSplitSphereSqRadii.y = _DirShadowSplitSpheres[1].w;
vDirShadowSplitSphereSqRadii.z = _DirShadowSplitSpheres[2].w;
vDirShadowSplitSphereSqRadii.w = _DirShadowSplitSpheres[3].w;
fixed4 weights = fixed4(distances2 < vDirShadowSplitSphereSqRadii);
weights.yzw = saturate(weights.yzw - weights.xyz);
return 4 - dot(weights, fixed4(4, 3, 2, 1));
}
inline half ShadowAttenuation(half3 shadowCoord)
{
if (shadowCoord.x <= 0 || shadowCoord.x >= 1 || shadowCoord.y <= 0 || shadowCoord.y >= 1)
return 1;
half depth = tex2D(_ShadowMap, shadowCoord).r;
#if defined(UNITY_REVERSED_Z)
return step(depth, shadowCoord.z);
#else
return step(shadowCoord.z, depth);
#endif
}
inline half ShadowPCF(half3 shadowCoord)
{
// TODO: simulate textureGatherOffset not available, simulate it
half2 offset = half2(0, 0);
half attenuation = ShadowAttenuation(half3(shadowCoord.xy + half2(_PCFKernel[0], _PCFKernel[1]) + offset, shadowCoord.z)) +
ShadowAttenuation(half3(shadowCoord.xy + half2(_PCFKernel[2], _PCFKernel[3]) + offset, shadowCoord.z)) +
ShadowAttenuation(half3(shadowCoord.xy + half2(_PCFKernel[4], _PCFKernel[5]) + offset, shadowCoord.z)) +
ShadowAttenuation(half3(shadowCoord.xy + half2(_PCFKernel[6], _PCFKernel[7]) + offset, shadowCoord.z));
return attenuation * 0.25;
}
inline half3 EvaluateOneLight(LightInput lightInput, half3 diffuseColor, half4 specularGloss, half3 normal, float3 posWorld, half3 viewDir)
inline half3 EvaluateOneLight(LightInput lightInput, half3 diffuseColor, half4 specularGloss, half3 normal, float3 posWorld, half3 viewDir, out half NdotL)
{
float3 posToLight = lightInput.pos.xyz;
posToLight -= posWorld * lightInput.pos.w;

half3 lightDir = posToLight * rsqrt(distanceSqr);
float3 lightDir = posToLight * rsqrt(distanceSqr);
half SdotL = saturate(dot(lightInput.spotDir.xyz, lightDir));
lightAtten *= saturate((SdotL - lightInput.atten.x) / lightInput.atten.y);

half NdotL = saturate(dot(normal, lightDir));
NdotL = saturate(dot(normal, lightDir));
half3 halfVec = normalize(lightDir + viewDir);
half NdotH = saturate(dot(normal, halfVec));

#if defined(_SHARED_SPECULAR_DIFFUSE) || defined(_SPECGLOSSMAP) || defined(_SPECULAR_COLOR)
#if defined(_SPECGLOSSMAP_BASE_ALPHA) || defined(_SPECGLOSSMAP) || defined(_SPECULAR_COLOR)
half3 specular = specularGloss.rgb * lightColor * pow(NdotH, _Shininess * 128.0) * specularGloss.a;
return diffuse + specular;
#else

inline half ComputeShadowAttenuation(v2f i)
{
#ifndef _SHADOW_CASCADES
half4 shadowCoord;
shadowCoord = i.shadowCoord;
#else
half4 shadowCoord;
int cascadeIndex = ComputeCascadeIndex(i.posWS);
if (cascadeIndex < 4)
shadowCoord = mul(_WorldToShadow[cascadeIndex], half4(i.posWS, 1.0));
else
return 1.0;
#endif
shadowCoord.xyz /= shadowCoord.w;
shadowCoord.z = saturate(shadowCoord.z);
#if defined(_SOFT_SHADOWS) || defined(_SOFT_SHADOWS_CASCADES)
return ShadowPCF(shadowCoord.xyz);
#else
return ShadowAttenuation(shadowCoord.xyz);
#endif
}

2
Assets/ScriptableRenderPipeline/ShaderLibrary/ImageBasedLighting.hlsl


{
float3 H = normalize(L + V);
float LdotH = dot(L, H);
float disneyDiffuse = DisneyDiffuse(NdotV, NdotL, LdotH, RoughnessToPerceptualRoughness(roughness));
float disneyDiffuse = DisneyDiffuseNoPI(NdotV, NdotL, LdotH, RoughnessToPerceptualRoughness(roughness));
acc.z += disneyDiffuse * weightOverPdf;
}

18
Assets/ScriptableRenderPipeline/common/TextureCache.cs


var probeFormat = TextureFormat.BC6H;
// On editor the texture is uncompressed when operating against mobile build targets
#if UNITY_2017_2_OR_NEWER
//#if UNITY_2017_2_OR_NEWER
#else
if (SystemInfo.SupportsTextureFormat(probeFormat) && !TextureCache.isMobileBuildTarget)
format = probeFormat;
#endif
//#else
// if (SystemInfo.SupportsTextureFormat(probeFormat) && !TextureCache.isMobileBuildTarget)
// format = probeFormat;
//#endif
return format;
}

{
get
{
#if UNITY_2017_2_OR_NEWER
//#if UNITY_2017_2_OR_NEWER
#else
return (SystemInfo.supportsCubemapArrayTextures && !TextureCache.isMobileBuildTarget);
#endif
//#else
// return (SystemInfo.supportsCubemapArrayTextures && !TextureCache.isMobileBuildTarget);
//#endif
}
}

258
Assets/ScriptableRenderPipeline/fptl/FptlLighting.cs


using UnityEngine.Rendering;
using UnityEngine.Rendering;
class ShadowSetup : IDisposable
{
// shadow related stuff
const int k_MaxShadowDataSlots = 64;
const int k_MaxPayloadSlotsPerShadowData = 4;
ShadowmapBase[] m_Shadowmaps;
ShadowManager m_ShadowMgr;
static ComputeBuffer s_ShadowDataBuffer;
static ComputeBuffer s_ShadowPayloadBuffer;
public ShadowSetup(ShadowSettings shadowSettings, out IShadowManager shadowManager)
{
s_ShadowDataBuffer = new ComputeBuffer(k_MaxShadowDataSlots, System.Runtime.InteropServices.Marshal.SizeOf(typeof(ShadowData)));
s_ShadowPayloadBuffer = new ComputeBuffer(k_MaxShadowDataSlots * k_MaxPayloadSlotsPerShadowData, System.Runtime.InteropServices.Marshal.SizeOf(typeof(ShadowPayload)));
ShadowAtlas.AtlasInit atlasInit;
atlasInit.baseInit.width = (uint)shadowSettings.shadowAtlasWidth;
atlasInit.baseInit.height = (uint)shadowSettings.shadowAtlasHeight;
atlasInit.baseInit.slices = 1;
atlasInit.baseInit.shadowmapBits = 32;
atlasInit.baseInit.shadowmapFormat = RenderTextureFormat.Shadowmap;
atlasInit.baseInit.samplerState = SamplerState.Default();
atlasInit.baseInit.comparisonSamplerState = ComparisonSamplerState.Default();
atlasInit.baseInit.clearColor = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
atlasInit.baseInit.maxPayloadCount = 0;
atlasInit.baseInit.shadowSupport = ShadowmapBase.ShadowSupport.Directional | ShadowmapBase.ShadowSupport.Point | ShadowmapBase.ShadowSupport.Spot;
atlasInit.shaderKeyword = null;
atlasInit.cascadeCount = shadowSettings.directionalLightCascadeCount;
atlasInit.cascadeRatios = shadowSettings.directionalLightCascades;
m_Shadowmaps = new ShadowmapBase[] { new ShadowAtlas(ref atlasInit) };
ShadowContext.SyncDel syncer = (ShadowContext sc) =>
{
// update buffers
uint offset, count;
ShadowData[] sds;
sc.GetShadowDatas(out sds, out offset, out count);
Debug.Assert(offset == 0);
s_ShadowDataBuffer.SetData(sds); // unfortunately we can't pass an offset or count to this function
ShadowPayload[] payloads;
sc.GetPayloads(out payloads, out offset, out count);
Debug.Assert(offset == 0);
s_ShadowPayloadBuffer.SetData(payloads);
};
// binding code. This needs to be in sync with ShadowContext.hlsl
ShadowContext.BindDel binder = (ShadowContext sc, CommandBuffer cb) =>
{
// bind buffers
cb.SetGlobalBuffer("_ShadowDatasExp", s_ShadowDataBuffer);
cb.SetGlobalBuffer("_ShadowPayloads", s_ShadowPayloadBuffer);
// bind textures
uint offset, count;
RenderTargetIdentifier[] tex;
sc.GetTex2DArrays(out tex, out offset, out count);
cb.SetGlobalTexture("_ShadowmapExp_PCF", tex[0]);
// TODO: Currently samplers are hard coded in ShadowContext.hlsl, so we can't really set them here
};
ShadowContext.CtxtInit scInit;
scInit.storage.maxShadowDataSlots = k_MaxShadowDataSlots;
scInit.storage.maxPayloadSlots = k_MaxShadowDataSlots * k_MaxPayloadSlotsPerShadowData;
scInit.storage.maxTex2DArraySlots = 1;
scInit.storage.maxTexCubeArraySlots = 0;
scInit.storage.maxComparisonSamplerSlots = 1;
scInit.storage.maxSamplerSlots = 0;
scInit.dataSyncer = syncer;
scInit.resourceBinder = binder;
m_ShadowMgr = new ShadowManager(shadowSettings, ref scInit, m_Shadowmaps);
// set global overrides - these need to match the override specified in ShadowDispatch.hlsl
m_ShadowMgr.SetGlobalShadowOverride( GPUShadowType.Point , ShadowAlgorithm.PCF, ShadowVariant.V1, ShadowPrecision.High, true );
m_ShadowMgr.SetGlobalShadowOverride( GPUShadowType.Spot , ShadowAlgorithm.PCF, ShadowVariant.V1, ShadowPrecision.High, true );
m_ShadowMgr.SetGlobalShadowOverride( GPUShadowType.Directional , ShadowAlgorithm.PCF, ShadowVariant.V1, ShadowPrecision.High, true );
shadowManager = m_ShadowMgr;
}
public void Dispose()
{
if (m_Shadowmaps != null)
{
(m_Shadowmaps[0] as ShadowAtlas).Dispose();
m_Shadowmaps = null;
}
m_ShadowMgr = null;
if( s_ShadowDataBuffer != null )
s_ShadowDataBuffer.Release();
if( s_ShadowPayloadBuffer != null )
s_ShadowPayloadBuffer.Release();
}
}
public class FptlLightingInstance : RenderPipeline
{
private readonly FptlLighting m_Owner;

[SerializeField]
ShadowSettings m_ShadowSettings = ShadowSettings.Default;
ShadowRenderPass m_ShadowPass;
ShadowSetup m_ShadowSetup;
IShadowManager m_ShadowMgr;
FrameId m_FrameId = new FrameId();
List<int> m_ShadowRequests = new List<int>();
Dictionary<int, int> m_ShadowIndices = new Dictionary<int,int>();
void InitShadowSystem(ShadowSettings shadowSettings)
{
m_ShadowSetup = new ShadowSetup(shadowSettings, out m_ShadowMgr);
}
void DeinitShadowSystem()
{
if (m_ShadowSetup != null)
{
m_ShadowSetup.Dispose();
m_ShadowSetup = null;
m_ShadowMgr = null;
}
}
[SerializeField]
TextureSettings m_TextureSettings = TextureSettings.Default;

const float k_DirectionalLightPullbackDistance = 10000.0f;
[NonSerialized]
private int m_WarnedTooManyLights = 0;
private TextureCache2D m_CookieTexArray;
private TextureCacheCubemap m_CubeCookieTexArray;
private TextureCacheCubemap m_CubeReflTexArray;

}
ClearComputeBuffers();
DeinitShadowSystem();
}
void ClearComputeBuffers()

m_MatWorldToShadow = new Matrix4x4[k_MaxLights * k_MaxShadowmapPerLights];
m_DirShadowSplitSpheres = new Vector4[k_MaxDirectionalSplit];
m_Shadow3X3PCFTerms = new Vector4[4];
m_ShadowPass = new ShadowRenderPass(m_ShadowSettings);
InitShadowSystem(m_ShadowSettings);
m_SkyboxHelper = new SkyboxHelper();
m_SkyboxHelper.CreateMesh();

return camera.projectionMatrix * GetFlipMatrix();
}
static int UpdateDirectionalLights(Camera camera, IList<VisibleLight> visibleLights)
static int UpdateDirectionalLights(Camera camera, IList<VisibleLight> visibleLights, Dictionary<int,int> shadowIndices)
{
var dirLightCount = 0;
var lights = new List<DirectionalLight>();

vy = worldToView.MultiplyVector(vy);
vz = worldToView.MultiplyVector(vz);
l.shadowLightIndex = (light.light.shadows != LightShadows.None) ? (uint)nLight : 0xffffffff;
int shadowIdx;
l.shadowLightIndex = shadowIndices.TryGetValue((int)nLight, out shadowIdx) ? (uint)shadowIdx : 0x80000000;
l.lightAxisX = vx;
l.lightAxisY = vy;
l.lightAxisZ = vz;

return dirLightCount;
}
void UpdateShadowConstants(IList<VisibleLight> visibleLights, ref ShadowOutput shadow)
int GenerateSourceLightBuffers(Camera camera, CullResults inputs)
var nNumLightsIncludingTooMany = 0;
var numLights = 0;
var lightShadowIndex_LightParams = new Vector4[k_MaxLights];
var lightFalloffParams = new Vector4[k_MaxLights];
for (int nLight = 0; nLight < visibleLights.Count; nLight++)
// 0. deal with shadows
nNumLightsIncludingTooMany++;
if (nNumLightsIncludingTooMany > k_MaxLights)
continue;
var light = visibleLights[nLight];
var lightType = light.lightType;
var position = light.light.transform.position;
var lightDir = light.light.transform.forward.normalized;
// Setup shadow data arrays
var hasShadows = shadow.GetShadowSliceCountLightIndex(nLight) != 0;
if (lightType == LightType.Directional)
m_FrameId.frameCount++;
// get the indices for all lights that want to have shadows
m_ShadowRequests.Clear();
m_ShadowRequests.Capacity = inputs.visibleLights.Length;
int lcnt = inputs.visibleLights.Length;
for (int i = 0; i < lcnt; ++i)
lightShadowIndex_LightParams[numLights] = new Vector4(0, 0, 1, 1);
lightFalloffParams[numLights] = new Vector4(0.0f, 0.0f, float.MaxValue, (float)lightType);
if (hasShadows)
{
for (int s = 0; s < k_MaxDirectionalSplit; ++s)
{
m_DirShadowSplitSpheres[s] = shadow.directionalShadowSplitSphereSqr[s];
}
}
VisibleLight vl = inputs.visibleLights[i];
if (vl.light.shadows != LightShadows.None && vl.light.GetComponent<AdditionalLightData>().shadowDimmer > 0.0f)
m_ShadowRequests.Add(i);
else if (lightType == LightType.Point)
{
lightShadowIndex_LightParams[numLights] = new Vector4(0, 0, 1, 1);
lightFalloffParams[numLights] = new Vector4(1.0f, 0.0f, light.range * light.range, (float)lightType);
}
else if (lightType == LightType.Spot)
{
lightShadowIndex_LightParams[numLights] = new Vector4(0, 0, 1, 1);
lightFalloffParams[numLights] = new Vector4(1.0f, 0.0f, light.range * light.range, (float)lightType);
}
// pass this list to a routine that assigns shadows based on some heuristic
uint shadowRequestCount = (uint)m_ShadowRequests.Count;
int[] shadowRequests = m_ShadowRequests.ToArray();
int[] shadowDataIndices;
m_ShadowMgr.ProcessShadowRequests(m_FrameId, inputs, camera, inputs.visibleLights,
ref shadowRequestCount, shadowRequests, out shadowDataIndices);
if (hasShadows)
// update the visibleLights with the shadow information
m_ShadowIndices.Clear();
for (uint i = 0; i < shadowRequestCount; i++)
// Enable shadows
lightShadowIndex_LightParams[numLights].x = 1;
for (int s = 0; s < shadow.GetShadowSliceCountLightIndex(nLight); ++s)
{
var shadowSliceIndex = shadow.GetShadowSliceIndex(nLight, s);
m_MatWorldToShadow[numLights * k_MaxShadowmapPerLights + s] = shadow.shadowSlices[shadowSliceIndex].shadowTransform.transpose;
}
}
numLights++;
}
// Warn if too many lights found
if (nNumLightsIncludingTooMany > k_MaxLights)
{
if (nNumLightsIncludingTooMany > m_WarnedTooManyLights)
{
Debug.LogError("ERROR! Found " + nNumLightsIncludingTooMany + " runtime lights! Valve renderer supports up to " + k_MaxLights +
" active runtime lights at a time!\nDisabling " + (nNumLightsIncludingTooMany - k_MaxLights) + " runtime light" +
((nNumLightsIncludingTooMany - k_MaxLights) > 1 ? "s" : "") + "!\n");
}
m_WarnedTooManyLights = nNumLightsIncludingTooMany;
}
else
{
if (m_WarnedTooManyLights > 0)
{
m_WarnedTooManyLights = 0;
Debug.Log("SUCCESS! Found " + nNumLightsIncludingTooMany + " runtime lights which is within the supported number of lights, " + k_MaxLights + ".\n\n");
m_ShadowIndices.Add(shadowRequests[i], shadowDataIndices[i]);
// PCF 3x3 Shadows
var flTexelEpsilonX = 1.0f / m_ShadowSettings.shadowAtlasWidth;
var flTexelEpsilonY = 1.0f / m_ShadowSettings.shadowAtlasHeight;
m_Shadow3X3PCFTerms[0] = new Vector4(20.0f / 267.0f, 33.0f / 267.0f, 55.0f / 267.0f, 0.0f);
m_Shadow3X3PCFTerms[1] = new Vector4(flTexelEpsilonX, flTexelEpsilonY, -flTexelEpsilonX, -flTexelEpsilonY);
m_Shadow3X3PCFTerms[2] = new Vector4(flTexelEpsilonX, flTexelEpsilonY, 0.0f, 0.0f);
m_Shadow3X3PCFTerms[3] = new Vector4(-flTexelEpsilonX, -flTexelEpsilonY, 0.0f, 0.0f);
}
int GenerateSourceLightBuffers(Camera camera, CullResults inputs)
{
var probes = inputs.visibleReflectionProbes;
//ReflectionProbe[] probes = Object.FindObjectsOfType<ReflectionProbe>();

light.color.Set(cl.finalColor.r, cl.finalColor.g, cl.finalColor.b);
light.sliceIndex = 0;
light.lightModel = (uint)LightDefinitions.DIRECT_LIGHT;
light.shadowLightIndex = shadowLightIndex;
int shadowIdx;
light.shadowLightIndex = m_ShadowIndices.TryGetValue( (int) shadowLightIndex, out shadowIdx ) ? (uint) shadowIdx : 0x80000000;
shadowLightIndex++;
var bHasCookie = cl.light.cookie != null;

if (!CullResults.GetCullingParameters(camera, out cullingParams))
continue;
m_ShadowPass.UpdateCullingParameters(ref cullingParams);
m_ShadowMgr.UpdateCullingParameters( ref cullingParams );
var cullResults = CullResults.Cull(ref cullingParams, renderContext);
ExecuteRenderLoop(camera, cullResults, renderContext);

// do anything we need to do upon a new frame.
NewFrame();
#pragma warning disable 162 // warning CS0162: Unreachable code detected
if (!k_UseAsyncCompute) RenderShadowMaps(cullResults, loop);
#pragma warning restore 162
// generate g-buffer before shadows to leverage async compute
// forward opaques just write to depth.
loop.SetupCameraProperties(camera);

var numLights = GenerateSourceLightBuffers(camera, cullResults);
BuildPerTileLightLists(camera, loop, numLights, projscr, invProjscr);
// 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);
loop.SetupCameraProperties(camera);
}
m_ShadowMgr.RenderShadows( m_FrameId, loop, cullResults, cullResults.visibleLights );
m_ShadowMgr.SyncData();
m_ShadowMgr.BindResources( loop );
var numDirLights = UpdateDirectionalLights(camera, cullResults.visibleLights);
var numDirLights = UpdateDirectionalLights(camera, cullResults.visibleLights, m_ShadowIndices);
PushGlobalParams(camera, loop, CameraToWorld(camera), projscr, invProjscr, numDirLights);
// do deferred lighting

void RenderShadowMaps(CullResults cullResults, ScriptableRenderContext loop)
{
ShadowOutput shadows;
m_ShadowPass.Render(loop, cullResults, out shadows);
UpdateShadowConstants(cullResults.visibleLights, ref shadows);
}
void ResizeIfNecessary(int curWidth, int curHeight)

161
Assets/ScriptableRenderPipeline/fptl/LightingTemplate.hlsl


#define CUBEMAPFACE_POSITIVE_Z 4
#define CUBEMAPFACE_NEGATIVE_Z 5
#define SHADOW_FPTL
# if defined(SHADER_API_D3D11)
# include "../ShaderLibrary/API/D3D11.hlsl"
# elif defined(SHADER_API_PSSL)
# include "../ShaderLibrary/API/PSSL.hlsl"
# elif defined(SHADER_API_XBOXONE)
# include "../ShaderLibrary/API/D3D11.hlsl"
# include "../ShaderLibrary/API/D3D11_1.hlsl"
# elif defined(SHADER_API_METAL)
# include "../ShaderLibrary/API/Metal.hlsl"
# else
# error unsupported shader api
# endif
# include "../ShaderLibrary/API/Validate.hlsl"
# include "../ShaderLibrary/Shadow/Shadow.hlsl"
#undef SHADOW_FPTL
CBUFFER_START(ShadowLightData)
float4 g_vShadow3x3PCFTerms0;

StructuredBuffer<DirectionalLight> g_dirLightData;
#define DECLARE_SHADOWMAP( tex ) Texture2D tex; SamplerComparisonState sampler##tex
#ifdef REVERSE_ZBUF
#define SAMPLE_SHADOW( tex, coord ) tex.SampleCmpLevelZero( sampler##tex, (coord).xy, (coord).z )
#else
#define SAMPLE_SHADOW( tex, coord ) tex.SampleCmpLevelZero( sampler##tex, (coord).xy, 1.0-(coord).z )
#endif
DECLARE_SHADOWMAP(g_tShadowBuffer);
float ComputeShadow_PCF_3x3_Gaussian(float3 vPositionWs, float4x4 matWorldToShadow)
{
float4 vPositionTextureSpace = mul(float4(vPositionWs.xyz, 1.0), matWorldToShadow);
vPositionTextureSpace.xyz /= vPositionTextureSpace.w;
float2 shadowMapCenter = vPositionTextureSpace.xy;
if ((shadowMapCenter.x < 0.0f) || (shadowMapCenter.x > 1.0f) || (shadowMapCenter.y < 0.0f) || (shadowMapCenter.y > 1.0f))
return 1.0f;
float objDepth = saturate(257.0 / 256.0 - vPositionTextureSpace.z);
float4 v20Taps;
v20Taps.x = SAMPLE_SHADOW(g_tShadowBuffer, float3(shadowMapCenter.xy + g_vShadow3x3PCFTerms1.xy, objDepth)).x; // 1 1
v20Taps.y = SAMPLE_SHADOW(g_tShadowBuffer, float3(shadowMapCenter.xy + g_vShadow3x3PCFTerms1.zy, objDepth)).x; // -1 1
v20Taps.z = SAMPLE_SHADOW(g_tShadowBuffer, float3(shadowMapCenter.xy + g_vShadow3x3PCFTerms1.xw, objDepth)).x; // 1 -1
v20Taps.w = SAMPLE_SHADOW(g_tShadowBuffer, float3(shadowMapCenter.xy + g_vShadow3x3PCFTerms1.zw, objDepth)).x; // -1 -1
float flSum = dot(v20Taps.xyzw, float4(0.25, 0.25, 0.25, 0.25));
if ((flSum == 0.0) || (flSum == 1.0))
return flSum;
flSum *= g_vShadow3x3PCFTerms0.x * 4.0;
float4 v33Taps;
v33Taps.x = SAMPLE_SHADOW(g_tShadowBuffer, float3(shadowMapCenter.xy + g_vShadow3x3PCFTerms2.xz, objDepth)).x; // 1 0
v33Taps.y = SAMPLE_SHADOW(g_tShadowBuffer, float3(shadowMapCenter.xy + g_vShadow3x3PCFTerms3.xz, objDepth)).x; // -1 0
v33Taps.z = SAMPLE_SHADOW(g_tShadowBuffer, float3(shadowMapCenter.xy + g_vShadow3x3PCFTerms3.zy, objDepth)).x; // 0 -1
v33Taps.w = SAMPLE_SHADOW(g_tShadowBuffer, float3(shadowMapCenter.xy + g_vShadow3x3PCFTerms2.zy, objDepth)).x; // 0 1
flSum += dot(v33Taps.xyzw, g_vShadow3x3PCFTerms0.yyyy);
flSum += SAMPLE_SHADOW(g_tShadowBuffer, float3(shadowMapCenter.xy, objDepth)).x * g_vShadow3x3PCFTerms0.z;
return flSum;
}
//---------------------------------------------------------------------------------------------------------------------------------------------------------
/**
* Gets the cascade weights based on the world position of the fragment and the positions of the split spheres for each cascade.
* Returns an invalid split index if past shadowDistance (ie 4 is invalid for cascade)
*/
float GetSplitSphereIndexForDirshadows(float3 wpos)
{
float3 fromCenter0 = wpos.xyz - g_vDirShadowSplitSpheres[0].xyz;
float3 fromCenter1 = wpos.xyz - g_vDirShadowSplitSpheres[1].xyz;
float3 fromCenter2 = wpos.xyz - g_vDirShadowSplitSpheres[2].xyz;
float3 fromCenter3 = wpos.xyz - g_vDirShadowSplitSpheres[3].xyz;
float4 distances2 = float4(dot(fromCenter0, fromCenter0), dot(fromCenter1, fromCenter1), dot(fromCenter2, fromCenter2), dot(fromCenter3, fromCenter3));
float4 vDirShadowSplitSphereSqRadii;
vDirShadowSplitSphereSqRadii.x = g_vDirShadowSplitSpheres[0].w;
vDirShadowSplitSphereSqRadii.y = g_vDirShadowSplitSpheres[1].w;
vDirShadowSplitSphereSqRadii.z = g_vDirShadowSplitSpheres[2].w;
vDirShadowSplitSphereSqRadii.w = g_vDirShadowSplitSpheres[3].w;
fixed4 weights = float4(distances2 < vDirShadowSplitSphereSqRadii);
weights.yzw = saturate(weights.yzw - weights.xyz);
return 4 - dot(weights, float4(4, 3, 2, 1));
}
float SampleShadow(uint type, float3 vPositionWs, float3 vPositionToLightDirWs, uint lightIndex)
{
float flShadowScalar = 1.0;
int shadowSplitIndex = 0;
if (type == DIRECTIONAL_LIGHT)
{
shadowSplitIndex = GetSplitSphereIndexForDirshadows(vPositionWs);
}
else if (type == SPHERE_LIGHT)
{
float3 absPos = abs(vPositionToLightDirWs);
shadowSplitIndex = (vPositionToLightDirWs.z > 0) ? CUBEMAPFACE_NEGATIVE_Z : CUBEMAPFACE_POSITIVE_Z;
if (absPos.x > absPos.y)
{
if (absPos.x > absPos.z)
{
shadowSplitIndex = (vPositionToLightDirWs.x > 0) ? CUBEMAPFACE_NEGATIVE_X : CUBEMAPFACE_POSITIVE_X;
}
}
else
{
if (absPos.y > absPos.z)
{
shadowSplitIndex = (vPositionToLightDirWs.y > 0) ? CUBEMAPFACE_NEGATIVE_Y : CUBEMAPFACE_POSITIVE_Y;
}
}
}
flShadowScalar = ComputeShadow_PCF_3x3_Gaussian(vPositionWs.xyz, g_matWorldToShadow[lightIndex * MAX_SHADOWMAP_PER_LIGHT + shadowSplitIndex]);
return flShadowScalar;
}
float3 ExecuteLightList(uint start, uint numLights, float3 vP, float3 vPw, float3 Vworld)
{
UnityIndirect ind;

ShadowContext shadowContext = InitShadowContext();
float3 ints = 0;

float atten = 1;
[branch]
if (lightData.shadowLightIndex != 0xffffffff)
{
float shadowScalar = SampleShadow(DIRECTIONAL_LIGHT, vPw, 0, lightData.shadowLightIndex);
atten *= shadowScalar;
}
int shadowIdx = asint(lightData.shadowLightIndex);
[branch]
if (shadowIdx >= 0)
{
float shadow = GetDirectionalShadowAttenuation(shadowContext, vPw, 0.0.xxx, shadowIdx, 0.0.xxx);
atten *= shadow;
}
UnityLight light;
light.color.xyz = lightData.color.xyz * atten;
light.dir.xyz = mul((float3x3) g_mViewToWorld, -lightData.lightAxisZ).xyz;

}
atten *= angularAtt.w*(fProjVec>0.0); // finally apply this to the dist att.
const bool bHasShadow = (lgtDat.flags&HAS_SHADOW)!=0;
[branch]if(bHasShadow)
{
float shadowScalar = SampleShadow(SPOT_LIGHT, vPw, 0, lgtDat.shadowLightIndex);
atten *= shadowScalar;
}
int shadowIdx = asint(lgtDat.shadowLightIndex);
[branch]
if (shadowIdx >= 0)
{
float shadow = GetPunctualShadowAttenuation(shadowContext, vPw, 0.0.xxx, shadowIdx, 0.0.xxx);
atten *= shadow;
}
UnityLight light;
light.color.xyz = lgtDat.color.xyz*atten*angularAtt.xyz;

atten *= cookieColor.w;
}
const bool bHasShadow = (lgtDat.flags&HAS_SHADOW)!=0;
[branch]if(bHasShadow)
{
float shadowScalar = SampleShadow(SPHERE_LIGHT, vPw, vLw, lgtDat.shadowLightIndex);
atten *= shadowScalar;
}
int shadowIdx = asint(lgtDat.shadowLightIndex);
[branch]
if (shadowIdx >= 0)
{
float shadow = GetPunctualShadowAttenuation(shadowContext, vPw, 0.0.xxx, shadowIdx, vLw);
atten *= shadow;
}
UnityLight light;
light.color.xyz = lgtDat.color.xyz*atten*cookieColor.xyz;

2
Assets/ScriptableRenderPipeline/fptl/RegularForwardLightingUtils.hlsl


StructuredBuffer<SFiniteLightData> g_vLightData;
Buffer<uint> g_vLightListMeshInst; // build on CPU if in use. direct lights first, then reflection probes.
StructuredBuffer<uint> g_vLightListMeshInst; // build on CPU if in use. direct lights first, then reflection probes. (don't support Buffer yet in unity, so using structured)
uniform int g_numLights;
uniform int g_numReflectionProbes;

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


- _HeightCenter: 0
- _HorizonFade: 1
- _InitialBend: 1
- _MaterialID: 0
- _MaterialID: 1
- _Metallic: 0
- _Mode: 0
- _NormalDetailMul: 0.347

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


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metallic: 0
- _Mode: 0
- _NormalMapSpace: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

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


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metallic: 0
- _Mode: 0
- _NormalMapSpace: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

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


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularOcclusionMap:
m_Texture: {fileID: 2800000, guid: b24f69ff4ace9194fb0d9eee4f5cf1a4, type: 3}
m_Scale: {x: 1, y: 1}

- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metallic: 0
- _Mode: 0
- _NormalMapSpace: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 0

- _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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

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


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metallic: 0
- _Mode: 0
- _NormalMapSpace: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 0

- _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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

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


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 1
- _Metallic: 1
- _Mode: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

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


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.1
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 1
- _Metallic: 1
- _Mode: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

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


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.2
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 1
- _Metallic: 1
- _Mode: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

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


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.3
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 1
- _Metallic: 1
- _Mode: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

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


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.4
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 1
- _Metallic: 1
- _Mode: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

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


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 1
- _Metallic: 1
- _Mode: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

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


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.6
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 1
- _Metallic: 1
- _Mode: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

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


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.7
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 1
- _Metallic: 1
- _Mode: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

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


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.8
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 1
- _Metallic: 1
- _Mode: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

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


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.9
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 1
- _Metallic: 1
- _Mode: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

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


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 1
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 1
- _Metallic: 1
- _Mode: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

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


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 0
- _Metallic: 0
- _Mode: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

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


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.1
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 0
- _Metallic: 0
- _Mode: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

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


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.2
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 0
- _Metallic: 0
- _Mode: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

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


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.3
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 0
- _Metallic: 0
- _Mode: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

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


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.4
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 0
- _Metallic: 0
- _Mode: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

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


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 0
- _Metallic: 0
- _Mode: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

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


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.6
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 0
- _Metallic: 0
- _Mode: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

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


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.7
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 0
- _Metallic: 0
- _Mode: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

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


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.8
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 0
- _Metallic: 0
- _Mode: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

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


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.9
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 0
- _Metallic: 0
- _Mode: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

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


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 1
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 0
- _Metallic: 0
- _Mode: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

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


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1

- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metallic: 0
- _Mode: 0
- _NormalMapSpace: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 0

- _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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

13
Assets/TestScenes/HDTest/GraphicTest/Parallax Occlusion Mapping/Material/POM - Wood triplanar.mat


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1

- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metallic: 0
- _Mode: 0
- _NormalMapSpace: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 1
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 0

- _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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

13
Assets/TestScenes/HDTest/GraphicTest/Parallax Occlusion Mapping/Material/POM - Wood.mat


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1

- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metallic: 0
- _Mode: 0
- _NormalMapSpace: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 1
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 0

- _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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

2
Assets/TestScenes/HDTest/GraphicTest/SSS/InifiniteRealityHead.mat


- _HeightCenter: 0.5
- _HorizonFade: 1
- _InitialBend: 1
- _MaterialID: 1
- _MaterialID: 0
- _Metallic: 0
- _Mode: 0
- _NormalMapSpace: 0

13
Assets/TestScenes/HDTest/GraphicTest/Tessellation/Material/Tessellation - Rock.mat


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1

- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metallic: 0
- _Mode: 0
- _NormalMapSpace: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 0

- _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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

13
Assets/TestScenes/HDTest/GraphicTest/Tessellation/Material/Tessellation - Wood.mat


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1

- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metallic: 0
- _Mode: 0
- _NormalMapSpace: 0

- _PPDMaxSamples: 64
- _PPDMinSamples: 1
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 0

- _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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

13
Assets/TestScenes/HDTest/GraphicTest/Triplanar/Material/Wood triplanar.mat


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1

- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metallic: 0
- _Mode: 0
- _NormalMapSpace: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 1
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 0

- _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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

13
Assets/TestScenes/HDTest/GraphicTest/Two Sided/Material/GroundLeaf_DoubleSidedFlip.mat


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedEnable: 1
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 2
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 0.892
- _Glossiness: 0.507
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 0
- _Metallic: 0
- _Mode: 1

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 0

- _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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

7
Assets/TestScenes/HDTest/GraphicTest/Two Sided/Material/GroundLeaf_DoubleSidedFlipSSS.mat


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _HeightScale: 1
- _HorizonFade: 1
- _InitialBend: 1
- _MaterialID: 1
- _MaterialID: 0
- _Metalic: 0
- _Metallic: 0
- _Mode: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

13
Assets/TestScenes/HDTest/GraphicTest/Two Sided/Material/GroundLeaf_DoubleSidedMirror.mat


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 3
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 0.892
- _Glossiness: 0.507
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 0
- _Metallic: 0
- _Mode: 1

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 0

- _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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

2
Assets/TestScenes/HDTest/GraphicTest/Two Sided/Prefabs/Materials.meta


fileFormatVersion: 2
fileFormatVersion: 2
guid: ee9aedf6876b41c459d476afd81ab708
folderAsset: yes
timeCreated: 1492083994

2
Assets/TestScenes/HDTest/LayeredLitTest/Mesh/Materials.meta


fileFormatVersion: 2
fileFormatVersion: 2
guid: babcbb0e8a80beb4ca87d6a963225ae6
folderAsset: yes
timeCreated: 1492083990

13
Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/CubeTransparent.mat


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 0
- _Metallic: 0
- _Mode: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

13
Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/GGX Test/GGX_a00_s00.mat


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedLigthing: 1
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 0
- _Metallic: 1
- _Mettalic: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

13
Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/GGX Test/GGX_a00_s01.mat


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedLigthing: 1
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 0
- _Metallic: 1
- _Mettalic: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

13
Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/GGX Test/GGX_a00_s02.mat


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedLigthing: 1
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 0
- _Metallic: 1
- _Mettalic: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

13
Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/GGX Test/GGX_a00_s03.mat


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedLigthing: 1
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 0
- _Metallic: 1
- _Mettalic: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

13
Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/GGX Test/GGX_a00_s04.mat


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedLigthing: 1
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 0
- _Metallic: 1
- _Mettalic: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

13
Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/GGX Test/GGX_a00_s05.mat


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedLigthing: 1
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 0
- _Metallic: 1
- _Mettalic: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

13
Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/GGX Test/GGX_a00_s06.mat


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedLigthing: 1
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 0
- _Metallic: 1
- _Mettalic: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

13
Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/GGX Test/GGX_a00_s07.mat


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedLigthing: 1
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 0
- _Metallic: 1
- _Mettalic: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

13
Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/GGX Test/GGX_a00_s08.mat


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedLigthing: 1
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 0
- _Metallic: 1
- _Mettalic: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

13
Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/GGX Test/GGX_a00_s09.mat


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedLigthing: 1
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 0
- _Metallic: 1
- _Mettalic: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

13
Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/GGX Test/GGX_a00_s10.mat


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedLigthing: 1
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 0
- _Metallic: 1
- _Mettalic: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

13
Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/GGX Test/GGX_a02_s00.mat


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedLigthing: 1
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 0
- _Metallic: 1
- _Mettalic: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

13
Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/GGX Test/GGX_a02_s01.mat


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedLigthing: 1
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 0
- _Metallic: 1
- _Mettalic: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

13
Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/GGX Test/GGX_a02_s02.mat


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedLigthing: 1
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 0
- _Metallic: 1
- _Mettalic: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

13
Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/GGX Test/GGX_a02_s03.mat


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedLigthing: 1
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 0
- _Metallic: 1
- _Mettalic: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

13
Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/GGX Test/GGX_a02_s04.mat


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedLigthing: 1
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 0
- _Metallic: 1
- _Mettalic: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

13
Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/GGX Test/GGX_a02_s05.mat


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedLigthing: 1
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 0
- _Metallic: 1
- _Mettalic: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

13
Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/GGX Test/GGX_a02_s06.mat


m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
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}

- _DoubleSidedLigthing: 1
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _Drag: 1
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1

- _HeightMapMode: 0
- _HeightScale: 1
- _HorizonFade: 1
- _MaterialID: 0
- _InitialBend: 1
- _MaterialID: 1
- _Metalic: 0
- _Metallic: 1
- _Mettalic: 0

- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Stiffness: 1
- _SubSurfaceRadius: 0
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 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}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

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

正在加载...
取消
保存