浏览代码

Merge remote-tracking branch 'origin/master' into hdrp-xr-lighting

Manual fixup of some LightLoop stuff (stereo + decals living together in light cull data)
/main
Robert Srinivasiah 7 年前
当前提交
6f2b52f2
共有 240 个文件被更改,包括 4561 次插入806 次删除
  1. 2
      .gitmodules
  2. 15
      ScriptableRenderPipeline/Core/CoreRP/Camera/CameraSwitcher.cs
  3. 2
      ScriptableRenderPipeline/Core/CoreRP/Camera/FreeCamera.cs
  4. 4
      ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/Sampling/Fibonacci.hlsl
  5. 34
      ScriptableRenderPipeline/Core/CoreRP/Shadow/Shadow.cs
  6. 10
      ScriptableRenderPipeline/Core/CoreRP/Shadow/ShadowBase.cs
  7. 4
      ScriptableRenderPipeline/Core/CoreRP/TextureCache.cs
  8. 2
      ScriptableRenderPipeline/Core/package.json
  9. 7
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Camera/HDCamera.cs
  10. 7
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/ColorPickerDebug.cs
  11. 369
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/DebugDisplay.cs
  12. 10
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/LightingDebug.cs
  13. 658
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/MaterialDebug.cs
  14. 371
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Decal/DecalSystem.cs
  15. 12
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/HDAssetFactory.cs
  16. 20
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/HDLightEditor.Styles.cs
  17. 18
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/HDLightEditor.cs
  18. 14
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditorUtility.cs
  19. 1
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/RenderPipelineSettingsUI.cs
  20. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/SerializedRenderPipelineSettings.cs
  21. 3
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDCustomSamplerId.cs
  22. 50
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs
  23. 12
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipelineAsset.asset
  24. 8
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDStringConstants.cs
  25. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Light/HDAdditionalShadowData.cs
  26. 63
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/LightLoop.cs
  27. 3
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/LightLoop.cs.hlsl
  28. 41
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/LightLoopSettings.cs
  29. 1
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/lightlistbuild-bigtile.compute
  30. 4
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/lightlistbuild-clustered.compute
  31. 4
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/lightlistbuild.compute
  32. 10
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Reflection/PlanarReflectionProbeCache.cs
  33. 17
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Reflection/ReflectionProbeCache.cs
  34. 11
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Decal/Decal.cs
  35. 16
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Decal/Decal.cs.hlsl
  36. 10
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Decal/Decal.hlsl
  37. 7
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Decal/DecalData.hlsl
  38. 96
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Decal/DecalUtilities.hlsl
  39. 4
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/DiffusionProfile/DiffusionProfileSettings.cs
  40. 3
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/LayeredLit/LayeredLit.shader
  41. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/LayeredLit/LayeredLitData.hlsl
  42. 3
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/LayeredLit/LayeredLitTessellation.shader
  43. 3
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.shader
  44. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/LitData.hlsl
  45. 3
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/LitTessellation.shader
  46. 65
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/SubsurfaceScattering/SubsurfaceScattering.compute
  47. 9
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/SubsurfaceScattering/SubsurfaceScatteringManager.cs
  48. 3
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Unlit/Unlit.shader
  49. 129
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/RenderPipeline/FrameSettings.cs
  50. 1
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/RenderPipeline/RenderPipelineSettings.cs
  51. 6
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/RenderPipelineResources/HDRenderPipelineResources.asset
  52. 9
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/RenderPipelineResources/RenderPipelineResources.cs
  53. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/ShaderPass/ShaderPassDBuffer.hlsl
  54. 4
      ScriptableRenderPipeline/HDRenderPipeline/package.json
  55. 4
      ScriptableRenderPipeline/LightweightPipeline/package.json
  56. 2
      ScriptableRenderPipeline/master-package.json
  57. 2
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/CommonAssets/RP_Assets/HDRP_Test_Def.asset
  58. 4
      ScriptableRenderPipeline/Core/CoreRP/Shadow/ShadowBlurMoments.compute
  59. 8
      ScriptableRenderPipeline/Core/CoreRP/CoreResources.meta
  60. 289
      ScriptableRenderPipeline/Core/CoreRP/Debugging/DebugManager.Actions.cs
  61. 11
      ScriptableRenderPipeline/Core/CoreRP/Debugging/DebugManager.Actions.cs.meta
  62. 231
      ScriptableRenderPipeline/Core/CoreRP/Debugging/DebugManager.cs
  63. 11
      ScriptableRenderPipeline/Core/CoreRP/Debugging/DebugManager.cs.meta
  64. 127
      ScriptableRenderPipeline/Core/CoreRP/Debugging/DebugUI.Containers.cs
  65. 11
      ScriptableRenderPipeline/Core/CoreRP/Debugging/DebugUI.Containers.cs.meta
  66. 180
      ScriptableRenderPipeline/Core/CoreRP/Debugging/DebugUI.Fields.cs
  67. 11
      ScriptableRenderPipeline/Core/CoreRP/Debugging/DebugUI.Fields.cs.meta
  68. 70
      ScriptableRenderPipeline/Core/CoreRP/Debugging/DebugUI.Panel.cs
  69. 11
      ScriptableRenderPipeline/Core/CoreRP/Debugging/DebugUI.Panel.cs.meta
  70. 99
      ScriptableRenderPipeline/Core/CoreRP/Debugging/DebugUI.cs
  71. 11
      ScriptableRenderPipeline/Core/CoreRP/Debugging/DebugUI.cs.meta
  72. 24
      ScriptableRenderPipeline/Core/CoreRP/Debugging/DebugUpdater.cs
  73. 11
      ScriptableRenderPipeline/Core/CoreRP/Debugging/DebugUpdater.cs.meta
  74. 8
      ScriptableRenderPipeline/Core/CoreRP/Debugging/Prefabs.meta
  75. 8
      ScriptableRenderPipeline/Core/CoreRP/Editor/CoreResources.meta
  76. 97
      ScriptableRenderPipeline/Core/CoreRP/Editor/Debugging/DebugState.cs
  77. 11
      ScriptableRenderPipeline/Core/CoreRP/Editor/Debugging/DebugState.cs.meta
  78. 304
      ScriptableRenderPipeline/Core/CoreRP/Editor/Debugging/DebugUIDrawer.Builtins.cs
  79. 11
      ScriptableRenderPipeline/Core/CoreRP/Editor/Debugging/DebugUIDrawer.Builtins.cs.meta
  80. 62
      ScriptableRenderPipeline/Core/CoreRP/Editor/Debugging/DebugUIDrawer.cs
  81. 11
      ScriptableRenderPipeline/Core/CoreRP/Editor/Debugging/DebugUIDrawer.cs.meta
  82. 78
      ScriptableRenderPipeline/Core/CoreRP/Editor/Debugging/DebugUIHandlerCanvasEditor.cs
  83. 11
      ScriptableRenderPipeline/Core/CoreRP/Editor/Debugging/DebugUIHandlerCanvasEditor.cs.meta
  84. 438
      ScriptableRenderPipeline/Core/CoreRP/Editor/Debugging/DebugWindow.cs
  85. 11
      ScriptableRenderPipeline/Core/CoreRP/Editor/Debugging/DebugWindow.cs.meta
  86. 34
      ScriptableRenderPipeline/Core/CoreRP/Editor/Debugging/UIFoldoutEditor.cs
  87. 11
      ScriptableRenderPipeline/Core/CoreRP/Editor/Debugging/UIFoldoutEditor.cs.meta
  88. 146
      ScriptableRenderPipeline/Core/CoreRP/ObservableList.cs
  89. 11
      ScriptableRenderPipeline/Core/CoreRP/ObservableList.cs.meta
  90. 43
      ScriptableRenderPipeline/Core/CoreRP/SerializedDictionary.cs
  91. 11
      ScriptableRenderPipeline/Core/CoreRP/SerializedDictionary.cs.meta
  92. 8
      ScriptableRenderPipeline/Core/CoreRP/Debugging/Prefabs/Fonts.meta
  93. 564
      ScriptableRenderPipeline/Core/CoreRP/Debugging/Prefabs/Fonts/Perfect DOS VGA 437.ttf
  94. 22
      ScriptableRenderPipeline/Core/CoreRP/Debugging/Prefabs/Fonts/Perfect DOS VGA 437.ttf.meta
  95. 8
      ScriptableRenderPipeline/Core/CoreRP/Debugging/Prefabs/Resources.meta
  96. 166
      ScriptableRenderPipeline/Core/CoreRP/Debugging/Prefabs/Resources/DebugUI Canvas.prefab
  97. 8
      ScriptableRenderPipeline/Core/CoreRP/Debugging/Prefabs/Resources/DebugUI Canvas.prefab.meta

2
.gitmodules


branch = v2
[submodule "ShaderGraph"]
path = ShaderGraph
url = git@github.com:Unity-Technologies/ShaderGraph.git
url = https://github.com/Unity-Technologies/ShaderGraph

15
ScriptableRenderPipeline/Core/CoreRP/Camera/CameraSwitcher.cs


GUIContent[] m_CameraNames = null;
int[] m_CameraIndices = null;
DebugUI.EnumField m_DebugEntry;
void OnEnable()
{
m_OriginalCamera = GetComponent<Camera>();

m_CameraNames[GetCameraCount() - 1] = new GUIContent("Original Camera");
m_CameraIndices[GetCameraCount() - 1] = GetCameraCount() - 1;
DebugMenuManager.instance.AddDebugItem<int>("Camera", "Camera Switcher", () => m_CurrentCameraIndex, (value) => SetCameraIndex((int)value), DebugItemFlag.None, new DebugItemHandlerIntEnum(m_CameraNames, m_CameraIndices));
m_DebugEntry = new DebugUI.EnumField { displayName = "Camera Switcher", getter = () => m_CurrentCameraIndex, setter = value => SetCameraIndex(value), enumNames = m_CameraNames, enumValues = m_CameraIndices };
var panel = DebugManager.instance.GetPanel("Camera", true);
panel.children.Add(m_DebugEntry);
}
void OnDisable()
{
if (m_DebugEntry != null && m_DebugEntry.panel != null)
{
var panel = m_DebugEntry.panel;
panel.children.Remove(m_DebugEntry);
}
}
int GetCameraCount()

2
ScriptableRenderPipeline/Core/CoreRP/Camera/FreeCamera.cs


void Update()
{
// If the debug menu is running, we don't want to conflict with its inputs.
if (DebugMenuManager.instance.menuUI.isEnabled)
if (DebugManager.instance.displayRuntimeUI)
return;
float inputRotateAxisX = 0.0f;

4
ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/Sampling/Fibonacci.hlsl


// 3 cycles on GCN if 'fibN1' and 'fibN2' are known at compile time.
// N.b.: According to Swinbank and Pusser [SP06], the uniformity of the distribution
// can be slightly improved by introducing an offset of 1/N to the Z (or R) coordinates.
return real2(i / fibN1 + (0.5/ fibN1), frac(i * (fibN2 / fibN1)));
return real2(i / fibN1 + (0.5 / fibN1), frac(i * (fibN2 / fibN1)));
}
#define GOLDEN_RATIO 1.6180339887498948482

{
return real2(i / n + (0.5/ n), frac(i * rcp(GOLDEN_RATIO)));
return real2(i / n + (0.5 / n), frac(i * rcp(GOLDEN_RATIO)));
}
static const uint k_FibonacciSeq[] = {

34
ScriptableRenderPipeline/Core/CoreRP/Shadow/Shadow.cs


protected Vector4[] m_TmpSplits = new Vector4[k_MaxCascadesInShader];
protected float[] m_TmpBorders = new float[((k_MaxCascadesInShader+3)/4)*4];
protected ShadowAlgoVector m_SupportedAlgorithms = new ShadowAlgoVector( 0, false );
protected Material m_DebugMaterial = null;
private Material m_ClearMat;
private readonly VectorArray<CachedEntry>.Cleanup m_Cleanup;
private readonly VectorArray<CachedEntry>.Comparator<Key> m_Comparator;

public struct AtlasInit
{
public BaseInit baseInit; // the base class's initializer
public string shaderKeyword; // the global shader keyword to use when rendering the shadowmap
public BaseInit baseInit; // the base class's initializer
public string shaderKeyword; // the global shader keyword to use when rendering the shadowmap
public Shader shadowClearShader;
public ComputeShader shadowBlurMoments;
}
// UI stuff

public ShadowAtlas( ref AtlasInit init ) : base( ref init.baseInit )
{
m_ClearMat = new Material( Shader.Find( "Hidden/ScriptableRenderPipeline/ShadowClear" ) );
m_ClearMat = CoreUtils.CreateEngineMaterial(init.shadowClearShader);
m_Cleanup = (CachedEntry entry) => { Free( entry ); };
m_Comparator = (ref Key k, ref CachedEntry entry) => { return k.id == entry.key.id && k.faceIdx == entry.key.faceIdx; };

public void Initialize( AtlasInit init )
{
m_ShaderKeyword = init.shaderKeyword;
m_DebugMaterial = new Material(Shader.Find("Hidden/ScriptableRenderPipeline/DebugDisplayShadowMap")) { hideFlags = HideFlags.HideAndDontSave };
}
override public void ReserveSlots( ShadowContextStorage sc )

if( m_Shadowmap != null )
m_Shadowmap.Release();
Object.DestroyImmediate(m_DebugMaterial);
CoreUtils.Destroy(m_ClearMat);
}
override public bool Reserve( FrameId frameId, Camera camera, bool cameraRelativeRendering, ref ShadowData shadowData, ShadowRequest sr, uint width, uint height, ref VectorArray<ShadowData> entries, ref VectorArray<ShadowPayload> payload, List<VisibleLight> lights)

sd.edgeTolerance = asd.edgeTolerance;
sd.viewBias = new Vector4( asd.viewBiasMin, asd.viewBiasMax, asd.viewBiasScale, 2.0f / ce.current.proj.m00 / ce.current.viewport.width * 1.4142135623730950488016887242097f );
sd.normalBias = new Vector4( asd.normalBiasMin, asd.normalBiasMax, asd.normalBiasScale, ShadowUtils.Asfloat( flags ) );
// write :(
ce.current.shadowAlgo = (GPUShadowAlgorithm) shadowAlgo;
m_EntryCache[ceIdx] = ce;

cmd.SetViewport( m_EntryCache[i].current.viewport );
cbName = "Shadowmap.ClearRect";
cmd.BeginSample( cbName );
if( m_ClearMat == null )
m_ClearMat = new Material( Shader.Find( "Hidden/ScriptableRenderPipeline/ShadowClear" ) );
CoreUtils.DrawFullScreen( cmd, m_ClearMat, null, 0 );
cmd.EndSample( cbName );
cmd.SetViewProjectionMatrices( m_EntryCache[i].current.view, m_EntryCache[i].current.proj );

m_EntryPool.Add( ce );
}
override public void DisplayShadowMap(CommandBuffer debugCB, Vector4 scaleBias, uint slice, float screenX, float screenY, float screenSizeX, float screenSizeY, float minValue, float maxValue)
override public void DisplayShadowMap(CommandBuffer debugCB, Material debugMaterial, Vector4 scaleBias, uint slice, float screenX, float screenY, float screenSizeX, float screenSizeY, float minValue, float maxValue)
{
Vector4 validRange = new Vector4(minValue, 1.0f / (maxValue - minValue));

propertyBlock.SetFloat("_TextureSlice", (float)slice);
propertyBlock.SetVector("_ValidRange", validRange);
debugCB.SetViewport(new Rect(screenX, screenY, screenSizeX, screenSizeY));
debugCB.DrawProcedural(Matrix4x4.identity, m_DebugMaterial, m_DebugMaterial.FindPass("REGULARSHADOW"), MeshTopology.Triangles, 3, 1, propertyBlock);
debugCB.DrawProcedural(Matrix4x4.identity, debugMaterial, debugMaterial.FindPass("REGULARSHADOW"), MeshTopology.Triangles, 3, 1, propertyBlock);
}
}

m_Flags |= SystemInfo.usesReversedZBuffer ? Flags.reversed_z : 0;
m_SampleCount = sampleCount <= 0 ? 1 : (sampleCount > k_MaxSampleCount ? k_MaxSampleCount : sampleCount);
m_MomentBlurCS = Resources.Load<ComputeShader>( "ShadowBlurMoments" );
m_MomentBlurCS = init.shadowBlurMoments;
if( m_MomentBlurCS )
{

cb.EndSample("VSM conversion");
}
override public void DisplayShadowMap(CommandBuffer debugCB, Vector4 scaleBias, uint slice, float screenX, float screenY, float screenSizeX, float screenSizeY, float minValue, float maxValue)
override public void DisplayShadowMap(CommandBuffer debugCB, Material debugMaterial, Vector4 scaleBias, uint slice, float screenX, float screenY, float screenSizeX, float screenSizeY, float minValue, float maxValue)
{
Vector4 validRange = new Vector4(minValue, 1.0f / (maxValue - minValue));

propertyBlock.SetFloat("_TextureSlice", (float)slice);
propertyBlock.SetVector("_ValidRange", validRange);
debugCB.SetViewport(new Rect(screenX, screenY, screenSizeX, screenSizeY));
debugCB.DrawProcedural(Matrix4x4.identity, m_DebugMaterial, m_DebugMaterial.FindPass("VARIANCESHADOW"), MeshTopology.Triangles, 3, 1, propertyBlock);
debugCB.DrawProcedural(Matrix4x4.identity, debugMaterial, debugMaterial.FindPass("VARIANCESHADOW"), MeshTopology.Triangles, 3, 1, propertyBlock);
}
}
// -------------------------------------------------------------------------------------------------------------------------------------------------

}
}
public override void DisplayShadow(CommandBuffer cmd, int shadowRequestIndex, uint faceIndex, float screenX, float screenY, float screenSizeX, float screenSizeY, float minValue, float maxValue)
public override void DisplayShadow(CommandBuffer cmd, Material debugMaterial, int shadowRequestIndex, uint faceIndex, float screenX, float screenY, float screenSizeX, float screenSizeY, float minValue, float maxValue)
{
if (m_ShadowIndices.Count() == 0)
return;

ShadowData faceData = shadowDatas[(uint)(m_ShadowIndices[index] + offset + faceIndex)];
uint texID, samplerID;
faceData.UnpackShadowmapId(out texID, out samplerID);
m_Shadowmaps[texID].DisplayShadowMap(cmd, faceData.scaleOffset, (uint) faceData.slice, screenX, screenY, screenSizeX, screenSizeY, minValue, maxValue);
m_Shadowmaps[texID].DisplayShadowMap(cmd, debugMaterial, faceData.scaleOffset, (uint) faceData.slice, screenX, screenY, screenSizeX, screenSizeY, minValue, maxValue);
public override void DisplayShadowMap(CommandBuffer cmd, uint shadowMapIndex, uint sliceIndex, float screenX, float screenY, float screenSizeX, float screenSizeY, float minValue, float maxValue)
public override void DisplayShadowMap(CommandBuffer cmd, Material debugMaterial, uint shadowMapIndex, uint sliceIndex, float screenX, float screenY, float screenSizeX, float screenSizeY, float minValue, float maxValue)
m_Shadowmaps[index].DisplayShadowMap(cmd, new Vector4(1.0f, 1.0f, 0.0f, 0.0f), sliceIndex, screenX, screenY, screenSizeX, screenSizeY, minValue, maxValue);
m_Shadowmaps[index].DisplayShadowMap(cmd, debugMaterial, new Vector4(1.0f, 1.0f, 0.0f, 0.0f), sliceIndex, screenX, screenY, screenSizeX, screenSizeY, minValue, maxValue);
}
public override void SyncData()

10
ScriptableRenderPipeline/Core/CoreRP/Shadow/ShadowBase.cs


abstract public void Fill( ShadowContextStorage cs );
abstract public void CreateShadowmap();
abstract protected void Register( GPUShadowType type, ShadowRegistry registry );
abstract public void DisplayShadowMap(CommandBuffer cmd, Vector4 scaleBias, uint slice, float screenX, float screenY, float screenSizeX, float screenSizeY, float minValue, float maxValue);
abstract public void DisplayShadowMap(CommandBuffer cmd, Material debugMaterial, Vector4 scaleBias, uint slice, float screenX, float screenY, float screenSizeX, float screenSizeY, float minValue, float maxValue);
}
public interface IShadowManager

// Renders all shadows for lights the were deemed shadow casters after the last call to ProcessShadowRequests
void RenderShadows( FrameId frameId, ScriptableRenderContext renderContext, CommandBuffer cmd, CullResults cullResults, List<VisibleLight> lights);
// Debug function to display a shadow at the screen coordinate
void DisplayShadow(CommandBuffer cmd, int shadowIndex, uint faceIndex, float screenX, float screenY, float screenSizeX, float screenSizeY, float minValue, float maxValue);
void DisplayShadowMap(CommandBuffer cmd, uint shadowMapIndex, uint sliceIndex, float screenX, float screenY, float screenSizeX, float screenSizeY, float minValue, float maxValue);
void DisplayShadow(CommandBuffer cmd, Material debugMaterial, int shadowIndex, uint faceIndex, float screenX, float screenY, float screenSizeX, float screenSizeY, float minValue, float maxValue);
void DisplayShadowMap(CommandBuffer cmd, Material debugMaterial, uint shadowMapIndex, uint sliceIndex, float screenX, float screenY, float screenSizeX, float screenSizeY, float minValue, float maxValue);
// Synchronize data with GPU buffers
void SyncData();
// Binds resources to shader stages just before rendering the lighting pass

{
public abstract void ProcessShadowRequests( FrameId frameId, CullResults cullResults, Camera camera, bool cameraRelativeRendering, List<VisibleLight> lights, ref uint shadowRequestsCount, int[] shadowRequests, out int[] shadowDataIndices );
public abstract void RenderShadows( FrameId frameId, ScriptableRenderContext renderContext, CommandBuffer cmd, CullResults cullResults, List<VisibleLight> lights);
public abstract void DisplayShadow(CommandBuffer cmd, int shadowIndex, uint faceIndex, float screenX, float screenY, float screenSizeX, float screenSizeY, float minValue, float maxValue);
public abstract void DisplayShadowMap(CommandBuffer cmd, uint shadowMapIndex, uint sliceIndex, float screenX, float screenY, float screenSizeX, float screenSizeY, float minValue, float maxValue);
public abstract void DisplayShadow(CommandBuffer cmd, Material debugMaterial, int shadowIndex, uint faceIndex, float screenX, float screenY, float screenSizeX, float screenSizeY, float minValue, float maxValue);
public abstract void DisplayShadowMap(CommandBuffer cmd, Material debugMaterial, uint shadowMapIndex, uint sliceIndex, float screenX, float screenY, float screenSizeX, float screenSizeY, float minValue, float maxValue);
public abstract void SyncData();
public abstract void BindResources( CommandBuffer cmd, ComputeShader computeShader, int computeKernel);
public abstract void UpdateCullingParameters( ref ScriptableCullingParameters cullingParams );

4
ScriptableRenderPipeline/Core/CoreRP/TextureCache.cs


return !TextureCache.supportsCubemapArrayTextures ? (Texture)m_CacheNoCubeArray : m_Cache;
}
public bool AllocTextureArray(int numCubeMaps, int width, TextureFormat format, bool isMipMapped)
public bool AllocTextureArray(int numCubeMaps, int width, TextureFormat format, bool isMipMapped, Material cubeBlitMaterial)
{
var res = AllocTextureArray(numCubeMaps);
m_NumMipLevels = GetNumMips(width, width); // will calculate same way whether we have cube array or not

if (!m_CubeBlitMaterial) m_CubeBlitMaterial = new Material(Shader.Find("Hidden/CubeToPano")) { hideFlags = HideFlags.HideAndDontSave };
m_CubeBlitMaterial = cubeBlitMaterial;
int panoWidthTop = 4 * width;
int panoHeightTop = 2 * width;

2
ScriptableRenderPipeline/Core/package.json


{
"name": "com.unity.render-pipelines.core",
"description": "Core library for Unity render pipelines.",
"version": "0.1.30",
"version": "0.1.32",
"unity": "2018.1",
"dependencies": {
"com.unity.postprocessing": "0.1.8"

7
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Camera/HDCamera.cs


isFirstFrame = false;
}
taaFrameIndex = taaEnabled ? (uint)postProcessLayer.temporalAntialiasing.sampleIndex : 0;
// TEMP: Re-enable this code once we bump the postprocessing package to 0.1.19 (or above)
// current package 0.1.8 don't have the .sampleIndex and it fail with template...
// taaFrameIndex = taaEnabled ? (uint)postProcessLayer.temporalAntialiasing.sampleIndex : 0;
const uint taaFrameCount = 8;
taaFrameIndex = taaEnabled ? (uint)Time.renderedFrameCount % taaFrameCount : 0;
// END TEMP
taaFrameRotation = new Vector2(Mathf.Sin(taaFrameIndex * (0.5f * Mathf.PI)),
Mathf.Cos(taaFrameIndex * (0.5f * Mathf.PI)));

7
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/ColorPickerDebug.cs


[Serializable]
public class ColorPickerDebugSettings
{
public static string kColorPickerFontColor = "Font Color";
public static string kColorPickerThreshold0Debug = "Color Range Threshold 0";
public static string kColorPickerThreshold1Debug = "Color Range Threshold 1";
public static string kColorPickerThreshold2Debug = "Color Range Threshold 2";
public static string kColorPickerThreshold3Debug = "Color Range Threshold 3";
public static string kColorPickerDebugMode = "Color Picker Debug Mode";
public ColorPickerDebugMode colorPickerMode = ColorPickerDebugMode.None;
public Color fontColor = new Color(1.0f, 0.0f, 0.0f);

369
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/DebugDisplay.cs


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

public class DebugDisplaySettings
{
public static string kEnableShadowDebug = "Enable Shadows";
public static string kShadowDebugMode = "Shadow Debug Mode";
public static string kShadowSelectionDebug = "Use Selection";
public static string kShadowMapIndexDebug = "Shadow Map Index";
public static string kShadowAtlasIndexDebug = "Shadow Atlas Index";
public static string kShadowMinValueDebug = "Shadow Range Min Value";
public static string kShadowMaxValueDebug = "Shadow Range Max Value";
public static string kLightingDebugMode = "Lighting Debug Mode";
public static string k_PanelDisplayStats = "Display Stats";
public static string k_PanelMaterials = "Material";
public static string k_PanelLighting = "Lighting";
public static string k_PanelRendering = "Rendering";
public static string kOverrideAlbedoDebug = "Override Albedo";
public static string kOverrideAlbedoValueDebug = "Override Albedo Value";
public static string kOverrideSmoothnessDebug = "Override Smoothness";
public static string kOverrideSmoothnessValueDebug = "Override Smoothness Value";
public static string kOverrideNormalDebug = "Override normal";
public static string kDebugEnvironmentProxyDepthScale = "Debug Environment Proxy Depth Scale";
public static string kFullScreenDebugMode = "Fullscreen Debug Mode";
public static string kFullScreenDebugMip = "Fullscreen Debug Mip";
public static string kDisplaySkyReflectionDebug = "Display Sky Reflection";
public static string kSkyReflectionMipmapDebug = "Sky Reflection Mipmap";
public static string kTileClusterCategoryDebug = "Tile/Cluster Debug By Category";
public static string kTileClusterDebug = "Tile/Cluster Debug";
public static string kMipMapDebugMode = "Mip Map Debug Mode";
DebugUI.Widget[] m_DebugDisplayStatsItems;
DebugUI.Widget[] m_DebugMaterialItems;
DebugUI.Widget[] m_DebugLightingItems;
DebugUI.Widget[] m_DebugRenderingItems;
public float debugOverlayRatio = 0.33f;
public FullScreenDebugMode fullScreenDebugMode = FullScreenDebugMode.None;

materialDebugSettings.SetDebugViewEngine(value);
}
public void SetDebugViewVarying(Attributes.DebugViewVarying value)
public void SetDebugViewVarying(DebugViewVarying value)
{
if (value != 0)
DisableNonMaterialDebugSettings();

public void SetDebugViewProperties(Attributes.DebugViewProperties value)
public void SetDebugViewProperties(DebugViewProperties value)
{
if (value != 0)
DisableNonMaterialDebugSettings();

// Texture.SetStreamingTextureMaterialDebugProperties();
}
public void RegisterDebug()
void RegisterDisplayStatsDebug()
{
m_DebugDisplayStatsItems = new DebugUI.Widget[]
{
new DebugUI.Value { displayName = "Frame Rate", getter = () => 1f / Time.smoothDeltaTime, refreshRate = 1f / 30f },
new DebugUI.Value { displayName = "Frame Rate (ms)", getter = () => Time.smoothDeltaTime * 1000f, refreshRate = 1f / 30f }
};
var panel = DebugManager.instance.GetPanel(k_PanelDisplayStats, true);
panel.flags = DebugUI.Flags.RuntimeOnly;
panel.children.Add(m_DebugDisplayStatsItems);
}
public void RegisterMaterialDebug()
DebugMenuManager.instance.AddDebugItem<float>("Display Stats", "Frame Rate", () => 1.0f / Time.smoothDeltaTime, null, DebugItemFlag.DynamicDisplay);
DebugMenuManager.instance.AddDebugItem<float>("Display Stats", "Frame Time (ms)", () => Time.smoothDeltaTime * 1000.0f, null, DebugItemFlag.DynamicDisplay);
m_DebugMaterialItems = new DebugUI.Widget[]
{
new DebugUI.EnumField { displayName = "Material", getter = () => materialDebugSettings.debugViewMaterial, setter = value => SetDebugViewMaterial(value), enumNames = MaterialDebugSettings.debugViewMaterialStrings, enumValues = MaterialDebugSettings.debugViewMaterialValues },
new DebugUI.EnumField { displayName = "Engine", getter = () => materialDebugSettings.debugViewEngine, setter = value => SetDebugViewEngine(value), enumNames = MaterialDebugSettings.debugViewEngineStrings, enumValues = MaterialDebugSettings.debugViewEngineValues },
new DebugUI.EnumField { displayName = "Attributes", getter = () => (int)materialDebugSettings.debugViewVarying, setter = value => SetDebugViewVarying((DebugViewVarying)value), autoEnum = typeof(DebugViewVarying) },
new DebugUI.EnumField { displayName = "Properties", getter = () => (int)materialDebugSettings.debugViewProperties, setter = value => SetDebugViewProperties((DebugViewProperties)value), autoEnum = typeof(DebugViewProperties) },
new DebugUI.EnumField { displayName = "GBuffer", getter = () => materialDebugSettings.debugViewGBuffer, setter = value => SetDebugViewGBuffer(value), enumNames = MaterialDebugSettings.debugViewMaterialGBufferStrings, enumValues = MaterialDebugSettings.debugViewMaterialGBufferValues }
};
var panel = DebugManager.instance.GetPanel(k_PanelMaterials, true);
panel.children.Add(m_DebugMaterialItems);
}
// For now we just rebuild the lighting panel if needed, but ultimately it could be done in a better way
void RefreshLightingDebug<T>(DebugUI.Field<T> field, T value)
{
UnregisterDebugItems(k_PanelLighting, m_DebugLightingItems);
RegisterLightingDebug();
}
public void RegisterLightingDebug()
{
var list = new List<DebugUI.Widget>();
list.Add(new DebugUI.EnumField
{
displayName = "Shadow Debug Mode",
getter = () => (int)lightingDebugSettings.shadowDebugMode,
setter = value => lightingDebugSettings.shadowDebugMode = (ShadowMapDebugMode)value,
autoEnum = typeof(ShadowMapDebugMode),
onValueChanged = RefreshLightingDebug
});
if (lightingDebugSettings.shadowDebugMode == ShadowMapDebugMode.VisualizeShadowMap)
{
var container = new DebugUI.Container();
container.children.Add(new DebugUI.BoolField { displayName = "Use Selection", getter = () => lightingDebugSettings.shadowDebugUseSelection, setter = value => lightingDebugSettings.shadowDebugUseSelection = value, flags = DebugUI.Flags.EditorOnly, onValueChanged = RefreshLightingDebug });
DebugMenuManager.instance.AddDebugItem<int>("Material", "Material",() => materialDebugSettings.debugViewMaterial, (value) => SetDebugViewMaterial((int)value), DebugItemFlag.None, new DebugItemHandlerIntEnum(MaterialDebugSettings.debugViewMaterialStrings, MaterialDebugSettings.debugViewMaterialValues));
DebugMenuManager.instance.AddDebugItem<int>("Material", "Engine",() => materialDebugSettings.debugViewEngine, (value) => SetDebugViewEngine((int)value), DebugItemFlag.None, new DebugItemHandlerIntEnum(MaterialDebugSettings.debugViewEngineStrings, MaterialDebugSettings.debugViewEngineValues));
DebugMenuManager.instance.AddDebugItem<Attributes.DebugViewVarying>("Material", "Attributes",() => materialDebugSettings.debugViewVarying, (value) => SetDebugViewVarying((Attributes.DebugViewVarying)value));
DebugMenuManager.instance.AddDebugItem<Attributes.DebugViewProperties>("Material", "Properties", () => materialDebugSettings.debugViewProperties, (value) => SetDebugViewProperties((Attributes.DebugViewProperties)value));
DebugMenuManager.instance.AddDebugItem<int>("Material", "GBuffer",() => materialDebugSettings.debugViewGBuffer, (value) => SetDebugViewGBuffer((int)value), DebugItemFlag.None, new DebugItemHandlerIntEnum(MaterialDebugSettings.debugViewMaterialGBufferStrings, MaterialDebugSettings.debugViewMaterialGBufferValues));
if (!lightingDebugSettings.shadowDebugUseSelection)
container.children.Add(new DebugUI.UIntField { displayName = "Shadow Map Index", getter = () => lightingDebugSettings.shadowMapIndex, setter = value => lightingDebugSettings.shadowMapIndex = value, min = () => 0u, max = () => (uint)(RenderPipelineManager.currentPipeline as HDRenderPipeline).GetCurrentShadowCount() - 1u });
DebugMenuManager.instance.AddDebugItem<LightingDebugPanel, ShadowMapDebugMode>(kShadowDebugMode, () => lightingDebugSettings.shadowDebugMode, (value) => lightingDebugSettings.shadowDebugMode = (ShadowMapDebugMode)value);
DebugMenuManager.instance.AddDebugItem<LightingDebugPanel, bool>(kShadowSelectionDebug, () => lightingDebugSettings.shadowDebugUseSelection, (value) => lightingDebugSettings.shadowDebugUseSelection = (bool)value, DebugItemFlag.EditorOnly);
DebugMenuManager.instance.AddDebugItem<LightingDebugPanel, uint>(kShadowMapIndexDebug, () => lightingDebugSettings.shadowMapIndex, (value) => lightingDebugSettings.shadowMapIndex = (uint)value, DebugItemFlag.None, new DebugItemHandlerShadowIndex(1));
DebugMenuManager.instance.AddDebugItem<LightingDebugPanel, uint>(kShadowAtlasIndexDebug, () => lightingDebugSettings.shadowAtlasIndex, (value) => lightingDebugSettings.shadowAtlasIndex = (uint)value, DebugItemFlag.None, new DebugItemHandlerShadowAtlasIndex(1));
DebugMenuManager.instance.AddDebugItem<LightingDebugPanel, float>(kShadowMinValueDebug, () => lightingDebugSettings.shadowMinValue, (value) => lightingDebugSettings.shadowMinValue = (float)value);
DebugMenuManager.instance.AddDebugItem<LightingDebugPanel, float>(kShadowMaxValueDebug, () => lightingDebugSettings.shadowMaxValue, (value) => lightingDebugSettings.shadowMaxValue = (float)value);
DebugMenuManager.instance.AddDebugItem<LightingDebugPanel, int>(kFullScreenDebugMode, () => (int)fullScreenDebugMode, (value) => fullScreenDebugMode = (FullScreenDebugMode)value, DebugItemFlag.None, new DebugItemHandlerIntEnum(DebugDisplaySettings.lightingFullScreenDebugStrings, DebugDisplaySettings.lightingFullScreenDebugValues));
DebugMenuManager.instance.AddDebugItem<LightingDebugPanel, uint>(
kFullScreenDebugMip,
() =>
list.Add(container);
}
else if (lightingDebugSettings.shadowDebugMode == ShadowMapDebugMode.VisualizeAtlas)
{
list.Add(new DebugUI.Container
var id = 0;
switch (fullScreenDebugMode)
children =
default:
case FullScreenDebugMode.DepthPyramid:
id = HDShaderIDs._DepthPyramidMipSize;
break;
case FullScreenDebugMode.FinalColorPyramid:
case FullScreenDebugMode.PreRefractionColorPyramid:
id = HDShaderIDs._GaussianPyramidColorMipSize;
break;
new DebugUI.UIntField { displayName = "Shadow Atlas Index", getter = () => lightingDebugSettings.shadowMapIndex, setter = value => lightingDebugSettings.shadowAtlasIndex = value, min = () => 0u, max = () => (uint)(RenderPipelineManager.currentPipeline as HDRenderPipeline).GetShadowAtlasCount() - 1u }
var size = Shader.GetGlobalVector(id);
var lodCount = size.z;
return (uint)(fullscreenDebugMip * lodCount);
});
}
list.Add(new DebugUI.FloatField { displayName = "Shadow Range Min Value", getter = () => lightingDebugSettings.shadowMinValue, setter = value => lightingDebugSettings.shadowMinValue = value });
list.Add(new DebugUI.FloatField { displayName = "Shadow Range Max Value", getter = () => lightingDebugSettings.shadowMaxValue, setter = value => lightingDebugSettings.shadowMaxValue = value });
},
value =>
list.Add(new DebugUI.EnumField { displayName = "Lighting Debug Mode", getter = () => (int)lightingDebugSettings.debugLightingMode, setter = value => SetDebugLightingMode((DebugLightingMode)value), autoEnum = typeof(DebugLightingMode), onValueChanged = RefreshLightingDebug });
if (lightingDebugSettings.debugLightingMode == DebugLightingMode.EnvironmentProxyVolume)
{
list.Add(new DebugUI.Container
var id = 0;
switch (fullScreenDebugMode)
children =
default:
case FullScreenDebugMode.DepthPyramid:
id = HDShaderIDs._DepthPyramidMipSize;
break;
case FullScreenDebugMode.FinalColorPyramid:
case FullScreenDebugMode.PreRefractionColorPyramid:
id = HDShaderIDs._GaussianPyramidColorMipSize;
break;
new DebugUI.FloatField { displayName = "Debug Environment Proxy Depth Scale", getter = () => lightingDebugSettings.environmentProxyDepthScale, setter = value => lightingDebugSettings.environmentProxyDepthScale = value, min = () => 0.1f, max = () => 50f }
var size = Shader.GetGlobalVector(id);
var lodCount = size.z;
fullscreenDebugMip = (float)Convert.ChangeType(value, typeof(Single)) / lodCount;
},
DebugItemFlag.None,
new DebugItemHandlerUIntMinMax(() => 0,
() =>
});
}
list.Add(new DebugUI.EnumField { displayName = "Fullscreen Debug Mode", getter = () => (int)fullScreenDebugMode, setter = value => fullScreenDebugMode = (FullScreenDebugMode)value, enumNames = lightingFullScreenDebugStrings, enumValues = lightingFullScreenDebugValues, onValueChanged = RefreshLightingDebug });
switch (fullScreenDebugMode)
{
case FullScreenDebugMode.PreRefractionColorPyramid:
case FullScreenDebugMode.FinalColorPyramid:
case FullScreenDebugMode.DepthPyramid:
{
list.Add(new DebugUI.Container
var id = 0;
switch (fullScreenDebugMode)
children =
default:
case FullScreenDebugMode.DepthPyramid:
id = HDShaderIDs._DepthPyramidMipSize;
break;
case FullScreenDebugMode.FinalColorPyramid:
case FullScreenDebugMode.PreRefractionColorPyramid:
id = HDShaderIDs._GaussianPyramidColorMipSize;
break;
new DebugUI.UIntField
{
displayName = "Fullscreen Debug Mip",
getter = () =>
{
int id;
switch (fullScreenDebugMode)
{
case FullScreenDebugMode.FinalColorPyramid:
case FullScreenDebugMode.PreRefractionColorPyramid:
id = HDShaderIDs._GaussianPyramidColorMipSize;
break;
default:
id = HDShaderIDs._DepthPyramidMipSize;
break;
}
var size = Shader.GetGlobalVector(id);
float lodCount = size.z;
return (uint)(fullscreenDebugMip * lodCount);
},
setter = value =>
{
int id;
switch (fullScreenDebugMode)
{
case FullScreenDebugMode.FinalColorPyramid:
case FullScreenDebugMode.PreRefractionColorPyramid:
id = HDShaderIDs._GaussianPyramidColorMipSize;
break;
default:
id = HDShaderIDs._DepthPyramidMipSize;
break;
}
var size = Shader.GetGlobalVector(id);
float lodCount = size.z;
fullscreenDebugMip = (float)Convert.ChangeType(value, typeof(float)) / lodCount;
},
min = () => 0u,
max = () =>
{
int id;
switch (fullScreenDebugMode)
{
case FullScreenDebugMode.FinalColorPyramid:
case FullScreenDebugMode.PreRefractionColorPyramid:
id = HDShaderIDs._GaussianPyramidColorMipSize;
break;
default:
id = HDShaderIDs._DepthPyramidMipSize;
break;
}
var size = Shader.GetGlobalVector(id);
float lodCount = size.z;
return (uint)lodCount;
}
}
var size = Shader.GetGlobalVector(id);
var lodCount = size.z;
return (uint)lodCount;
})
);
DebugMenuManager.instance.AddDebugItem<LightingDebugPanel, DebugLightingMode>(kLightingDebugMode, () => lightingDebugSettings.debugLightingMode, (value) => SetDebugLightingMode((DebugLightingMode)value));
DebugMenuManager.instance.AddDebugItem<LightingDebugPanel, bool>(kOverrideSmoothnessDebug, () => lightingDebugSettings.overrideSmoothness, (value) => lightingDebugSettings.overrideSmoothness = (bool)value);
DebugMenuManager.instance.AddDebugItem<LightingDebugPanel, float>(kOverrideSmoothnessValueDebug, () => lightingDebugSettings.overrideSmoothnessValue, (value) => lightingDebugSettings.overrideSmoothnessValue = (float)value, DebugItemFlag.None, new DebugItemHandlerFloatMinMax(0.0f, 1.0f));
DebugMenuManager.instance.AddDebugItem<LightingDebugPanel, bool>(kOverrideAlbedoDebug, () => lightingDebugSettings.overrideAlbedo, (value) => lightingDebugSettings.overrideAlbedo = (bool)value);
DebugMenuManager.instance.AddDebugItem<LightingDebugPanel, Color>(kOverrideAlbedoValueDebug, () => lightingDebugSettings.overrideAlbedoValue, (value) => lightingDebugSettings.overrideAlbedoValue = (Color)value);
DebugMenuManager.instance.AddDebugItem<LightingDebugPanel, bool>(kOverrideNormalDebug, () => lightingDebugSettings.overrideNormal, (value) => lightingDebugSettings.overrideNormal = (bool)value);
DebugMenuManager.instance.AddDebugItem<bool>("Lighting", kDisplaySkyReflectionDebug, () => lightingDebugSettings.displaySkyReflection, (value) => lightingDebugSettings.displaySkyReflection = (bool)value);
DebugMenuManager.instance.AddDebugItem<LightingDebugPanel, float>(kSkyReflectionMipmapDebug, () => lightingDebugSettings.skyReflectionMipmap, (value) => lightingDebugSettings.skyReflectionMipmap = (float)value, DebugItemFlag.None, new DebugItemHandlerFloatMinMax(0.0f, 1.0f));
DebugMenuManager.instance.AddDebugItem<LightingDebugPanel, LightLoop.TileClusterDebug>(kTileClusterDebug,() => lightingDebugSettings.tileClusterDebug, (value) => lightingDebugSettings.tileClusterDebug = (LightLoop.TileClusterDebug)value);
DebugMenuManager.instance.AddDebugItem<LightingDebugPanel, LightLoop.TileClusterCategoryDebug>(kTileClusterCategoryDebug,() => lightingDebugSettings.tileClusterDebugByCategory, (value) => lightingDebugSettings.tileClusterDebugByCategory = (LightLoop.TileClusterCategoryDebug)value);
});
break;
}
default:
fullscreenDebugMip = 0;
break;
}
DebugMenuManager.instance.AddDebugItem<LightingDebugPanel, float>(kDebugEnvironmentProxyDepthScale, () => lightingDebugSettings.environmentProxyDepthScale, value => lightingDebugSettings.environmentProxyDepthScale = (float)value, DebugItemFlag.None, new DebugItemHandlerFloatMinMax(0.1f, 50f));
list.Add(new DebugUI.BoolField { displayName = "Override Smoothness", getter = () => lightingDebugSettings.overrideSmoothness, setter = value => lightingDebugSettings.overrideSmoothness = value, onValueChanged = RefreshLightingDebug });
if (lightingDebugSettings.overrideSmoothness)
{
list.Add(new DebugUI.Container
{
children =
{
new DebugUI.FloatField { displayName = "Smoothness", getter = () => lightingDebugSettings.overrideSmoothnessValue, setter = value => lightingDebugSettings.overrideSmoothnessValue = value, min = () => 0f, max = () => 1f, incStep = 0.025f }
}
});
}
DebugMenuManager.instance.AddDebugItem<int>("Rendering", kFullScreenDebugMode, () => (int)fullScreenDebugMode, (value) => fullScreenDebugMode = (FullScreenDebugMode)value, DebugItemFlag.None, new DebugItemHandlerIntEnum(DebugDisplaySettings.renderingFullScreenDebugStrings, DebugDisplaySettings.renderingFullScreenDebugValues));
DebugMenuManager.instance.AddDebugItem<DebugMipMapMode>("Rendering", "MipMaps", () => mipMapDebugSettings.debugMipMapMode, (value) => SetMipMapMode((DebugMipMapMode)value));
list.Add(new DebugUI.BoolField { displayName = "Override Albedo", getter = () => lightingDebugSettings.overrideAlbedo, setter = value => lightingDebugSettings.overrideAlbedo = value, onValueChanged = RefreshLightingDebug });
if (lightingDebugSettings.overrideAlbedo)
{
list.Add(new DebugUI.Container
{
children =
{
new DebugUI.ColorField { displayName = "Albedo", getter = () => lightingDebugSettings.overrideAlbedoValue, setter = value => lightingDebugSettings.overrideAlbedoValue = value, showAlpha = false, hdr = false }
}
});
}
DebugMenuManager.instance.AddDebugItem<ColorPickerDebugMode>("Rendering", ColorPickerDebugSettings.kColorPickerDebugMode, () => (int)colorPickerDebugSettings.colorPickerMode, (value) => colorPickerDebugSettings.colorPickerMode = (ColorPickerDebugMode)value);
DebugMenuManager.instance.AddDebugItem<float>("Rendering", ColorPickerDebugSettings.kColorPickerThreshold0Debug, () => colorPickerDebugSettings.colorThreshold0, (value) => colorPickerDebugSettings.colorThreshold0 = (float)value);
DebugMenuManager.instance.AddDebugItem<float>("Rendering", ColorPickerDebugSettings.kColorPickerThreshold1Debug, () => colorPickerDebugSettings.colorThreshold1, (value) => colorPickerDebugSettings.colorThreshold1 = (float)value);
DebugMenuManager.instance.AddDebugItem<float>("Rendering", ColorPickerDebugSettings.kColorPickerThreshold2Debug, () => colorPickerDebugSettings.colorThreshold2, (value) => colorPickerDebugSettings.colorThreshold2 = (float)value);
DebugMenuManager.instance.AddDebugItem<float>("Rendering", ColorPickerDebugSettings.kColorPickerThreshold3Debug, () => colorPickerDebugSettings.colorThreshold3, (value) => colorPickerDebugSettings.colorThreshold3 = (float)value);
DebugMenuManager.instance.AddDebugItem<Color>("Rendering", ColorPickerDebugSettings.kColorPickerFontColor, () => colorPickerDebugSettings.fontColor, (value) => colorPickerDebugSettings.fontColor = (Color)value);
list.Add(new DebugUI.BoolField { displayName = "Override Normal", getter = () => lightingDebugSettings.overrideNormal, setter = value => lightingDebugSettings.overrideNormal = value });
list.Add(new DebugUI.EnumField { displayName = "Tile/Cluster Debug", getter = () => (int)lightingDebugSettings.tileClusterDebug, setter = value => lightingDebugSettings.tileClusterDebug = (LightLoop.TileClusterDebug)value, autoEnum = typeof(LightLoop.TileClusterDebug), onValueChanged = RefreshLightingDebug });
if (lightingDebugSettings.tileClusterDebug != LightLoop.TileClusterDebug.None && lightingDebugSettings.tileClusterDebug != LightLoop.TileClusterDebug.MaterialFeatureVariants)
{
list.Add(new DebugUI.Container
{
children =
{
new DebugUI.EnumField { displayName = "Tile/Cluster Debug By Category", getter = () => (int)lightingDebugSettings.tileClusterDebugByCategory, setter = value => lightingDebugSettings.tileClusterDebugByCategory = (LightLoop.TileClusterCategoryDebug)value, autoEnum = typeof(LightLoop.TileClusterCategoryDebug) }
}
});
}
list.Add(new DebugUI.BoolField { displayName = "Display Sky Reflection", getter = () => lightingDebugSettings.displaySkyReflection, setter = value => lightingDebugSettings.displaySkyReflection = value, onValueChanged = RefreshLightingDebug });
if (lightingDebugSettings.displaySkyReflection)
{
list.Add(new DebugUI.Container
{
children =
{
new DebugUI.FloatField { displayName = "Sky Reflection Mipmap", getter = () => lightingDebugSettings.skyReflectionMipmap, setter = value => lightingDebugSettings.skyReflectionMipmap = value, min = () => 0f, max = () => 1f, incStep = 0.05f }
}
});
}
m_DebugLightingItems = list.ToArray();
var panel = DebugManager.instance.GetPanel(k_PanelLighting, true);
panel.children.Add(m_DebugLightingItems);
public void OnValidate()
public void RegisterRenderingDebug()
lightingDebugSettings.OnValidate();
m_DebugRenderingItems = new DebugUI.Widget[]
{
new DebugUI.EnumField { displayName = "Fullscreen Debug Mode", getter = () => (int)fullScreenDebugMode, setter = value => fullScreenDebugMode = (FullScreenDebugMode)value, enumNames = renderingFullScreenDebugStrings, enumValues = renderingFullScreenDebugValues },
new DebugUI.EnumField { displayName = "MipMaps", getter = () => (int)mipMapDebugSettings.debugMipMapMode, setter = value => SetMipMapMode((DebugMipMapMode)value), autoEnum = typeof(DebugMipMapMode) },
new DebugUI.Container
{
displayName = "Color Picker",
flags = DebugUI.Flags.EditorOnly,
children =
{
new DebugUI.EnumField { displayName = "Debug Mode", getter = () => (int)colorPickerDebugSettings.colorPickerMode, setter = value => colorPickerDebugSettings.colorPickerMode = (ColorPickerDebugMode)value, autoEnum = typeof(ColorPickerDebugMode) },
new DebugUI.FloatField { displayName = "Range Threshold 0", getter = () => colorPickerDebugSettings.colorThreshold0, setter = value => colorPickerDebugSettings.colorThreshold0 = value },
new DebugUI.FloatField { displayName = "Range Threshold 1", getter = () => colorPickerDebugSettings.colorThreshold1, setter = value => colorPickerDebugSettings.colorThreshold1 = value },
new DebugUI.FloatField { displayName = "Range Threshold 2", getter = () => colorPickerDebugSettings.colorThreshold2, setter = value => colorPickerDebugSettings.colorThreshold2 = value },
new DebugUI.FloatField { displayName = "Range Threshold 3", getter = () => colorPickerDebugSettings.colorThreshold3, setter = value => colorPickerDebugSettings.colorThreshold3 = value },
new DebugUI.ColorField { displayName = "Font Color", flags = DebugUI.Flags.EditorOnly, getter = () => colorPickerDebugSettings.fontColor, setter = value => colorPickerDebugSettings.fontColor = value }
}
}
};
var panel = DebugManager.instance.GetPanel(k_PanelRendering, true);
panel.children.Add(m_DebugRenderingItems);
}
public void RegisterDebug()
{
RegisterDisplayStatsDebug();
RegisterMaterialDebug();
RegisterLightingDebug();
RegisterRenderingDebug();
}
public void UnregisterDebug()
{
UnregisterDebugItems(k_PanelDisplayStats, m_DebugDisplayStatsItems);
UnregisterDebugItems(k_PanelMaterials, m_DebugMaterialItems);
UnregisterDebugItems(k_PanelLighting, m_DebugLightingItems);
UnregisterDebugItems(k_PanelRendering, m_DebugLightingItems);
}
void UnregisterDebugItems(string panelName, DebugUI.Widget[] items)
{
var panel = DebugManager.instance.GetPanel(panelName);
if (panel != null)
panel.children.Remove(items);
}
void FillFullScreenDebugEnum(ref GUIContent[] strings, ref int[] values, FullScreenDebugMode min, FullScreenDebugMode max)

10
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/LightingDebug.cs


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

public LightLoop.TileClusterDebug tileClusterDebug = LightLoop.TileClusterDebug.None;
public LightLoop.TileClusterCategoryDebug tileClusterDebugByCategory = LightLoop.TileClusterCategoryDebug.Punctual;
public void OnValidate()
{
overrideSmoothnessValue = Mathf.Clamp(overrideSmoothnessValue, 0.0f, 1.0f);
skyReflectionMipmap = Mathf.Clamp(skyReflectionMipmap, 0.0f, 1.0f);
}
}
}

658
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/MaterialDebug.cs


using System.Collections.Generic;
using UnityEngine;
using System;
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
namespace Attributes
{
// 0 is reserved!
[GenerateHLSL]
public enum DebugViewVarying
{
None = 0,
Texcoord0 = 1,
Texcoord1,
Texcoord2,
Texcoord3,
VertexTangentWS,
VertexBitangentWS,
VertexNormalWS,
VertexColor,
VertexColorAlpha,
Last,
};
// Number must be contiguous
[GenerateHLSL]
public enum DebugViewGbuffer
{
None = 0,
Depth = DebugViewVarying.Last,
BakeDiffuseLightingWithAlbedoPlusEmissive,
BakeShadowMask0,
BakeShadowMask1,
BakeShadowMask2,
BakeShadowMask3,
Last,
}
// Number must be contiguous
[GenerateHLSL]
public enum DebugViewProperties
{
None = 0,
Tessellation = DebugViewGbuffer.Last,
PixelDisplacement,
VertexDisplacement,
TessellationDisplacement,
DepthOffset,
Lightmap,
Instancing,
Last,
}
}
[Serializable]
public class MaterialDebugSettings
{
private static bool isDebugViewMaterialInit = false;
public static GUIContent[] debugViewMaterialStrings = null;
public static int[] debugViewMaterialValues = null;
public static GUIContent[] debugViewEngineStrings = null;
public static int[] debugViewEngineValues = null;
public static GUIContent[] debugViewMaterialVaryingStrings = null;
public static int[] debugViewMaterialVaryingValues = null;
public static GUIContent[] debugViewMaterialPropertiesStrings = null;
public static int[] debugViewMaterialPropertiesValues = null;
public static GUIContent[] debugViewMaterialTextureStrings = null;
public static int[] debugViewMaterialTextureValues = null;
public static GUIContent[] debugViewMaterialGBufferStrings = null;
public static int[] debugViewMaterialGBufferValues = null;
public MaterialDebugSettings()
{
BuildDebugRepresentation();
}
// className include the additional "/"
void FillWithProperties(Type type, ref List<GUIContent> debugViewMaterialStringsList, ref List<int> debugViewMaterialValuesList, string className)
{
var attributes = type.GetCustomAttributes(true);
// Get attribute to get the start number of the value for the enum
var attr = attributes[0] as GenerateHLSL;
if (!attr.needParamDebug)
{
return;
}
var fields = type.GetFields();
var localIndex = 0;
foreach (var field in fields)
{
// Note: One field can have multiple name. This is to allow to have different debug view mode for the same field
// like for example display normal in world space or in view space. Same field but two different modes.
List<String> displayNames = new List<string>();
displayNames.Add(field.Name);
// Check if the display name have been override by the users
if (Attribute.IsDefined(field, typeof(SurfaceDataAttributes)))
{
var propertyAttr = (SurfaceDataAttributes[])field.GetCustomAttributes(typeof(SurfaceDataAttributes), false);
if (propertyAttr[0].displayNames.Length > 0 && propertyAttr[0].displayNames[0] != "")
{
displayNames.Clear();
displayNames.AddRange(propertyAttr[0].displayNames);
}
}
foreach (string fieldName in displayNames)
{
debugViewMaterialStringsList.Add(new GUIContent(className + fieldName));
debugViewMaterialValuesList.Add(attr.paramDefinesStart + (int)localIndex);
localIndex++;
}
}
}
void FillWithPropertiesEnum(Type type, ref List<GUIContent> debugViewMaterialStringsList, ref List<int> debugViewMaterialValuesList, string prefix)
{
var names = Enum.GetNames(type);
var localIndex = 0;
foreach (var value in Enum.GetValues(type))
{
var valueName = prefix + names[localIndex];
debugViewMaterialStringsList.Add(new GUIContent(valueName));
debugViewMaterialValuesList.Add((int)value);
localIndex++;
}
}
public class MaterialItem
{
public String className;
public Type surfaceDataType;
public Type bsdfDataType;
};
void BuildDebugRepresentation()
{
if (!isDebugViewMaterialInit)
{
List<RenderPipelineMaterial> materialList = HDUtils.GetRenderPipelineMaterialList();
// TODO: Share this code to retrieve deferred material with HDRenderPipeline
// Find first material that have non 0 Gbuffer count and assign it as deferredMaterial
Type bsdfDataDeferredType = null;
foreach (RenderPipelineMaterial material in materialList)
{
if (material.GetMaterialGBufferCount() > 0)
{
bsdfDataDeferredType = material.GetType().GetNestedType("BSDFData");
}
}
// TODO: Handle the case of no Gbuffer material
Debug.Assert(bsdfDataDeferredType != null);
List<MaterialItem> materialItems = new List<MaterialItem>();
int numSurfaceDataFields = 0;
int numBSDFDataFields = 0;
foreach (RenderPipelineMaterial material in materialList)
{
MaterialItem item = new MaterialItem();
item.className = material.GetType().Name + "/";
item.surfaceDataType = material.GetType().GetNestedType("SurfaceData");
numSurfaceDataFields += item.surfaceDataType.GetFields().Length;
item.bsdfDataType = material.GetType().GetNestedType("BSDFData");
numBSDFDataFields += item.bsdfDataType.GetFields().Length;
materialItems.Add(item);
}
// Init list
List<GUIContent> debugViewMaterialStringsList = new List<GUIContent>();
List<int> debugViewMaterialValuesList = new List<int>();
List<GUIContent> debugViewEngineStringsList = new List<GUIContent>();
List<int> debugViewEngineValuesList = new List<int>();
List<GUIContent> debugViewMaterialVaryingStringsList = new List<GUIContent>();
List<int> debugViewMaterialVaryingValuesList = new List<int>();
List<GUIContent> debugViewMaterialPropertiesStringsList = new List<GUIContent>();
List<int> debugViewMaterialPropertiesValuesList = new List<int>();
List<GUIContent> debugViewMaterialTextureStringsList = new List<GUIContent>();
List<int> debugViewMaterialTextureValuesList = new List<int>();
List<GUIContent> debugViewMaterialGBufferStringsList = new List<GUIContent>();
List<int> debugViewMaterialGBufferValuesList = new List<int>();
// First element is a reserved location and should not be used (allow to track error)
// Special case for None since it cannot be inferred from SurfaceData/BuiltinData
debugViewMaterialStringsList.Add(new GUIContent("None"));
debugViewMaterialValuesList.Add(0);
foreach (MaterialItem item in materialItems)
{
// BuiltinData are duplicated for each material
FillWithProperties(typeof(Builtin.BuiltinData), ref debugViewMaterialStringsList, ref debugViewMaterialValuesList, item.className);
FillWithProperties(item.surfaceDataType, ref debugViewMaterialStringsList, ref debugViewMaterialValuesList, item.className);
}
// Engine properties debug
// First element is a reserved location and should not be used (allow to track error)
// Special case for None since it cannot be inferred from SurfaceData/BuiltinData
debugViewEngineStringsList.Add(new GUIContent("None"));
debugViewEngineValuesList.Add(0);
foreach (MaterialItem item in materialItems)
{
FillWithProperties(item.bsdfDataType, ref debugViewEngineStringsList, ref debugViewEngineValuesList, item.className);
}
// For the following, no need to reserve the 0 case as it is handled in the Enum
// Attributes debug
FillWithPropertiesEnum(typeof(Attributes.DebugViewVarying), ref debugViewMaterialVaryingStringsList, ref debugViewMaterialVaryingValuesList, "");
// Properties debug
FillWithPropertiesEnum(typeof(Attributes.DebugViewProperties), ref debugViewMaterialPropertiesStringsList, ref debugViewMaterialPropertiesValuesList, "");
// Gbuffer debug
FillWithPropertiesEnum(typeof(Attributes.DebugViewGbuffer), ref debugViewMaterialGBufferStringsList, ref debugViewMaterialGBufferValuesList, "");
FillWithProperties(typeof(Lit.BSDFData), ref debugViewMaterialGBufferStringsList, ref debugViewMaterialGBufferValuesList, "");
// Convert to array for UI
debugViewMaterialStrings = debugViewMaterialStringsList.ToArray();
debugViewMaterialValues = debugViewMaterialValuesList.ToArray();
debugViewEngineStrings = debugViewEngineStringsList.ToArray();
debugViewEngineValues = debugViewEngineValuesList.ToArray();
debugViewMaterialVaryingStrings = debugViewMaterialVaryingStringsList.ToArray();
debugViewMaterialVaryingValues = debugViewMaterialVaryingValuesList.ToArray();
debugViewMaterialPropertiesStrings = debugViewMaterialPropertiesStringsList.ToArray();
debugViewMaterialPropertiesValues = debugViewMaterialPropertiesValuesList.ToArray();
debugViewMaterialTextureStrings = debugViewMaterialTextureStringsList.ToArray();
debugViewMaterialTextureValues = debugViewMaterialTextureValuesList.ToArray();
debugViewMaterialGBufferStrings = debugViewMaterialGBufferStringsList.ToArray();
debugViewMaterialGBufferValues = debugViewMaterialGBufferValuesList.ToArray();
isDebugViewMaterialInit = true;
}
}
public int debugViewMaterial { get { return m_DebugViewMaterial; } }
public int debugViewEngine { get { return m_DebugViewEngine; } }
public Attributes.DebugViewVarying debugViewVarying { get { return m_DebugViewVarying; } }
public Attributes.DebugViewProperties debugViewProperties { get { return m_DebugViewProperties; } }
public int debugViewGBuffer { get { return m_DebugViewGBuffer; } }
int m_DebugViewMaterial = 0; // No enum there because everything is generated from materials.
int m_DebugViewEngine = 0; // No enum there because everything is generated from BSDFData
Attributes.DebugViewVarying m_DebugViewVarying = Attributes.DebugViewVarying.None;
Attributes.DebugViewProperties m_DebugViewProperties = Attributes.DebugViewProperties.None;
int m_DebugViewGBuffer = 0; // Can't use GBuffer enum here because the values are actually split between this enum and values from Lit.BSDFData
public int GetDebugMaterialIndex()
{
// This value is used in the shader for the actual debug display.
// There is only one uniform parameter for that so we just add all of them
// They are all mutually exclusive so return the sum will return the right index.
return m_DebugViewGBuffer + m_DebugViewMaterial + m_DebugViewEngine + (int)m_DebugViewVarying + (int)m_DebugViewProperties;
}
public void DisableMaterialDebug()
{
m_DebugViewMaterial = 0;
m_DebugViewEngine = 0;
m_DebugViewVarying = Attributes.DebugViewVarying.None;
m_DebugViewProperties = Attributes.DebugViewProperties.None;
m_DebugViewGBuffer = 0;
}
public void SetDebugViewMaterial(int value)
{
if (value != 0)
DisableMaterialDebug();
m_DebugViewMaterial = value;
}
public void SetDebugViewEngine(int value)
{
if (value != 0)
DisableMaterialDebug();
m_DebugViewEngine = value;
}
public void SetDebugViewVarying(Attributes.DebugViewVarying value)
{
if (value != 0)
DisableMaterialDebug();
m_DebugViewVarying = value;
}
public void SetDebugViewProperties(Attributes.DebugViewProperties value)
{
if (value != 0)
DisableMaterialDebug();
m_DebugViewProperties = value;
}
public void SetDebugViewGBuffer(int value)
{
if (value != 0)
DisableMaterialDebug();
m_DebugViewGBuffer = value;
}
public bool IsDebugGBufferEnabled()
{
return m_DebugViewGBuffer != 0;
}
public bool IsDebugDisplayEnabled()
{
return (m_DebugViewEngine != 0 || m_DebugViewMaterial != 0 || m_DebugViewVarying != Attributes.DebugViewVarying.None || m_DebugViewProperties != Attributes.DebugViewProperties.None || m_DebugViewGBuffer != 0);
}
}
}
using System.Collections.Generic;
using System;
using UnityEngine.Experimental.Rendering.HDPipeline.Attributes;
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
namespace Attributes
{
// 0 is reserved!
[GenerateHLSL]
public enum DebugViewVarying
{
None = 0,
Texcoord0 = 1,
Texcoord1,
Texcoord2,
Texcoord3,
VertexTangentWS,
VertexBitangentWS,
VertexNormalWS,
VertexColor,
VertexColorAlpha,
Last,
};
// Number must be contiguous
[GenerateHLSL]
public enum DebugViewGbuffer
{
None = 0,
Depth = DebugViewVarying.Last,
BakeDiffuseLightingWithAlbedoPlusEmissive,
BakeShadowMask0,
BakeShadowMask1,
BakeShadowMask2,
BakeShadowMask3,
Last,
}
// Number must be contiguous
[GenerateHLSL]
public enum DebugViewProperties
{
None = 0,
Tessellation = DebugViewGbuffer.Last,
PixelDisplacement,
VertexDisplacement,
TessellationDisplacement,
DepthOffset,
Lightmap,
Instancing,
Last,
}
}
[Serializable]
public class MaterialDebugSettings
{
static bool isDebugViewMaterialInit = false;
public static GUIContent[] debugViewMaterialStrings = null;
public static int[] debugViewMaterialValues = null;
public static GUIContent[] debugViewEngineStrings = null;
public static int[] debugViewEngineValues = null;
public static GUIContent[] debugViewMaterialVaryingStrings = null;
public static int[] debugViewMaterialVaryingValues = null;
public static GUIContent[] debugViewMaterialPropertiesStrings = null;
public static int[] debugViewMaterialPropertiesValues = null;
public static GUIContent[] debugViewMaterialTextureStrings = null;
public static int[] debugViewMaterialTextureValues = null;
public static GUIContent[] debugViewMaterialGBufferStrings = null;
public static int[] debugViewMaterialGBufferValues = null;
public MaterialDebugSettings()
{
BuildDebugRepresentation();
}
// className include the additional "/"
void FillWithProperties(Type type, ref List<GUIContent> debugViewMaterialStringsList, ref List<int> debugViewMaterialValuesList, string className)
{
var attributes = type.GetCustomAttributes(true);
// Get attribute to get the start number of the value for the enum
var attr = attributes[0] as GenerateHLSL;
if (!attr.needParamDebug)
{
return;
}
var fields = type.GetFields();
var localIndex = 0;
foreach (var field in fields)
{
// Note: One field can have multiple name. This is to allow to have different debug view mode for the same field
// like for example display normal in world space or in view space. Same field but two different modes.
List<String> displayNames = new List<string>();
displayNames.Add(field.Name);
// Check if the display name have been override by the users
if (Attribute.IsDefined(field, typeof(SurfaceDataAttributes)))
{
var propertyAttr = (SurfaceDataAttributes[])field.GetCustomAttributes(typeof(SurfaceDataAttributes), false);
if (propertyAttr[0].displayNames.Length > 0 && propertyAttr[0].displayNames[0] != "")
{
displayNames.Clear();
displayNames.AddRange(propertyAttr[0].displayNames);
}
}
foreach (string fieldName in displayNames)
{
debugViewMaterialStringsList.Add(new GUIContent(className + fieldName));
debugViewMaterialValuesList.Add(attr.paramDefinesStart + (int)localIndex);
localIndex++;
}
}
}
void FillWithPropertiesEnum(Type type, ref List<GUIContent> debugViewMaterialStringsList, ref List<int> debugViewMaterialValuesList, string prefix)
{
var names = Enum.GetNames(type);
var localIndex = 0;
foreach (var value in Enum.GetValues(type))
{
var valueName = prefix + names[localIndex];
debugViewMaterialStringsList.Add(new GUIContent(valueName));
debugViewMaterialValuesList.Add((int)value);
localIndex++;
}
}
public class MaterialItem
{
public String className;
public Type surfaceDataType;
public Type bsdfDataType;
};
void BuildDebugRepresentation()
{
if (!isDebugViewMaterialInit)
{
List<RenderPipelineMaterial> materialList = HDUtils.GetRenderPipelineMaterialList();
// TODO: Share this code to retrieve deferred material with HDRenderPipeline
// Find first material that have non 0 Gbuffer count and assign it as deferredMaterial
Type bsdfDataDeferredType = null;
foreach (RenderPipelineMaterial material in materialList)
{
if (material.GetMaterialGBufferCount() > 0)
{
bsdfDataDeferredType = material.GetType().GetNestedType("BSDFData");
}
}
// TODO: Handle the case of no Gbuffer material
Debug.Assert(bsdfDataDeferredType != null);
List<MaterialItem> materialItems = new List<MaterialItem>();
int numSurfaceDataFields = 0;
int numBSDFDataFields = 0;
foreach (RenderPipelineMaterial material in materialList)
{
MaterialItem item = new MaterialItem();
item.className = material.GetType().Name + "/";
item.surfaceDataType = material.GetType().GetNestedType("SurfaceData");
numSurfaceDataFields += item.surfaceDataType.GetFields().Length;
item.bsdfDataType = material.GetType().GetNestedType("BSDFData");
numBSDFDataFields += item.bsdfDataType.GetFields().Length;
materialItems.Add(item);
}
// Init list
List<GUIContent> debugViewMaterialStringsList = new List<GUIContent>();
List<int> debugViewMaterialValuesList = new List<int>();
List<GUIContent> debugViewEngineStringsList = new List<GUIContent>();
List<int> debugViewEngineValuesList = new List<int>();
List<GUIContent> debugViewMaterialVaryingStringsList = new List<GUIContent>();
List<int> debugViewMaterialVaryingValuesList = new List<int>();
List<GUIContent> debugViewMaterialPropertiesStringsList = new List<GUIContent>();
List<int> debugViewMaterialPropertiesValuesList = new List<int>();
List<GUIContent> debugViewMaterialTextureStringsList = new List<GUIContent>();
List<int> debugViewMaterialTextureValuesList = new List<int>();
List<GUIContent> debugViewMaterialGBufferStringsList = new List<GUIContent>();
List<int> debugViewMaterialGBufferValuesList = new List<int>();
// First element is a reserved location and should not be used (allow to track error)
// Special case for None since it cannot be inferred from SurfaceData/BuiltinData
debugViewMaterialStringsList.Add(new GUIContent("None"));
debugViewMaterialValuesList.Add(0);
foreach (MaterialItem item in materialItems)
{
// BuiltinData are duplicated for each material
FillWithProperties(typeof(Builtin.BuiltinData), ref debugViewMaterialStringsList, ref debugViewMaterialValuesList, item.className);
FillWithProperties(item.surfaceDataType, ref debugViewMaterialStringsList, ref debugViewMaterialValuesList, item.className);
}
// Engine properties debug
// First element is a reserved location and should not be used (allow to track error)
// Special case for None since it cannot be inferred from SurfaceData/BuiltinData
debugViewEngineStringsList.Add(new GUIContent("None"));
debugViewEngineValuesList.Add(0);
foreach (MaterialItem item in materialItems)
{
FillWithProperties(item.bsdfDataType, ref debugViewEngineStringsList, ref debugViewEngineValuesList, item.className);
}
// For the following, no need to reserve the 0 case as it is handled in the Enum
// Attributes debug
FillWithPropertiesEnum(typeof(DebugViewVarying), ref debugViewMaterialVaryingStringsList, ref debugViewMaterialVaryingValuesList, "");
// Properties debug
FillWithPropertiesEnum(typeof(DebugViewProperties), ref debugViewMaterialPropertiesStringsList, ref debugViewMaterialPropertiesValuesList, "");
// Gbuffer debug
FillWithPropertiesEnum(typeof(DebugViewGbuffer), ref debugViewMaterialGBufferStringsList, ref debugViewMaterialGBufferValuesList, "");
FillWithProperties(typeof(Lit.BSDFData), ref debugViewMaterialGBufferStringsList, ref debugViewMaterialGBufferValuesList, "");
// Convert to array for UI
debugViewMaterialStrings = debugViewMaterialStringsList.ToArray();
debugViewMaterialValues = debugViewMaterialValuesList.ToArray();
debugViewEngineStrings = debugViewEngineStringsList.ToArray();
debugViewEngineValues = debugViewEngineValuesList.ToArray();
debugViewMaterialVaryingStrings = debugViewMaterialVaryingStringsList.ToArray();
debugViewMaterialVaryingValues = debugViewMaterialVaryingValuesList.ToArray();
debugViewMaterialPropertiesStrings = debugViewMaterialPropertiesStringsList.ToArray();
debugViewMaterialPropertiesValues = debugViewMaterialPropertiesValuesList.ToArray();
debugViewMaterialTextureStrings = debugViewMaterialTextureStringsList.ToArray();
debugViewMaterialTextureValues = debugViewMaterialTextureValuesList.ToArray();
debugViewMaterialGBufferStrings = debugViewMaterialGBufferStringsList.ToArray();
debugViewMaterialGBufferValues = debugViewMaterialGBufferValuesList.ToArray();
isDebugViewMaterialInit = true;
}
}
public int debugViewMaterial { get { return m_DebugViewMaterial; } }
public int debugViewEngine { get { return m_DebugViewEngine; } }
public DebugViewVarying debugViewVarying { get { return m_DebugViewVarying; } }
public DebugViewProperties debugViewProperties { get { return m_DebugViewProperties; } }
public int debugViewGBuffer { get { return m_DebugViewGBuffer; } }
int m_DebugViewMaterial = 0; // No enum there because everything is generated from materials.
int m_DebugViewEngine = 0; // No enum there because everything is generated from BSDFData
DebugViewVarying m_DebugViewVarying = DebugViewVarying.None;
DebugViewProperties m_DebugViewProperties = DebugViewProperties.None;
int m_DebugViewGBuffer = 0; // Can't use GBuffer enum here because the values are actually split between this enum and values from Lit.BSDFData
public int GetDebugMaterialIndex()
{
// This value is used in the shader for the actual debug display.
// There is only one uniform parameter for that so we just add all of them
// They are all mutually exclusive so return the sum will return the right index.
return m_DebugViewGBuffer + m_DebugViewMaterial + m_DebugViewEngine + (int)m_DebugViewVarying + (int)m_DebugViewProperties;
}
public void DisableMaterialDebug()
{
m_DebugViewMaterial = 0;
m_DebugViewEngine = 0;
m_DebugViewVarying = DebugViewVarying.None;
m_DebugViewProperties = DebugViewProperties.None;
m_DebugViewGBuffer = 0;
}
public void SetDebugViewMaterial(int value)
{
if (value != 0)
DisableMaterialDebug();
m_DebugViewMaterial = value;
}
public void SetDebugViewEngine(int value)
{
if (value != 0)
DisableMaterialDebug();
m_DebugViewEngine = value;
}
public void SetDebugViewVarying(DebugViewVarying value)
{
if (value != 0)
DisableMaterialDebug();
m_DebugViewVarying = value;
}
public void SetDebugViewProperties(DebugViewProperties value)
{
if (value != 0)
DisableMaterialDebug();
m_DebugViewProperties = value;
}
public void SetDebugViewGBuffer(int value)
{
if (value != 0)
DisableMaterialDebug();
m_DebugViewGBuffer = value;
}
public bool IsDebugGBufferEnabled()
{
return m_DebugViewGBuffer != 0;
}
public bool IsDebugDisplayEnabled()
{
return (m_DebugViewEngine != 0 || m_DebugViewMaterial != 0 || m_DebugViewVarying != DebugViewVarying.None || m_DebugViewProperties != DebugViewProperties.None || m_DebugViewGBuffer != 0);
}
}
}

371
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Decal/DecalSystem.cs


}
private const int kDefaultDrawDistance = 1000;
static public int DrawDistance
public int DrawDistance
{
get
{

}
}
private static readonly int m_NormalToWorldID = Shader.PropertyToID("normalToWorld");
public TextureCache2D TextureAtlas
{
get
{
if (m_DecalAtlas == null)
{
m_DecalAtlas = new TextureCache2D();
m_DecalAtlas.AllocTextureArray(2048, 128, 128, TextureFormat.RGBA32, true);
}
return m_DecalAtlas;
}
}
public Camera CurrentCamera
{
get
{
return m_Camera;
}
set
{
m_Camera = value;
}
}
private static MaterialPropertyBlock m_PropertyBlock = new MaterialPropertyBlock();
private const int kDecalBlockSize = 128;

static Vector4 kMax = new Vector4( 0.5f, 0.0f, 0.5f, 1.0f);
static public Mesh m_DecalMesh = null;
static public Matrix4x4[] m_InstanceMatrices = new Matrix4x4[kDrawIndexedBatchSize];
static public Matrix4x4[] m_InstanceNormalToWorld = new Matrix4x4[kDrawIndexedBatchSize];
// clustered draw data
static public DecalData[] m_DecalDatas = new DecalData[kDecalBlockSize];
static public SFiniteLightBound[] m_Bounds = new SFiniteLightBound[kDecalBlockSize];
static public LightVolumeData[] m_LightVolumes = new LightVolumeData[kDecalBlockSize];
static public int m_DecalDatasCount = 0;
private TextureCache2D m_DecalAtlas = null;
// current camera
private Camera m_Camera;
static public int m_DecalsVisibleThisFrame = 0;
private void InitializeMaterialValues()
{
m_DiffuseTexture = m_Material.GetTexture("_BaseColorMap");
m_NormalTexture = m_Material.GetTexture("_NormalMap");
m_MaskTexture = m_Material.GetTexture("_MaskMap");
m_Blend = m_Material.GetFloat("_DecalBlend");
}
public DecalSet(Material material)
{
m_Material = material;
InitializeMaterialValues();
}
private BoundingSphere GetDecalProjectBoundingSphere(Matrix4x4 decalToWorld)
{
Vector4 min = new Vector4();

BoundingSphere res = new BoundingSphere();
res.position = (max + min) / 2;
res.radius = ((Vector3)(max - min)).magnitude / 2;
res.radius = ((Vector3) (max - min)).magnitude / 2;
m_CachedTransforms[decal.CullIndex] = decal.transform.localToWorldMatrix;
m_CachedDecalToWorld[decal.CullIndex] = decal.transform.localToWorldMatrix;
float y0 = decalRotation.m01;
float y1 = decalRotation.m11;
float y2 = decalRotation.m21;
decalRotation.m01 = decalRotation.m02;
decalRotation.m11 = decalRotation.m12;
decalRotation.m21 = decalRotation.m22;
decalRotation.m02 = y0;
decalRotation.m12 = y1;
decalRotation.m22 = y2;
float y0 = decalRotation.m01;
float y1 = decalRotation.m11;
float y2 = decalRotation.m21;
decalRotation.m01 = decalRotation.m02;
decalRotation.m11 = decalRotation.m12;
decalRotation.m21 = decalRotation.m22;
decalRotation.m02 = y0;
decalRotation.m12 = y1;
decalRotation.m22 = y2;
// draw distance can't be more than global draw distance
m_CachedDrawDistances[decal.CullIndex].x = decal.m_DrawDistance < DrawDistance ? decal.m_DrawDistance : DrawDistance;
// draw distance can't be more than global draw distance
m_CachedDrawDistances[decal.CullIndex].x = decal.m_DrawDistance < instance.DrawDistance
? decal.m_DrawDistance
: instance.DrawDistance;
m_BoundingSpheres[decal.CullIndex] = GetDecalProjectBoundingSphere(m_CachedTransforms[decal.CullIndex]);
m_BoundingSpheres[decal.CullIndex] = GetDecalProjectBoundingSphere(m_CachedDecalToWorld[decal.CullIndex]);
}
public void AddDecal(DecalProjectorComponent decal)

m_Decals.CopyTo(newDecals, 0);
m_BoundingSpheres.CopyTo(newSpheres, 0);
m_CachedTransforms.CopyTo(newCachedTransforms, 0);
m_CachedDecalToWorld.CopyTo(newCachedTransforms, 0);
m_CachedDrawDistances.CopyTo(newCachedDrawDistances, 0);
m_CachedDrawDistances.CopyTo(newCachedDrawDistances, 0);
m_CachedTransforms = newCachedTransforms;
m_CachedDecalToWorld = newCachedTransforms;
m_CachedDrawDistances = newCachedDrawDistances;
m_CachedDrawDistances = newCachedDrawDistances;
}
m_Decals[m_DecalsCount] = decal;

// update the bounding spheres array
m_BoundingSpheres[removeAtIndex] = m_BoundingSpheres[m_DecalsCount - 1];
m_CachedTransforms[removeAtIndex] = m_CachedTransforms[m_DecalsCount - 1];
m_CachedDecalToWorld[removeAtIndex] = m_CachedDecalToWorld[m_DecalsCount - 1];
m_CachedDrawDistances[removeAtIndex] = m_CachedDrawDistances[m_DecalsCount - 1];
m_CachedDrawDistances[removeAtIndex] = m_CachedDrawDistances[m_DecalsCount - 1];
public void BeginCull(Camera camera)
public void BeginCull()
{
if (m_CullingGroup != null)
{

// let the culling group code do some of the heavy lifting for global draw distance
m_BoundingDistances[0] = DrawDistance;
// let the culling group code do some of the heavy lifting for global draw distance
m_BoundingDistances[0] = DecalSystem.instance.DrawDistance;
m_CullingGroup.targetCamera = camera;
m_CullingGroup.SetDistanceReferencePoint(camera.transform.position);
m_CullingGroup.SetBoundingDistances(m_BoundingDistances);
m_CullingGroup.targetCamera = instance.CurrentCamera;
m_CullingGroup.SetDistanceReferencePoint( m_CullingGroup.targetCamera.transform.position);
m_CullingGroup.SetBoundingDistances(m_BoundingDistances);
m_CullingGroup.SetBoundingSpheres(m_BoundingSpheres);
m_CullingGroup.SetBoundingSphereCount(m_DecalsCount);
}

return m_NumResults;
}
private void GetDecalVolumeDataAndBound(Matrix4x4 decalToWorld, Matrix4x4 worldToView)
{
var influenceX = decalToWorld.GetColumn(0) * 0.5f;
var influenceY = decalToWorld.GetColumn(1) * 0.5f;
var influenceZ = decalToWorld.GetColumn(2) * 0.5f;
var pos = decalToWorld.GetColumn(3) - influenceY; // decal cube mesh pivot is at 0,0,0, with bottom face at -1 on the y plane
Vector3 influenceExtents = new Vector3();
influenceExtents.x = influenceX.magnitude;
influenceExtents.y = influenceY.magnitude;
influenceExtents.z = influenceZ.magnitude;
// transform to camera space (becomes a left hand coordinate frame in Unity since Determinant(worldToView)<0)
var influenceRightVS = worldToView.MultiplyVector(influenceX / influenceExtents.x);
var influenceUpVS = worldToView.MultiplyVector(influenceY / influenceExtents.y);
var influenceForwardVS = worldToView.MultiplyVector(influenceZ / influenceExtents.z);
var influencePositionVS = worldToView.MultiplyPoint(pos); // place the mesh pivot in the center
m_Bounds[m_DecalDatasCount].center = influencePositionVS;
m_Bounds[m_DecalDatasCount].boxAxisX = influenceRightVS * influenceExtents.x;
m_Bounds[m_DecalDatasCount].boxAxisY = influenceUpVS * influenceExtents.y;
m_Bounds[m_DecalDatasCount].boxAxisZ = influenceForwardVS * influenceExtents.z;
m_Bounds[m_DecalDatasCount].scaleXY.Set(1.0f, 1.0f);
m_Bounds[m_DecalDatasCount].radius = influenceExtents.magnitude;
// The culling system culls pixels that are further
// than a threshold to the box influence extents.
// So we use an arbitrary threshold here (k_BoxCullingExtentOffset)
m_LightVolumes[m_DecalDatasCount].lightCategory = (uint)LightCategory.Decal;
m_LightVolumes[m_DecalDatasCount].lightVolume = (uint)LightVolumeType.Box;
m_LightVolumes[m_DecalDatasCount].featureFlags = (uint)LightFeatureFlags.Env;
m_LightVolumes[m_DecalDatasCount].lightPos = influencePositionVS;
m_LightVolumes[m_DecalDatasCount].lightAxisX = influenceRightVS;
m_LightVolumes[m_DecalDatasCount].lightAxisY = influenceUpVS;
m_LightVolumes[m_DecalDatasCount].lightAxisZ = influenceForwardVS;
m_LightVolumes[m_DecalDatasCount].boxInnerDist = influenceExtents - LightLoop.k_BoxCullingExtentThreshold;
m_LightVolumes[m_DecalDatasCount].boxInvRange.Set(1.0f / LightLoop.k_BoxCullingExtentThreshold.x, 1.0f /LightLoop. k_BoxCullingExtentThreshold.y, 1.0f / LightLoop.k_BoxCullingExtentThreshold.z);
}
private void AssignCurrentBatches(ref Matrix4x4[] decalToWorldBatch, ref Matrix4x4[] normalToWorldBatch, int batchCount)
{
if (m_DecalToWorld.Count == batchCount)
{
decalToWorldBatch = new Matrix4x4[kDrawIndexedBatchSize];
m_DecalToWorld.Add(decalToWorldBatch);
normalToWorldBatch = new Matrix4x4[kDrawIndexedBatchSize];
m_NormalToWorld.Add(normalToWorldBatch);
}
else
{
decalToWorldBatch = m_DecalToWorld[batchCount];
normalToWorldBatch = m_NormalToWorld[batchCount];
}
}
public void CreateDrawData()
{
if (m_NumResults == 0)
return;
int instanceCount = 0;
int batchCount = 0;
Matrix4x4[] decalToWorldBatch = null;
Matrix4x4[] normalToWorldBatch = null;
AssignCurrentBatches(ref decalToWorldBatch, ref normalToWorldBatch, batchCount);
Vector3 cameraPos = instance.CurrentCamera.transform.position;
Matrix4x4 worldToView = LightLoop.WorldToCamera(instance.CurrentCamera);
for (int resultIndex = 0; resultIndex < m_NumResults; resultIndex++)
{
int decalIndex = m_ResultIndices[resultIndex];
// do additional culling based on individual decal draw distances
float distanceToDecal = (cameraPos - m_BoundingSpheres[decalIndex].position).magnitude;
float cullDistance = m_CachedDrawDistances[decalIndex].x + m_BoundingSpheres[decalIndex].radius;
if (distanceToDecal < cullDistance)
{
// d-buffer data
decalToWorldBatch[instanceCount] = m_CachedDecalToWorld[decalIndex];
normalToWorldBatch[instanceCount] = m_CachedNormalToWorld[decalIndex];
float fadeFactor = Mathf.Clamp((cullDistance - distanceToDecal) / (cullDistance * (1.0f - m_CachedDrawDistances[decalIndex].y)), 0.0f, 1.0f);
normalToWorldBatch[instanceCount].m03 = fadeFactor * m_Blend; // vector3 rotation matrix so bottom row and last column can be used for other data to save space
normalToWorldBatch[instanceCount].m13 = m_DiffuseTexIndex; // texture atlas indices needed for clustered
normalToWorldBatch[instanceCount].m23 = m_NormalTexIndex;
normalToWorldBatch[instanceCount].m33 = m_MaskTexIndex;
// clustered forward data
m_DecalDatas[m_DecalDatasCount].worldToDecal = decalToWorldBatch[instanceCount].inverse;
m_DecalDatas[m_DecalDatasCount].normalToWorld = normalToWorldBatch[instanceCount];
GetDecalVolumeDataAndBound(decalToWorldBatch[instanceCount], worldToView);
m_DecalDatasCount++;
instanceCount++;
if (instanceCount == kDrawIndexedBatchSize)
{
instanceCount = 0;
batchCount++;
AssignCurrentBatches(ref decalToWorldBatch, ref normalToWorldBatch, batchCount);
}
}
}
}
public void EndCull()
{
if (m_CullingGroup == null)

}
}
public void Render(ScriptableRenderContext renderContext, HDCamera camera, CommandBuffer cmd)
void UpdateTextureCache(CommandBuffer cmd)
{
if (m_DiffuseTexture != null)
{
m_DiffuseTexIndex = instance.TextureAtlas.FetchSlice(cmd, m_DiffuseTexture);
}
else
{
m_DiffuseTexIndex = -1;
}
if (m_NormalTexture != null)
{
m_NormalTexIndex = instance.TextureAtlas.FetchSlice(cmd, m_NormalTexture);
}
else
{
m_NormalTexIndex = -1;
}
if (m_MaskTexture != null)
{
m_MaskTexIndex = instance.TextureAtlas.FetchSlice(cmd, m_MaskTexture);
}
else
{
m_MaskTexIndex = -1;
}
}
public void RemoveFromTextureCache()
int instanceCount = 0;
Vector3 cameraPos = camera.cameraPos;
for (int resultIndex = 0; resultIndex < m_NumResults; resultIndex++)
if (m_DiffuseTexture != null)
int decalIndex = m_ResultIndices[resultIndex];
// do additional culling based on individual decal draw distances
float distanceToDecal = (cameraPos - m_BoundingSpheres[decalIndex].position).magnitude;
float cullDistance = m_CachedDrawDistances[decalIndex].x + m_BoundingSpheres[decalIndex].radius;
if (distanceToDecal < cullDistance)
{
m_InstanceMatrices[instanceCount] = m_CachedTransforms[decalIndex];
m_InstanceNormalToWorld[instanceCount] = m_CachedNormalToWorld[decalIndex];
float fadeFactor = (cullDistance - distanceToDecal) / (cullDistance * (1.0f - m_CachedDrawDistances[decalIndex].y));
m_InstanceNormalToWorld[instanceCount].m03 = fadeFactor; // rotation only matrix so 3rd column can be used to pass some values
instanceCount++;
if (instanceCount == kDrawIndexedBatchSize)
{
m_PropertyBlock.SetMatrixArray(m_NormalToWorldID, m_InstanceNormalToWorld);
cmd.DrawMeshInstanced(m_DecalMesh, 0, KeyMaterial, 0, m_InstanceMatrices, kDrawIndexedBatchSize, m_PropertyBlock);
instanceCount = 0;
}
}
instance.TextureAtlas.RemoveEntryFromSlice(m_DiffuseTexture);
}
if (m_NormalTexture != null)
{
instance.TextureAtlas.RemoveEntryFromSlice(m_NormalTexture);
if (instanceCount > 0)
if (m_MaskTexture != null)
m_PropertyBlock.SetMatrixArray(m_NormalToWorldID, m_InstanceNormalToWorld);
cmd.DrawMeshInstanced(m_DecalMesh, 0, KeyMaterial, 0, m_InstanceMatrices, instanceCount, m_PropertyBlock);
instance.TextureAtlas.RemoveEntryFromSlice(m_MaskTexture);
public void UpdateCachedMaterialData(CommandBuffer cmd)
{
InitializeMaterialValues(); // refresh in case they changed in the UI
UpdateTextureCache(cmd);
}
public void RenderIntoDBuffer(CommandBuffer cmd)
{
if(m_NumResults == 0)
return;
int batchIndex = 0;
int totalToDraw = m_NumResults;
for (; batchIndex < m_NumResults / kDrawIndexedBatchSize; batchIndex++)
{
m_PropertyBlock.SetMatrixArray(HDShaderIDs._NormalToWorldID, m_NormalToWorld[batchIndex]);
cmd.DrawMeshInstanced(m_DecalMesh, 0, KeyMaterial, 0, m_DecalToWorld[batchIndex], kDrawIndexedBatchSize, m_PropertyBlock);
totalToDraw -= kDrawIndexedBatchSize;
}
if(totalToDraw > 0)
{
m_PropertyBlock.SetMatrixArray(HDShaderIDs._NormalToWorldID, m_NormalToWorld[batchIndex]);
cmd.DrawMeshInstanced(m_DecalMesh, 0, KeyMaterial, 0, m_DecalToWorld[batchIndex], totalToDraw, m_PropertyBlock);
}
}
public Material KeyMaterial
{
get

set
{
this.m_Material = value;
}
}
public int Count

}
}
private List<Matrix4x4[]> m_DecalToWorld = new List<Matrix4x4[]>();
private List<Matrix4x4[]> m_NormalToWorld = new List<Matrix4x4[]>();
private CullingGroup m_CullingGroup = null;
private BoundingSphere[] m_BoundingSpheres = new BoundingSphere[kDecalBlockSize];
private DecalProjectorComponent[] m_Decals = new DecalProjectorComponent[kDecalBlockSize];

private Matrix4x4[] m_CachedTransforms = new Matrix4x4[kDecalBlockSize];
private Matrix4x4[] m_CachedDecalToWorld = new Matrix4x4[kDecalBlockSize];
private Texture m_DiffuseTexture = null;
private Texture m_NormalTexture = null;
private Texture m_MaskTexture = null;
private float m_Blend = 0;
private int m_DiffuseTexIndex = -1;
private int m_NormalTexIndex = -1;
private int m_MaskTexIndex = -1;
}
public void AddDecal(DecalProjectorComponent decal)

int key = decal.m_Material.GetInstanceID();
if (!m_DecalSets.TryGetValue(key, out decalSet))
{
decalSet = new DecalSet();
decalSet.KeyMaterial = decal.m_Material;
decalSet = new DecalSet(decal.m_Material);
m_DecalSets.Add(key, decalSet);
}
decalSet.AddDecal(decal);

decalSet.RemoveDecal(decal);
if (decalSet.Count == 0)
{
decalSet.RemoveFromTextureCache();
m_DecalSets.Remove(key);
}
}

}
}
public void BeginCull(Camera camera)
public void BeginCull()
pair.Value.BeginCull(camera);
pair.Value.BeginCull();
public int QueryCullResults()
private int QueryCullResults()
{
int totalVisibleDecals = 0;
foreach (var pair in m_DecalSets)

public void EndCull()
{
m_DecalsVisibleThisFrame = QueryCullResults();
foreach (var pair in m_DecalSets)
{
pair.Value.EndCull();

public void Render(ScriptableRenderContext renderContext, HDCamera camera, CommandBuffer cmd)
// need a better way than passing light loop here
public void RenderIntoDBuffer(CommandBuffer cmd)
{
if (m_DecalMesh == null)
m_DecalMesh = CoreUtils.CreateCubeMesh(kMin, kMax);

pair.Value.Render(renderContext, camera, cmd);
pair.Value.RenderIntoDBuffer(cmd);
}
public void SetAtlas(CommandBuffer cmd)
{
cmd.SetGlobalTexture(HDShaderIDs._DecalAtlasID, TextureAtlas.GetTexCache());
}
// updates textures, texture atlas indices and blend value
public void UpdateCachedMaterialData(CommandBuffer cmd)
{
foreach (var pair in m_DecalSets)
{
pair.Value.UpdateCachedMaterialData(cmd);
}
}
public void CreateDrawData()
{
m_DecalDatasCount = 0;
// reallocate if needed
if (m_DecalsVisibleThisFrame > m_DecalDatas.Length)
{
int newDecalDatasSize = ((m_DecalsVisibleThisFrame + kDecalBlockSize - 1) / kDecalBlockSize) * kDecalBlockSize;
m_DecalDatas = new DecalData[newDecalDatasSize];
m_Bounds = new SFiniteLightBound[newDecalDatasSize];
m_LightVolumes = new LightVolumeData[newDecalDatasSize];
}
foreach (var pair in m_DecalSets)
{
pair.Value.CreateDrawData();
}
}
}
}

12
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/HDAssetFactory.cs


newAsset.deferredShader = Load<Shader>(HDRenderPipelinePath + "Lighting/Deferred.Shader");
newAsset.gaussianPyramidCS = Load<ComputeShader>(HDRenderPipelinePath + "RenderPipelineResources/ColorPyramid.compute");
newAsset.depthPyramidCS = Load<ComputeShader>(HDRenderPipelinePath + "RenderPipelineResources/DepthPyramid.compute");
newAsset.copyChannelCS = Load<ComputeShader>(CorePath + "Resources/GPUCopy.compute");
newAsset.copyChannelCS = Load<ComputeShader>(CorePath + "CoreResources/GPUCopy.compute");
newAsset.applyDistortionCS = Load<ComputeShader>(HDRenderPipelinePath + "RenderPipelineResources/ApplyDistorsion.compute");
newAsset.clearDispatchIndirectShader = Load<ComputeShader>(HDRenderPipelinePath + "Lighting/LightLoop/cleardispatchindirect.compute");

newAsset.GGXConvolve = Load<Shader>(HDRenderPipelinePath + "Material/GGXConvolution/GGXConvolve.shader");
newAsset.opaqueAtmosphericScattering = Load<Shader>(HDRenderPipelinePath + "Sky/OpaqueAtmosphericScattering.shader");
newAsset.encodeBC6HCS = Load<ComputeShader>(CorePath + "Resources/EncodeBC6H.compute");
// Utilities / Core
newAsset.encodeBC6HCS = Load<ComputeShader>(CorePath + "CoreResources/EncodeBC6H.compute");
newAsset.cubeToPanoShader = Load<Shader>(CorePath + "CoreResources/CubeToPano.shader");
newAsset.blitCubeTextureFace = Load<Shader>(CorePath + "CoreResources/BlitCubeTextureFace.shader");
// Shadow
newAsset.shadowClearShader = Load<Shader>(CorePath + "Shadow/ShadowClear.shader");
newAsset.shadowBlurMoments = Load<ComputeShader>(CorePath + "Shadow/ShadowBlurMoments.compute");
newAsset.debugShadowMapShader = Load<Shader>(CorePath + "Shadow/DebugDisplayShadowMap.shader");
AssetDatabase.CreateAsset(newAsset, pathName);
ProjectWindowUtil.ShowCreatedAsset(newAsset);

20
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/HDLightEditor.Styles.cs


public readonly GUIContent contactShadowSampleCount = new GUIContent("Sample Count", "Number of samples when ray casting.");
// Bias control
public readonly GUIContent viewBiasMin = new GUIContent("view Bias");
public readonly GUIContent viewBiasMax = new GUIContent("view Bias Max");
public readonly GUIContent viewBiasScale = new GUIContent("view Bias Scale");
public readonly GUIContent normalBiasMin = new GUIContent("normal Bias");
public readonly GUIContent normalBiasMax = new GUIContent("normal Bias Max");
public readonly GUIContent normalBiasScale = new GUIContent("normal Bias Scale");
public readonly GUIContent sampleBiasScale = new GUIContent("sample Bias Scale");
public readonly GUIContent edgeLeakFixup = new GUIContent("edge Leak Fixup");
public readonly GUIContent edgeToleranceNormal = new GUIContent("edge Tolerance Normal");
public readonly GUIContent edgeTolerance = new GUIContent("edge Tolerance");
public readonly GUIContent viewBiasMin = new GUIContent("View Bias");
public readonly GUIContent viewBiasMax = new GUIContent("View Bias Max");
public readonly GUIContent viewBiasScale = new GUIContent("View Bias Scale");
public readonly GUIContent normalBiasMin = new GUIContent("Normal Bias");
public readonly GUIContent normalBiasMax = new GUIContent("Normal Bias Max");
public readonly GUIContent normalBiasScale = new GUIContent("Normal Bias Scale");
public readonly GUIContent sampleBiasScale = new GUIContent("Sample Bias Scale");
public readonly GUIContent edgeLeakFixup = new GUIContent("Edge Leak Fixup");
public readonly GUIContent edgeToleranceNormal = new GUIContent("Edge Tolerance Normal");
public readonly GUIContent edgeTolerance = new GUIContent("Edge Tolerance");
public Styles()
{

18
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/HDLightEditor.cs


DrawBakedShadowParameters();
// There is currently no additional settings for shadow on directional light
if (m_AdditionalLightData.showAdditionalSettings.boolValue && settings.lightType.enumValueIndex != (int)LightType.Directional)
if (m_AdditionalLightData.showAdditionalSettings.boolValue)
if (settings.lightType.enumValueIndex == (int)LightType.Point || settings.lightType.enumValueIndex == (int)LightType.Spot)
if (settings.lightType.enumValueIndex != (int)LightType.Directional)
{
EditorGUILayout.PropertyField(m_AdditionalShadowData.dimmer, s_Styles.shadowDimmer);
EditorGUILayout.PropertyField(m_AdditionalShadowData.dimmer, s_Styles.shadowDimmer);
}
EditorGUILayout.Slider(m_AdditionalShadowData.viewBiasMin, 0.0f, 5.0f, s_Styles.viewBiasMin);
//EditorGUILayout.PropertyField(m_AdditionalShadowData.viewBiasMax, s_Styles.viewBiasMax);

//EditorGUILayout.PropertyField(m_AdditionalShadowData.normalBiasScale, s_Styles.normalBiasScale);
//EditorGUILayout.PropertyField(m_AdditionalShadowData.sampleBiasScale, s_Styles.sampleBiasScale);
EditorGUILayout.PropertyField(m_AdditionalShadowData.edgeLeakFixup, s_Styles.edgeLeakFixup);
//EditorGUILayout.PropertyField(m_AdditionalShadowData.edgeToleranceNormal, s_Styles.edgeToleranceNormal);
//EditorGUILayout.PropertyField(m_AdditionalShadowData.edgeTolerance, s_Styles.edgeTolerance);
if (m_AdditionalShadowData.edgeLeakFixup.boolValue)
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(m_AdditionalShadowData.edgeToleranceNormal, s_Styles.edgeToleranceNormal);
EditorGUILayout.Slider(m_AdditionalShadowData.edgeTolerance, 0.0f, 1.0f, s_Styles.edgeTolerance);
EditorGUI.indentLevel--;
}
EditorGUI.indentLevel--;
}
}

14
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditorUtility.cs


[InitializeOnLoadMethod]
static void Initialize()
{
s_PreviewMaterial = new Material(Shader.Find("Debug/ReflectionProbePreview"))
{
hideFlags = HideFlags.HideAndDontSave
};
s_SphereMesh = Resources.GetBuiltinResource(typeof(Mesh), "New-Sphere.fbx") as Mesh;
}

var meshRenderer = p.GetComponent<MeshRenderer>() ?? p.gameObject.AddComponent<MeshRenderer>();
meshFilter.sharedMesh = s_SphereMesh;
// Lazy evaluation attempt to avoid shader compil error issue in Editor (The shader is not found the first time
// we load after deleting Library folder)
if (s_PreviewMaterial == null)
{
s_PreviewMaterial = new Material(Shader.Find("Debug/ReflectionProbePreview"))
{
hideFlags = HideFlags.HideAndDontSave
};
}
var material = meshRenderer.sharedMaterial;
if (material == null

1
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/RenderPipelineSettingsUI.cs


EditorGUILayout.PropertyField(d.supportForwardOnly, _.GetContent("Support Forward Only"));
EditorGUILayout.PropertyField(d.supportMotionVectors, _.GetContent("Support Motion Vectors"));
EditorGUILayout.PropertyField(d.supportStereo, _.GetContent("Support Stereo Rendering"));
EditorGUILayout.PropertyField(d.enableUltraQualitySSS, _.GetContent("Enable Ultra Quality SSS"));
--EditorGUI.indentLevel;
}
}

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/SerializedRenderPipelineSettings.cs


public SerializedProperty supportForwardOnly;
public SerializedProperty supportMotionVectors;
public SerializedProperty supportStereo;
public SerializedProperty enableUltraQualitySSS;
public SerializedGlobalLightLoopSettings lightLoopSettings;
public SerializedShadowInitParameters shadowInitParams;

supportForwardOnly = root.Find((RenderPipelineSettings s) => s.supportForwardOnly);
supportMotionVectors = root.Find((RenderPipelineSettings s) => s.supportMotionVectors);
supportStereo = root.Find((RenderPipelineSettings s) => s.supportStereo);
enableUltraQualitySSS = root.Find((RenderPipelineSettings s) => s.enableUltraQualitySSS);
lightLoopSettings = new SerializedGlobalLightLoopSettings(root.Find((RenderPipelineSettings s) => s.lightLoopSettings));
shadowInitParams = new SerializedShadowInitParameters(root.Find((RenderPipelineSettings s) => s.shadowInitParams));

3
ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDCustomSamplerId.cs


DepthPrepass,
TransparentDepthPrepass,
GBuffer,
DBuffer,
DBufferRender,
DBufferPrepareDrawData,
DisplayDebugViewMaterial,
DebugViewMaterialGBuffer,
BlitDebugViewMaterialDebug,

50
ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs


{
base.Dispose();
m_DebugDisplaySettings.UnregisterDebug();
m_LightLoop.Cleanup();
// For debugging

ScriptableRenderContext.EmitWorldGeometryForSceneView(camera);
}
#endif
// decal system needs to be updated with current camera
DecalSystem.instance.BeginCull(camera);
{
// decal system needs to be updated with current camera, it needs it to set up culling and light list generation parameters
DecalSystem.instance.CurrentCamera = camera;
DecalSystem.instance.BeginCull();
}
ReflectionSystem.PrepareCull(camera, m_ReflectionProbeCullResults);

m_ReflectionProbeCullResults.Cull();
m_DbufferManager.vsibleDecalCount = 0;
if (m_FrameSettings.enableDBuffer)
using (new ProfilingSample(cmd, "DBufferPrepareDrawData", CustomSamplerId.DBufferPrepareDrawData.GetSampler()))
m_DbufferManager.vsibleDecalCount = DecalSystem.instance.QueryCullResults();
DecalSystem.instance.EndCull();
if (m_FrameSettings.enableDBuffer)
{
DecalSystem.instance.EndCull();
m_DbufferManager.vsibleDecalCount = DecalSystem.m_DecalsVisibleThisFrame;
DecalSystem.instance.UpdateCachedMaterialData(cmd); // textures, alpha or fade distances could've changed
DecalSystem.instance.CreateDrawData(); // prepare data is separate from draw
}
renderContext.SetupCameraProperties(camera, m_FrameSettings.enableStereo);
PushGlobalParams(hdCamera, cmd, diffusionProfileSettings);

RenderObjectsVelocity(m_CullResults, hdCamera, renderContext, cmd);
RenderDBuffer(hdCamera, renderContext, cmd);
RenderDBuffer(hdCamera, cmd);
RenderGBuffer(m_CullResults, hdCamera, enableBakeShadowMask, renderContext, cmd);
RenderGBuffer(m_CullResults, hdCamera, enableBakeShadowMask, renderContext, cmd);
// In both forward and deferred, everything opaque should have been rendered at this point so we can safely copy the depth buffer for later processing.
CopyDepthBufferIfNeeded(cmd);

}
}
void RenderDBuffer(HDCamera camera, ScriptableRenderContext renderContext, CommandBuffer cmd)
void RenderDBuffer(HDCamera camera, CommandBuffer cmd)
using (new ProfilingSample(cmd, "DBuffer", CustomSamplerId.DBuffer.GetSampler()))
using (new ProfilingSample(cmd, "DBufferRender", CustomSamplerId.DBufferRender.GetSampler()))
{
// We need to copy depth buffer texture if we want to bind it at this stage
CopyDepthBufferIfNeeded(cmd);

HDUtils.SetRenderTarget(cmd, camera, m_DbufferManager.GetBuffersRTI(), m_CameraDepthStencilBuffer); // do not clear anymore
m_DbufferManager.SetHTile(m_DbufferManager.bufferCount, cmd);
DecalSystem.instance.Render(renderContext, camera, cmd);
DecalSystem.instance.RenderIntoDBuffer(cmd);
m_DbufferManager.SetHTileTexture(cmd);
m_DbufferManager.SetHTileTexture(cmd); // mask per 8x8 tile used for optimization when looking up dbuffer values
}
}

// In case of forward SSS we will bind all the required target. It is up to the shader to write into it or not.
if (m_FrameSettings.enableSubsurfaceScattering)
{
RenderTargetIdentifier[] m_MRTWithSSS = new RenderTargetIdentifier[2 + m_SSSBufferManager.sssBufferCount];
RenderTargetIdentifier[] m_MRTWithSSS =
new RenderTargetIdentifier[2 + m_SSSBufferManager.sssBufferCount];
m_MRTWithSSS[0] = m_CameraColorBuffer; // Store the specular color
m_MRTWithSSS[1] = m_CameraSssDiffuseLightingBuffer;
for (int i = 0; i < m_SSSBufferManager.sssBufferCount; ++i)

HDUtils.SetRenderTarget(cmd, hdCamera, m_CameraColorBuffer, m_CameraDepthStencilBuffer);
}
m_ForwardAndForwardOnlyPassNames[0] = m_ForwardOnlyPassNames[0] = HDShaderPassNames.s_ForwardOnlyName;
m_ForwardAndForwardOnlyPassNames[0] = m_ForwardOnlyPassNames[0] =
HDShaderPassNames.s_ForwardOnlyName;
var passNames = m_FrameSettings.enableForwardRenderingOnly ? m_ForwardAndForwardOnlyPassNames : m_ForwardOnlyPassNames;
var passNames = m_FrameSettings.enableForwardRenderingOnly
? m_ForwardAndForwardOnlyPassNames
: m_ForwardOnlyPassNames;
if (m_FrameSettings.enableDBuffer) // enable d-buffer flag value is being interpreted more like enable decals in general now that we have clustered
{
DecalSystem.instance.SetAtlas(cmd); // for clustered decals
}
RenderTransparentRenderList(cullResults, camera, renderContext, cmd, m_AllTransparentPassNames, m_currentRendererConfigurationBakedLighting, pass == ForwardPass.PreRefraction ? HDRenderQueue.k_RenderQueue_PreRefraction : HDRenderQueue.k_RenderQueue_Transparent);
}
}

12
ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipelineAsset.asset


--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1

supportSSR: 1
supportSSAO: 1
supportSubsurfaceScattering: 1
supportsForwardOnly: 0
supportForwardOnly: 0
supportMSAAAntiAliasing: 0
supportMSAA: 0
supportsMotionVectors: 1
supportsStereo: 0
supportMotionVectors: 1
supportStereo: 0
spotCookieSize: 128
cookieSize: 128
cookieTexArraySize: 16
pointCookieSize: 512
cubeCookieTexArraySize: 16

8
ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDStringConstants.cs


public static readonly int _SrcBlend = Shader.PropertyToID("_SrcBlend");
public static readonly int _DstBlend = Shader.PropertyToID("_DstBlend");
public static readonly int _HTile = Shader.PropertyToID("_HTile");
// all decal properties
public static readonly int _NormalToWorldID = Shader.PropertyToID("_NormalToWorld");
public static readonly int _DecalAtlasID = Shader.PropertyToID("_DecalAtlas");
public static readonly int _DecalIndexShift = Shader.PropertyToID("_DecalIndexShift");
public static readonly int _DecalCount = Shader.PropertyToID("_DecalCount");
public static readonly int _DecalDatas = Shader.PropertyToID("_DecalDatas");
public static readonly int _ViewMatrix = Shader.PropertyToID("_ViewMatrix");
public static readonly int _InvViewMatrix = Shader.PropertyToID("_InvViewMatrix");

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Light/HDAdditionalShadowData.cs


// bias control default value based on empirical experiment
shadowData.viewBiasMin = 0.2f;
shadowData.viewBiasMax = 10.0f;
shadowData.viewBiasMax = 100.0f; // Not used, high value to have no effect
shadowData.viewBiasScale = 1.0f;
shadowData.normalBiasMin = 0.5f;
shadowData.normalBiasMax = 0.5f;

63
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/LightLoop.cs


return shadowType;
}
public ShadowSetup(ShadowInitParameters shadowInit, ShadowSettings shadowSettings, out IShadowManager shadowManager)
public ShadowSetup(RenderPipelineResources resources, ShadowInitParameters shadowInit, 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 ) ) );

atlasInit.baseInit.maxPayloadCount = 0;
atlasInit.baseInit.shadowSupport = ShadowmapBase.ShadowSupport.Directional | ShadowmapBase.ShadowSupport.Point | ShadowmapBase.ShadowSupport.Spot;
atlasInit.shaderKeyword = null;
atlasInit.shadowClearShader = resources.shadowClearShader;
atlasInit.shadowBlurMoments = resources.shadowBlurMoments;
var varianceInit = atlasInit;
varianceInit.baseInit.shadowmapFormat = ShadowVariance.GetFormat( false, false, true );

Punctual,
Area,
Env,
Decal,
Count
}

Env = 1 << 15,
Sky = 1 << 16,
SSRefraction = 1 << 17,
SSReflection = 1 << 18,
SSReflection = 1 << 18
// If adding more light be sure to not overflow LightDefinitions.s_LightFeatureMaskFlags
}

Environment = 4,
EnvironmentAndPunctual = 5,
EnvironmentAndArea = 6,
EnvironmentAndAreaAndPunctual = 7
EnvironmentAndAreaAndPunctual = 7,
Decal = 8
public const int k_MaxLightsOnScreen = k_MaxDirectionalLightsOnScreen + k_MaxPunctualLightsOnScreen + k_MaxAreaLightsOnScreen;
public const int k_MaxDecalsOnScreen = 512;
public const int k_MaxLightsOnScreen = k_MaxDirectionalLightsOnScreen + k_MaxPunctualLightsOnScreen + k_MaxAreaLightsOnScreen + k_MaxDecalsOnScreen;
static readonly Vector3 k_BoxCullingExtentThreshold = Vector3.one * 0.01f;
public static readonly Vector3 k_BoxCullingExtentThreshold = Vector3.one * 0.01f;
// Static keyword is required here else we get a "DestroyBuffer can only be called from the main thread"
static ComputeBuffer s_DirectionalLightDatas = null;

static ComputeBuffer s_DecalDatas = null;
static Texture2DArray s_DefaultTexture2DArray;
static Cubemap s_DefaultTextureCube;

// Following is an array of material of size eight for all combination of keyword: OUTPUT_SPLIT_LIGHTING - LIGHTLOOP_TILE_PASS - SHADOWS_SHADOWMASK - USE_FPTL_LIGHTLIST/USE_CLUSTERED_LIGHTLIST - DEBUG_DISPLAY
Material[] m_deferredLightingMaterial;
Material m_DebugViewTilesMaterial;
Material m_DebugShadowMapMaterial;
Material m_CubeToPanoMaterial;
Light m_CurrentSunLight;
int m_CurrentSunLightShadowIndex = -1;

List<int> m_ShadowRequests = new List<int>();
Dictionary<int, int> m_ShadowIndices = new Dictionary<int, int>();
void InitShadowSystem(ShadowInitParameters initParam, ShadowSettings shadowSettings)
void InitShadowSystem(HDRenderPipelineAsset hdAsset, ShadowSettings shadowSettings)
m_ShadowSetup = new ShadowSetup(initParam, shadowSettings, out m_ShadowMgr);
m_ShadowSetup = new ShadowSetup(hdAsset.renderPipelineResources, hdAsset.GetRenderPipelineSettings().shadowInitParams, shadowSettings, out m_ShadowMgr);
}
void DeinitShadowSystem()

{
m_Resources = hdAsset.renderPipelineResources;
m_DebugViewTilesMaterial = CoreUtils.CreateEngineMaterial(m_Resources.debugViewTilesShader);
m_DebugShadowMapMaterial = CoreUtils.CreateEngineMaterial(m_Resources.debugShadowMapShader);
m_CubeToPanoMaterial = CoreUtils.CreateEngineMaterial(m_Resources.cubeToPanoShader);
m_lightList = new LightList();
m_lightList.Allocate();
m_Env2DCaptureVP.Clear();

s_LightDatas = new ComputeBuffer(k_MaxPunctualLightsOnScreen + k_MaxAreaLightsOnScreen, System.Runtime.InteropServices.Marshal.SizeOf(typeof(LightData)));
s_EnvLightDatas = new ComputeBuffer(k_MaxEnvLightsOnScreen, System.Runtime.InteropServices.Marshal.SizeOf(typeof(EnvLightData)));
s_shadowDatas = new ComputeBuffer(k_MaxCascadeCount + k_MaxShadowOnScreen, System.Runtime.InteropServices.Marshal.SizeOf(typeof(ShadowData)));
s_DecalDatas = new ComputeBuffer(k_MaxDecalsOnScreen, System.Runtime.InteropServices.Marshal.SizeOf(typeof(DecalData)));
m_CubeCookieTexArray.AllocTextureArray(gLightLoopSettings.cubeCookieTexArraySize, gLightLoopSettings.pointCookieSize, TextureFormat.RGBA32, true);
m_CubeCookieTexArray.AllocTextureArray(gLightLoopSettings.cubeCookieTexArraySize, gLightLoopSettings.pointCookieSize, TextureFormat.RGBA32, true, m_CubeToPanoMaterial);
m_ReflectionProbeCache = new ReflectionProbeCache(iblFilterGGX, gLightLoopSettings.reflectionProbeCacheSize, gLightLoopSettings.reflectionCubemapSize, probeCacheFormat, true);
m_ReflectionProbeCache = new ReflectionProbeCache(hdAsset, iblFilterGGX, gLightLoopSettings.reflectionProbeCacheSize, gLightLoopSettings.reflectionCubemapSize, probeCacheFormat, true);
m_ReflectionPlanarProbeCache = new PlanarReflectionProbeCache(iblFilterGGX, gLightLoopSettings.planarReflectionProbeCacheSize, gLightLoopSettings.planarReflectionTextureSize, planarProbeCacheFormat, true);
m_ReflectionPlanarProbeCache = new PlanarReflectionProbeCache(hdAsset, iblFilterGGX, gLightLoopSettings.planarReflectionProbeCacheSize, gLightLoopSettings.planarReflectionTextureSize, planarProbeCacheFormat, true);
s_GenAABBKernel = buildScreenAABBShader.FindKernel("ScreenBoundsAABB");

}
}
m_DebugViewTilesMaterial = CoreUtils.CreateEngineMaterial(m_Resources.debugViewTilesShader);
s_DefaultTexture2DArray = new Texture2DArray(1, 1, 1, TextureFormat.ARGB32, false);
s_DefaultTexture2DArray.SetPixels32(new Color32[1] { new Color32(128, 128, 128, 128) }, 0);
s_DefaultTexture2DArray.Apply();

InitShadowSystem(hdAsset.GetRenderPipelineSettings().shadowInitParams, shadowSettings);
InitShadowSystem(hdAsset, shadowSettings);
}
public void Cleanup()

CoreUtils.SafeRelease(s_LightDatas);
CoreUtils.SafeRelease(s_EnvLightDatas);
CoreUtils.SafeRelease(s_shadowDatas);
CoreUtils.SafeRelease(s_DecalDatas);
if (m_ReflectionProbeCache != null)
{

}
CoreUtils.Destroy(m_DebugViewTilesMaterial);
CoreUtils.Destroy(m_DebugShadowMapMaterial);
CoreUtils.Destroy(m_CubeToPanoMaterial);
}
public void NewFrame(FrameSettings frameSettings)

}
}
static Matrix4x4 WorldToCamera(Camera camera)
public static Matrix4x4 WorldToCamera(Camera camera)
{
// camera.worldToCameraMatrix is RHS and Unity's transforms are LHS
// We need to flip it to work with transforms

envLightData.proxyPositionWS = proxyToWorld.GetColumn(3);
m_lightList.envLights.Add(envLightData);
return true;
}

m_lightCount = m_lightList.lights.Count + m_lightList.envLights.Count;
Debug.Assert(m_lightList.bounds.Count == m_lightCount);
Debug.Assert(m_lightList.lightVolumes.Count == m_lightCount);
m_lightList.bounds.AddRange(DecalSystem.m_Bounds);
m_lightList.lightVolumes.AddRange(DecalSystem.m_LightVolumes);
m_lightCount += DecalSystem.m_DecalDatasCount;
// TODO: Make sure decals are taken into account in the future
Debug.Assert(m_lightList.rightEyeBounds.Count == m_lightCount);
Debug.Assert(m_lightList.rightEyeLightVolumes.Count == m_lightCount);

}
UpdateDataBuffers();
m_maxShadowDistance = shadowSettings.maxShadowDistance;

bool isOrthographic = camera.orthographic;
cmd.SetComputeIntParam(buildPerVoxelLightListShader, HDShaderIDs.g_isOrthographic, isOrthographic ? 1 : 0);
cmd.SetComputeIntParam(buildPerVoxelLightListShader, HDShaderIDs._EnvLightIndexShift, m_lightList.lights.Count);
cmd.SetComputeIntParam(buildPerVoxelLightListShader, HDShaderIDs._DecalIndexShift, m_lightList.lights.Count + m_lightList.envLights.Count);
cmd.SetComputeIntParam(buildPerVoxelLightListShader, HDShaderIDs.g_iNrVisibLights, m_lightCount);
cmd.SetComputeMatrixParam(buildPerVoxelLightListShader, HDShaderIDs.g_mScrProjection, projscr);
cmd.SetComputeMatrixParam(buildPerVoxelLightListShader, HDShaderIDs.g_mInvScrProjection, invProjscr);

cmd.SetComputeIntParam(buildPerBigTileLightListShader, HDShaderIDs.g_isOrthographic, isOrthographic ? 1 : 0);
cmd.SetComputeIntParams(buildPerBigTileLightListShader, HDShaderIDs.g_viDimensions, s_TempIntArray);
cmd.SetComputeIntParam(buildPerBigTileLightListShader, HDShaderIDs._EnvLightIndexShift, m_lightList.lights.Count);
cmd.SetComputeIntParam(buildPerBigTileLightListShader, HDShaderIDs._DecalIndexShift, m_lightList.lights.Count + m_lightList.envLights.Count);
cmd.SetComputeIntParam(buildPerBigTileLightListShader, HDShaderIDs.g_iNrVisibLights, m_lightCount);
//cmd.SetComputeMatrixParam(buildPerBigTileLightListShader, HDShaderIDs.g_mScrProjection, projscr);
//cmd.SetComputeMatrixParam(buildPerBigTileLightListShader, HDShaderIDs.g_mInvScrProjection, invProjscr);

cmd.SetComputeIntParam(buildPerTileLightListShader, HDShaderIDs.g_isOrthographic, isOrthographic ? 1 : 0);
cmd.SetComputeIntParams(buildPerTileLightListShader, HDShaderIDs.g_viDimensions, s_TempIntArray);
cmd.SetComputeIntParam(buildPerTileLightListShader, HDShaderIDs._EnvLightIndexShift, m_lightList.lights.Count);
cmd.SetComputeIntParam(buildPerTileLightListShader, HDShaderIDs._DecalIndexShift, m_lightList.lights.Count + m_lightList.envLights.Count);
cmd.SetComputeIntParam(buildPerTileLightListShader, HDShaderIDs.g_iNrVisibLights, m_lightCount);
cmd.SetComputeBufferParam(buildPerTileLightListShader, s_GenListPerTileKernel, HDShaderIDs.g_vBoundsBuffer, s_AABBBoundsBuffer);

PushGlobalParams(hdCamera, cmd);
}
private void UpdateDataBuffers()
void UpdateDataBuffers()
s_DecalDatas.SetData(DecalSystem.m_DecalDatas);
// These two buffers have been set in Rebuild()
s_ConvexBoundsBuffer.SetData(m_lightList.bounds);

cmd.SetGlobalInt(HDShaderIDs._AreaLightCount, m_areaLightCount);
cmd.SetGlobalBuffer(HDShaderIDs._EnvLightDatas, s_EnvLightDatas);
cmd.SetGlobalInt(HDShaderIDs._EnvLightCount, m_lightList.envLights.Count);
cmd.SetGlobalBuffer(HDShaderIDs._DecalDatas, s_DecalDatas);
cmd.SetGlobalInt(HDShaderIDs._DecalCount, DecalSystem.m_DecalDatasCount);
cmd.SetGlobalBuffer(HDShaderIDs._ShadowDatas, s_shadowDatas);
cmd.SetGlobalInt(HDShaderIDs._NumTileFtplX, GetNumTileFtplX(hdCamera));

uint faceCount = m_ShadowMgr.GetShadowRequestFaceCount((uint)index);
for (uint i = 0; i < faceCount; ++i)
{
m_ShadowMgr.DisplayShadow(cmd, index, i, x, y, overlaySize, overlaySize, lightingDebug.shadowMinValue, lightingDebug.shadowMaxValue);
m_ShadowMgr.DisplayShadow(cmd, m_DebugShadowMapMaterial, index, i, x, y, overlaySize, overlaySize, lightingDebug.shadowMinValue, lightingDebug.shadowMaxValue);
HDUtils.NextOverlayCoord(ref x, ref y, overlaySize, overlaySize, hdCamera.actualWidth);
}
}

m_ShadowMgr.DisplayShadowMap(cmd, lightingDebug.shadowAtlasIndex, 0, x, y, overlaySize, overlaySize, lightingDebug.shadowMinValue, lightingDebug.shadowMaxValue);
m_ShadowMgr.DisplayShadowMap(cmd, m_DebugShadowMapMaterial, lightingDebug.shadowAtlasIndex, 0, x, y, overlaySize, overlaySize, lightingDebug.shadowMinValue, lightingDebug.shadowMaxValue);
HDUtils.NextOverlayCoord(ref x, ref y, overlaySize, overlaySize, hdCamera.actualWidth);
}
}

3
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/LightLoop.cs.hlsl


#define LIGHTCATEGORY_PUNCTUAL (0)
#define LIGHTCATEGORY_AREA (1)
#define LIGHTCATEGORY_ENV (2)
#define LIGHTCATEGORY_COUNT (3)
#define LIGHTCATEGORY_DECAL (3)
#define LIGHTCATEGORY_COUNT (4)
//
// UnityEngine.Experimental.Rendering.HDPipeline.LightFeatureFlags: static fields

41
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/LightLoopSettings.cs


using System;
public static string kEnableFptlForForwardOpaque = "Enable Fptl for Forward Opaque";
public static string kEnableTileCluster = "Enable Tile/Cluster";
public static string kEnableBigTile = "Enable Big Tile";
public static string kEnableComputeLighting = "Enable Compute Lighting";
public static string kEnableLightclassification = "Enable Light Classification";
public static string kEnableMaterialClassification = "Enable Material Classification";
// Setup by the users
public bool enableTileAndCluster = true;
public bool enableComputeLightEvaluation = true;

// Setup by system
public bool isFptlEnabled = true;
static DebugUI.Widget[] s_DebugEntries;
public void CopyTo(LightLoopSettings lightLoopSettings)
{

aggregate.isFptlEnabled = !aggregateFrameSettings.enableForwardRenderingOnly || aggregate.enableFptlForForwardOpaque;
}
static public void RegisterDebug(String menuName, LightLoopSettings lightLoopSettings)
public static void RegisterDebug(string menuName, LightLoopSettings lightLoopSettings)
DebugMenuManager.instance.AddDebugItem<bool>(menuName, kEnableFptlForForwardOpaque, () => lightLoopSettings.enableFptlForForwardOpaque, (value) => lightLoopSettings.enableFptlForForwardOpaque = (bool)value);
DebugMenuManager.instance.AddDebugItem<bool>(menuName, kEnableTileCluster, () => lightLoopSettings.enableTileAndCluster, (value) => lightLoopSettings.enableTileAndCluster = (bool)value);
DebugMenuManager.instance.AddDebugItem<bool>(menuName, kEnableBigTile, () => lightLoopSettings.enableBigTilePrepass, (value) => lightLoopSettings.enableBigTilePrepass = (bool)value);
DebugMenuManager.instance.AddDebugItem<bool>(menuName, kEnableComputeLighting, () => lightLoopSettings.enableComputeLightEvaluation, (value) => lightLoopSettings.enableComputeLightEvaluation = (bool)value);
DebugMenuManager.instance.AddDebugItem<bool>(menuName, kEnableLightclassification, () => lightLoopSettings.enableComputeLightVariants, (value) => lightLoopSettings.enableComputeLightVariants = (bool)value);
DebugMenuManager.instance.AddDebugItem<bool>(menuName, kEnableMaterialClassification, () => lightLoopSettings.enableComputeMaterialVariants, (value) => lightLoopSettings.enableComputeMaterialVariants = (bool)value);
s_DebugEntries = new DebugUI.Widget[]
{
new DebugUI.BoolField { displayName = "Enable Fptl for Forward Opaque", getter = () => lightLoopSettings.enableFptlForForwardOpaque, setter = value => lightLoopSettings.enableFptlForForwardOpaque = value },
new DebugUI.BoolField { displayName = "Enable Tile/Cluster", getter = () => lightLoopSettings.enableTileAndCluster, setter = value => lightLoopSettings.enableTileAndCluster = value },
new DebugUI.BoolField { displayName = "Enable Big Tile", getter = () => lightLoopSettings.enableBigTilePrepass, setter = value => lightLoopSettings.enableBigTilePrepass = value },
new DebugUI.BoolField { displayName = "Enable Compute Lighting", getter = () => lightLoopSettings.enableComputeLightEvaluation, setter = value => lightLoopSettings.enableComputeLightEvaluation = value },
new DebugUI.BoolField { displayName = "Enable Light Classification", getter = () => lightLoopSettings.enableComputeLightVariants, setter = value => lightLoopSettings.enableComputeLightVariants = value },
new DebugUI.BoolField { displayName = "Enable Material Classification", getter = () => lightLoopSettings.enableComputeMaterialVariants, setter = value => lightLoopSettings.enableComputeMaterialVariants = value }
};
var panel = DebugManager.instance.GetPanel(menuName, true);
panel.children.Add(s_DebugEntries);
static public void UnRegisterDebug(String menuName)
public static void UnRegisterDebug(string menuName)
DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableTileCluster);
DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableBigTile);
DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableComputeLighting);
DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableLightclassification);
DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableMaterialClassification);
var panel = DebugManager.instance.GetPanel(menuName);
if (panel != null)
panel.children.Remove(s_DebugEntries);
}
}
}

1
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/lightlistbuild-bigtile.compute


uniform float g_fFarPlane;
uniform uint g_isOrthographic;
uniform int _EnvLightIndexShift;
uniform int _DecalIndexShift;
StructuredBuffer<float3> g_vBoundsBuffer : register( t1 );
StructuredBuffer<LightVolumeData> _LightVolumeData : register(t2);

4
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/lightlistbuild-clustered.compute


float4x4 g_mScrProjection;
uint g_isOrthographic;
int _EnvLightIndexShift;
int _DecalIndexShift;
float g_fClustScale;
float g_fClustBase;

// to make it work correctly
int shiftIndex[LIGHTCATEGORY_COUNT];
ZERO_INITIALIZE_ARRAY(int, shiftIndex, LIGHTCATEGORY_COUNT);
shiftIndex[LIGHTCATEGORY_COUNT - 1] = _EnvLightIndexShift;
shiftIndex[LIGHTCATEGORY_COUNT - 2] = _EnvLightIndexShift;
shiftIndex[LIGHTCATEGORY_COUNT - 1] = _DecalIndexShift;
int categoryListCount[LIGHTCATEGORY_COUNT]; // direct light count and reflection lights
ZERO_INITIALIZE_ARRAY(int, categoryListCount, LIGHTCATEGORY_COUNT);

4
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/lightlistbuild.compute


uniform float4x4 g_mScrProjection;
uniform uint g_isOrthographic;
uniform int _EnvLightIndexShift;
uniform int _DecalIndexShift;
uniform uint g_BaseFeatureFlags;
Texture2D g_depth_tex : register( t0 );

// to make it work correctly
int shiftIndex[LIGHTCATEGORY_COUNT];
ZERO_INITIALIZE_ARRAY(int, shiftIndex, LIGHTCATEGORY_COUNT);
shiftIndex[LIGHTCATEGORY_COUNT - 1] = _EnvLightIndexShift;
shiftIndex[LIGHTCATEGORY_COUNT - 2] = _EnvLightIndexShift;
shiftIndex[LIGHTCATEGORY_COUNT - 1] = _DecalIndexShift;
for(int category=0; category<LIGHTCATEGORY_COUNT; category++)
{

10
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Reflection/PlanarReflectionProbeCache.cs


MaterialPropertyBlock m_ConvertTextureMPB;
bool m_PerformBC6HCompression;
public PlanarReflectionProbeCache(IBLFilterGGX iblFilter, int cacheSize, int probeSize, TextureFormat probeFormat, bool isMipmaped)
public PlanarReflectionProbeCache(HDRenderPipelineAsset hdAsset, IBLFilterGGX iblFilter, int cacheSize, int probeSize, TextureFormat probeFormat, bool isMipmaped)
m_ConvertTextureMaterial = CoreUtils.CreateEngineMaterial(hdAsset.renderPipelineResources.blitCubeTextureFace);
m_ConvertTextureMPB = new MaterialPropertyBlock();
// BC6H requires CPP feature not yet available
probeFormat = TextureFormat.RGBAHalf;

m_ConvolutionTargetTexture.name = CoreUtils.GetRenderTargetAutoName(m_ProbeSize, m_ProbeSize, RenderTextureFormat.ARGBHalf, "PlanarReflectionConvolution", mips: true);
m_ConvolutionTargetTexture.Create();
m_ConvertTextureMaterial = CoreUtils.CreateEngineMaterial("Hidden/SRP/BlitCubeTextureFace");
m_ConvertTextureMPB = new MaterialPropertyBlock();
InitializeProbeBakingStates();
}
}

m_ConvolutionTargetTexture = null;
}
m_ProbeBakingState = null;
CoreUtils.Destroy(m_ConvertTextureMaterial);
}
public void NewFrame()

17
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Reflection/ReflectionProbeCache.cs


RenderTexture m_ConvolutionTargetTexture;
ProbeFilteringState[] m_ProbeBakingState;
Material m_ConvertTextureMaterial;
Material m_CubeToPano;
public ReflectionProbeCache(IBLFilterGGX iblFilter, int cacheSize, int probeSize, TextureFormat probeFormat, bool isMipmaped)
public ReflectionProbeCache(HDRenderPipelineAsset hdAsset, IBLFilterGGX iblFilter, int cacheSize, int probeSize, TextureFormat probeFormat, bool isMipmaped)
m_ConvertTextureMaterial = CoreUtils.CreateEngineMaterial(hdAsset.renderPipelineResources.blitCubeTextureFace);
m_ConvertTextureMPB = new MaterialPropertyBlock();
m_CubeToPano = CoreUtils.CreateEngineMaterial(hdAsset.renderPipelineResources.cubeToPanoShader);
// BC6H requires CPP feature not yet available
probeFormat = TextureFormat.RGBAHalf;

m_CacheSize = cacheSize;
m_TextureCache = new TextureCacheCubemap();
m_TextureCache.AllocTextureArray(cacheSize, probeSize, probeFormat, isMipmaped);
m_TextureCache.AllocTextureArray(cacheSize, probeSize, probeFormat, isMipmaped, m_CubeToPano);
m_IBLFilterGGX = iblFilter;
m_PerformBC6HCompression = probeFormat == TextureFormat.BC6H;

void Initialize()
{
if(m_TempRenderTexture == null)
if (m_TempRenderTexture == null)
{
// Temporary RT used for convolution and compression
m_TempRenderTexture = new RenderTexture(m_ProbeSize, m_ProbeSize, 1, RenderTextureFormat.ARGBHalf);

m_ConvolutionTargetTexture.autoGenerateMips = false;
m_ConvolutionTargetTexture.name = CoreUtils.GetRenderTargetAutoName(m_ProbeSize, m_ProbeSize, RenderTextureFormat.ARGBHalf, "PlanarReflection", mips : true);
m_ConvolutionTargetTexture.Create();
m_ConvertTextureMaterial = CoreUtils.CreateEngineMaterial("Hidden/SRP/BlitCubeTextureFace");
m_ConvertTextureMPB = new MaterialPropertyBlock();
InitializeProbeBakingStates();
}

m_ConvolutionTargetTexture = null;
}
m_ProbeBakingState = null;
CoreUtils.Destroy(m_ConvertTextureMaterial);
CoreUtils.Destroy(m_CubeToPano);
}
public void NewFrame()

11
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Decal/Decal.cs


sRGBFlags = m_sRGBFlags;
}
}
// normalToWorld.m03 - total blend factor
// normalToWorld.m13 - diffuse texture index in atlas
// normalToWorld.m23 - normal texture index in atlas
// normalToWorld.m33 - mask texture index in atlas
[GenerateHLSL]
public struct DecalData
{
public Matrix4x4 worldToDecal;
public Matrix4x4 normalToWorld;
};
}

16
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Decal/Decal.cs.hlsl


uint HTileMask;
};
// Generated from UnityEngine.Experimental.Rendering.HDPipeline.DecalData
// PackingRules = Exact
struct DecalData
{
float4x4 worldToDecal;
float4x4 normalToWorld;
};
//
// Accessors for UnityEngine.Experimental.Rendering.HDPipeline.DecalData
//
float4x4 GetNormalToWorld(DecalData value)
{
return value.normalToWorld;
}
//
// Debug functions
//

10
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Decal/Decal.hlsl


CBUFFER_END
UNITY_INSTANCING_BUFFER_START(Decal)
UNITY_DEFINE_INSTANCED_PROP(float4x4, normalToWorld)
UNITY_DEFINE_INSTANCED_PROP(float4x4, _NormalToWorld)
TEXTURE2D(_DecalHTileTexture);
TEXTURE2D(_DecalHTileTexture);
uint _DecalCount;
StructuredBuffer<DecalData> _DecalDatas;
TEXTURE2D_ARRAY(_DecalAtlas);
SAMPLER(sampler_DecalAtlas);
// Must be in sync with RT declared in HDRenderPipeline.cs ::Rebuild
void EncodeIntoDBuffer( DecalSurfaceData surfaceData,

7
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Decal/DecalData.hlsl


surfaceData.normalWS = float4(0,0,0,0);
surfaceData.mask = float4(0,0,0,0);
surfaceData.HTileMask = 0;
float totalBlend = _DecalBlend * clamp(decalToWorld[0][3], 0.0f, 1.0f);
float totalBlend = clamp(decalToWorld[0][3], 0.0f, 1.0f);
UVMapping texCoord;
ZERO_INITIALIZE(UVMapping, texCoord);
texCoord.uv = texCoordDS.xy;
surfaceData.normalWS.xyz = mul((float3x3)decalToWorld, SAMPLE_UVMAPPING_NORMALMAP(_NormalMap, sampler_NormalMap, texCoord, 1)) * 0.5f + 0.5f;
surfaceData.normalWS.xyz = mul((float3x3)decalToWorld, UnpackNormalmapRGorAG(SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, texCoordDS))) * 0.5f + 0.5f;
surfaceData.normalWS.w = totalBlend;
surfaceData.HTileMask |= DBUFFERHTILEBIT_NORMAL;
#endif

96
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Decal/DecalUtilities.hlsl


DECLARE_DBUFFER_TEXTURE(_DBufferTexture);
void AddDecalContribution(uint2 unPositionSS, inout SurfaceData surfaceData)
DecalData FetchDecal(uint start, uint i)
{
#ifdef LIGHTLOOP_TILE_PASS
int j = FetchIndex(start, i);
#else
int j = start + i;
#endif
return _DecalDatas[j];
}
void ApplyBlendNormal(inout float4 dst, inout int matMask, float2 texCoords, int sliceIndex, int mapMask, float3x3 decalToWorld, float blend)
{
float4 src;
src.xyz = mul(decalToWorld, UnpackNormalmapRGorAG(SAMPLE_TEXTURE2D_ARRAY(_DecalAtlas, sampler_DecalAtlas, texCoords, sliceIndex))) * 0.5f + 0.5f;
src.w = blend;
dst.xyz = src.xyz * src.w + dst.xyz * (1.0f - src.w);
dst.w = dst.w * (1.0f - src.w);
matMask |= mapMask;
}
void ApplyBlendDiffuse(inout float4 dst, inout int matMask, float2 texCoords, int sliceIndex, int mapMask, float blend)
{
float4 src = SAMPLE_TEXTURE2D_ARRAY(_DecalAtlas, sampler_DecalAtlas, texCoords, sliceIndex);
src.w *= blend;
dst.xyz = src.xyz * src.w + dst.xyz * (1.0f - src.w);
dst.w = dst.w * (1.0f - src.w);
matMask |= mapMask;
}
void ApplyBlendMask(inout float4 dst, inout int matMask, float2 texCoords, int sliceIndex, int mapMask, float blend)
{
float4 src = SAMPLE_TEXTURE2D_ARRAY(_DecalAtlas, sampler_DecalAtlas, texCoords, sliceIndex);
src.z = src.w;
src.w = blend;
dst.xyz = src.xyz * src.w + dst.xyz * (1.0f - src.w);
dst.w = dst.w * (1.0f - src.w);
matMask |= mapMask;
}
void AddDecalContribution(PositionInputs posInput, inout SurfaceData surfaceData)
DecalSurfaceData decalSurfaceData;
int mask = 0;
FETCH_DBUFFER(DBuffer, _DBufferTexture, unPositionSS);
DecalSurfaceData decalSurfaceData;
DECODE_FROM_DBUFFER(DBuffer, decalSurfaceData);
uint mask = UnpackByte(LOAD_TEXTURE2D(_DecalHTileTexture, unPositionSS / 8).x);
FETCH_DBUFFER(DBuffer, _DBufferTexture, posInput.positionSS);
#ifdef _SURFACE_TYPE_TRANSPARENT // forward transparent using clustered decals
uint decalCount, decalStart;
DBuffer0 = float4(0.0f, 0.0f, 0.0f, 1.0f);
DBuffer1 = float4(0.5f, 0.5f, 0.5f, 1.0f);
DBuffer2 = float4(0.0f, 0.0f, 0.0f, 1.0f);
#ifdef LIGHTLOOP_TILE_PASS
GetCountAndStart(posInput, LIGHTCATEGORY_DECAL, decalStart, decalCount);
#else
decalCount = _DecalCount;
decalStart = 0;
#endif
float3 positionWS = GetAbsolutePositionWS(posInput.positionWS);
uint i = 0;
for (i = 0; i < decalCount; i++)
{
DecalData decalData = FetchDecal(decalStart, i);
float3 positionDS = mul(decalData.worldToDecal, float4(positionWS, 1.0)).xyz;
positionDS = positionDS * float3(1.0, -1.0, 1.0) + float3(0.5, 0.0f, 0.5);
float decalBlend = decalData.normalToWorld[0][3];
int diffuseIndex = decalData.normalToWorld[1][3];
int normalIndex = decalData.normalToWorld[2][3];
int maskIndex = decalData.normalToWorld[3][3];
if((all(positionDS.xyz > 0.0f) && all(1.0f - positionDS.xyz > 0.0f))) // clip to decal space
{
if(diffuseIndex != -1)
{
ApplyBlendDiffuse(DBuffer0, mask, positionDS.xz, diffuseIndex, DBUFFERHTILEBIT_DIFFUSE, decalBlend);
}
if(normalIndex != -1)
{
ApplyBlendNormal(DBuffer1, mask, positionDS.xz, normalIndex, DBUFFERHTILEBIT_NORMAL, (float3x3)decalData.normalToWorld, decalBlend);
}
if(maskIndex != -1)
{
ApplyBlendMask(DBuffer2, mask, positionDS.xz, maskIndex, DBUFFERHTILEBIT_MASK, decalBlend);
}
}
}
#else
mask = UnpackByte(LOAD_TEXTURE2D(_DecalHTileTexture, posInput.positionSS / 8));
#endif
DECODE_FROM_DBUFFER(DBuffer, decalSurfaceData);
if(mask & DBUFFERHTILEBIT_NORMAL)
{
surfaceData.normalWS.xyz = normalize(surfaceData.normalWS.xyz * decalSurfaceData.normalWS.w + decalSurfaceData.normalWS.xyz);

}
}
}

4
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/DiffusionProfile/DiffusionProfileSettings.cs


// Importance sample the near field kernel.
for (int i = 0, n = DiffusionProfileConstants.SSS_N_SAMPLES_NEAR_FIELD; i < n; i++)
{
float p = (i + 0.5f) * (1f / n);
float p = (i + 0.5f) * (1.0f / n);
float r = DisneyProfileCdfInverse(p, s);
// N.b.: computation of normalized weights, and multiplication by the surface albedo

// Importance sample the far field kernel.
for (int i = 0, n = DiffusionProfileConstants.SSS_N_SAMPLES_FAR_FIELD; i < n; i++)
{
float p = (i + 0.5f) * (1f / n);
float p = (i + 0.5f) * (1.0f / n);
float r = DisneyProfileCdfInverse(p, s);
// N.b.: computation of normalized weights, and multiplication by the surface albedo

3
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/LayeredLit/LayeredLit.shader


SubShader
{
// This tags allow to use the shader replacement features
Tags{ "RenderType" = "HDLitShader" }
// Caution: The outline selection in the editor use the vertex shader/hull/domain shader of the first pass declare. So it should not bethe meta pass.
Pass
{

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/LayeredLit/LayeredLitData.hlsl


#endif
#ifndef _DISABLE_DBUFFER
AddDecalContribution(posInput.positionSS, surfaceData);
AddDecalContribution(posInput, surfaceData);
#endif
#if defined(DEBUG_DISPLAY)

3
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/LayeredLit/LayeredLitTessellation.shader


SubShader
{
// This tags allow to use the shader replacement features
Tags{ "RenderType" = "HDLitShader" }
// Caution: The outline selection in the editor use the vertex shader/hull/domain shader of the first pass declare. So it should not bethe meta pass.
Pass
{

3
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.shader


SubShader
{
// This tags allow to use the shader replacement features
Tags{ "RenderType" = "HDLitShader" }
// Caution: The outline selection in the editor use the vertex shader/hull/domain shader of the first pass declare. So it should not bethe meta pass.
Pass
{

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


surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS);
#ifndef _DISABLE_DBUFFER
AddDecalContribution(posInput.positionSS, surfaceData);
AddDecalContribution(posInput, surfaceData);
#endif
#if defined(DEBUG_DISPLAY)

3
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/LitTessellation.shader


SubShader
{
// This tags allow to use the shader replacement features
Tags{ "RenderType" = "HDLitShader" }
// Caution: The outline selection in the editor use the vertex shader/hull/domain shader of the first pass declare. So it should not bethe meta pass.
Pass
{

65
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/SubsurfaceScattering/SubsurfaceScattering.compute


// Definitions
//--------------------------------------------------------------------------------------------------
#pragma kernel SubsurfaceScatteringQualityNormal SubsurfaceScattering=SubsurfaceScatteringQualityNormal SSS_ENABLE_NEAR_FIELD=0
#pragma kernel SubsurfaceScatteringQualityUltra SubsurfaceScattering=SubsurfaceScatteringQualityUltra SSS_ENABLE_NEAR_FIELD=1
// TODO: use sharp load hoisting on PS4.
#define SSS_TAA_INTEGRATION 1 // Smoother results at the cost of a tiny amount of flickering in under-sampled areas
#define SSS_ENABLE_NEAR_FIELD 0 // Greatly increases the number of samples. Comes at a high cost.
#define SSS_RANDOM_ROTATION 1 // Hides undersampling artifacts with high-frequency noise. TAA blurs the noise.
#define SSS_USE_TANGENT_PLANE 0 // Improves the accuracy of the approximation(0 -> 1st order). High cost. Does not work with back-facing normals.
#define SSS_CLAMP_ARTIFACT 0 // Reduces bleeding. Use with SSS_USE_TANGENT_PLANE.
#define SSS_DEBUG_LOD 0

#if SSS_USE_TANGENT_PLANE
// Both 'xy2' and 'z' require conversion to millimeters.
float r = sqrt(xy2 + z * z) * mmPerUnit;
float p = sqrt(xy2) * mmPerUnit;
float p = sqrt(xy2);
#endif
float area = rcpPdf;
#if 0
// Boost the area associated with the sample by the ratio between the sample-center distance
// and its orthogonal projection onto the integration plane (disk).
area *= r / p;
return saturate(DisneyProfilePolar(r, S) * rcpPdf);
return saturate(DisneyProfilePolar(r, S) * area);
return DisneyProfilePolar(r, S) * rcpPdf;
return DisneyProfilePolar(r, S) * area;
float3 tangentX, float3 tangentY, float4x4 projMatrix,
float startAngle, float3 tangentX, float3 tangentY, float4x4 projMatrix,
// The relative sample position is known at the compile time.
// The relative sample position is known at the compile time.
#if (SSS_TAA_INTEGRATION != 0)
// Note that we repeat the pattern twice during the TAA cycle to reduce flickering.
float sinPsi = _TaaFrameRotation.x;
float cosPsi = _TaaFrameRotation.y;
// The angle 'psi' is loop-invariant.
float sinPsi = sin(startAngle);
float cosPsi = cos(startAngle);
// The angle 'psi' is loop-invariant. All the trigonometry is done at compile time.
// cos(a + b) = cos(a) * cos(b) - sin(a) * sin(b)
// sin(a + b) = sin(a) * cos(b) + cos(a) * sin(b)
float cosSum = cos(phi) * cosPsi - sin(phi) * sinPsi;

#else
float2 vec = r * float2(cos(phi), sin(phi));
#endif
// Compute the screen-space position and the squared distance (in mm) in the image plane.
int2 position; float xy2;

#endif
}
#pragma kernel SubsurfaceScattering
void SubsurfaceScattering(uint3 reorderedGroupId : SV_GroupID,
uint groupThreadId : SV_GroupThreadID)
void SubsurfaceScattering(uint2 groupId : SV_GroupID,
uint groupThreadId : SV_GroupThreadID)
// We dispatch 4x swizzled 16x16 groups per a 32x32 macrotile.
// Therefore, we need to reorder. TODO: macrotile order.
uint2 groupQuad = DeinterleaveQuad(reorderedGroupId.x);
uint2 groupId = uint2(reorderedGroupId.y * 2 + groupQuad.x, reorderedGroupId.z * 2 + groupQuad.y);
// Arrange threads in the Morton order to optimally match the memory layout of GCN tiles.
uint2 groupCoord = DecodeMorton2D(groupThreadId);

}
#endif
#if SSS_RANDOM_ROTATION
float startAngle = TWO_PI * GenerateHashedRandomFloat(asuint(centerPosVS));
#else
float startAngle = 0;
#endif
// Use more samples for SS regions larger than 5x5 pixels (rotated by 45 degrees).
bool useNearFieldKernel = SSS_ENABLE_NEAR_FIELD && maxDistInPixels > SSS_LOD_THRESHOLD;

// Compute the indices used to access the individual components of the float4 of the kernel.
uint iR = useNearFieldKernel ? 0 : 2; // radius
uint iP = useNearFieldKernel ? 1 : 3; // rcp(pdf)
uint n = useNearFieldKernel ? SSS_N_SAMPLES_NEAR_FIELD : SSS_N_SAMPLES_FAR_FIELD;
float centerRadius = _FilterKernels[profileID][0][iR];
float centerRcpPdf = _FilterKernels[profileID][0][iP];

float3 totalIrradiance = centerWeight * centerIrradiance;
float3 totalWeight = centerWeight;
int i, n; // Declare once to avoid the warning from the Unity shader compiler.
uint i; // Declare once to avoid the warning from the Unity shader compiler.
for (i = 1, n = SSS_N_SAMPLES_FAR_FIELD; i < n; i++)
for (i = 1; i < SSS_N_SAMPLES_FAR_FIELD; i++)
tangentX, tangentY, projMatrix,
startAngle, tangentX, tangentY, projMatrix,
totalIrradiance, totalWeight);
}

}
UNITY_UNROLL
for (i = SSS_N_SAMPLES_FAR_FIELD, n = SSS_N_SAMPLES_NEAR_FIELD; i < n; i++)
for (i = SSS_N_SAMPLES_FAR_FIELD; i < SSS_N_SAMPLES_NEAR_FIELD; i++)
tangentX, tangentY, projMatrix,
startAngle, tangentX, tangentY, projMatrix,
totalIrradiance, totalWeight);
}

9
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/SubsurfaceScattering/SubsurfaceScatteringManager.cs


public void Build(HDRenderPipelineAsset hdAsset)
{
// Disney SSS (compute + combine)
string kernelName = hdAsset.renderPipelineSettings.enableUltraQualitySSS ? "SubsurfaceScatteringQualityUltra" : "SubsurfaceScatteringQualityNormal";
m_SubsurfaceScatteringKernel = m_SubsurfaceScatteringCS.FindKernel("SubsurfaceScattering");
m_SubsurfaceScatteringKernel = m_SubsurfaceScatteringCS.FindKernel(kernelName);
m_CombineLightingPass = CoreUtils.CreateEngineMaterial(hdAsset.renderPipelineResources.combineLighting);
m_CombineLightingPass.SetInt(HDShaderIDs._StencilMask, (int)HDRenderPipeline.StencilBitMask.LightingMask);

cmd.SetComputeTextureParam(m_SubsurfaceScatteringCS, m_SubsurfaceScatteringKernel, HDShaderIDs._CameraFilteringBuffer, m_CameraFilteringBuffer);
// Perform the SSS filtering pass which fills 'm_CameraFilteringBufferRT'.
// We dispatch 4x swizzled 16x16 groups per a 32x32 macro tile.
cmd.DispatchCompute(m_SubsurfaceScatteringCS, m_SubsurfaceScatteringKernel, 4, ((int)hdCamera.screenSize.x + 31) / 32, ((int)hdCamera.screenSize.y + 31) / 32);
cmd.DispatchCompute(m_SubsurfaceScatteringCS, m_SubsurfaceScatteringKernel, ((int)hdCamera.screenSize.x + 15) / 16, ((int)hdCamera.screenSize.y + 15) / 16, 1);
cmd.SetGlobalTexture(HDShaderIDs._IrradianceSource, m_CameraFilteringBuffer); // Cannot set a RT on a material

cmd.SetComputeTextureParam(m_SubsurfaceScatteringCS, m_SubsurfaceScatteringKernel, HDShaderIDs._CameraColorTexture, colorBufferRT);
// Perform the SSS filtering pass which performs an in-place update of 'colorBuffer'.
// We dispatch 4x swizzled 16x16 groups per a 32x32 macro tile.
cmd.DispatchCompute(m_SubsurfaceScatteringCS, m_SubsurfaceScatteringKernel, 4, ((int)hdCamera.screenSize.x + 31) / 32, ((int)hdCamera.screenSize.y + 31) / 32);
cmd.DispatchCompute(m_SubsurfaceScatteringCS, m_SubsurfaceScatteringKernel, ((int)hdCamera.screenSize.x + 15) / 16, ((int)hdCamera.screenSize.y + 15) / 16, 1);
}
}
else

3
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Unlit/Unlit.shader


SubShader
{
// This tags allow to use the shader replacement features
Tags{ "RenderType" = "HDUnlitShader" }
// Caution: The outline selection in the editor use the vertex shader/hull/domain shader of the first pass declare. So it should not be the meta pass.
Pass

129
ScriptableRenderPipeline/HDRenderPipeline/HDRP/RenderPipeline/FrameSettings.cs


[Serializable]
public class FrameSettings
{
public static string kEnableShadow = "Enable Shadows";
public static string kEnableContactShadows = "Enable Contact Shadows";
public static string kEnableSSR = "Enable SSR";
public static string kEnableSSAO = "Enable SSAO";
public static string kEnableSubsurfaceScattering = "Enable SubsurfaceScattering";
public static string kEnableTransmission = "Enable Transmission";
public static string kForwardOnly = "Forward Only";
public static string kDeferredDepthPrepass = "Deferred Depth Prepass";
public static string kDeferredDepthPrepassATestOnly = "Deferred Depth Prepass ATest Only";
public static string KEnableTransparentPrepass = "Enable Transparent Prepass";
public static string kEnableMotionVectors = "Enable Motion Vectors";
public static string KEnableObjectMotionVectors = "Enable Object Motion Vectors";
public static string kEnableDBuffer = "Enable DBuffer";
public static string kEnableAtmosphericScattering = "Enable Atmospheric Scattering";
public static string kEnableRoughRefraction = "Enable Rough Refraction";
public static string kEnableTransparentPostpass = "Enable Transparent Postpass";
public static string kEnableDistortion = "Enable Distortion";
public static string kEnablePostprocess = "Enable Postprocess";
public static string kEnableStereoRendering = "Enable Stereo Rendering";
public static string kEnableAsyncCompute = "Enable Async Compute";
public static string kEnableOpaqueObjects = "Enable Opaque Objects";
public static string kEnableTransparentObjects = "Enable Transparent Objects";
public static string kEnableMSAA = "Enable MSAA";
public static string kEnableShadowMask = "Enable ShadowMask";
// Lighting
// Setup by users
public bool enableShadow = true;

public bool enableShadowMask = false;
public LightLoopSettings lightLoopSettings = new LightLoopSettings();
static DebugUI.Widget[] s_DebugEntries;
public void CopyTo(FrameSettings frameSettings)
{

// TODO: The work will be implemented piecemeal to support all passes
enableMotionVectors = false;
enableDBuffer = false;
enableDistortion = false;
enableDBuffer = false;
enableDistortion = false;
enableRoughRefraction = false;
enableRoughRefraction = false;
enableSSAO = false;
enableSSR = false;
enableSubsurfaceScattering = false;

static public void RegisterDebug(String menuName, FrameSettings frameSettings)
public static void RegisterDebug(string menuName, FrameSettings frameSettings)
// Register the camera into the debug menu
DebugMenuManager.instance.AddDebugItem<bool>(menuName, kEnableShadow, () => frameSettings.enableShadow, (value) => frameSettings.enableShadow = (bool)value);
DebugMenuManager.instance.AddDebugItem<bool>(menuName, kEnableContactShadows, () => frameSettings.enableContactShadows, (value) => frameSettings.enableContactShadows = (bool)value);
DebugMenuManager.instance.AddDebugItem<bool>(menuName, kEnableSSR, () => frameSettings.enableSSR, (value) => frameSettings.enableSSR = (bool)value);
DebugMenuManager.instance.AddDebugItem<bool>(menuName, kEnableSSAO, () => frameSettings.enableSSAO, (value) => frameSettings.enableSSAO = (bool)value);
DebugMenuManager.instance.AddDebugItem<bool>(menuName, kEnableSubsurfaceScattering, () => frameSettings.enableSubsurfaceScattering, (value) => frameSettings.enableSubsurfaceScattering = (bool)value);
DebugMenuManager.instance.AddDebugItem<bool>(menuName, kEnableTransmission, () => frameSettings.enableTransmission, (value) => frameSettings.enableTransmission = (bool)value);
s_DebugEntries = new DebugUI.Widget[]
{
new DebugUI.BoolField { displayName = "Enable Shadows", getter = () => frameSettings.enableShadow, setter = value => frameSettings.enableShadow = value },
new DebugUI.BoolField { displayName = "Enable Contact Shadows", getter = () => frameSettings.enableContactShadows, setter = value => frameSettings.enableContactShadows = value },
new DebugUI.BoolField { displayName = "Enable SSR", getter = () => frameSettings.enableSSR, setter = value => frameSettings.enableSSR = value },
new DebugUI.BoolField { displayName = "Enable SSAO", getter = () => frameSettings.enableSSAO, setter = value => frameSettings.enableSSAO = value },
new DebugUI.BoolField { displayName = "Enable SubsurfaceScattering", getter = () => frameSettings.enableSubsurfaceScattering, setter = value => frameSettings.enableSubsurfaceScattering = value },
new DebugUI.BoolField { displayName = "Enable Transmission", getter = () => frameSettings.enableTransmission, setter = value => frameSettings.enableTransmission = value },
new DebugUI.BoolField { displayName = "Forward Only", getter = () => frameSettings.enableForwardRenderingOnly, setter = value => frameSettings.enableForwardRenderingOnly = value },
new DebugUI.BoolField { displayName = "Deferred Depth Prepass", getter = () => frameSettings.enableDepthPrepassWithDeferredRendering, setter = value => frameSettings.enableDepthPrepassWithDeferredRendering = value },
new DebugUI.BoolField { displayName = "Deferred Depth Prepass ATest Only", getter = () => frameSettings.enableAlphaTestOnlyInDeferredPrepass, setter = value => frameSettings.enableAlphaTestOnlyInDeferredPrepass = value },
DebugMenuManager.instance.AddDebugItem<bool>(menuName, kForwardOnly, () => frameSettings.enableForwardRenderingOnly, (value) => frameSettings.enableForwardRenderingOnly = (bool)value);
DebugMenuManager.instance.AddDebugItem<bool>(menuName, kDeferredDepthPrepass, () => frameSettings.enableDepthPrepassWithDeferredRendering, (value) => frameSettings.enableDepthPrepassWithDeferredRendering = (bool)value);
DebugMenuManager.instance.AddDebugItem<bool>(menuName, kDeferredDepthPrepassATestOnly, () => frameSettings.enableAlphaTestOnlyInDeferredPrepass, (value) => frameSettings.enableAlphaTestOnlyInDeferredPrepass = (bool)value);
new DebugUI.BoolField { displayName = "Enable Transparent Prepass", getter = () => frameSettings.enableTransparentPrepass, setter = value => frameSettings.enableTransparentPrepass = value },
new DebugUI.BoolField { displayName = "Enable Motion Vectors", getter = () => frameSettings.enableMotionVectors, setter = value => frameSettings.enableMotionVectors = value },
new DebugUI.BoolField { displayName = "Enable Object Motion Vectors", getter = () => frameSettings.enableObjectMotionVectors, setter = value => frameSettings.enableObjectMotionVectors = value },
new DebugUI.BoolField { displayName = "Enable DBuffer", getter = () => frameSettings.enableDBuffer, setter = value => frameSettings.enableDBuffer = value },
new DebugUI.BoolField { displayName = "Enable Atmospheric Scattering", getter = () => frameSettings.enableAtmosphericScattering, setter = value => frameSettings.enableAtmosphericScattering = value },
new DebugUI.BoolField { displayName = "Enable Rough Refraction", getter = () => frameSettings.enableRoughRefraction, setter = value => frameSettings.enableRoughRefraction = value },
new DebugUI.BoolField { displayName = "Enable Transparent Postpass", getter = () => frameSettings.enableTransparentPostpass, setter = value => frameSettings.enableTransparentPostpass = value },
new DebugUI.BoolField { displayName = "Enable Distortion", getter = () => frameSettings.enableDistortion, setter = value => frameSettings.enableDistortion = value },
new DebugUI.BoolField { displayName = "Enable Postprocess", getter = () => frameSettings.enablePostprocess, setter = value => frameSettings.enablePostprocess = value },
DebugMenuManager.instance.AddDebugItem<bool>(menuName, KEnableTransparentPrepass, () => frameSettings.enableTransparentPrepass, (value) => frameSettings.enableTransparentPrepass = (bool)value);
DebugMenuManager.instance.AddDebugItem<bool>(menuName, kEnableMotionVectors, () => frameSettings.enableMotionVectors, (value) => frameSettings.enableMotionVectors = (bool)value);
DebugMenuManager.instance.AddDebugItem<bool>(menuName, KEnableObjectMotionVectors, () => frameSettings.enableObjectMotionVectors, (value) => frameSettings.enableObjectMotionVectors = (bool)value);
DebugMenuManager.instance.AddDebugItem<bool>(menuName, kEnableDBuffer, () => frameSettings.enableDBuffer, (value) => frameSettings.enableDBuffer = (bool)value);
DebugMenuManager.instance.AddDebugItem<bool>(menuName, kEnableAtmosphericScattering, () => frameSettings.enableAtmosphericScattering, (value) => frameSettings.enableAtmosphericScattering = (bool)value);
DebugMenuManager.instance.AddDebugItem<bool>(menuName, kEnableRoughRefraction, () => frameSettings.enableRoughRefraction, (value) => frameSettings.enableRoughRefraction = (bool)value);
DebugMenuManager.instance.AddDebugItem<bool>(menuName, kEnableTransparentPostpass, () => frameSettings.enableTransparentPostpass, (value) => frameSettings.enableTransparentPostpass = (bool)value);
DebugMenuManager.instance.AddDebugItem<bool>(menuName, kEnableDistortion, () => frameSettings.enableDistortion, (value) => frameSettings.enableDistortion = (bool)value);
DebugMenuManager.instance.AddDebugItem<bool>(menuName, kEnablePostprocess, () => frameSettings.enablePostprocess, (value) => frameSettings.enablePostprocess = (bool)value);
new DebugUI.BoolField { displayName = "Enable Stereo Rendering", getter = () => frameSettings.enableStereo, setter = value => frameSettings.enableStereo = value },
new DebugUI.BoolField { displayName = "Enable Async Compute", getter = () => frameSettings.enableAsyncCompute, setter = value => frameSettings.enableAsyncCompute = value },
DebugMenuManager.instance.AddDebugItem<bool>(menuName, kEnableStereoRendering, () => frameSettings.enableStereo, (value) => frameSettings.enableStereo = (bool)value);
DebugMenuManager.instance.AddDebugItem<bool>(menuName, kEnableAsyncCompute, () => frameSettings.enableAsyncCompute, (value) => frameSettings.enableAsyncCompute = (bool)value);
new DebugUI.BoolField { displayName = "Enable Opaque Objects", getter = () => frameSettings.enableOpaqueObjects, setter = value => frameSettings.enableOpaqueObjects = value },
new DebugUI.BoolField { displayName = "Enable Transparent Objects", getter = () => frameSettings.enableTransparentObjects, setter = value => frameSettings.enableTransparentObjects = value },
DebugMenuManager.instance.AddDebugItem<bool>(menuName, kEnableOpaqueObjects, () => frameSettings.enableOpaqueObjects, (value) => frameSettings.enableOpaqueObjects = (bool)value);
DebugMenuManager.instance.AddDebugItem<bool>(menuName, kEnableTransparentObjects, () => frameSettings.enableTransparentObjects, (value) => frameSettings.enableTransparentObjects = (bool)value);
new DebugUI.BoolField { displayName = "Enable MSAA", getter = () => frameSettings.enableMSAA, setter = value => frameSettings.enableMSAA = value },
new DebugUI.BoolField { displayName = "Enable ShadowMask", getter = () => frameSettings.enableShadowMask, setter = value => frameSettings.enableShadowMask = value },
};
DebugMenuManager.instance.AddDebugItem<bool>(menuName, kEnableMSAA, () => frameSettings.enableMSAA, (value) => frameSettings.enableMSAA = (bool)value);
DebugMenuManager.instance.AddDebugItem<bool>(menuName, kEnableShadowMask, () => frameSettings.enableShadowMask, (value) => frameSettings.enableShadowMask = (bool)value);
var panel = DebugManager.instance.GetPanel(menuName, true);
panel.children.Add(s_DebugEntries);
static public void UnRegisterDebug(String menuName)
public static void UnRegisterDebug(string menuName)
// Register the camera into the debug menu
DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableShadow);
DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableContactShadows);
DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableSSR);
DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableSSAO);
DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableSubsurfaceScattering);
DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableTransmission);
DebugMenuManager.instance.RemoveDebugItem(menuName, kForwardOnly);
DebugMenuManager.instance.RemoveDebugItem(menuName, kDeferredDepthPrepass);
DebugMenuManager.instance.RemoveDebugItem(menuName, kDeferredDepthPrepassATestOnly);
DebugMenuManager.instance.RemoveDebugItem(menuName, KEnableTransparentPrepass);
DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableMotionVectors);
DebugMenuManager.instance.RemoveDebugItem(menuName, KEnableObjectMotionVectors);
DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableDBuffer);
DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableAtmosphericScattering);
DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableRoughRefraction);
DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableTransparentPostpass);
DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableDistortion);
DebugMenuManager.instance.RemoveDebugItem(menuName, kEnablePostprocess);
DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableStereoRendering);
DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableAsyncCompute);
DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableOpaqueObjects);
DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableTransparentObjects);
var panel = DebugManager.instance.GetPanel(menuName);
DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableMSAA);
DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableShadowMask);
if (panel != null)
panel.children.Remove(s_DebugEntries);
LightLoopSettings.UnRegisterDebug(menuName);
}

1
ScriptableRenderPipeline/HDRenderPipeline/HDRP/RenderPipeline/RenderPipelineSettings.cs


public bool supportSSAO = true;
public bool supportSubsurfaceScattering = true;
public bool supportForwardOnly = false;
public bool enableUltraQualitySSS = false;
// Engine
public bool supportDBuffer = false;

6
ScriptableRenderPipeline/HDRenderPipeline/HDRP/RenderPipelineResources/HDRenderPipelineResources.asset


type: 3}
skyboxCubemap: {fileID: 103, guid: 0000000000000000f000000000000000, type: 0}
encodeBC6HCS: {fileID: 7200000, guid: aa922d239de60304f964e24488559eeb, type: 3}
cubeToPanoShader: {fileID: 4800000, guid: 595434cc3b6405246b6cd3086d0b6f7d, type: 3}
blitCubeTextureFace: {fileID: 4800000, guid: d850d0a2481878d4bbf17e5126b04163, type: 3}
shadowClearShader: {fileID: 4800000, guid: e3cab24f27741f44d8af1e94d006267c, type: 3}
shadowBlurMoments: {fileID: 7200000, guid: fb36979473602464fa32deacb9630c08, type: 3}
debugShadowMapShader: {fileID: 4800000, guid: ee25e539f5594f44085e0a9000c15d9b,
type: 3}

9
ScriptableRenderPipeline/HDRenderPipeline/HDRP/RenderPipelineResources/RenderPipelineResources.cs


public Shader skyboxCubemap;
// Utilities
// Utilities / Core
public Shader cubeToPanoShader;
public Shader blitCubeTextureFace;
// Shadow
public Shader shadowClearShader;
public ComputeShader shadowBlurMoments;
public Shader debugShadowMapShader;
}
}

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/ShaderPass/ShaderPassDBuffer.hlsl


clip(1.0 - positionDS); // Clip value above one
DecalSurfaceData surfaceData;
float4x4 decalToWorld = UNITY_ACCESS_INSTANCED_PROP(matrix, normalToWorld);
float4x4 decalToWorld = UNITY_ACCESS_INSTANCED_PROP(matrix, _NormalToWorld);
GetSurfaceData(positionDS.xz, decalToWorld, surfaceData);
// have to do explicit test since compiler behavior is not defined for RW resources and discard instructions

4
ScriptableRenderPipeline/HDRenderPipeline/package.json


{
"name": "com.unity.render-pipelines.high-definition",
"description": "HD Render Pipeline for Unity.",
"version": "0.1.30",
"version": "0.1.32",
"com.unity.render-pipelines.core": "0.1.30"
"com.unity.render-pipelines.core": "0.1.32"
}
}

4
ScriptableRenderPipeline/LightweightPipeline/package.json


{
"name": "com.unity.render-pipelines.lightweight",
"description": "Lightweight Render Pipeline for Unity.",
"version": "0.1.30",
"version": "0.1.32",
"com.unity.render-pipelines.core": "0.1.30"
"com.unity.render-pipelines.core": "0.1.32"
}
}

2
ScriptableRenderPipeline/master-package.json


{
"version": "0.1.30",
"version": "0.1.32",
"unity": "2018.1",
"dependencies": {
"com.unity.postprocessing": "0.1.8"

2
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/CommonAssets/RP_Assets/HDRP_Test_Def.asset


supportMotionVectors: 1
supportStereo: 0
lightLoopSettings:
spotCookieSize: 128
cookieSize: 128
cookieTexArraySize: 16
pointCookieSize: 512
cubeCookieTexArraySize: 16

4
ScriptableRenderPipeline/Core/CoreRP/Shadow/ShadowBlurMoments.compute


#pragma kernel main_MSAA_MSM_15 KERNEL_MAIN=main_MSAA_MSM_15 SHADOW_MOMENT_ALGORITHM=MSM MAX_MSAA=8 BLUR_SIZE=15
#pragma kernel main_MSAA_MSM_17 KERNEL_MAIN=main_MSAA_MSM_17 SHADOW_MOMENT_ALGORITHM=MSM MAX_MSAA=8 BLUR_SIZE=17
#include "../../common.hlsl"
#include "../ShadowMoments.hlsl"
#include "CoreRP/ShaderLibrary/Common.hlsl"
#include "CoreRP/ShaderLibrary/Shadow/ShadowMoments.hlsl"
#if MAX_MSAA > 1
Texture2DMS<float> depthTex;

8
ScriptableRenderPipeline/Core/CoreRP/CoreResources.meta


fileFormatVersion: 2
guid: 9b76b9e7a4790f14ca7a8b57cd46600d
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

289
ScriptableRenderPipeline/Core/CoreRP/Debugging/DebugManager.Actions.cs


using System.Collections.Generic;
namespace UnityEngine.Experimental.Rendering
{
public enum DebugAction
{
EnableDebugMenu,
PreviousDebugPanel,
NextDebugPanel,
Action,
MakePersistent,
MoveVertical,
MoveHorizontal,
Multiplier,
DebugActionCount
}
enum DebugActionRepeatMode
{
Never,
Delay
}
public sealed partial class DebugManager
{
const string kEnableDebugBtn1 = "Enable Debug Button 1";
const string kEnableDebugBtn2 = "Enable Debug Button 2";
const string kDebugPreviousBtn = "Debug Previous";
const string kDebugNextBtn = "Debug Next";
const string kValidateBtn = "Debug Validate";
const string kPersistentBtn = "Debug Persistent";
const string kDPadVertical = "Debug Vertical";
const string kDPadHorizontal = "Debug Horizontal";
const string kMultiplierBtn = "Debug Multiplier";
DebugActionDesc[] m_DebugActions;
DebugActionState[] m_DebugActionStates;
void RegisterActions()
{
m_DebugActions = new DebugActionDesc[(int)DebugAction.DebugActionCount];
m_DebugActionStates = new DebugActionState[(int)DebugAction.DebugActionCount];
var enableDebugMenu = new DebugActionDesc();
enableDebugMenu.buttonTriggerList.Add(new[] { kEnableDebugBtn1, kEnableDebugBtn2 });
enableDebugMenu.keyTriggerList.Add(new[] { KeyCode.LeftControl, KeyCode.Backspace });
enableDebugMenu.repeatMode = DebugActionRepeatMode.Never;
AddAction(DebugAction.EnableDebugMenu, enableDebugMenu);
var nextDebugPanel = new DebugActionDesc();
nextDebugPanel.buttonTriggerList.Add(new[] { kDebugNextBtn });
nextDebugPanel.repeatMode = DebugActionRepeatMode.Never;
AddAction(DebugAction.NextDebugPanel, nextDebugPanel);
var previousDebugPanel = new DebugActionDesc();
previousDebugPanel.buttonTriggerList.Add(new[] { kDebugPreviousBtn });
previousDebugPanel.repeatMode = DebugActionRepeatMode.Never;
AddAction(DebugAction.PreviousDebugPanel, previousDebugPanel);
var validate = new DebugActionDesc();
validate.buttonTriggerList.Add(new[] { kValidateBtn });
validate.repeatMode = DebugActionRepeatMode.Never;
AddAction(DebugAction.Action, validate);
var persistent = new DebugActionDesc();
persistent.buttonTriggerList.Add(new[] { kPersistentBtn });
persistent.repeatMode = DebugActionRepeatMode.Never;
AddAction(DebugAction.MakePersistent, persistent);
var multiplier = new DebugActionDesc();
multiplier.buttonTriggerList.Add(new[] { kMultiplierBtn });
multiplier.repeatMode = DebugActionRepeatMode.Delay;
validate.repeatDelay = 0f;
AddAction(DebugAction.Multiplier, multiplier);
AddAction(DebugAction.MoveVertical, new DebugActionDesc { axisTrigger = kDPadVertical, repeatMode = DebugActionRepeatMode.Delay, repeatDelay = 0.16f });
AddAction(DebugAction.MoveHorizontal, new DebugActionDesc { axisTrigger = kDPadHorizontal, repeatMode = DebugActionRepeatMode.Delay, repeatDelay = 0.16f });
}
void AddAction(DebugAction action, DebugActionDesc desc)
{
int index = (int)action;
m_DebugActions[index] = desc;
m_DebugActionStates[index] = new DebugActionState();
}
void SampleAction(int actionIndex)
{
var desc = m_DebugActions[actionIndex];
var state = m_DebugActionStates[actionIndex];
//bool canSampleAction = (state.actionTriggered == false) || (desc.repeatMode == DebugActionRepeatMode.Delay && state.timer > desc.repeatDelay);
if (state.runningAction == false)
{
// Check button triggers
for (int buttonListIndex = 0; buttonListIndex < desc.buttonTriggerList.Count; ++buttonListIndex)
{
var buttons = desc.buttonTriggerList[buttonListIndex];
bool allButtonPressed = true;
foreach (var button in buttons)
{
allButtonPressed = Input.GetButton(button);
if (!allButtonPressed)
break;
}
if (allButtonPressed)
{
state.TriggerWithButton(buttons, 1f);
break;
}
}
// Check axis triggers
if (desc.axisTrigger != "")
{
float axisValue = Input.GetAxis(desc.axisTrigger);
if (axisValue != 0f)
state.TriggerWithAxis(desc.axisTrigger, axisValue);
}
// Check key triggers
for (int keyListIndex = 0; keyListIndex < desc.keyTriggerList.Count; ++keyListIndex)
{
var keys = desc.keyTriggerList[keyListIndex];
bool allKeyPressed = true;
foreach (var key in keys)
{
allKeyPressed = Input.GetKey(key);
if (!allKeyPressed)
break;
}
if (allKeyPressed)
{
state.TriggerWithKey(keys, 1f);
break;
}
}
}
}
void UpdateAction(int actionIndex)
{
var desc = m_DebugActions[actionIndex];
var state = m_DebugActionStates[actionIndex];
if (state.runningAction)
state.Update(desc);
}
public void UpdateActions()
{
for (int actionIndex = 0; actionIndex < m_DebugActions.Length; ++actionIndex)
{
UpdateAction(actionIndex);
SampleAction(actionIndex);
}
}
public float GetAction(DebugAction action)
{
return m_DebugActionStates[(int)action].actionState;
}
void RegisterInputs()
{
#if UNITY_EDITOR
var inputEntries = new List<InputManagerEntry>
{
new InputManagerEntry { name = kEnableDebugBtn1, kind = InputManagerEntry.Kind.KeyOrButton, btnPositive = "left ctrl", altBtnPositive = "joystick button 8" },
new InputManagerEntry { name = kEnableDebugBtn2, kind = InputManagerEntry.Kind.KeyOrButton, btnPositive = "backspace", altBtnPositive = "joystick button 9" },
new InputManagerEntry { name = kDebugNextBtn, kind = InputManagerEntry.Kind.KeyOrButton, btnPositive = "page down", altBtnPositive = "joystick button 5" },
new InputManagerEntry { name = kDebugPreviousBtn, kind = InputManagerEntry.Kind.KeyOrButton, btnPositive = "page up", altBtnPositive = "joystick button 4" },
new InputManagerEntry { name = kValidateBtn, kind = InputManagerEntry.Kind.KeyOrButton, btnPositive = "return", altBtnPositive = "joystick button 0" },
new InputManagerEntry { name = kPersistentBtn, kind = InputManagerEntry.Kind.KeyOrButton, btnPositive = "right shift", altBtnPositive = "joystick button 2" },
new InputManagerEntry { name = kMultiplierBtn, kind = InputManagerEntry.Kind.KeyOrButton, btnPositive = "left shift", altBtnPositive = "joystick button 3" },
new InputManagerEntry { name = kDPadHorizontal, kind = InputManagerEntry.Kind.KeyOrButton, btnPositive = "right", btnNegative = "left", gravity = 1000f, deadZone = 0.001f, sensitivity = 1000f },
new InputManagerEntry { name = kDPadVertical, kind = InputManagerEntry.Kind.KeyOrButton, btnPositive = "up", btnNegative = "down", gravity = 1000f, deadZone = 0.001f, sensitivity = 1000f },
new InputManagerEntry { name = kDPadVertical, kind = InputManagerEntry.Kind.Axis, axis = InputManagerEntry.Axis.Seventh, btnPositive = "up", btnNegative = "down", gravity = 1000f, deadZone = 0.001f, sensitivity = 1000f },
new InputManagerEntry { name = kDPadHorizontal, kind = InputManagerEntry.Kind.Axis, axis = InputManagerEntry.Axis.Sixth, btnPositive = "right", btnNegative = "left", gravity = 1000f, deadZone = 0.001f, sensitivity = 1000f },
};
InputRegistering.RegisterInputs(inputEntries);
#endif
}
}
class DebugActionDesc
{
public List<string[]> buttonTriggerList = new List<string[]>();
public string axisTrigger = "";
public List<KeyCode[]> keyTriggerList = new List<KeyCode[]>();
public DebugActionRepeatMode repeatMode = DebugActionRepeatMode.Never;
public float repeatDelay;
}
class DebugActionState
{
enum DebugActionKeyType
{
Button,
Axis,
Key
}
DebugActionKeyType m_Type;
string[] m_PressedButtons;
string m_PressedAxis = "";
KeyCode[] m_PressedKeys;
bool[] m_TriggerPressedUp;
float m_Timer;
internal bool runningAction { get; private set; }
internal float actionState { get; private set; }
void Trigger(int triggerCount, float state)
{
actionState = state;
runningAction = true;
m_Timer = 0f;
m_TriggerPressedUp = new bool[triggerCount];
for (int i = 0; i < m_TriggerPressedUp.Length; ++i)
m_TriggerPressedUp[i] = false;
}
public void TriggerWithButton(string[] buttons, float state)
{
m_Type = DebugActionKeyType.Button;
m_PressedButtons = buttons;
m_PressedAxis = "";
Trigger(buttons.Length, state);
}
public void TriggerWithAxis(string axis, float state)
{
m_Type = DebugActionKeyType.Axis;
m_PressedAxis = axis;
Trigger(1, state);
}
public void TriggerWithKey(KeyCode[] keys, float state)
{
m_Type = DebugActionKeyType.Key;
m_PressedKeys = keys;
m_PressedAxis = "";
Trigger(keys.Length, state);
}
void Reset()
{
runningAction = false;
m_Timer = 0f;
m_TriggerPressedUp = null;
}
public void Update(DebugActionDesc desc)
{
// Always reset this so that the action can only be caught once until repeat/reset
actionState = 0f;
if (m_TriggerPressedUp != null)
{
m_Timer += Time.deltaTime;
for (int i = 0; i < m_TriggerPressedUp.Length; ++i)
{
if (m_Type == DebugActionKeyType.Button)
m_TriggerPressedUp[i] |= Input.GetButtonUp(m_PressedButtons[i]);
else if (m_Type == DebugActionKeyType.Axis)
m_TriggerPressedUp[i] |= Mathf.Approximately(Input.GetAxis(m_PressedAxis), 0f);
else
m_TriggerPressedUp[i] |= Input.GetKeyUp(m_PressedKeys[i]);
}
bool allTriggerUp = true;
foreach (bool value in m_TriggerPressedUp)
allTriggerUp &= value;
if (allTriggerUp || (m_Timer > desc.repeatDelay && desc.repeatMode == DebugActionRepeatMode.Delay))
Reset();
}
}
}
}

11
ScriptableRenderPipeline/Core/CoreRP/Debugging/DebugManager.Actions.cs.meta


fileFormatVersion: 2
guid: b9ea0a15a47dead4ebc52bd3f7a926c1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

231
ScriptableRenderPipeline/Core/CoreRP/Debugging/DebugManager.cs


using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using UnityEngine.Experimental.Rendering.UI;
namespace UnityEngine.Experimental.Rendering
{
using UnityObject = UnityEngine.Object;
public sealed partial class DebugManager
{
static readonly DebugManager s_Instance = new DebugManager();
public static DebugManager instance { get { return s_Instance; } }
// Explicit static constructor to tell the C# compiler not to mark type as beforefieldinit
static DebugManager() { }
ReadOnlyCollection<DebugUI.Panel> m_ReadOnlyPanels;
readonly List<DebugUI.Panel> m_Panels = new List<DebugUI.Panel>();
public ReadOnlyCollection<DebugUI.Panel> panels
{
get
{
if (m_ReadOnlyPanels == null)
m_ReadOnlyPanels = m_Panels.AsReadOnly();
return m_ReadOnlyPanels;
}
}
public event Action<bool> onDisplayRuntimeUIChanged = delegate { };
public event Action onSetDirty = delegate { };
GameObject m_Root;
DebugUIHandlerCanvas m_RootUICanvas;
GameObject m_PersistentRoot;
DebugUIHandlerPersistentCanvas m_RootUIPersistentCanvas;
public bool displayRuntimeUI
{
get
{
return m_Root != null && m_Root.activeInHierarchy;
}
set
{
if (value && m_Root == null)
{
var uiManager = UnityObject.FindObjectOfType<DebugUIHandlerCanvas>();
if (uiManager != null)
{
m_Root = uiManager.gameObject;
return;
}
m_Root = UnityObject.Instantiate(Resources.Load<Transform>("DebugUI Canvas")).gameObject;
m_Root.name = "[Debug Canvas]";
m_Root.transform.localPosition = Vector3.zero;
m_RootUICanvas = m_Root.GetComponent<DebugUIHandlerCanvas>();
}
if (m_Root != null)
m_Root.SetActive(value);
onDisplayRuntimeUIChanged(value);
}
}
public bool displayPersistentRuntimeUI
{
get { return m_RootUIPersistentCanvas != null && m_PersistentRoot.activeInHierarchy; }
set
{
CheckPersistentCanvas();
m_PersistentRoot.SetActive(value);
}
}
DebugManager()
{
RegisterInputs();
RegisterActions();
}
public void Reset()
{
if (m_Panels != null)
m_Panels.Clear();
}
public int GetState()
{
int hash = 17;
foreach (var panel in m_Panels)
hash = hash * 23 + panel.GetHashCode();
return hash;
}
internal void ChangeSelection(DebugUIHandlerWidget widget, bool fromNext)
{
m_RootUICanvas.ChangeSelection(widget, fromNext);
}
void CheckPersistentCanvas()
{
if (m_RootUIPersistentCanvas == null)
{
var uiManager = UnityObject.FindObjectOfType<DebugUIHandlerPersistentCanvas>();
if (uiManager == null)
{
m_PersistentRoot = UnityObject.Instantiate(Resources.Load<Transform>("DebugUI Persistent Canvas")).gameObject;
m_PersistentRoot.name = "[Debug Canvas - Persistent]";
m_PersistentRoot.transform.localPosition = Vector3.zero;
}
else
{
m_PersistentRoot = uiManager.gameObject;
}
m_RootUIPersistentCanvas = m_PersistentRoot.GetComponent<DebugUIHandlerPersistentCanvas>();
}
}
public void TogglePersistent(DebugUI.Widget widget)
{
if (widget == null)
return;
var valueWidget = widget as DebugUI.Value;
if (valueWidget == null)
{
Debug.Log("Only DebugUI.Value items can be made persistent.");
return;
}
CheckPersistentCanvas();
m_RootUIPersistentCanvas.Toggle(valueWidget);
}
void OnPanelDirty(DebugUI.Panel panel)
{
onSetDirty();
}
// TODO: Optimally we should use a query path here instead of a display name
public DebugUI.Panel GetPanel(string displayName, bool createIfNull = false)
{
foreach (var panel in m_Panels)
{
if (panel.displayName == displayName)
return panel;
}
DebugUI.Panel p = null;
if (createIfNull)
{
p = new DebugUI.Panel { displayName = displayName };
p.onSetDirty += OnPanelDirty;
m_Panels.Add(p);
m_ReadOnlyPanels = m_Panels.AsReadOnly();
}
return p;
}
// TODO: Use a query path here as well instead of a display name
public void RemovePanel(string displayName)
{
DebugUI.Panel panel = null;
foreach (var p in m_Panels)
{
if (p.displayName == displayName)
{
p.onSetDirty -= OnPanelDirty;
panel = p;
break;
}
}
RemovePanel(panel);
}
public void RemovePanel(DebugUI.Panel panel)
{
if (panel == null)
return;
m_Panels.Remove(panel);
m_ReadOnlyPanels = m_Panels.AsReadOnly();
}
public DebugUI.Widget GetItem(string queryPath)
{
foreach (var panel in m_Panels)
{
var w = GetItem(queryPath, panel);
if (w != null)
return w;
}
return null;
}
DebugUI.Widget GetItem(string queryPath, DebugUI.IContainer container)
{
foreach (var child in container.children)
{
if (child.queryPath == queryPath)
return child;
var containerChild = child as DebugUI.IContainer;
if (containerChild != null)
{
var w = GetItem(queryPath, containerChild);
if (w != null)
return w;
}
}
return null;
}
}
}

11
ScriptableRenderPipeline/Core/CoreRP/Debugging/DebugManager.cs.meta


fileFormatVersion: 2
guid: a09c907f481d4894a96697283a87c352
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

127
ScriptableRenderPipeline/Core/CoreRP/Debugging/DebugUI.Containers.cs


namespace UnityEngine.Experimental.Rendering
{
public partial class DebugUI
{
// Base class for "container" type widgets, although it can be used on its own (if a display
// name is set then it'll behave as a group with a header)
public class Container : Widget, IContainer
{
public ObservableList<Widget> children { get; private set; }
public override Panel panel
{
get { return m_Panel; }
internal set
{
m_Panel = value;
// Bubble down
foreach (var child in children)
child.panel = value;
}
}
public Container()
{
displayName = "";
children = new ObservableList<Widget>();
children.ItemAdded += OnItemAdded;
children.ItemRemoved += OnItemRemoved;
}
internal override void GenerateQueryPath()
{
base.GenerateQueryPath();
foreach (var child in children)
child.GenerateQueryPath();
}
protected virtual void OnItemAdded(ObservableList<Widget> sender, ListChangedEventArgs<Widget> e)
{
if (e.item != null)
{
e.item.panel = m_Panel;
e.item.parent = this;
}
if (m_Panel != null)
m_Panel.SetDirty();
}
protected virtual void OnItemRemoved(ObservableList<Widget> sender, ListChangedEventArgs<Widget> e)
{
if (e.item != null)
{
e.item.panel = null;
e.item.parent = null;
}
if (m_Panel != null)
m_Panel.SetDirty();
}
public override int GetHashCode()
{
int hash = 17;
hash = hash * 23 + queryPath.GetHashCode();
foreach (var child in children)
hash = hash * 23 + child.GetHashCode();
return hash;
}
}
// Unity-like foldout that can be collapsed
public class Foldout : Container, IValueField
{
public bool isReadOnly { get { return false; } }
public bool opened;
public bool GetValue()
{
return opened;
}
object IValueField.GetValue()
{
return GetValue();
}
public void SetValue(object value)
{
SetValue((bool)value);
}
public object ValidateValue(object value)
{
return value;
}
public void SetValue(bool value)
{
opened = value;
}
}
// Horizontal layout
public class HBox : Container
{
public HBox()
{
displayName = "HBox";
}
}
// Vertical layout
public class VBox : Container
{
public VBox()
{
displayName = "VBox";
}
}
}
}

11
ScriptableRenderPipeline/Core/CoreRP/Debugging/DebugUI.Containers.cs.meta


fileFormatVersion: 2
guid: 02feae31429679949ab4a4a40c8ad34e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

180
ScriptableRenderPipeline/Core/CoreRP/Debugging/DebugUI.Fields.cs


using System;
using System.Linq;
using UnityEngine.Assertions;
namespace UnityEngine.Experimental.Rendering
{
public partial class DebugUI
{
// Generic field - will be serialized in the editor if it's not read-only
public abstract class Field<T> : Widget, IValueField
{
public Func<T> getter { get; set; }
public Action<T> setter { get; set; }
// This should be an `event` but they don't play nice with object initializers in the
// version of C# we use.
public Action<Field<T>, T> onValueChanged;
object IValueField.ValidateValue(object value)
{
return ValidateValue((T)value);
}
public virtual T ValidateValue(T value)
{
return value;
}
object IValueField.GetValue()
{
return GetValue();
}
public T GetValue()
{
Assert.IsNotNull(getter);
return getter();
}
public void SetValue(object value)
{
SetValue((T)value);
}
public void SetValue(T value)
{
Assert.IsNotNull(setter);
var v = ValidateValue(value);
if (!v.Equals(getter()))
{
setter(v);
if (onValueChanged != null)
onValueChanged(this, v);
}
}
}
public class BoolField : Field<bool> { }
public class IntField : Field<int>
{
public Func<int> min;
public Func<int> max;
// Runtime-only
public int incStep = 1;
public int intStepMult = 10;
public override int ValidateValue(int value)
{
if (min != null) value = Mathf.Max(value, min());
if (max != null) value = Mathf.Min(value, max());
return value;
}
}
public class UIntField : Field<uint>
{
public Func<uint> min;
public Func<uint> max;
// Runtime-only
public uint incStep = 1u;
public uint intStepMult = 10u;
public override uint ValidateValue(uint value)
{
if (min != null) value = (uint)Mathf.Max((int)value, (int)min());
if (max != null) value = (uint)Mathf.Min((int)value, (int)max());
return value;
}
}
public class FloatField : Field<float>
{
public Func<float> min;
public Func<float> max;
// Runtime-only
public float incStep = 0.1f;
public float incStepMult = 10f;
public int decimals = 3;
public override float ValidateValue(float value)
{
if (min != null) value = Mathf.Max(value, min());
if (max != null) value = Mathf.Min(value, max());
return value;
}
}
public class EnumField : Field<int>
{
public GUIContent[] enumNames;
public int[] enumValues;
public Type autoEnum
{
set
{
enumNames = Enum.GetNames(value).Select(x => new GUIContent(x)).ToArray();
enumValues = Enum.GetValues(value).Cast<int>().ToArray();
}
}
}
public class ColorField : Field<Color>
{
public bool hdr = false;
public bool showAlpha = true;
// Editor-only
public bool showPicker = true;
// Runtime-only
public float incStep = 0.025f;
public float incStepMult = 5f;
public int decimals = 3;
public override Color ValidateValue(Color value)
{
if (!hdr)
{
value.r = Mathf.Clamp01(value.r);
value.g = Mathf.Clamp01(value.g);
value.b = Mathf.Clamp01(value.b);
value.a = Mathf.Clamp01(value.a);
}
return value;
}
}
public class Vector2Field : Field<Vector2>
{
// Runtime-only
public float incStep = 0.025f;
public float incStepMult = 10f;
public int decimals = 3;
}
public class Vector3Field : Field<Vector3>
{
// Runtime-only
public float incStep = 0.025f;
public float incStepMult = 10f;
public int decimals = 3;
}
public class Vector4Field : Field<Vector4>
{
// Runtime-only
public float incStep = 0.025f;
public float incStepMult = 10f;
public int decimals = 3;
}
}
}

11
ScriptableRenderPipeline/Core/CoreRP/Debugging/DebugUI.Fields.cs.meta


fileFormatVersion: 2
guid: 332920c028664644e9e4e1bf5a1631d5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

70
ScriptableRenderPipeline/Core/CoreRP/Debugging/DebugUI.Panel.cs


using System;
namespace UnityEngine.Experimental.Rendering
{
public partial class DebugUI
{
// Root panel class - we don't want to extend Container here because we need a clear
// separation between debug panels and actual widgets
public class Panel : IContainer
{
public Flags flags { get; set; }
public string displayName { get; set; }
public string queryPath { get { return displayName; } }
public bool isEditorOnly { get { return (flags & Flags.EditorOnly) != 0; } }
public bool isRuntimeOnly { get { return (flags & Flags.RuntimeOnly) != 0; } }
public ObservableList<Widget> children { get; private set; }
public event Action<Panel> onSetDirty = delegate { };
public Panel()
{
children = new ObservableList<Widget>();
children.ItemAdded += OnItemAdded;
children.ItemRemoved += OnItemRemoved;
}
protected virtual void OnItemAdded(ObservableList<Widget> sender, ListChangedEventArgs<Widget> e)
{
if (e.item != null)
{
e.item.panel = this;
e.item.parent = this;
}
SetDirty();
}
protected virtual void OnItemRemoved(ObservableList<Widget> sender, ListChangedEventArgs<Widget> e)
{
if (e.item != null)
{
e.item.panel = null;
e.item.parent = null;
}
SetDirty();
}
public void SetDirty()
{
foreach (var child in children)
child.GenerateQueryPath();
onSetDirty(this);
}
public override int GetHashCode()
{
int hash = 17;
hash = hash * 23 + displayName.GetHashCode();
foreach (var child in children)
hash = hash * 23 + child.GetHashCode();
return hash;
}
}
}
}

11
ScriptableRenderPipeline/Core/CoreRP/Debugging/DebugUI.Panel.cs.meta


fileFormatVersion: 2
guid: 9a33c6b643214f847b2e0cf1721a64db
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

99
ScriptableRenderPipeline/Core/CoreRP/Debugging/DebugUI.cs


using System;
using UnityEngine.Assertions;
namespace UnityEngine.Experimental.Rendering
{
public partial class DebugUI
{
[Flags]
public enum Flags
{
None = 0,
EditorOnly = 1 << 1,
RuntimeOnly = 1 << 2
}
// Base class for all debug UI widgets
public abstract class Widget
{
// Set to null until it's added to a panel, be careful
protected Panel m_Panel;
public virtual Panel panel
{
get { return m_Panel; }
internal set { m_Panel = value; }
}
protected IContainer m_Parent;
public virtual IContainer parent
{
get { return m_Parent; }
internal set { m_Parent = value; }
}
public Flags flags { get; set; }
public string displayName { get; set; }
public string queryPath { get; private set; }
public bool isEditorOnly { get { return (flags & Flags.EditorOnly) != 0; } }
public bool isRuntimeOnly { get { return (flags & Flags.RuntimeOnly) != 0; } }
internal virtual void GenerateQueryPath()
{
queryPath = displayName.Trim();
if (m_Parent != null)
queryPath = m_Parent.queryPath + " -> " + queryPath;
}
public override int GetHashCode()
{
return queryPath.GetHashCode();
}
public void RemoveSelf()
{
if (parent != null)
parent.children.Remove(this);
}
}
// Any widget that can holds other widgets must implement this interface
public interface IContainer
{
ObservableList<Widget> children { get; }
string displayName { get; set; }
string queryPath { get; }
}
// Any widget that implements this will be considered for serialization (only if the setter
// is set and thus is not read-only)
public interface IValueField
{
object GetValue();
void SetValue(object value);
object ValidateValue(object value);
}
// Miscellaneous
public class Button : Widget
{
public Action action { get; set; }
}
public class Value : Widget
{
public Func<object> getter { get; set; }
// Runtime-only
public float refreshRate = 0.1f;
public object GetValue()
{
Assert.IsNotNull(getter);
return getter();
}
}
}
}

11
ScriptableRenderPipeline/Core/CoreRP/Debugging/DebugUI.cs.meta


fileFormatVersion: 2
guid: 4cce618ad8a6d934dbdc631f979b3aa6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

24
ScriptableRenderPipeline/Core/CoreRP/Debugging/DebugUpdater.cs


namespace UnityEngine.Experimental.Rendering
{
public class DebugUpdater : MonoBehaviour
{
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterSceneLoad)]
static void RuntimeInit()
{
if (FindObjectOfType<DebugUpdater>() != null)
return;
var go = new GameObject { name = "[Debug Updater]" };
go.AddComponent<DebugUpdater>();
DontDestroyOnLoad(go);
}
void Update()
{
DebugManager.instance.UpdateActions();
if (DebugManager.instance.GetAction(DebugAction.EnableDebugMenu) != 0.0f)
DebugManager.instance.displayRuntimeUI = !DebugManager.instance.displayRuntimeUI;
}
}
}

11
ScriptableRenderPipeline/Core/CoreRP/Debugging/DebugUpdater.cs.meta


fileFormatVersion: 2
guid: 6fa749f6d8ed4b441af9aa005fe0f895
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

8
ScriptableRenderPipeline/Core/CoreRP/Debugging/Prefabs.meta


fileFormatVersion: 2
guid: d2160913896effa4aa65b93012ff3465
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
ScriptableRenderPipeline/Core/CoreRP/Editor/CoreResources.meta


fileFormatVersion: 2
guid: a6209f4861b884a41ba167d4c8b50646
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

97
ScriptableRenderPipeline/Core/CoreRP/Editor/Debugging/DebugState.cs


using System;
using UnityEngine;
using UnityEngine.Experimental.Rendering;
namespace UnityEditor.Experimental.Rendering
{
[Serializable]
public abstract class DebugState : ScriptableObject
{
[SerializeField]
protected string m_QueryPath;
public string queryPath
{
get { return m_QueryPath; }
internal set { m_QueryPath = value; }
}
public abstract object GetValue();
public abstract void SetValue(object value, DebugUI.IValueField field);
public virtual void OnEnable()
{
hideFlags = HideFlags.HideAndDontSave;
}
}
[Serializable]
public class DebugState<T> : DebugState
{
[SerializeField]
protected T m_Value;
public virtual T value
{
get { return m_Value; }
set { m_Value = value; }
}
public override object GetValue()
{
return value;
}
public override void SetValue(object value, DebugUI.IValueField field)
{
this.value = (T)field.ValidateValue(value);
}
public override int GetHashCode()
{
unchecked
{
int hash = 13;
hash = hash * 23 + m_QueryPath.GetHashCode();
hash = hash * 23 + m_Value.GetHashCode();
return hash;
}
}
}
public sealed class DebugStateAttribute : Attribute
{
public readonly Type[] types;
public DebugStateAttribute(params Type[] types)
{
this.types = types;
}
}
// Builtins
[Serializable, DebugState(typeof(DebugUI.BoolField), typeof(DebugUI.Foldout))]
public sealed class DebugStateBool : DebugState<bool> { }
[Serializable, DebugState(typeof(DebugUI.IntField), typeof(DebugUI.EnumField))]
public sealed class DebugStateInt : DebugState<int> { }
[Serializable, DebugState(typeof(DebugUI.UIntField))]
public sealed class DebugStateUInt : DebugState<uint> { }
[Serializable, DebugState(typeof(DebugUI.FloatField))]
public sealed class DebugStateFloat : DebugState<float> { }
[Serializable, DebugState(typeof(DebugUI.ColorField))]
public sealed class DebugStateColor : DebugState<Color> { }
[Serializable, DebugState(typeof(DebugUI.Vector2Field))]
public sealed class DebugStateVector2 : DebugState<Vector2> { }
[Serializable, DebugState(typeof(DebugUI.Vector3Field))]
public sealed class DebugStateVector3 : DebugState<Vector3> { }
[Serializable, DebugState(typeof(DebugUI.Vector4Field))]
public sealed class DebugStateVector4 : DebugState<Vector4> { }
}

11
ScriptableRenderPipeline/Core/CoreRP/Editor/Debugging/DebugState.cs.meta


fileFormatVersion: 2
guid: 7270f3dffc138834da5642e5943f5072
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

304
ScriptableRenderPipeline/Core/CoreRP/Editor/Debugging/DebugUIDrawer.Builtins.cs


using UnityEngine;
using UnityEngine.Experimental.Rendering;
namespace UnityEditor.Experimental.Rendering
{
[DebugUIDrawer(typeof(DebugUI.Value))]
public sealed class DebugUIDrawerValue : DebugUIDrawer
{
public override bool OnGUI(DebugUI.Widget widget, DebugState state)
{
var w = Cast<DebugUI.Value>(widget);
var rect = PrepareControlRect();
EditorGUI.LabelField(rect, CoreEditorUtils.GetContent(w.displayName), CoreEditorUtils.GetContent(w.GetValue().ToString()));
return true;
}
}
[DebugUIDrawer(typeof(DebugUI.Button))]
public sealed class DebugUIDrawerButton : DebugUIDrawer
{
public override bool OnGUI(DebugUI.Widget widget, DebugState state)
{
var w = Cast<DebugUI.Button>(widget);
var rect = EditorGUI.IndentedRect(EditorGUILayout.GetControlRect());
if (GUI.Button(rect, w.displayName, EditorStyles.miniButton))
{
if (w.action != null)
w.action();
}
return true;
}
}
[DebugUIDrawer(typeof(DebugUI.BoolField))]
public sealed class DebugUIDrawerBoolField : DebugUIDrawer
{
public override bool OnGUI(DebugUI.Widget widget, DebugState state)
{
var w = Cast<DebugUI.BoolField>(widget);
var s = Cast<DebugStateBool>(state);
EditorGUI.BeginChangeCheck();
var rect = PrepareControlRect();
bool value = EditorGUI.Toggle(rect, CoreEditorUtils.GetContent(w.displayName), s.value);
if (EditorGUI.EndChangeCheck())
Apply(w, s, value);
return true;
}
}
[DebugUIDrawer(typeof(DebugUI.IntField))]
public sealed class DebugUIDrawerIntField : DebugUIDrawer
{
public override bool OnGUI(DebugUI.Widget widget, DebugState state)
{
var w = Cast<DebugUI.IntField>(widget);
var s = Cast<DebugStateInt>(state);
EditorGUI.BeginChangeCheck();
var rect = PrepareControlRect();
int value = w.min != null && w.max != null
? EditorGUI.IntSlider(rect, CoreEditorUtils.GetContent(w.displayName), s.value, w.min(), w.max())
: EditorGUI.IntField(rect, CoreEditorUtils.GetContent(w.displayName), s.value);
if (EditorGUI.EndChangeCheck())
Apply(w, s, value);
return true;
}
}
[DebugUIDrawer(typeof(DebugUI.UIntField))]
public sealed class DebugUIDrawerUIntField : DebugUIDrawer
{
public override bool OnGUI(DebugUI.Widget widget, DebugState state)
{
var w = Cast<DebugUI.UIntField>(widget);
var s = Cast<DebugStateUInt>(state);
EditorGUI.BeginChangeCheck();
// No UIntField so we need to max to 0 ourselves or the value will wrap around
var rect = PrepareControlRect();
int tmp = w.min != null && w.max != null
? EditorGUI.IntSlider(rect, CoreEditorUtils.GetContent(w.displayName), Mathf.Max(0, (int)s.value), Mathf.Max(0, (int)w.min()), Mathf.Max(0, (int)w.max()))
: EditorGUI.IntField(rect, CoreEditorUtils.GetContent(w.displayName), Mathf.Max(0, (int)s.value));
uint value = (uint)Mathf.Max(0, tmp);
if (EditorGUI.EndChangeCheck())
Apply(w, s, value);
return true;
}
}
[DebugUIDrawer(typeof(DebugUI.FloatField))]
public sealed class DebugUIDrawerFloatField : DebugUIDrawer
{
public override bool OnGUI(DebugUI.Widget widget, DebugState state)
{
var w = Cast<DebugUI.FloatField>(widget);
var s = Cast<DebugStateFloat>(state);
EditorGUI.BeginChangeCheck();
var rect = PrepareControlRect();
float value = w.min != null && w.max != null
? EditorGUI.Slider(rect, CoreEditorUtils.GetContent(w.displayName), s.value, w.min(), w.max())
: EditorGUI.FloatField(rect, CoreEditorUtils.GetContent(w.displayName), s.value);
if (EditorGUI.EndChangeCheck())
Apply(w, s, value);
return true;
}
}
[DebugUIDrawer(typeof(DebugUI.EnumField))]
public sealed class DebugUIDrawerEnumField : DebugUIDrawer
{
public override bool OnGUI(DebugUI.Widget widget, DebugState state)
{
var w = Cast<DebugUI.EnumField>(widget);
var s = Cast<DebugStateInt>(state);
EditorGUI.BeginChangeCheck();
int value = s.value;
if (w.enumNames == null || w.enumValues == null)
{
EditorGUILayout.LabelField("Can't draw an empty enumeration.");
}
else
{
var rect = PrepareControlRect();
value = EditorGUI.IntPopup(rect, CoreEditorUtils.GetContent(w.displayName), s.value, w.enumNames, w.enumValues);
}
if (EditorGUI.EndChangeCheck())
Apply(w, s, value);
return true;
}
}
[DebugUIDrawer(typeof(DebugUI.Foldout))]
public sealed class DebugUIDrawerFoldout : DebugUIDrawer
{
public override void Begin(DebugUI.Widget widget, DebugState state)
{
var w = Cast<DebugUI.Foldout>(widget);
var s = Cast<DebugStateBool>(state);
EditorGUI.BeginChangeCheck();
bool value = EditorGUILayout.Foldout(s.value, CoreEditorUtils.GetContent(w.displayName), true);
if (EditorGUI.EndChangeCheck())
Apply(w, s, value);
EditorGUI.indentLevel++;
}
public override bool OnGUI(DebugUI.Widget node, DebugState state)
{
var s = Cast<DebugStateBool>(state);
return s.value;
}
public override void End(DebugUI.Widget node, DebugState state)
{
EditorGUI.indentLevel--;
}
}
[DebugUIDrawer(typeof(DebugUI.ColorField))]
public sealed class DebugUIDrawerColorField : DebugUIDrawer
{
public override bool OnGUI(DebugUI.Widget widget, DebugState state)
{
var w = Cast<DebugUI.ColorField>(widget);
var s = Cast<DebugStateColor>(state);
EditorGUI.BeginChangeCheck();
var rect = PrepareControlRect();
var value = EditorGUI.ColorField(rect, CoreEditorUtils.GetContent(w.displayName), s.value, w.showPicker, w.showAlpha, w.hdr);
if (EditorGUI.EndChangeCheck())
Apply(w, s, value);
return true;
}
}
[DebugUIDrawer(typeof(DebugUI.Vector2Field))]
public sealed class DebugUIDrawerVector2Field : DebugUIDrawer
{
public override bool OnGUI(DebugUI.Widget widget, DebugState state)
{
var w = Cast<DebugUI.Vector2Field>(widget);
var s = Cast<DebugStateVector2>(state);
EditorGUI.BeginChangeCheck();
var value = EditorGUILayout.Vector2Field(w.displayName, s.value);
if (EditorGUI.EndChangeCheck())
Apply(w, s, value);
return true;
}
}
[DebugUIDrawer(typeof(DebugUI.Vector3Field))]
public sealed class DebugUIDrawerVector3Field : DebugUIDrawer
{
public override bool OnGUI(DebugUI.Widget widget, DebugState state)
{
var w = Cast<DebugUI.Vector3Field>(widget);
var s = Cast<DebugStateVector3>(state);
EditorGUI.BeginChangeCheck();
var value = EditorGUILayout.Vector3Field(w.displayName, s.value);
if (EditorGUI.EndChangeCheck())
Apply(w, s, value);
return true;
}
}
[DebugUIDrawer(typeof(DebugUI.Vector4Field))]
public sealed class DebugUIDrawerVector4Field : DebugUIDrawer
{
public override bool OnGUI(DebugUI.Widget widget, DebugState state)
{
var w = Cast<DebugUI.Vector4Field>(widget);
var s = Cast<DebugStateVector4>(state);
EditorGUI.BeginChangeCheck();
var value = EditorGUILayout.Vector4Field(w.displayName, s.value);
if (EditorGUI.EndChangeCheck())
Apply(w, s, value);
return true;
}
}
[DebugUIDrawer(typeof(DebugUI.Container))]
public sealed class DebugUIDrawerContainer : DebugUIDrawer
{
public override void Begin(DebugUI.Widget widget, DebugState state)
{
if (!string.IsNullOrEmpty(widget.displayName))
EditorGUILayout.LabelField(widget.displayName, EditorStyles.boldLabel);
EditorGUI.indentLevel++;
}
public override void End(DebugUI.Widget widget, DebugState state)
{
EditorGUI.indentLevel--;
}
}
[DebugUIDrawer(typeof(DebugUI.HBox))]
public sealed class DebugUIDrawerHBox : DebugUIDrawer
{
public override void Begin(DebugUI.Widget widget, DebugState state)
{
EditorGUILayout.BeginHorizontal();
}
public override void End(DebugUI.Widget widget, DebugState state)
{
EditorGUILayout.EndHorizontal();
}
}
[DebugUIDrawer(typeof(DebugUI.VBox))]
public sealed class DebugUIDrawerVBox : DebugUIDrawer
{
public override void Begin(DebugUI.Widget widget, DebugState state)
{
EditorGUILayout.BeginVertical();
}
public override void End(DebugUI.Widget widget, DebugState state)
{
EditorGUILayout.EndVertical();
}
}
}

11
ScriptableRenderPipeline/Core/CoreRP/Editor/Debugging/DebugUIDrawer.Builtins.cs.meta


fileFormatVersion: 2
guid: 7f9e548e5e2920b47987881c21171ef6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

62
ScriptableRenderPipeline/Core/CoreRP/Editor/Debugging/DebugUIDrawer.cs


using System;
using UnityEngine;
using UnityEngine.Experimental.Rendering;
namespace UnityEditor.Experimental.Rendering
{
public class DebugUIDrawerAttribute : Attribute
{
public readonly Type type;
public DebugUIDrawerAttribute(Type type)
{
this.type = type;
}
}
public class DebugUIDrawer
{
protected T Cast<T>(object o)
where T : class
{
var casted = o as T;
string typeName = o == null ? "null" : o.GetType().ToString();
if (casted == null)
throw new InvalidOperationException("Can't cast " + typeName + " to " + typeof(T));
return casted;
}
public virtual void Begin(DebugUI.Widget widget, DebugState state)
{ }
public virtual bool OnGUI(DebugUI.Widget widget, DebugState state)
{
return true;
}
public virtual void End(DebugUI.Widget widget, DebugState state)
{ }
protected void Apply(DebugUI.IValueField widget, DebugState state, object value)
{
Undo.RegisterCompleteObjectUndo(state, "Debug Property Change");
state.SetValue(value, widget);
widget.SetValue(value);
EditorUtility.SetDirty(state);
UnityEditorInternal.InternalEditorUtility.RepaintAllViews();
}
protected Rect PrepareControlRect(float height = -1)
{
if (height < 0)
height = EditorGUIUtility.singleLineHeight;
var rect = GUILayoutUtility.GetRect(1f, 1f, height, height);
rect.width -= 2f;
rect.xMin += 2f;
EditorGUIUtility.labelWidth = rect.width / 2f;
return rect;
}
}
}

11
ScriptableRenderPipeline/Core/CoreRP/Editor/Debugging/DebugUIDrawer.cs.meta


fileFormatVersion: 2
guid: 3581d3ff7a65eee458feb865b7f29154
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

78
ScriptableRenderPipeline/Core/CoreRP/Editor/Debugging/DebugUIHandlerCanvasEditor.cs


using System;
using System.Linq;
using UnityEditor;
using UnityEditor.Experimental.Rendering;
using UnityEditorInternal;
namespace UnityEngine.Experimental.Rendering.UI
{
[CustomEditor(typeof(DebugUIHandlerCanvas))]
public sealed class DebugUIHandlerCanvasEditor : Editor
{
SerializedProperty m_PanelPrefab;
SerializedProperty m_Prefabs;
ReorderableList m_PrefabList;
static string[] s_Types; // Assembly qualified names
static string[] s_DisplayTypes; // Pretty names
static DebugUIHandlerCanvasEditor()
{
s_Types = CoreUtils.GetAllAssemblyTypes()
.Where(t => t.IsSubclassOf(typeof(DebugUI.Widget)) && !t.IsAbstract)
.Select(t => t.AssemblyQualifiedName)
.ToArray();
s_DisplayTypes = new string[s_Types.Length];
for (int i = 0; i < s_Types.Length; i++)
s_DisplayTypes[i] = Type.GetType(s_Types[i]).Name;
}
void OnEnable()
{
var o = new PropertyFetcher<DebugUIHandlerCanvas>(serializedObject);
m_PanelPrefab = o.Find(x => x.panelPrefab);
m_Prefabs = o.Find(x => x.prefabs);
m_PrefabList = new ReorderableList(serializedObject, m_Prefabs, true, true, true, true)
{
drawHeaderCallback = rect => EditorGUI.LabelField(rect, "Widget Prefabs"),
drawElementCallback = (rect, index, isActive, isFocused) =>
{
var element = m_PrefabList.serializedProperty.GetArrayElementAtIndex(index);
rect.y += 2f;
const float kTypeWidth = 100f;
// Type selector
var typeProp = element.FindPropertyRelative("type");
int typeIndex = ArrayUtility.IndexOf(s_Types, typeProp.stringValue);
typeIndex = Mathf.Max(typeIndex, 0);
typeIndex = EditorGUI.Popup(new Rect(rect.x, rect.y, kTypeWidth, EditorGUIUtility.singleLineHeight), typeIndex, s_DisplayTypes);
typeProp.stringValue = s_Types[typeIndex];
// Prefab
EditorGUI.PropertyField(
new Rect(rect.x + kTypeWidth + 2f, rect.y, rect.width - kTypeWidth - 2f, EditorGUIUtility.singleLineHeight),
element.FindPropertyRelative("prefab"), GUIContent.none);
},
onSelectCallback = list =>
{
var prefab = list.serializedProperty.GetArrayElementAtIndex(list.index).FindPropertyRelative("prefab").objectReferenceValue as GameObject;
if (prefab)
EditorGUIUtility.PingObject(prefab.gameObject);
}
};
}
public override void OnInspectorGUI()
{
serializedObject.Update();
EditorGUILayout.PropertyField(m_PanelPrefab);
EditorGUILayout.Space();
m_PrefabList.DoLayoutList();
serializedObject.ApplyModifiedProperties();
}
}
}

11
ScriptableRenderPipeline/Core/CoreRP/Editor/Debugging/DebugUIHandlerCanvasEditor.cs.meta


fileFormatVersion: 2
guid: f1d41f85c15ac6048a850b51ff36c098
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

438
ScriptableRenderPipeline/Core/CoreRP/Editor/Debugging/DebugWindow.cs


using System;
using System.Collections.Generic;
using System.Linq;
using UnityEditor.Callbacks;
using UnityEngine;
using UnityEngine.Experimental.Rendering;
namespace UnityEditor.Experimental.Rendering
{
#pragma warning disable 414
[Serializable]
sealed class WidgetStateDictionary : SerializedDictionary<string, DebugState> { }
sealed class DebugWindowSettings : ScriptableObject
{
// Keep these settings in a separate scriptable object so we can handle undo/redo on them
// without the rest of the debug window interfering
public int currentStateHash;
public int selectedPanel;
void OnEnable()
{
hideFlags = HideFlags.HideAndDontSave;
}
}
public sealed class DebugWindow : EditorWindow
{
static Styles s_Styles;
[SerializeField]
WidgetStateDictionary m_WidgetStates;
[SerializeField]
DebugWindowSettings m_Settings;
[SerializeField]
int m_DebugTreeState;
bool m_IsDirty;
Vector2 m_PanelScroll;
Vector2 m_ContentScroll;
static bool s_TypeMapDirty;
static Dictionary<Type, Type> s_WidgetStateMap; // DebugUI.Widget type -> DebugState type
static Dictionary<Type, DebugUIDrawer> s_WidgetDrawerMap; // DebugUI.Widget type -> DebugUIDrawer
[DidReloadScripts]
static void OnEditorReload()
{
s_TypeMapDirty = true;
}
static void RebuildTypeMaps()
{
var assemblyTypes = CoreUtils.GetAllAssemblyTypes();
// Map states to widget (a single state can map to several widget types if the value to
// serialize is the same)
var attrType = typeof(DebugStateAttribute);
var stateTypes = assemblyTypes
.Where(
t => t.IsSubclassOf(typeof(DebugState))
&& t.IsDefined(attrType, false)
&& !t.IsAbstract
);
s_WidgetStateMap = new Dictionary<Type, Type>();
foreach (var stateType in stateTypes)
{
var attr = (DebugStateAttribute)stateType.GetCustomAttributes(attrType, false)[0];
foreach (var t in attr.types)
s_WidgetStateMap.Add(t, stateType);
}
// Drawers
attrType = typeof(DebugUIDrawerAttribute);
var types = assemblyTypes
.Where(
t => t.IsSubclassOf(typeof(DebugUIDrawer))
&& t.IsDefined(attrType, false)
&& !t.IsAbstract
);
s_WidgetDrawerMap = new Dictionary<Type, DebugUIDrawer>();
foreach (var t in types)
{
var attr = (DebugUIDrawerAttribute)t.GetCustomAttributes(attrType, false)[0];
var inst = (DebugUIDrawer)Activator.CreateInstance(t);
s_WidgetDrawerMap.Add(attr.type, inst);
}
// Done
s_TypeMapDirty = false;
}
[MenuItem("Window/Render Pipeline/Debug Window", priority = CoreUtils.editMenuPriority2)]
static void Init()
{
var window = GetWindow<DebugWindow>();
window.titleContent = new GUIContent("Debugging");
}
void OnEnable()
{
hideFlags = HideFlags.HideAndDontSave;
autoRepaintOnSceneChange = true;
if (m_Settings == null)
m_Settings = CreateInstance<DebugWindowSettings>();
if (m_WidgetStates == null)
m_WidgetStates = new WidgetStateDictionary();
if (s_WidgetStateMap == null || s_WidgetDrawerMap == null || s_TypeMapDirty)
RebuildTypeMaps();
Undo.undoRedoPerformed += OnUndoRedoPerformed;
DebugManager.instance.onSetDirty += MarkDirty;
// First init
m_DebugTreeState = DebugManager.instance.GetState();
UpdateWidgetStates();
}
// Note: this won't get called if the window is opened when the editor itself is closed
void OnDestroy()
{
DebugManager.instance.onSetDirty -= MarkDirty;
if (m_WidgetStates != null)
{
// Clear all the states from memory
foreach (var state in m_WidgetStates)
{
var s = state.Value;
Undo.ClearUndo(s); // Don't leave dangling states in the global undo/redo stack
DestroyImmediate(s);
}
m_WidgetStates.Clear();
}
}
void MarkDirty()
{
m_IsDirty = true;
}
// We use item states to keep a cached value of each serializable debug items in order to
// handle domain reloads, play mode entering/exiting and undo/redo
// Note: no removal of orphan states
void UpdateWidgetStates()
{
foreach (var panel in DebugManager.instance.panels)
UpdateWidgetStates(panel);
}
void UpdateWidgetStates(DebugUI.IContainer container)
{
// Skip runtime only containers, we won't draw them so no need to serialize them either
var actualWidget = container as DebugUI.Widget;
if (actualWidget != null && actualWidget.isRuntimeOnly)
return;
// Recursively update widget states
foreach (var widget in container.children)
{
// Skip non-serializable widgets but still traverse them in case one of their
// children needs serialization support
var valueField = widget as DebugUI.IValueField;
if (valueField != null)
{
// Skip runtime & readonly only items
if (widget.isRuntimeOnly)
return;
var widgetType = widget.GetType();
string guid = widget.queryPath;
Type stateType;
s_WidgetStateMap.TryGetValue(widgetType, out stateType);
// Create missing states & recreate the ones that are null
if (stateType != null)
{
if (!m_WidgetStates.ContainsKey(guid) || m_WidgetStates[guid] == null)
{
var inst = (DebugState)CreateInstance(stateType);
inst.queryPath = guid;
inst.SetValue(valueField.GetValue(), valueField);
m_WidgetStates[guid] = inst;
}
}
}
// Recurse if the widget is a container
var containerField = widget as DebugUI.IContainer;
if (containerField != null)
UpdateWidgetStates(containerField);
}
}
public void ApplyStates()
{
foreach (var state in m_WidgetStates)
{
var widget = DebugManager.instance.GetItem(state.Key) as DebugUI.IValueField;
if (widget == null)
continue;
widget.SetValue(state.Value.GetValue());
}
}
void OnUndoRedoPerformed()
{
int stateHash = ComputeStateHash();
// Something has been undone / redone, re-apply states to the debug tree
if (stateHash != m_Settings.currentStateHash)
{
ApplyStates();
m_Settings.currentStateHash = stateHash;
}
Repaint();
}
int ComputeStateHash()
{
unchecked
{
int hash = 13;
foreach (var state in m_WidgetStates)
hash = hash * 23 + state.Value.GetHashCode();
return hash;
}
}
void Update()
{
int treeState = DebugManager.instance.GetState();
if (m_DebugTreeState != treeState || m_IsDirty)
{
UpdateWidgetStates();
ApplyStates();
m_DebugTreeState = treeState;
m_IsDirty = false;
}
}
void OnGUI()
{
if (s_Styles == null)
s_Styles = new Styles();
var panels = DebugManager.instance.panels;
int itemCount = panels.Count(x => !x.isRuntimeOnly && x.children.Count(w => !w.isRuntimeOnly) > 0);
if (itemCount == 0)
{
EditorGUILayout.HelpBox("No debug item found.", MessageType.Info);
return;
}
// Background color
var wrect = position;
wrect.x = 0;
wrect.y = 0;
var oldColor = GUI.color;
GUI.color = s_Styles.skinBackgroundColor;
GUI.DrawTexture(wrect, EditorGUIUtility.whiteTexture);
GUI.color = oldColor;
using (new EditorGUILayout.HorizontalScope())
{
// Side bar
using (var scrollScope = new EditorGUILayout.ScrollViewScope(m_PanelScroll, s_Styles.sectionScrollView, GUILayout.Width(150f)))
{
GUILayout.Space(40f);
if (m_Settings.selectedPanel >= panels.Count)
m_Settings.selectedPanel = 0;
// Validate container id
while (panels[m_Settings.selectedPanel].isRuntimeOnly || panels[m_Settings.selectedPanel].children.Count(x => !x.isRuntimeOnly) == 0)
{
m_Settings.selectedPanel++;
if (m_Settings.selectedPanel >= panels.Count)
m_Settings.selectedPanel = 0;
}
// Root children are containers
for (int i = 0; i < panels.Count; i++)
{
var panel = panels[i];
if (panel.isRuntimeOnly)
continue;
if (panel.children.Count(x => !x.isRuntimeOnly) == 0)
continue;
var elementRect = GUILayoutUtility.GetRect(CoreEditorUtils.GetContent(panel.displayName), s_Styles.sectionElement, GUILayout.ExpandWidth(true));
if (m_Settings.selectedPanel == i && Event.current.type == EventType.Repaint)
s_Styles.selected.Draw(elementRect, false, false, false, false);
if (GUI.Toggle(elementRect, m_Settings.selectedPanel == i, panel.displayName, s_Styles.sectionElement))
{
Undo.RecordObject(m_Settings, "Debug Panel Selection");
m_Settings.selectedPanel = i;
}
}
m_PanelScroll = scrollScope.scrollPosition;
}
GUILayout.Space(10f);
// Main section - traverse current container
using (var changedScope = new EditorGUI.ChangeCheckScope())
{
using (new EditorGUILayout.VerticalScope())
{
var selectedPanel = panels[m_Settings.selectedPanel];
GUILayout.Label(selectedPanel.displayName, s_Styles.sectionHeader);
GUILayout.Space(10f);
using (var scrollScope = new EditorGUILayout.ScrollViewScope(m_ContentScroll))
{
TraverseContainerGUI(selectedPanel);
m_ContentScroll = scrollScope.scrollPosition;
}
}
if (changedScope.changed)
m_Settings.currentStateHash = ComputeStateHash();
}
}
}
void OnWidgetGUI(DebugUI.Widget widget)
{
if (widget.isRuntimeOnly)
return;
DebugState state; // State will be null for stateless widget
m_WidgetStates.TryGetValue(widget.queryPath, out state);
DebugUIDrawer drawer;
if (!s_WidgetDrawerMap.TryGetValue(widget.GetType(), out drawer))
{
EditorGUILayout.LabelField("Drawer not found (" + widget.GetType() + ").");
}
else
{
drawer.Begin(widget, state);
if (drawer.OnGUI(widget, state))
{
var container = widget as DebugUI.IContainer;
if (container != null)
TraverseContainerGUI(container);
}
drawer.End(widget, state);
}
}
void TraverseContainerGUI(DebugUI.IContainer container)
{
// /!\ SHAAAAAAAME ALERT /!\
// A container can change at runtime because of the way IMGUI works and how we handle
// onValueChanged on widget so we have to take this into account while iterating
try
{
foreach (var widget in container.children)
OnWidgetGUI(widget);
}
catch (InvalidOperationException)
{
Repaint();
}
}
public class Styles
{
public static float s_DefaultLabelWidth = 0.5f;
public readonly GUIStyle sectionScrollView = "PreferencesSectionBox";
public readonly GUIStyle sectionElement = "PreferencesSection";
public readonly GUIStyle selected = "OL SelectedRow";
public readonly GUIStyle sectionHeader = new GUIStyle(EditorStyles.largeLabel);
public readonly Color skinBackgroundColor;
public Styles()
{
sectionScrollView = new GUIStyle(sectionScrollView);
sectionScrollView.overflow.bottom += 1;
sectionHeader.fontStyle = FontStyle.Bold;
sectionHeader.fontSize = 18;
sectionHeader.margin.top = 10;
sectionHeader.margin.left += 1;
sectionHeader.normal.textColor = !EditorGUIUtility.isProSkin
? new Color(0.4f, 0.4f, 0.4f, 1.0f)
: new Color(0.7f, 0.7f, 0.7f, 1.0f);
if (EditorGUIUtility.isProSkin)
{
sectionHeader.normal.textColor = new Color(0.7f, 0.7f, 0.7f, 1.0f);
skinBackgroundColor = Color.gray * new Color(0.3f, 0.3f, 0.3f, 0.5f);
}
else
{
sectionHeader.normal.textColor = new Color(0.4f, 0.4f, 0.4f, 1.0f);
skinBackgroundColor = Color.gray * new Color(1f, 1f, 1f, 0.32f);
}
}
}
}
#pragma warning restore 414
}

11
ScriptableRenderPipeline/Core/CoreRP/Editor/Debugging/DebugWindow.cs.meta


fileFormatVersion: 2
guid: 41147144ff556e246b736135eb26f185
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

34
ScriptableRenderPipeline/Core/CoreRP/Editor/Debugging/UIFoldoutEditor.cs


using UnityEngine.Experimental.Rendering.UI;
namespace UnityEditor.Experimental.Rendering.UI
{
[CustomEditor(typeof(UIFoldout), true)]
sealed class UIFoldoutEditor : Editor
{
SerializedProperty m_IsOn;
SerializedProperty m_Content;
SerializedProperty m_ArrowClosed;
SerializedProperty m_ArrowOpened;
void OnEnable()
{
var o = new PropertyFetcher<UIFoldout>(serializedObject);
m_IsOn = o.Find("m_IsOn");
m_Content = o.Find(x => x.content);
m_ArrowClosed = o.Find(x => x.arrowClosed);
m_ArrowOpened = o.Find(x => x.arrowOpened);
}
public override void OnInspectorGUI()
{
serializedObject.Update();
EditorGUILayout.PropertyField(m_IsOn);
EditorGUILayout.PropertyField(m_Content);
EditorGUILayout.PropertyField(m_ArrowClosed);
EditorGUILayout.PropertyField(m_ArrowOpened);
serializedObject.ApplyModifiedProperties();
}
}
}

11
ScriptableRenderPipeline/Core/CoreRP/Editor/Debugging/UIFoldoutEditor.cs.meta


fileFormatVersion: 2
guid: e89075dc59755d8479f34df9e20926e1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

146
ScriptableRenderPipeline/Core/CoreRP/ObservableList.cs


using System;
using System.Collections;
using System.Collections.Generic;
namespace UnityEngine.Experimental.Rendering
{
public sealed class ListChangedEventArgs<T> : EventArgs
{
public readonly int index;
public readonly T item;
public ListChangedEventArgs(int index, T item)
{
this.index = index;
this.item = item;
}
}
public delegate void ListChangedEventHandler<T>(ObservableList<T> sender, ListChangedEventArgs<T> e);
public class ObservableList<T> : IList<T>
{
IList<T> m_List;
public event ListChangedEventHandler<T> ItemAdded;
public event ListChangedEventHandler<T> ItemRemoved;
public T this[int index]
{
get { return m_List[index]; }
set
{
OnEvent(ItemRemoved, index, m_List[index]);
m_List[index] = value;
OnEvent(ItemAdded, index, value);
}
}
public int Count
{
get { return m_List.Count; }
}
public bool IsReadOnly
{
get { return false; }
}
public ObservableList()
: this(0) { }
public ObservableList(int capacity)
{
m_List = new List<T>(capacity);
}
public ObservableList(IEnumerable<T> collection)
{
m_List = new List<T>(collection);
}
void OnEvent(ListChangedEventHandler<T> e, int index, T item)
{
if (e != null)
e(this, new ListChangedEventArgs<T>(index, item));
}
public bool Contains(T item)
{
return m_List.Contains(item);
}
public int IndexOf(T item)
{
return m_List.IndexOf(item);
}
public void Add(T item)
{
m_List.Add(item);
OnEvent(ItemAdded, m_List.IndexOf(item), item);
}
public void Add(params T[] items)
{
foreach (var i in items)
Add(i);
}
public void Insert(int index, T item)
{
m_List.Insert(index, item);
OnEvent(ItemAdded, index, item);
}
public bool Remove(T item)
{
int index = m_List.IndexOf(item);
bool ret = m_List.Remove(item);
if (ret)
OnEvent(ItemRemoved, index, item);
return ret;
}
public int Remove(params T[] items)
{
if (items == null)
return 0;
int count = 0;
foreach (var i in items)
count += Remove(i) ? 1 : 0;
return count;
}
public void RemoveAt(int index)
{
var item = m_List[index];
m_List.RemoveAt(index);
OnEvent(ItemRemoved, index, item);
}
public void Clear()
{
for (int i = 0; i < Count; i++)
RemoveAt(i);
}
public void CopyTo(T[] array, int arrayIndex)
{
m_List.CopyTo(array, arrayIndex);
}
public IEnumerator<T> GetEnumerator()
{
return m_List.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
}
}

11
ScriptableRenderPipeline/Core/CoreRP/ObservableList.cs.meta


fileFormatVersion: 2
guid: 1511526f1e7c8e94ea477c5b5c9dcc32
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

43
ScriptableRenderPipeline/Core/CoreRP/SerializedDictionary.cs


using System;
using System.Collections.Generic;
namespace UnityEngine.Experimental.Rendering
{
//
// Unity can't serialize Dictionary so here's a custom wrapper that does. Note that you have to
// extend it before it can be serialized as Unity won't serialized generic-based types either.
//
// Example:
// public sealed class MyDictionary : SerializedDictionary<KeyType, ValueType> {}
//
[Serializable]
public class SerializedDictionary<K, V> : Dictionary<K, V>, ISerializationCallbackReceiver
{
[SerializeField]
List<K> m_Keys = new List<K>();
[SerializeField]
List<V> m_Values = new List<V>();
public void OnBeforeSerialize()
{
m_Keys.Clear();
m_Values.Clear();
foreach (var kvp in this)
{
m_Keys.Add(kvp.Key);
m_Values.Add(kvp.Value);
}
}
public void OnAfterDeserialize()
{
for (int i = 0; i < m_Keys.Count; i++)
Add(m_Keys[i], m_Values[i]);
m_Keys.Clear();
m_Values.Clear();
}
}
}

11
ScriptableRenderPipeline/Core/CoreRP/SerializedDictionary.cs.meta


fileFormatVersion: 2
guid: b21ca88b322a62d4b9a511ddabc12251
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

8
ScriptableRenderPipeline/Core/CoreRP/Debugging/Prefabs/Fonts.meta


fileFormatVersion: 2
guid: a11be56b627f5034bbca389c76bd3964
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

564
ScriptableRenderPipeline/Core/CoreRP/Debugging/Prefabs/Fonts/Perfect DOS VGA 437.ttf


�pOS/2v�s�x`VDMXb iy��cmap�,� ��cvt V0fpgmP�.�sgasp =glyf~�3D!�head����6hhea4$hmtxz�loca�rqr3maxpK�X nameh���5bpost7֜�9l�prep�}��[X�_<� �"���o��  � <@
� � �/JSWAP@" �  @                                                                          ���� ��
�� �� ��
�� �� �� �� ������������������������������ ��!��"��#��$��%��&��'��(��)��* ��+!��,!��-"��.#��/$��0$��1%��2&��3'��4'��5(��6)��7*��8*��9+��:,��;-��<-��=.��>/��?0��@0��A1��B2��C3��D3��E4��F5��G6��H6��I7��J8��K9��L9��M:��N;��O<��P<��Q=��R>��S?��T?��U@��VA��WB��XB��YC��ZD��[E��\E��]F��^G��_H��`H��aI��bJ��cK��dK��eL��fM��gN��hN��iO��jP��kQ��lQ��mR��nS��oT��pT��qU��rV��sW��tW��uX��vY��wZ��xZ��y[��z\��{]��|]��}^��~_��`���`���a���b���c���c���d���e���f���f���g���h���i���i���j���k���l���l���m���n���o���o���p���q���r���r���s���t���u���u���v���w���x���x���y���z���{���{���|���}���~���~���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}��������������������������������������������������������������������������������������������������������. ����Sax���    " & 0 : �!""������R`x���    & 0 9 �!""�������������&���������^�X���vޝ.$&"&&�����������������. ����Sax���    " & 0 : �!""������R`x���    & 0 9 �!""�������������&���������^�X���vޝ.$&"&&�����������������,K�PX��Y����D�_^-�, EiD�`-�,�*!-�, F�%FRX#Y � �Id� F had�%F hadRX#e�Y/ �SXi �TX!�@Yi �TX!�@eYY:-�, F�%FRX#�Y F jad�%F jadRX#�Y/�-�,K �&PXQX��D�@DY!! E��PX��D!YY-�, EiD�` E}iD�`-�,�*-�,K �&SX�@�Y�� �&SX#!�����#Y �&SX#!�����#Y �&SX#!����#Y �&SX#!�@���#Y �&SX�%E��PX#!��#!�%E#!#!Y!YD-� ,KSXED!!Y-�+�+� E}iDU�

Ӻ+�+��ܸܸ�ܸ�и� и�
и� и�и���EX�/�>Y�EX�/�>Y�EX�/�>Y�EX�/�>Y��ܸии�ܸ� ܸ� ܸ и � и�01!!!!!!!!!!!!������������������+��и�и�
ܸ ܸи
�и ���/�
/�EX�/�>Y�EX�/�>Y�EX� /� >Y�EX�/�>Y��ܸи�01!!!!!!!!!!!!���������������+�+��и�и�и���/�/�EX�/�>Y�EX�/�>Y�+�
+��и�и �и
��01!!!!!!!!!!!!!!������������� غ+�+��ܸ�и� и�
и� и� и�ܸ�и�и�и���EX�/�>Y�
+��ܸии�ܸииии� и�ܸи�и�и��01!!!7!!!!!!!!!������������ ��
+�+��и
�и�и���/�EX�/�>Y�EX�
/�
>Y�EX�/�>Y� +� �и
�ܸ�ܸии�ии��01!!!!!!!!!!!!!!������������ C�+�+��и� ��+�+��и�
�01!!!!!!������� 7� +�+��ܸ�и �ܸ
�� /�/01!!!!!!!��������
� Ժ +�+� �ܸи �ܸ�и � и�и�и �и ���EX�/�>Y�+��ܸи�ܸ�ܸ�ܸ�и и�
и� и иии�и�и��01!!!!!!!!!!!!������������� ��+�
+�+��и�и
� и� и
�ܸܸ
�и�и���/�/�EX�/�>Y�+�+��и�
и� и�и�и��01!!!!!!!!!!!!!�������������� �
F�+�+��ܸ ܸи�и�и� и�
и� и�и�и�и�ܸ�и�и ���EX�/�>Y�EX�/�>Y�EX�/�>Y��ܸ�ܸܸ�ܸиии�ܸ�ܸ�
и и� и иии �ии�ии�ии�ܸ�и�01!!!!!!!!!!!!!!!!���������������
ٺ+�+��ܸ�и� и� и� и�ܸ�и�и�и�и���EX� /� >Y�EX�/�>Y�+�+� �ܸ�и�и�
и иии�и��01!!!!!!!!!!!!!!��������� ��������
m�+�
+�+��и� ��EX� /� >Y�EX�/�>Y�+� �ܸ� ܸ� �01!!!!!!!�������
}�
+� +�+�+����EX�/�>Y�EX�
/�
>Y�+�+��ܸ�и
� �01!!!!!!!!!!�����������  '��+�+�� ܸи�"ܸ и� и�и�ܸ�и�и�и�и�и�и�и�и �и �#и"�%��EX�/�>Y�EX�/�>Y�EX�/�>Y�+�+��
ܸииܸ�ܸܸ� и� и� и�и�и�ии�и�и�ииии� и�!и�"и#и�$и�%и�&�01!!!!!!!!!!!!!!!!!!!!�������������������� �� +� �ܸ �ܸ �ܸ� и� и�и���
/�EX� /� >Y�EX�/�>Y�EX�/�>Y�+01!!!!!!!!!!!!���������� ������ ~� +� �ܸ �ܸ �
ܸ и�и�и���
/�EX�/�>Y�EX�/�>Y�EX� /� >Y�+01!!!!!!!!!!!!�������
��+�+��и� и� и� и�и���/�EX� /� >Y�+� +��ܸ� ܸ �и �и�и�и�и�и��01!!!!!!!!!!!!!!��������������
 ��/�/�ܸ�и/�ܸ�и� и� и� ��EX�/�>Y�EX� /� >Y�EX�/�>Y�EX�/�>Y��ܸи�01!!!!!!!!��������
��
��+� +� +� �ܸ и���EX�/�>Y�EX�/�>Y�EX� /� >Y�+��ܸии
и и��01!)!!!!!!�������� �� ?�� +�
+�3+� �ܸ�и
�и �и�и�и�и �и�и �и�и �и�и�и �и�!и3�#и�2ܸ%и�'и�(и �)и�*и
�+и�-и�.и3�/и�5и�6и3�7и2�9и3�;и�=��EX� /� >Y�EX�$/�$>Y�EX�(/�(>Y�EX�/�>Y�EX�/�>Y�EX�./�.>Y�EX�/�>Y�EX�:/�:>Y�EX�>/�>>Y�;<+�"!+�-+�>� ܸܸиܸ"�ܸ,иܸ�и�и�и� и�
ܸ<�7ܸи ܸ � и;�и �ии
�ии�и�и�и�и,�и �ܸ&и'ии!�%и!�)и'�*и+и�/и�0и�1и�2и�3и�4и5и�6и�8и9и;�?�01!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!�����������������������������������EX�/�>Y��01!!��
ɺ+�+�� и�и�и�и�и���EX�/�>Y�EX�/�>Y� +�
+�
� ܸи�и �ܸ�ܸии�и�и �и �и
��01!!!!!!!!!!!!!!!!���������������
a�+�� и� ��EX�/�>Y�EX� /� >Y�
+�
� ܸи�и
��01!!!!!!!!�������
m�+�� и� ��EX�/�>Y�EX�
/�
>Y� +��и�и�ܸ � и��01!!!!!!!!�����������+� +��и� и� и ���EX�/�>Y�
+�+��ܸ � и�и�и�и�01!!!!!!!!!!����������|�+�+��и�и� и� ��EX�/�>Y�+�+��и�ܸ
и и� и��01!!!!!!!!!!�����������+�+���01!!!���ź
+�+��ܸ�ܸ
� и�и�и�и�и�и���/�/�EX�/�>Y�EX�/�>Y�+�+��и�
и� и�и�и��01!!!!!!!!!!!!!!�������������U�
+�+�/�EX�/�>Y�EX�/�>Y� +�� ܸи ��01!!!!!!!!�����3�+�+�/� +� �ܸи ��01!!!!!!!!����������
u� +�+��и�и� и� ��EX�/�>Y�EX�/�>Y�
+��ܸ �и
��01!!!!!!!!������ ���  O�
+�+��ܸ
� ��+��ܸи�и� и�
�01!!)!!������� �� /�/� �и/�ܸи�и�ܸ и�и�и�и�и���/�/�EX�/�>Y�EX�
/�
>Y�EX�/�>Y�EX�/�>Y�EX�/�>Y�+��и�ܸ и и�и�и�и �и�01!!!!!!!!!!!!!!!������������������ '��+�
+�
�и�ܸи
�#ܸܸ#�и�и�и
�и�и�и�и�и �и
�и� и�!и�$и�%��EX�/�>Y�EX� /� >Y�EX�/�>Y�EX� /� >Y�+� �ܸиܸ�ܸܸ�иииии�
ܸ�ܸ �ܸ�и�и�и�и�ии�ܸ�"и#и$ܸ �&�01!!!!!!!!!!!!!!!!!!!!���������� ����������#f�+�+��ܸܸܸ�ܸ"ܸи�и�ܸ� и� и� и�и�и�и�и�и�и�и�и�и#� и�!��EX�/�>Y�EX�/�>Y�EX�/�>Y�+�+��ܸ�ܸии и�
ܸ� и�ииии
�и�и
�ܸ� и�"и�#�01!!!!!!!!!!!!!!!!!!�������������������
+ʺ+�+��%ܸܸ�и�ܸи(�и�+ܸܸ%�и�
и+� и(� и�и�и�и�и�и�и�и� и�!и�"и+�#и(�$и+�'и�)и�*��EX�"/�">Y�EX� /� >Y�EX�/�>Y�+�+�"�ܸ"�ܸ � ܸܸ � ии�и�и�ииии�и�и�ии�и� и!и$и%и�&и�(и)и�*и�+�01!!7!!!!!!!!!!!!!!!!!!!������������� ������������ +�+�+�+�+���01!!!!����
�� +�+� �и �ܸ� и� и �и�и���EX�/�>Y�EX�/�>Y��ܸ�ܸии�и и�
ܸ� ܸии
�и�01!!!!!!!!!!����������
��+�+��и�и�и� и�
и� и���EX�/�>Y�EX�/�>Y�ܸ�ܸ�ܸ�ܸ
и и� и и�ии�и�01!!!!!!!!!!����������ٺ+� +�+� �и� и�и�и�и���EX�/�>Y�EX�/�>Y� +�
+��ܸиии ܸ �и �и�и �и �и
�и �и�и�01!!!!!!!!!!!!!!�������������� H�+��и� ��/�EX�/�>Y�+��и�
�01!!!!!!�������Q�+�+�EX�/�>Y�EX�/�>Y�+��и�ܸ�01)!!!���� �+01!!�� �+�EX�/�>Y��01!!����
+�+��ܸ
�ܸܸии�ии�и �ܸ
� и�и�и���EX�/�>Y�EX�
/�
>Y�+�+��ܸиии
�ܸܸи�и� и и�и�и��01!!!!!!!!!!!!!!�������������
#m� +�+��и�ܸии�и �ܸ� и�
и�и �и�и �и �и�и�и�ܸ�ܸ�и�!и�"и �#��EX�/�>Y�EX�"/�">Y�+�"�ܸ�ܸ�ܸ�
и и� и и"�ܸии �ии �ии�ииии�ии�ии� и!�01!!!!!!!)!!!!!!!!!��������������������
m�+��ܸ�ܸ� и� ��EX�/�>Y�EX�/�>Y� +� �ܸ�ܸ
и �01!!!!!!!����
#k�+�+��и�и�ܸи�ܸ и� и� и� и�и�ܸи�ܸ �и�и�и � и�!��EX�/�>Y�EX�/�>Y�EX�/�>Y�EX�"/�">Y� +�"�ܸиии"�ܸиии�ܸ�ܸ�
ܸ ܸ
�ииии �и�ии�ии"�ܸ"� �01!!!!!!!!!!!!!!!!!!�����������������
��+� +��и� ܸ и �и �и�и�и�и���EX�/�>Y�EX�/�>Y�+� +��ܸ �и�ܸии
и и� и�ܸܸ�ииии�ܸ�и�и��01!!!!!!!!!!!!!!��������������
��+�+��ܸܸ�ܸ�и�
и� и�и�и�и���EX�/�>Y�EX�/�>Y�EX�/�>Y�EX� /� >Y��ܸܸи�иܸ�и � ܸ ии�и�и�и�ܸ��01!!!!!!!!!!!!!�����������
��/� /�� и /� ܸи �ܸ �и���EX�/�>Y�EX�/�>Y�+��ܸܸ�и и ии � ܸ � и�и�и��01!!!!!!!!!!����������
��+� +�+��и�и� и���EX�/�>Y�EX�/�>Y�ܸܸии�ܸи и�
ܸ� ܸ�ииии
�и�01!!!!!!!!!!!!��������������
�� +�+��и�ܸи�и� ܸ�ܸ���EX�
/�
>Y�EX�/�>Y�ܸиии
�ܸ
�ܸ
�ܸ� и �01!!!!!!!!!!�����������
��/�/��и/�ܸи�и� и�ܸ��EX�/�>Y�EX�/�>Y�+�+��ܸ�ܸܸи� и�
и� и� и иии�и�и�и�и�иии�01!!!!!!!!!!!!!!�������� ��������
Ѻ +�+�+��и� ии� и�и�и���EX�/�>Y�EX�/�>Y�+�
+��ܸиии�ܸ�ܸ� и� и�ииии��01!!!!!!!!!!!!�����������+�+��и���+�+01!!!!���� T� +�+��и���EX�/�>Y�+��ܸܸ�
и �01!!!!!!������� #~�
+� +�
�ܸи�ܸ �ܸ�и �и �!ии� и�и�и�и�и�и �и!�и
�и
�ии���EX�/�>Y�EX� /� >Y�EX�/�>Y�+�#+�
+��ܸ �ܸ�ܸи ܸ�ܸи ܸ�и�и�и�и �и �и
�и�ии�и�!и�"�01!!!!!!!!!!!!!!!!!!��������� ���������$�EX�/�>Y�+���01!!!!����� #j�+�+��и�и�ܸ�и�ܸ� ܸ� и� и�и�и �и�и�и �и�и�и�и�и�и�!��EX�/�>Y�EX� /� >Y�EX�/�>Y�+� �и�ܸи�ܸ�ܸܸ
и ܸ�ܸܸ и�ии�ии
�и�ии�"и�#�01!!!!!!!!!!!!!!!!!!��������� ���������
��
+�+�+��и�и�и�ܸ�и���EX�/�>Y�EX�/�>Y�EX�
/�
>Y�EX�/�>Y�EX�/�>Y�ܸ�ܸиии�ܸܸ и� и иии�и��01!!!!!!!!!!!!������������ l� +�+�+��и���EX�/�>Y� +�+��и�ܸи и�
�01!!!!!!!!!!����������
�� +�+�+��ܸ �и�и �и�и�и�и�и���EX�/�>Y�EX�/�>Y�EX� /� >Y�+� +��ܸ�и� и�ии�и�ии��01!!!!!!!!!!!!!�������������
��/�/�� и /�ܸи�и�ܸ��EX� /� >Y�EX�/�>Y�+� �ܸ�ܸи и�
и иии�и�и �и�01!!!)!!!!!!!��������������
%�+�+�+��и�и�ܸ и� и� и�и�и�и�и�и���EX�/�>Y�EX�/�>Y��ܸиииии�ܸ�ܸ�ܸ и ии�и и �
ܸ �ии �ии�ии�ܸ�и�01!!!!!!!!!!!!!!!!�������� �������
�� +�+�+��и�и�и���EX�/�>Y�EX� /� >Y��ܸ�ܸ �ܸ �ܸ�и и и� ииии�ии�ии ��01!!!!!!!!!!!������������
ݺ +�+��и�ܸܸ�и�и�и�и�и�и���EX�/�>Y�EX�/�>Y�+��ܸ�ܸ�ܸ�
и и� ܸ�ܸ�ܸ �ии�и�01!!!!!!!!!!!!!!������������
��+� +��ܸи �и�и� и�
и�и�ܸ��EX�/�>Y�EX�/�>Y�
+��ܸ�ܸ�ܸ� ܸии�ии�и�01!!!!!!!!!!!!������������
!~� +�+��и�ܸ �!ܸܸ�ܸ � ܸи!�и�и�и� и�
и!�и �и �и�и �и �и�и �и�и�и���EX�/�>Y�EX�/�>Y�EX�/�>Y�+��ܸܸ�и�ܸииии и�
ܸ� ܸ�ииии �ии
�ии�ܸ� и!�01!!!!!!!!!!!!!!!!!�����������������
w� /�/�и �и/�ܸи� ��EX�/�>Y�EX�/�>Y�EX�/�>Y�EX�
/�
>Y�+01!!!!!!����
��
i�+� +��и���EX�/�>Y�EX�/�>Y��ܸ�ܸи и�
и �01!!!!!!���
���
}�/� /�ܸ� и /� ��EX�/�>Y�EX�/�>Y��ܸ�ܸи и ии � ܸ � и�и�01!!!!!!!!�����
����
�� +� +�+��и�и�и�и �ܸ �и �и ���EX�/�>Y�EX�/�>Y�EX�/�>Y�EX� /� >Y��ܸ�ܸܸ�ܸи и�
и и �ܸ�ܸ�ии�ܸи�01!!!!!!!!!!!!!!�������������
�� +� +�+��ܸ ���EX� /� >Y�EX�/�>Y�EX�/�>Y�ܸ�ܸ�ܸ�и и �
ܸи�01!!!!!!)!�����
��+�+��и� и� и�ܸܸ��EX�/�>Y�EX�/�>Y�EX�/�>Y�EX�/�>Y� +� � и��01!!!!!!!!!!������
���
��+� +�� ܸи �и�и�ܸ и�ܸ��EX�/�>Y�EX�/�>Y�EX� /� >Y�EX�/�>Y�EX�/�>Y01!!!!!!!!!!������
����
}�/�/��и/�ܸ� ��EX�/�>Y�EX� /� >Y��ܸ �ܸ�иии и�
и ии�01!!!!!!!!����� ����
��+� +�+��и� ��EX� /� >Y�EX�/�>Y�+� �ܸ�и�ܸи и�
и ии�01!!!!!!!!!!������ �������
�� +�+�+��и�ܸи���EX�/�>Y�EX�/�>Y�+��ܸ�ܸ�ܸ�
и и� и иии �ии��01!!!!!!!!!!!!�����������
Һ +�+�+��и�и� ܸ � и�и���EX�/�>Y�EX�/�>Y�EX�/�>Y�+��ܸ�ܸܸ�
ܸ� и иии�и�и�и�01!!!!!!!!!!!!������� �������
#h�+� +�+�+��и� и � и�и�и�и�и�и�и �!��EX�/�>Y�EX�
/�
>Y�EX�/�>Y�EX�/�>Y�EX� /� >Y�+� �ܸܸ�ܸииܸ�ܸ� и� ܸ
� ܸ �ии
�и�ии
�и�ии�и�и�ии"и#�01!!!!!!!!!!!!!!!!!!������������������
��+� +� +��и � ��EX�/�>Y�EX�/�>Y�ܸ�ܸ�ܸи и�
и и� и �01!!!!!!!!���������
j� /�/� �и/�ܸ���EX�/�>Y�EX�/�>Y�EX�/�>Y�ܸии
и �01!!!!!!���
� ��
ʺ+�
+� +�
�и�и
�ܸ и�ܸ �и ���EX�/�>Y�EX�/�>Y�EX�/�>Y� +��ܸ �и�
и и � и �и �ии��01!!!!!!!!!!!!�������������
��+�+� +��и�ܸ и���EX�/�>Y�EX� /� >Y�EX�/�>Y�EX�/�>Y��ܸ
и �01)!!!!!!!!!����� ����
#L�+�+�
+��и�ܸ и�ܸ �и�и�и�и �и
�и�и�и�и�и�!��EX�/�>Y�EX�/�>Y�EX� /� >Y�EX�/�>Y�EX�/�>Y��ܸ�ܸии
и иии�ии�ܸ�ܸииии и!и�"и#�01!!!!!!!!!!!!!!!!!!������������������
��+�+��и�и�ܸ и� ܸ� и ���EX�/�>Y�EX�
/�
>Y�EX�/�>Y�ܸ�ܸи и и и�и�01!!!!!!!!!!����������
#Z�+�+��ܸи�и�ܸ и� и� и�и�ܸ�ܸ �и�и�и�и �и�и�!��EX�/�>Y�EX� /� >Y�EX�"/�">Y�ܸиии"�ܸиии �ܸ�ܸ�ܸ�
ܸ� ܸ�ииии�ии�ии"�ܸ"�ܸ� и!�01!!!!!!!!!!!!!!!!!!������������������
E�+��ܸ��EX�/�>Y�EX�/�>Y�ܸ��01!!!!���
� ��
+�+��ܸ �ܸи �ܸ
� и�и�и�и�ܸ�� /�EX�/�>Y�EX�/�>Y01!!!!!!!!!!!!!!��������������
I�+��ܸ���EX�/�>Y�EX�/�>Y�ܸ��01!!!!��� ��+�+�+��ܸ� и� и� и� и�и���EX�/�>Y�EX�/�>Y�EX�/�>Y� +��ܸܸи�и� и� ܸ �и�и�и�и�ии�и��01!!!!!!!!!!!!�����
�������� �+01!!��� q�+�+��и� ��EX�/�>Y�EX�/�>Y�+��
ܸ ܸиܸ�и��01!!!!!!��� �����+�+�+��и�и�и� и� и�ܸ и�ܸ�и���EX�
/�
>Y�EX�/�>Y�EX�/�>Y��ܸܸܸ
�ܸ и и�ииии�и�и�01)!!!!!!!!#'!!�����������
��+� +� +��и�и � и���EX�/�>Y�EX�/�>Y�EX�/�>Y��ܸ�ܸ�ܸ�и и�
и и� и и��01!!!!!!!!!!����������� ��/�/�� и /�ܸ�и�ܸ��EX�/�>Y�EX�/�>Y�+��ܸ и ииии�ܸии
и и��01!!!!!!!!!!����������
 �
+� +�+��ܸܸи�и �ܸ �и�и�и�и�ܸ���EX�/�>Y�EX�/�>Y�EX�/�>Y�EX�/�>Y��ܸ�ܸ�ܸܸ� и
и� и и� ии�ܸ
�иии�01!!!!!!!!!!!!!���������������/�/��и/�
ܸи�ܸ� и� ��EX�/�>Y�EX�/�>Y� +��ܸииܸܸ�и�
ܸииии�и�01!!!!!!!!!!!�����������
ͺ+�+��ܸܸ и� и�и�и �и�и���EX�/�>Y�EX�/�>Y�+��и�ܸиии�ܸ�
ܸ� и и�ܸии��01!!!!!!!!!!!!!�������������� +� +�+��и�ܸ�и � ܸ �и
�и �и �и
�и�и�и���EX�/�>Y�EX�/�>Y�EX� /� >Y�EX�/�>Y��ܸии �ܸ и иии�ܸ�и�ܸ�ииии�и�0173!!!!!!!!!!!!!���������������
�� +�+�+�� ܸ � и�и�и ���EX�/�>Y�EX�/�>Y�EX�/�>Y�EX�/�>Y��ܸиии�
ܸ� ܸ�ии��01!!!!!!!!!!�����������
 ��+��ܸ�и�ܸ� и� ��EX�/�>Y�EX�/�>Y�EX�/�>Y��ܸ�ܸ
и и� �01!!!!!!!����
�����
�� +�+��ܸ�и���EX�/�>Y�EX�/�>Y�EX�/�>Y��ܸ�ܸ
и иии� ܸ�и��01!!!!!!!!!������
�����
��+�+�+��и� и� и� и�и�ܸ�и���EX�/�>Y�EX�/�>Y�EX� /� >Y�EX�/�>Y��ܸии�ܸ �ܸܸ �
ܸии�ии�ܸ�ܸ�и�01!!!!!!!!!!!!!!��������������
Y�+��ܸ�и���EX�/�>Y�EX�/�>Y�ܸии��01!!!!!��
����+�+�+�� и� и���EX�/�>Y�EX� /� >Y�EX�/�>Y�EX�/�>Y� �ܸи�01!!!!!!!!!������������+�+� +����EX�/�>Y�EX�/�>Y�EX�/�>Y�EX� /� >Y��ܸии
и ии�01!!!!!!!!��������}�/�/��и/�ܸ� ��EX�/�>Y�EX�/�>Y��ܸ�ܸии�ии
и и� и �01!)!!!!!����������ߺ+� +�+��и�ܸи�
ܸ� и�и���EX�/�>Y�EX�/�>Y�EX�
/�
>Y�EX�/�>Y��ܸ�ܸ
�ܸ и и�ииии�ии�и�01!!!!!!!!!3!!����������������+�+�
+��и �и
�ܸ
�и�ܸ�и�и ���EX�/�>Y�EX�/�>Y�EX�
/�
>Y�EX�/�>Y�ܸ�ܸии
�ܸ и и�ии�иии�0173!!!!!!!!!!�������������� +�+�+��ܸи �и� ��EX�
/�
>Y�EX�/�>Y�EX�/�>Y��ܸ�ܸии
�ܸ и иии и�ܸ�и�01!!!!!!!!!!!����������#A�+�+�+�!+��и�и!� и� и� и�и�и�и�и���EX�/�>Y�EX� /� >Y�+��ܸ�ܸ �
ܸ ܸиܸ �ܸ�и
�ии �и�и�ии�ии�ии�и�#ܸи�ии и!и�"�01!!!!!!!!!!!!!!!!!!������������������
Ǻ+� +��ܸܸ� и�
и�и�и�и���EX�/�>Y�EX�/�>Y�EX�/�>Y�EX�/�>Y� +��ܸ�
ܸииии�и�01!!!!!!!!!!!������������ +�+�+�� ��EX�/�>Y�EX�/�>Y�EX�/�>Y�EX� /� >Y��ܸии
и ии�01!!!!!!!!����������� +� +�+�+��и���EX�/�>Y�EX� /� >Y�EX�/�>Y�ܸ�ܸи и�
и иии �ии�и�01!!!!!!!!!!������������
+�+�+��ܸܸ� и� и� и���EX�/�>Y�EX�/�>Y�EX�/�>Y�EX�/�>Y� +��и�
ܸии��01)!!!!!!!!!���������#[�+�+� +��и�ܸ
ܸ� и�и �и
�и�и�и�и�и�и�и�!��EX�/�>Y�EX�/�>Y�EX�/�>Y�EX�/�>Y��ܸи�ܸ�ии
и и� и и�ܸ�ܸии�ии�ииии�ии � и!и �"и#�01!!!!!!!!!!!!!!!!!!���������������������
+�+�+��и� и���EX�/�>Y�EX� /� >Y�EX�/�>Y�EX�/�>Y��ܸ�ܸ�ܸ
и и�ии�и�01!!!!!!!!!!�����������+�
+�
�ܸܸ�ܸܸ�ии� и�и и� и�и�и�и
���EX�/�>Y�EX�/�>Y��ܸ�ܸиии�ܸиии�ܸ�
ܸ� ܸ
�ииии�ии�ии�и�01!!!!!!!!!!!!!!!����������������
�� +�+��и�и� и� и ���EX�/�>Y�EX�
/�
>Y�+��ܸ�ܸ
�ܸ и и�и�ии�и�01!!!!!!!!!!�����
�����
-�+�EX�/�>Y�EX�/�>Y01!!�
�
��+�+��и�и�и� и� ��EX�/�>Y�EX�/�>Y�+��ܸ�ܸ�ܸ
и и� и и�и�и�01!!!!!!!!!!����������  ��/�/�ܸ� и /���EX�/�>Y�EX�/�>Y�EX�
/�
>Y�EX�/�>Y��ܸ�ܸи�и�и и� и� и��01!!!!!!!!���� ������ +�+� +��ܸ�и� ܸ�и�и�и���EX�/�>Y�EX�/�>Y�+��ܸии
и ии � ܸܸ�и �ии��01!!!!!!!!!!!!����������
'~�+�+��и�и� и� и� и�"ܸ и�$ܸܸ"�и$�и�и�и$�и�и"�и�и�#и�%��EX� /� >Y�EX�/�>Y�EX�"/�">Y�%&+�!+�%�и!�и�ܸ�ܸ �ܸ �
ܸии и�ܸ�ии�ии�ии�ии�и!�и�ии� �01!!!!!!!!!!!!!!!!!!!!���������������������
ٺ+�+� +��и� и�и�и���EX�/�>Y�EX�/�>Y�EX�/�>Y�EX�/�>Y�EX� /� >Y�EX�/�>Y��ܸии �
ܸиииии�01!!!!!!!!!!!!��������
������� !3�+� +��и �и� ии� ܸи �ܸ� и�и �ܸ �и�и�и���EX�/�>Y�EX�/�>Y�EX�/�>Y�EX�/�>Y�+�+��ܸииܸܸ�и� и� ܸ� ܸ �и�ܸииии� и!�01!!!!!!!!!!!!!!!!!������������������ (��'+� +�'�и �и �и �ܸ"�и'�ܸ� ܸ� и�и�и�и�и �и�и�и"�и �и�ܸ�!и�$и �%и �(��EX�/�>Y�EX�/�>Y�EX�/�>Y�EX�/�>Y�EX� /� >Y� +� �и�
ܸ ܸи �и
�ии�ܸܸܸ�ܸии�ии"и#и�%и#�'и(�01!!!!!!!!!!!!!!!!!#'!!��������� ����������
 4�+� +�+��и�ܸ� и � и�и�и �и�и �ܸи�и�и�и���EX�/�>Y�EX�/�>Y�EX�/�>Y�EX�/�>Y�EX�/�>Y��ܸии�
ܸ ܸܸ�ܸии
�ииии �и�и �01!!!!!!!!!!!!!#'!!���������
�������� $x�#+�+��и#�и�и#�ܸ� ܸ�
и� и� и�и�и�и �и�и�ܸ �ܸ �и� и�!и�$��EX�/�>Y�EX�/�>Y�EX�/�>Y�EX� /� >Y�EX�/�>Y�+��ܸ�
ܸ ܸи�и�и �ܸܸܸ�ܸии�ииии�!и�#и$�01!!!!!!!!!!!!!!!#'!!��������� ��������� (��'+�+� +�'�и"�и'�ܸ и"� и'� и�и�и�и�и�и�и�и"�и �и�ܸ�!и�$��EX�/�>Y�EX�/�>Y�EX�/�>Y�EX�/�>Y�EX�/�>Y�EX� /� >Y��и�ܸ
и ии�и�ܸ � ܸ �ии�ܸܸܸ�ܸии�ии"и#и�%и#�'и(�01!!!!!!!!!!!!!!!!!#'!!�����������
�������������+�+�+��и�и� ܸ� и�и �и ���EX�/�>Y�EX�/�>Y�EX�/�>Y�+��и�ܸиии�ܸ
и ии � ܸ �ии�ܸ�и�01!!!!!!!!!!!!!!���������������� %S�#+�+�+��и�и�ܸ �и�и� ܸ� и�и�и �и�и�и �и�!��EX�/�>Y�EX�/�>Y�EX�/�>Y�EX� /� >Y�+� +��ܸииܸܸ�и �и�
ܸ ܸ
�ии �и �и �ܸии"и#и�$и%�01!!!!!!!!!!!!!!!!!!!�������������������
 ��/�/�ܸ�и/�ܸи� и�и�и�и�и���EX�/�>Y�EX�/�>Y�EX� /� >Y�EX�/�>Y�+��ܸии �
ܸииܸ ܸ� и�ܸииии�и�01!!!!!!!!!!!!!!!���������
�������� !;�+�
+��и
� ܸи�ии
�и� ܸ�и�и �ܸ �и�и�и���EX�/�>Y�EX�
/�
>Y�EX�/�>Y�EX�/�>Y�+�+��ܸииܸܸ�и�ܸ
�ܸ ܸи� и� и�ܸииии� и!�01!!!!!!!!!!!!!!!!!������������������
��+� +� �и �ܸ� ܸ� и���EX�/�>Y�EX�/�>Y�EX�/�>Y�EX� /� >Y��ܸии �
ܸии��01!!!!!!!!!�����
����� ��+�+��и� и� ܸ� ܸ�и�и �и�и���EX�/�>Y�EX�
/�
>Y�EX�/�>Y�EX�/�>Y� +��ܸܸ�и�и� и� и�ии�ܸии��01!!!!!!!!!!!!!������ ������� ߺ+� +��ܸ�и � и� и �ܸ �и�и�и���EX�/�>Y�EX�
/�
>Y�EX� /� >Y�EX�/�>Y��ܸܸи�ܸܸ и� и�ܸии ��01!!!!!!!!!!!����� ������ #D�+�
+�+�
�ܸ� и� и�и�и�и�и
�и �и�и�и� ܸ�"��EX�/�>Y�EX�/�>Y�EX�/�>Y�EX�/�>Y�EX�/�>Y�
+� +��ܸи�и�ܸ
�и
�и�ии�и�и�и и
�!�01!!!!!!!!!!!!!!!!!�������� �����������  +��+�+��ܸ�и�и�и�
ܸ и�&ܸи
�ܸ
�и�и�и�и�и�и�и� и�"и�#и
�$и
�(и�*��EX�/�>Y�EX� /� >Y�EX�/�>Y�EX�/�>Y�EX�/�>Y�$%+�+� +�+�%�и�
и� и�и�и$�ܸ�и%�!и�"и�'и�)�01!!!!!!!!!!!!!!!!!!!!!����������� ������������ #�
+�
�и
�ܸܸ�ܸܸ�и� и� и� и�и�и�и�и
�и�и�и�!и�"��EX�/�>Y�+�+�+�+��и�
ܸ� ܸ�ܸ
�ии�ܸ�ܸ�и� и�"и#�01!!!!!!!!!!!!!!!!!!��������� ��������#o�+�+��ܸ� ܸи
�и�и#�и�ܸ � ܸ и�и#�и�и�и�и�и�и�!и�"��EX�/�>Y�EX� /� >Y�EX� /� >Y�EX�/�>Y�ܸи�ܸиии� ܸ � ܸ
ܸ �ии
�и �и�ииии
�и �и�ии�ии"и#�01!#'5!!!!!#'!!!!!!!!!����������������� �� +� +�+��и�и� и�ܸи�и���EX�/�>Y�EX�/�>Y� +�+� �и�ܸ
и �и�и�и��01!!!!!!!!!!!!!����������
����� /�+�+�+��ܸ�и�и�и� и� и� ܸ�и�и �и ���EX�/�>Y�EX�
/�
>Y�EX�/�>Y�EX�/�>Y� +��ܸܸ�и�и� и� и�ии�ܸ�ܸии�ииии�и�01!!!!!!!!!)!!!!!�������� ���������
 ˸/�/�ܸ�и/�ܸ�и� и� и���EX�/�>Y�EX�/�>Y�EX�/�>Y�EX�/�>Y��ܸии�ܸ�
ܸ и и�ииии �и�01!!!!!)!!!!!��������
������� ��+�+��ܸ�ܸ ии�и� и�и�и���EX�/�>Y�EX�
/�
>Y�EX�/�>Y�EX�/�>Y��ܸܸи�ܸܸ и� и� ܸ�ܸии �ииии�и�01!!!!!!!)!!!!!�������� �������� 9�+�+�+��и� и� и� ܸ� ܸ�и �и�и�и�и���EX�/�>Y�EX�/�>Y�EX�/�>Y�EX�
/�
>Y�EX�/�>Y�EX�/�>Y� +��ܸܸ�и�и� и� и�ии�ܸиииии�01!!!!!!!!!!!!!!!!�������� ��������� !�+�+��ܸ ии�ܸ�и�и� и� ܸ�ܸ�и�и �и���EX� /� >Y�EX�/�>Y�EX�/�>Y�EX�
/�
>Y�EX�/�>Y�EX�/�>Y��ܸܸи�ܸܸ и� и�ܸиииии�01!!!!!!!!!!!!!!�������� ���������
�+� +�+��и� и�и�и�и�и���EX�/�>Y�EX�/�>Y�EX�/�>Y�EX�/�>Y�EX�/�>Y�EX� /� >Y��ܸии�ܸ�
ܸ �ܸии
�ии�и�01!!!!!!!!!!!!!!��������
�������  ��/�/�ܸ�и/�ܸ�и� и� и���EX�/�>Y�+�+��и�и�и�
ܸ� и
�иии�01!!!!!!!!!!!!�������� ������� ��/�/��и/�ܸ�ܸ�и� и� и� ��EX�/�>Y�+��и�и�
ܸиии�01!!!!!!!!!!������ ������ ĺ+�
+�
�и
�и�и
�ܸи �и
���EX�
/�
>Y�+�+�
�ܸиииܸ�ܸ и�ии�и�и�ܸи��01!!!!!!!!!!!!!!�������������� )� +�+��и�и �ܸ�ܸ
ܸ� и�ܸ �и�и�и���EX�/�>Y�EX�/�>Y�EX�/�>Y�EX�/�>Y�EX�/�>Y�EX� /� >Y�+��и�ܸ �ܸ
и и�и�ии�и�ܸ�ܸ��01!!!!!!!!!!!!!!!�������
�������
�+��и�и� и� и�ܸ и�ܸ�и �и�и �и�и�и �и���EX�
/�
>Y�EX�/�>Y�EX�/�>Y�+�+��и
�ܸ
�ܸ и иии�ии�и�и��01!!!!!!!!!!!!!!!!����������������� /�
+�+�+�
�и�и�ܸ�ܸ и�и�и�и�и�и�и�и�и�и���EX�/�>Y�EX�/�>Y�EX�
/�
>Y�EX�/�>Y�+��и�ܸиии�и�ܸ� ܸ�и�ܸии��01!!!!!!!!!!!!!!!!���������
��� ������� ��+�+� +� +��ܸ и �и�и�и���EX�/�>Y�EX�/�>Y�EX�
/�
>Y�EX�/�>Y�+� +� �и�и�ܸ и� и�ܸииии�ܸ�и��01!!!!!!!!!!!!!!�������������� $p�#+�+��и�ܸ�и�и#�ܸ#� и� и� и�и�и�и�и�и�ܸ�ܸ�и� и�!и�$��EX�/�>Y�EX�
/�
>Y�EX�/�>Y�EX� /� >Y�EX�/�>Y�+��ܸ
�ܸ�и� и �ܸܸܸ�ܸии�ииии�!и�#и$�01!!!!!!!!!!!!!!!#'!!��������� ��������� Ϻ+� +��и�ܸ� и� и�и�и ���EX�/�>Y�EX�
/�
>Y�EX� /� >Y�EX�/�>Y�+��ܸ
�ܸ�и� и�ܸии ��01!!!!!!!!!!!������ ������ ��+�+��и�ܸ ии�ܸ� и�и�и���EX�/�>Y�EX�
/�
>Y�EX�/�>Y�EX�/�>Y�+��ܸ
�ܸ�и� и� ܸ�ܸии �ииии�и�01!!!!!!!)!!!!!�������� �������� �+� +��и �и�и �ܸ�ܸ ии� ܸ�ܸ�и�и �и���EX� /� >Y�EX�/�>Y�EX�/�>Y�EX�/�>Y�EX�/�>Y�EX�/�>Y�+�� ܸи�и�
ܸ�ܸиииии�01!!!!!!!!!!!!!!�������� ��������
!�+�+� +��ܸ� ܸ�и�и�и�и�и �и �и ���EX�/�>Y�EX�
/�
>Y�EX�/�>Y�EX�/�>Y�EX�/�>Y�EX�/�>Y�+��ܸиии и и и�и�ܸиииии�01!!!!!!!!!!!!!!!!��������� ��������� #
� +� +�+��ܸܸ�и�и�и �и�и�и�и �и�и�и�!и �#��EX�/�>Y�EX�/�>Y�EX� /� >Y�+��ܸ�и�и�и�
и� и� и�и��01!!!!!!!!!!!!!!!!!!���������� ������ ����
�� +�+��ܸ �и� ��EX� /� >Y�EX�/�>Y�EX�/�>Y�EX�/�>Y�+� �ܸ�ܸ� и�
и и�и�ܸ�01!!!!!!!!!���������
Ǻ +�+�+� �и�и� и� ��EX� /� >Y�EX�/�>Y�EX�/�>Y�EX�/�>Y�+� �ܸ�ܸ� и�
и иии�и�ܸ�01!!!!!!!!!!������ ������
ֺ
+�+� +�
�и
�ܸ
�и�и�и���EX�/�>Y�EX�/�>Y�EX�/�>Y� +��ܸ�ܸ�ܸ�
ܸ ܸ
�ииии�ии�и�01!!!!!!!!!!!!������
��������+�/�+01!!!����+�/�+01!!!���� 7d� +�+� �ܸи�4ܸи�и� и �
ܸ �и �и�и
�и�и�и �и �и �и �и �и�и�и�и4�и� и�2ܸ!и4�0ܸ#и2�%и4�'и�(и�)и�+и�,и2�-и�3и0�5��/�EX�/�>Y�EX�/�>Y�EX�$/�$>Y�EX�/�>Y�EX�2/�2>Y�06+�+� '+�6�5ܸи2�и0�и�ܸии,и-и и�
и�.и и0� и� и�*ܸи�ܸ�ܸ'�и�ܸ�ܸ"ии'�и�и"�%ܸи"�#и�(и)и�+�01!!!!!!!!!!!!!!!!!!!!!!!!!!!!���������������������������� 7H�+� +� �ܸ�
ܸܸܸи�и�и�ܸ� и
�и�и�и�и�и
�и � и�!и�"и�#и�%и�&и
�'и �(и �)и�+и�-и�/и�1и�3и �5и �7��&/�EX�$/�$>Y�EX�*/�*>Y�EX�0/�0>Y�EX�/�>Y�EX�/�>Y�+�,3+��ܸ�ܸ�и иии�ܸ�
и и*�ܸ4и5и ܸ� ܸ�и �и �и �ии�ии �и �и�и5�и3� и$�"ܸ.и#и3�(и.�1ܸ+и.�/и�6�01!!!!!!!!!!!!!!!!!!!!!!!!!!!�������������������������
�� +�+��и�и� и� ��EX�/�>Y�EX�/�>Y�EX� /� >Y�
+��ܸ �и
��01!!!!!!!!�����
�����*Ѻ$+�"+��ܸи�ܸ�ܸܸ�и� и� и� и�и�и�и�и�и�и�и�и�и�и� и�!и"�&и�(и�)и�*��EX�/�>Y�EX�)/�)>Y� +��ܸиии�ܸ �ܸ�
ܸ � ܸи
�и �и�и�ии�ии�ии �и�и �и
�и �и �!и
�"и �#и�$и�%и&и�'и(�01!!!!!!!#'5#'5!#!!!!!!!!!���������������������*��+� +� �и �ܸ�и� ܸܸи�ܸ� и�
и�и �и �и �и �и�и�"и�#и �$и�&и�(и�)и�*��EX�/�>Y�EX�'/�'>Y�
+�+��ܸ�ܸ�иܸ
� ܸ и� и�ии�ии�ии�и�и �и�и
�и �и� и�!и�"и�#и$и�%и&и)и*�01!!!!!!!!!#'!##!!!!!!!��������������������� �  #'+/37;?CGKOSW[_cgkosw{��a`+�A@+�! +�+��и�и�и� и� и� и�и�и�и�и�и�и�и�и �$и!�%и �(и!�)и �,и!�-и �0и!�1и �4и!�5и �8и!�9и �<и!�=и@�DиA�Eи@�HиA�Iи@�LиA�Mи@�PиA�Qи@�TиA�Uи@�XиA�Yи@�\иA�]и`�dиa�eи`�hиa�iи`�lиa�mи`�pиa�qи`�tиa�uи`�xиa�yи`�|иa�}��EX� /� >Y�EX�>/�>>Y�EX�L/�L>Y�EX�~/�~>Y�EX�
/�
>Y�EX�(/�(>Y�EX�J/�J>Y�EX�h/�h>Y�EX�/�>Y�EX�8/�8>Y�EX�Z/�Z>Y�EX�x/�x>Y�EX�/�>Y�EX�6/�6>Y�EX�@/�@>Y�EX�v/�v>Y�9:+�+�+�+�+�+�+��ܸܸ�ܸ
� ܸ �ܸ
�ܸ�ܸܸ9�и �ܸ� и�!и�"и#и�$и�%и�&и�'и
�)и�*и+и�,и-и�.и �/и�0и�1и�2и�3и�4и5и�7и�<и�=и �?и�Aи�Bи�Cи�Dи�Eи�Fи�Gи�Hи �Iи
�Kи �Mи-�NиOи+�PиQи�Rи�Sи�Tи�Uи5�VиWи#�XиYи9�[и�\и�^и�_и�`и�aиY�bиcи�dи�eи�fи�gи
�iиQ�jиkиO�lиmи�nи �oи�pи�qи�rи�sиW�tиuи�wи9�yи:�zи�|и�}и ��01)!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!����������������������������������������������������������������������������������@�  "',16;@EJOTY^chmrw|��������������������������  %).27;��'+�'�%ܸܸܸ ܸܸи/��ܸи/��и/��ܸ�
и
/� � и /� �и/�%�и/��и/��и/�'� и#�!и�(и(/��*и*/��-и-/��/и//��2и2/� �4и4/� �7и7/��9и9/�%�<и</��>и>/��AиA/��CиC/��Fи'�Hи#�Iи'�Kи%�Mи#�Oи�PиP/��RиR/��UиU/��WиW/��ZиZ/� �\и\/� �_и_/��aиa/�%�dиd/��fиf/��iиi/��kиk/��nи'�pи#�qи'�sи%�uи#�wи�xиx/��zиz/��}и}/��и/���и�/� ��и�/� ��и�/���и�/�%��и�/���и�/���и�/���и�/���и'��и#��и'��и%��и#��и��и�/���и�/���и�/���и�/���и�/� ��и�/� ��и�/���и�/�%��и�/���и�/���и�/���и�/���и'��и#��и'��и%��и#��и��и�/���и�/���и�/���и�/���и�/� ��и�/� ��и�/���и�/�%��и�/���и�/���и�/���и�/���и'��и#��и'��и%��и#��и��и�/���и�/���и�/���и�/���и�/� ��и�/� ��и�/��и/�%�и/��и/�� и /�� и /��и'�и#�и'�и%�и#�и�и�и�и�и�!и �#и �&и�'и%�*и�,и�/и�0и�3и'�5и#�6и'�8и%�9и#�;��EX��/��>Y�EX��/��>Y�EX��/��>Y�EX�/�>Y�EX� /� >Y�EX� /� >Y�EX�/�>Y�EX�/�>Y�EX�/�>Y�EX�$/�$>Y�EX�-/�->Y�EX�6/�6>Y�EX��/��>Y�EX��/��>Y�EX��/��>Y�EX��/��>Y�EX��/��>Y�EX��/��>Y�EX��/��>Y�EX��/��>Y�EX��/��>Y�EX��/��>Y�EX��/��>Y�EX��/��>Y�EX�/�>Y�EX�/�>Y�EX�/�>Y�EX�
/�
>Y�EX� /� >Y�EX�/�>Y�EX�/�>Y�EX�/�>Y�EX�/�>Y�EX�/�>Y�EX� /� >Y�EX�&/�&>Y�EX�-/�->Y�EX�//�/>Y�EX�7/�7>Y�EX�9/�9>Y�EX�A/�A>Y�EX�C/�C>Y�EX�K/�K>Y�EX�M/�M>Y�EX�S/�S>Y�EX�]/�]>Y�EX�g/�g>Y�EX�q/�q>Y� +�'+� �и�ܸи � и� и�ии �и �и�и�ии �и �и�!и�#и$и �'и�1ܸ(и$�+и,и(�Tܸ.и(�0и1�2и(�3и,�5и6иT�8и1�:и(�;и1�<и(�=и6�?и@иT�Bи1�Dи(�Eи1�Fи(�Gи@�IиJиT�Lи1�Nи(�Oи9�PܸQиP�|ܸUиQ�XиYиZи[иT�^и|�_иU�`и[�bиcиdиeиT�hи|�iиU�jиe�lиmиnиoиT�rи|�sиU�tиo�vиwиU��ܸxиU�{иx��ܸ}иx��и���иx��и|��иU��и���и}��и���иx��и���иx��и|��иU��и���и}��и���иx��и���иx��и|��иU��и���и}��и���иx��и���ܸ�и�и�и�и�и�и�и�и�и�ܸ}��ܸ�и}��и���и���и���и���и}��и���и���и���и���и���и}��и���и���и���и���и���и}��и���и���и��ܸ�и�и�и�ܸ���ܸ�и���и���и���и�и���и���и���и���и���и�и���и���и���и���и���и�и���и���и���и���и��и���и�и���и���и�и��ииии��и��и�
и� и иии��и��и�и�ии'�и�и� ܸ�!и �"и�%и �(и�)и�*и �+и�.и'�/и�1и �2и�3и �4и�7и'�8и�:и �;�013!3#!3!3#!3!3#!3!3#3!3#!3!3#!3!3#!3!3#3!3#!3!3#!3!3#!3!3#3!3#!3!3#!3!3#!3!3#3!3#!3!3#!3!3#!3!3#3!3#!3!3#!3!3#!3!3#3!3#!3!3#!3!3#!3!3#3!!)3!!)3!!)3!!!�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������  #'+/37;?CGKOS���3^+�[\+�O +�WX+�W�UܸиO�иU�иO�иU�иO�
иU� иO�иX�и[�иX�и[�иX�и[�иX�и[�и3�"и �$и3�&и �(и3�*и �,и3�.и �0и �4и3�6и �8и3�:иX�<и[�>иX�@и[�BиX�Dи[�FиU�HиO�JиU�LиU�PиO�Rи\�`и^�bи\�dи^�fи\�hи^�jи\�lи^�nи\�pи^�rи\�tи^�vи\�xи^�zи3�|и �~иO����EX�/�>Y�EX�/�>Y�EX�-/�->Y�EX�w/�w>Y�EX�/�>Y�EX�(/�(>Y�EX�P/�P>Y�EX�q/�q>Y�EX� /� >Y�EX�0/�0>Y�EX�Y/�Y>Y�EX�]/�]>Y�EX�%/�%>Y�EX�D/�D>Y�EX�I/�I>Y�EX�c/�c>Y���+��ܸ,ииP�ܸܸ�и�8ииI�ܸ ܸ� и � ܸи �Hܸи�и �и �Lܸи�ии��и�Tܸи�иL� и�@ܸ!и�#иH�$иD�&и�'и,�)ܸ<и*и�+и�.и,�/и�1и2и �3и �4и �5и4�7и�9и:и/�=и>и�Aи8�Bи!�Cи7�EиFиD�Jи�Kи@�Mи!�Nи�Oи)�Qи<�Rи�Sи��Uи �Wܸ �ZиW�[и �^и2�_и`иH�aи�bиD�dиF�eиfи �gиL�iи�jи@�kи!�lи�mи8�nи:�oиpи�rи)�sи<�tи>�uиvи�xи��yиT�zи��{и��}иT�~�01!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!���������������������������������� ����������������������������������� �+�/�/01!!� �� #�+����/�/�+01!!!!���� D�+��и� ��/�/�EX�/�>Y� +��
�01!!!!!!�����  7�+�+��ܸ ��/�/�/�/�
+01!!!!!!���� � �� ;�
/�/�
�и/�ܸ���/�/�+���01!!!!!������� 8�+����/�EX�/�>Y�+���01!!!!!�����  d�+� +��ܸ�и�и� ��/�/�/� /�EX�/�>Y� +���01!!!!!!!!��������� /�/�/�ܸ�и/���/�/�/�/01!!!!��� ��� L�+� +��ܸ���/�/�EX�/�>Y�+��
�01!!!!!!������
  L�+�
+��ܸ���/�/�EX�/�>Y�
+���01!!!!!!����� ;�
/�/�
�и/�ܸ���/�/�+���01!!!!!��� 8�+����/�EX�/�>Y�+���01!!!!!�����+�/�+01!!!��� �+�/�+01!!!� �� �+�/�+���01!!!!���� �+�/�+���01!!!! ������ #�+����/�/�+01!!!!�����  �+01!! ��� ;�+��и� ��/�/�+��и�
�01!!!!!!������� D�+����/�/�EX�/�>Y�+��
�01!!!!!!��������  ;�+�+��и�
��/�/�/�/�
+01!)!!!��� ���  H�+�+��ܸ ��/�/�EX�/�>Y�
+���01!!!!!!��� �����  T�
+�+��ܸ�и���/� /�EX�/�>Y�+�� �01!!!!!!!������� ��  q� +�+� �и�ܸи �
��/�
/�EX�/�>Y�EX�/�>Y�+��ܸ и �01!!!!)!! ���������  h�
+�+�
�и�ܸи � ��/� /�EX�/�>Y�+��ܸ�
и��01!!!!!!!! ���������� ��  l� +�+��ܸ�и�и� и� ��
/�/�/� /�EX�/�>Y�+���01!!!!!!!!����� ������ $�EX�/�>Y�+���01!!!! � ����  ��+�+��ܸ� ܸ и�и�и �и�и�и���/�/�/�/�EX�/�>Y�EX�/�>Y� +��ܸи
и и �и ��01!!!!!!!!)!!������������� �
 R�+�EX�/�>Y�EX�/�>Y�EX�/�>Y�+��
ܸ �01!!!!!! ����� C� /�/� �и/�ܸ���/�/�
+� �и ��01!!!!!!�����  8� +�/�EX�/�>Y�+��ܸ�
�01!!!!!! � ��������  C� /�/� �и/�ܸ� ��/�
/�+���01!!!!!!��� ����� ;�
/�/�
�и/�ܸ���/�/�+���01!!!!!� ��� 8�+����/�EX�/�>Y�+���01!!!!!�� �����  8�+����/�EX�/�>Y�+���01!!!! ������� �  ;�
/�/�
�и/�ܸ���/�/�+���01!!!!!����� ��� w�/�/��и/�ܸ�и� и� и�ܸ ��/�/�/� /� +��и �и �и��01!!!!!!!!!!����������� ��+��и� и� и��� /�/�EX�/�>Y�EX�/�>Y�
+��ܸ
�и �и�и�01!!!!!!!!!!���������� �+�/�+01!!!��� �+�/�+01!!!�����  �/�/01!! � ��  �/�/01!! ��� �+�/�/01!!� ��  �/�/01!!� �  �/�/01!! � ��� +�+�+��и� и� и�ܸи�ܸ�и�и���EX� /� >Y�EX�/�>Y�EX�/�>Y�EX�/�>Y� �ܸ�ܸиии и�
и иииии�ܸ�ܸи �и�01!)!!!!!!!!!!!���������������
��
+� +�+��иии�и�ܸ�и�и�и�и���EX�/�>Y�EX�
/�
>Y�EX�/�>Y�
�ܸи�ܸܸܸ� и иии�и�и�и�01!!!!!!!!!!!!!!�������� ������
U�/�/��и/�ܸ���EX�/�>Y�EX�/�>Y��ܸ��01)!!!���
� n� /�/� �и/�ܸ� ��EX�/�>Y�EX�/�>Y�EX�
/�
>Y��ܸиии �01!!!!!!��������
#e�+�+��и�и�и�и� и� и�ܸܸ�и�и�и�и�и�ܸи�и�и� и�!��EX� /� >Y�EX�"/�">Y�ܸиии"�ܸ�ܸ �
ܸииииܸ�ܸ �ܸ� и �ܸ�ии�и�и�и�ии"�ܸ� и!�01!!!!!!!!!!!!!!!!!!������������������}�+� +� +����EX�/�>Y�EX� /� >Y��ܸ �ܸ�иии и�
и ии�01!!!!!!!!������������� +� +�+� ���EX�/�>Y�EX�/�>Y�EX�/�>Y�EX�
/�
>Y��ܸ
�ܸи и� и �01!!!!!!!!����� �������+� +� � ܸ� ܸ ���EX�/�>Y�EX�/�>Y�EX�/�>Y�EX� /� >Y�EX�/�>Y��и�ܸи�и�ܸ
и� и�и�01!!!!!!!!!����������

�+�+��ܸ�и� и�ܸ и� и�и�и�и�и�и���EX�
/�
>Y�EX�/�>Y�EX�/�>Y�
�ܸ�ܸ�ܸ�ии
�ܸ и и�ии�ии�ܸии�и�01!!!!!!!!!!!!!!!!�����������������
#a�+�
+�+��и�ܸ
�и� и� и�и�и�и�и�и�и�и�ܸ�и�!и�"и�#��EX�/�>Y�EX�"/�">Y�+��ܸ�ܸ�ии"�ܸ"�
ܸ� и и
�ии �ии�ии�ииии�ии�ии� и!�01!!!!!!!!!!!!!!!!!!������������������
� +� +�+�+��и �и � и�и�и�и�и���EX�/�>Y�EX�/�>Y�EX�/�>Y�+��ܸ�ܸ�ܸ�
и� и и�ииии �ии�и�ии�и�и�01!!!!!!!!!!!!!!!!������� ��������
%�+�+��ܸ�и� ܸи�и�и� и� ܸи�и�и�и�и���EX�/�>Y�EX�/�>Y�+� +��ܸܸ�ܸ�
ܸ� ܸ�ииии�и�и �и
�ии�и �и�и�01!!!!!!!!!!!!!!!��������� ������ �� +�+�+�EX�/�>Y�+��ܸ�иܸ�ии�и�и�
и� и� и ии�01!!!!!!!!!!����������  !�+� +� +� �и�и �ܸ�ܸ�ܸ
и�и�и�и�и ���EX�/�>Y�EX�/�>Y�+�
+��ܸиии�ܸии
�и� ܸии
�и�и�ии�ܸ�и�и�и �01!!!!)!!!!!!!!!!!�����������������
պ +�+��ܸ�и� и� и�и�и�и�и�и���EX�/�>Y�EX�/�>Y�+��ܸ�ܸии�и и�
ܸ� ܸии
�и�01!!!!!!!!!!!!������������ ]� /�/� �и/�ܸ� ��EX�/�>Y�EX�
/�
>Y�+���01!!!!!!������ �
+�+�+01!!!!!!�������P�+�� и� ��/�EX�/�>Y�
+��ܸ �и
��01!!!!!!!!�������� �+�+�� ܸи�и�и� ܸ и�и�и�и�и�и�и�и���EX�/�>Y�+�+�+��ܸ�ܸи�ܸ
и� и ܸ�и�ܸи�и �и�и��01!!!!!!!!!!!!!!!!��������� ������� �+�+��и�ܸ�ܸ� и�
и� и�и и�и�и�и�и�и���EX�/�>Y�+�+�
+��ܸ� ܸ
� ܸ�ܸи ܸ�и�и �и �и
�и �и �и��01!!!!!!!!!!!!!!!!��������� ��������
X� /�/� �и/�ܸ� ��/�EX�/�>Y�ܸиии ии �
�01!!!!!!��� � ��� ~� /�/� �и/�ܸ���/�EX�/�>Y�EX�/�>Y�EX�
/�
>Y�+�
�ܸи�и� �01!!!!!!���� �� D�+��и���EX�/�>Y�+�
+���01!!!!!!�������� � +� +�+�+��и�и�и�и�и �и �и���EX�/�>Y�EX� /� >Y�+�+��ܸии�и�
и иии�ܸ�и�и�и�и�и�и�и��01!!!!!!!!!!!!!!!!����������������� ��+� +� +��и � ��EX�/�>Y�EX�/�>Y�EX�
/�
>Y�и�ܸии и ии
�и
� ܸ ��01!)!!!!!�����
�����+�+01!!���+�+01!!�� x�+� +��ܸܸ�ܸ� и�
и� ��EX�/�>Y�+�
+��ܸ и и��01!!!!!!!!������ �� c� +�+�+��ܸ� и���/�/�+��и�и�
и� �01!!!)!!!����� ���� y�+�+��и�ܸи� и� и� и�ܸи�ܸ�ܸ�и�и�и�и�и���EX�/�>Y�EX�/�>Y�EX�/�>Y�EX�/�>Y�EX� /� >Y�EX�/�>Y��ܸܸи�ܸ
иܸ�ܸи
�и� и
� и� и�ܸ�ܸ �ии�и�и�и��01!!!!!!!!!!!!!!!������������� �/�/01!!��
 ��+�+�+��ܸܸ�и� и� и� и�и�и�и���EX�/�>Y�EX�/�>Y�+� +��и�и �
ܸи�ܸ�ܸии�ииии�и �01!!!!!!!!!!!!!'5!!!�����������������������0��.�X6�0��~  x � � � � � , � ���..�������b����0��&�~����8d���� h �!l!�"�#H#�$v%r%�&&x'('�((x(�)H)�*b+T+�,,�--�.^/H/�/�0.0�0�1<1�2\2�3�44�5\5�6F6�7f7�88x8�9v::�;x<<j<�=d>P>�?�@@.@�AA�B�CND(E:FGH$H�I�JpKNK�LxMM�O O�P�QZR,R�SrTJUU�VHV�WHXX�Y�ZR[L[�\�]V^$^�_j_�`�`�`�bXc�dBerf�jVs�wlw�w�w�xxTx�x�yyHy�y�y�z
z(zLzpz�z�z�{{V{�{�|:|�|�}}�}�~~T~�~�~�.dƀ,�H�f�z�������΁��$�b������l����b�,���h��J�t���z�<���ڍ�؎D�\�t�Џ"��(�(��>.!5V ir�� �
� � � 6  &B h Bv &� �  � 6 F 6L
6� 6� 6�http://www.fatorcaos.com.brPerfect DOS VGA 437Regularzeh: Pixel Perfect Template: 2002Perfect DOS VGA 4372003; 1.0PerfectDOSVGA437http://www.fatorcaos.com.brzehhttp://www.fatorcaos.com.brhttp://www.fatorcaos.com.brhttp://www.fatorcaos.com.brhttp://www.fatorcaos.com.brhttp://www.fatorcaos.com.brPerfect DOS VGA 437Regularzeh: Pixel Perfect Template: 2002Perfect DOS VGA 4372003; 1.0PerfectDOSVGA437http://www.fatorcaos.com.brzehhttp://www.fatorcaos.com.brhttp://www.fatorcaos.com.brhttp://www.fatorcaos.com.brhttp://www.fatorcaos.com.br�� 
    !
 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`a"#$�����������%&'(������������)*��������������+�,-������.������������/c�d�e�������f����g�����h���jikmln�oqprsutvw�xzy{}|��~���0�1uni0002uni0003uni0004uni0005uni0006uni0007uni0008uni0009uni000Auni000Buni000Cuni000Duni000Euni000Funi0010uni0011uni0012uni0013uni0014uni0015uni0016uni0017uni0018uni0019uni001Auni001Buni001Cuni001Duni001Euni001F visiblespaceuni0025uni007FEurouni0081uni008Duni008Euni008Funi0090uni009Duni009Euni00ADmacronltshadeperiodcenteredSF100000uni25A0uni0001��

22
ScriptableRenderPipeline/Core/CoreRP/Debugging/Prefabs/Fonts/Perfect DOS VGA 437.ttf.meta


fileFormatVersion: 2
guid: 74a5091d8707f334b9a5c31ef71a64ba
TrueTypeFontImporter:
externalObjects: {}
serializedVersion: 4
fontSize: 16
forceTextureCase: -2
characterSpacing: 0
characterPadding: 1
includeFontData: 1
fontName: Perfect DOS VGA 437
fontNames:
- Perfect DOS VGA 437
fallbackFontReferences: []
customCharacters:
fontRenderingMode: 2
ascentCalculationMode: 1
useLegacyBoundsCalculation: 0
shouldRoundAdvanceValue: 1
userData:
assetBundleName:
assetBundleVariant:

8
ScriptableRenderPipeline/Core/CoreRP/Debugging/Prefabs/Resources.meta


fileFormatVersion: 2
guid: 3774a3e29f7c59445ba79c15769126fd
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

166
ScriptableRenderPipeline/Core/CoreRP/Debugging/Prefabs/Resources/DebugUI Canvas.prefab


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 1153602445894428}
m_IsPrefabParent: 1
--- !u!1 &1153602445894428
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 224711363741255626}
- component: {fileID: 223912878945851142}
- component: {fileID: 114908889885781782}
- component: {fileID: 114649910605725082}
- component: {fileID: 114530362809716058}
m_Layer: 5
m_Name: DebugUI Canvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &114530362809716058
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1153602445894428}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 76db615e524a19c4990482d75a475543, type: 3}
m_Name:
m_EditorClassIdentifier:
panelPrefab: {fileID: 224481716535368988, guid: daa46a58178a6ad41ae1ddc2dc7f856d,
type: 2}
prefabs:
- type: UnityEngine.Experimental.Rendering.DebugUI+Value, com.unity.render-pipelines.core.Runtime,
Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
prefab: {fileID: 224720214277421396, guid: dc0f88987826e6e48b1fe9c7c2b53a53, type: 2}
- type: UnityEngine.Experimental.Rendering.DebugUI+BoolField, com.unity.render-pipelines.core.Runtime,
Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
prefab: {fileID: 224131888606727344, guid: ce347ad101f41ee4ab5c3fbc0ea447db, type: 2}
- type: UnityEngine.Experimental.Rendering.DebugUI+IntField, com.unity.render-pipelines.core.Runtime,
Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
prefab: {fileID: 224720214277421396, guid: ae00bb75e0cd5b04b8fe7fb4ab662629, type: 2}
- type: UnityEngine.Experimental.Rendering.DebugUI+UIntField, com.unity.render-pipelines.core.Runtime,
Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
prefab: {fileID: 224720214277421396, guid: f22bcc84a5f4a1944b075a2c4ac71493, type: 2}
- type: UnityEngine.Experimental.Rendering.DebugUI+FloatField, com.unity.render-pipelines.core.Runtime,
Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
prefab: {fileID: 224720214277421396, guid: 7d4fd3415ea7dd64bbcfe13fb48a730b, type: 2}
- type: UnityEngine.Experimental.Rendering.DebugUI+EnumField, com.unity.render-pipelines.core.Runtime,
Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
prefab: {fileID: 224224135738715566, guid: 988db55689193434fb0b3b89538f978f, type: 2}
- type: UnityEngine.Experimental.Rendering.DebugUI+Button, com.unity.render-pipelines.core.Runtime,
Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
prefab: {fileID: 224438017010656346, guid: f6ce33b91f6ffe54cadacbf4bb112440, type: 2}
- type: UnityEngine.Experimental.Rendering.DebugUI+Foldout, com.unity.render-pipelines.core.Runtime,
Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
prefab: {fileID: 224053494956566916, guid: 1c87ab2ce8b8b304d98fbe9a734b1f74, type: 2}
- type: UnityEngine.Experimental.Rendering.DebugUI+ColorField, com.unity.render-pipelines.core.Runtime,
Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
prefab: {fileID: 224636372931965878, guid: 77c185820dd1a464eac89cae3abccddf, type: 2}
- type: UnityEngine.Experimental.Rendering.DebugUI+Vector2Field, com.unity.render-pipelines.core.Runtime,
Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
prefab: {fileID: 224169904409585018, guid: 326f7c58aed965d41bf7805a782d1e44, type: 2}
- type: UnityEngine.Experimental.Rendering.DebugUI+Vector3Field, com.unity.render-pipelines.core.Runtime,
Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
prefab: {fileID: 224119945032119512, guid: 94afea5f242d72547979595ba963f335, type: 2}
- type: UnityEngine.Experimental.Rendering.DebugUI+Vector4Field, com.unity.render-pipelines.core.Runtime,
Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
prefab: {fileID: 224325631027038092, guid: d47f009476100f545971a81ede14c750, type: 2}
- type: UnityEngine.Experimental.Rendering.DebugUI+VBox, com.unity.render-pipelines.core.Runtime,
Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
prefab: {fileID: 224489511352681190, guid: ca3e294656861a64b8aeeb9f916da0a9, type: 2}
- type: UnityEngine.Experimental.Rendering.DebugUI+HBox, com.unity.render-pipelines.core.Runtime,
Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
prefab: {fileID: 224719784157228276, guid: f7f5e36797cf0c1408561665c67b179b, type: 2}
- type: UnityEngine.Experimental.Rendering.DebugUI+Container, com.unity.render-pipelines.core.Runtime,
Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
prefab: {fileID: 224284813447651300, guid: 38a07789c9e87004dad98c2909f58369, type: 2}
--- !u!114 &114649910605725082
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1153602445894428}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1301386320, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreReversedGraphics: 1
m_BlockingObjects: 0
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
--- !u!114 &114908889885781782
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1153602445894428}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_UiScaleMode: 0
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 800, y: 600}
m_ScreenMatchMode: 0
m_MatchWidthOrHeight: 0
m_PhysicalUnit: 3
m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96
m_DynamicPixelsPerUnit: 1
--- !u!223 &223912878945851142
Canvas:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1153602445894428}
m_Enabled: 1
serializedVersion: 3
m_RenderMode: 0
m_Camera: {fileID: 0}
m_PlaneDistance: 100
m_PixelPerfect: 1
m_ReceivesEvents: 1
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_AdditionalShaderChannelsFlag: 0
m_SortingLayerID: 0
m_SortingOrder: 0
m_TargetDisplay: 0
--- !u!224 &224711363741255626
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1153602445894428}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}

8
ScriptableRenderPipeline/Core/CoreRP/Debugging/Prefabs/Resources/DebugUI Canvas.prefab.meta


fileFormatVersion: 2
guid: cf6cbdd672089a84796e55a21fed1cbe
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:

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

正在加载...
取消
保存