浏览代码

Merge branch 'master' into hdrp-xr-initial

/main
Robert Srinivasiah 7 年前
当前提交
44fabb65
共有 50 个文件被更改,包括 1433 次插入2202 次删除
  1. 999
      ImageTemplates/HDRenderPipeline/Scenes/2xxx_Lighting/2401_Light_on_Tesselation.unity.png
  2. 13
      ScriptableRenderPipeline/Core/CoreRP/CoreUtils.cs
  3. 90
      ScriptableRenderPipeline/Core/CoreRP/Editor/CoreEditorDrawers.cs
  4. 34
      ScriptableRenderPipeline/Core/CoreRP/RTHandle.cs
  5. 38
      ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/Common.hlsl
  6. 1
      ScriptableRenderPipeline/Core/CoreRP/Shadow/Shadow.cs
  7. 2
      ScriptableRenderPipeline/Core/CoreRP/TextureCache.cs
  8. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/DebugDisplayLatlong.shader
  9. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/DebugFullScreen.shader
  10. 10
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Camera/HDCameraUI.cs
  11. 16
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/Reflection/HDReflectionProbeUI.Drawers.cs
  12. 8
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/Reflection/PlanarReflectionProbeUI.Drawers.cs
  13. 6
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/Reflection/Volume/InfluenceVolumeUI.Drawers.cs
  14. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/Reflection/Volume/ProxyVolumeUI.cs
  15. 14
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/FrameSettingsUI.cs
  16. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/LightLoopSettingsUI.cs
  17. 22
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs
  18. 6
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/LightLoop.cs
  19. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/LightLoopDef.hlsl
  20. 19
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Reflection/PlanarReflectionProbeCache.cs
  21. 20
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Reflection/ReflectionProbeCache.cs
  22. 6
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Reflection/ReflectionSystemInternal.cs
  23. 3
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/VolumetricLighting.cs
  24. 4
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Decal/DBufferManager.cs
  25. 4
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/GBufferManager.cs
  26. 1
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/GGXConvolution/RuntimeFilterIBL.cs
  27. 3
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.cs
  28. 7
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/MaterialUtilities.hlsl
  29. 6
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/SubsurfaceScattering/SubsurfaceScatteringManager.cs
  30. 6
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/RenderPipelineResources/BufferPyramid.cs
  31. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/RenderPipelineResources/CopyDepthBuffer.shader
  32. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Sky/SkyManager.cs
  33. 8
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Sky/SkyRenderingContext.cs
  34. 480
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/2xxx_Lighting/2004_AnimatedCookie.unity
  35. 6
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/2xxx_Lighting/2004_AnimatedCookie/AnimatedCookie_CRT2.asset
  36. 1
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/EditorPlayModeTests.asset
  37. 1
      Tests/Scripts/Editor/Tests_Editor.asmdef
  38. 13
      Tests/Scripts/GraphicTests/Framework/SetupSceneForRenderPipelineTest.cs
  39. 4
      Tests/Scripts/GraphicTests/Framework/TestFrameworkTools.cs
  40. 3
      Tests/Scripts/Tests.asmdef
  41. 32
      build.py
  42. 557
      ImageTemplates/HDRenderPipeline/Scenes/2xxx_Lighting/2004_AnimatedCookie.unity.png
  43. 83
      ImageTemplates/HDRenderPipeline/Scenes/2xxx_Lighting/2004_AnimatedCookie.unity.png.meta
  44. 48
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/2xxx_Lighting/2004_AnimatedCookie/AnimatedCookie_CRT3.asset
  45. 8
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/2xxx_Lighting/2004_AnimatedCookie/AnimatedCookie_CRT3.asset.meta
  46. 1001
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/2xxx_Lighting/2004_AnimatedCookie/LoopVideo.mp4
  47. 30
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/2xxx_Lighting/2004_AnimatedCookie/LoopVideo.mp4.meta
  48. 8
      Tests/Scripts/Editor/Renderloop.meta

999
ImageTemplates/HDRenderPipeline/Scenes/2xxx_Lighting/2401_Light_on_Tesselation.unity.png
文件差异内容过多而无法显示
查看文件

13
ScriptableRenderPipeline/Core/CoreRP/CoreUtils.cs


ClearRenderTarget(cmd, clearFlag, clearColor);
}
public static string GetRenderTargetAutoName(int width, int height, RenderTextureFormat format, string name = "", bool mips = false, bool enableMSAA = false, MSAASamples msaaSamples = MSAASamples.None)
{
string temp;
if (enableMSAA)
temp = string.Format("{0}x{1}_{2}{3}_{4}", width, height, format, mips ? "_Mips" : "", msaaSamples.ToString());
else
temp = string.Format("{0}x{1}_{2}{3}", width, height, format, mips ? "_Mips" : "");
temp = String.Format("{0}_{1}", name == "" ? "RenderTarget" : name, temp);
return temp;
}
public static void ClearCubemap(CommandBuffer cmd, RenderTexture renderTexture, Color clearColor, bool clearMips = false)
{
int mipCount = 1;

90
ScriptableRenderPipeline/Core/CoreRP/Editor/CoreEditorDrawers.cs


using System;
using System.Collections.Generic;
using UnityEditor.AnimatedValues;
using UnityEngine;

[Flags]
public enum FoldoutOption
{
None = 0,
Indent = 1 << 0,
Animate = 1 << 1
}
[Flags]
public enum FadeOption
{
None = 0,
Indent = 1 << 0,
Animate = 1 << 1
}
public static class CoreEditorDrawer<TUIState, TData>
{
public interface IDrawer

return new ActionDrawerInternal(drawers);
}
public static IDrawer FadeGroup(AnimBoolItemGetter fadeGetter, bool indent, params IDrawer[] groupDrawers)
public static IDrawer FadeGroup(AnimBoolItemGetter fadeGetter, FadeOption options, params IDrawer[] groupDrawers)
return new FadeGroupsDrawerInternal(fadeGetter, indent, groupDrawers);
return new FadeGroupsDrawerInternal(fadeGetter, options, groupDrawers);
public static IDrawer FoldoutGroup(string title, AnimBoolGetter root, bool indent, params IDrawer[] bodies)
public static IDrawer FoldoutGroup(string title, AnimBoolGetter root, FoldoutOption options, params IDrawer[] bodies)
return new FoldoutDrawerInternal(title, root, indent, bodies);
return new FoldoutDrawerInternal(title, root, options, bodies);
}
public static IDrawer Select<T2UIState, T2Data>(

class FadeGroupsDrawerInternal : IDrawer
{
IDrawer[] groupDrawers;
AnimBoolItemGetter getter;
bool indent;
IDrawer[] m_GroupDrawers;
AnimBoolItemGetter m_Getter;
FadeOption m_Options;
public FadeGroupsDrawerInternal(AnimBoolItemGetter getter, bool indent, params IDrawer[] groupDrawers)
bool indent { get { return (m_Options & FadeOption.Indent) != 0; } }
bool animate { get { return (m_Options & FadeOption.Animate) != 0; } }
public FadeGroupsDrawerInternal(AnimBoolItemGetter getter, FadeOption options, params IDrawer[] groupDrawers)
this.groupDrawers = groupDrawers;
this.getter = getter;
this.indent = indent;
m_GroupDrawers = groupDrawers;
m_Getter = getter;
m_Options = options;
}
void IDrawer.Draw(TUIState s, TData p, Editor owner)

GUILayout.BeginVertical();
for (var i = 0; i < groupDrawers.Length; ++i)
for (var i = 0; i < m_GroupDrawers.Length; ++i)
var b = getter(s, p, owner, i);
if (EditorGUILayout.BeginFadeGroup(b.faded))
var b = m_Getter(s, p, owner, i);
if (animate && EditorGUILayout.BeginFadeGroup(b.faded)
|| !animate && b.target)
groupDrawers[i].Draw(s, p, owner);
m_GroupDrawers[i].Draw(s, p, owner);
EditorGUILayout.EndFadeGroup();
if (animate)
EditorGUILayout.EndFadeGroup();
}
GUILayout.EndVertical();
}

{
IDrawer[] bodies;
AnimBoolGetter isExpanded;
string title;
bool indent;
IDrawer[] m_Bodies;
AnimBoolGetter m_IsExpanded;
string m_Title;
FoldoutOption m_Options;
bool m_Animate;
bool animate { get { return (m_Options & FoldoutOption.Animate) != 0; } }
bool indent { get { return (m_Options & FoldoutOption.Indent) != 0; } }
public FoldoutDrawerInternal(string title, AnimBoolGetter isExpanded, bool indent, params IDrawer[] bodies)
public FoldoutDrawerInternal(string title, AnimBoolGetter isExpanded, FoldoutOption options, params IDrawer[] bodies)
this.title = title;
this.isExpanded = isExpanded;
this.bodies = bodies;
this.indent = indent;
m_Title = title;
m_IsExpanded = isExpanded;
m_Bodies = bodies;
m_Options = options;
var r = isExpanded(s, p, owner);
var r = m_IsExpanded(s, p, owner);
r.target = CoreEditorUtils.DrawHeaderFoldout(title, r.target);
r.target = CoreEditorUtils.DrawHeaderFoldout(m_Title, r.target);
if (EditorGUILayout.BeginFadeGroup(r.faded))
if (animate && EditorGUILayout.BeginFadeGroup(r.faded)
|| !animate && r.target)
for (var i = 0; i < bodies.Length; i++)
bodies[i].Draw(s, p, owner);
for (var i = 0; i < m_Bodies.Length; i++)
m_Bodies[i].Draw(s, p, owner);
EditorGUILayout.EndFadeGroup();
if (animate)
EditorGUILayout.EndFadeGroup();
GUILayout.EndVertical();
}
}

34
ScriptableRenderPipeline/Core/CoreRP/RTHandle.cs


if (category == RTCategory.MSAA)
rt.antiAliasing = (int)s_ScaledRTCurrentMSAASamples;
rt.name = CoreUtils.GetRenderTargetAutoName(rt.width, rt.height, rt.format, rth.m_Name, mips: rt.useMipMap, enableMSAA : category == RTCategory.MSAA, msaaSamples: s_ScaledRTCurrentMSAASamples);
// This method wraps around regular RenderTexture creation.
// There is no specific logic applied to RenderTextures created this way.

bool bindTextureMS = false,
bool useDynamicScale = false,
VRTextureUsage vrUsage = VRTextureUsage.None,
RenderTextureMemoryless memoryless = RenderTextureMemoryless.None
RenderTextureMemoryless memoryless = RenderTextureMemoryless.None,
string name = ""
)
{
bool enableMSAA = msaaSamples != MSAASamples.None;

bindTextureMS = bindTextureMS,
useDynamicScale = useDynamicScale,
vrUsage = vrUsage,
memorylessMode = memoryless
memorylessMode = memoryless,
name = CoreUtils.GetRenderTargetAutoName(width, height, colorFormat, name, mips: useMipMap, enableMSAA: enableMSAA, msaaSamples: msaaSamples)
};
rt.Create();

newRT.useScaling = false;
newRT.m_EnableRandomWrite = enableRandomWrite;
newRT.m_EnableMSAA = enableMSAA;
newRT.m_Name = name;
return newRT;
}

bool bindTextureMS = false,
bool useDynamicScale = false,
VRTextureUsage vrUsage = VRTextureUsage.None,
RenderTextureMemoryless memoryless = RenderTextureMemoryless.None
RenderTextureMemoryless memoryless = RenderTextureMemoryless.None,
string name = ""
)
{
bool allocForMSAA = s_ScaledRTSupportsMSAA ? enableMSAA : false;

bindTextureMS,
useDynamicScale,
vrUsage,
memoryless
memoryless,
name
);
rth.scaleFactor = scaleFactor;

bool bindTextureMS = false,
bool useDynamicScale = false,
VRTextureUsage vrUsage = VRTextureUsage.None,
RenderTextureMemoryless memoryless = RenderTextureMemoryless.None
RenderTextureMemoryless memoryless = RenderTextureMemoryless.None,
string name = ""
)
{
bool allocForMSAA = s_ScaledRTSupportsMSAA ? enableMSAA : false;

bindTextureMS,
useDynamicScale,
vrUsage,
memoryless
memoryless,
name
);
rth.scaleFunc = scaleFunc;

// Internal function
static RTHandle AllocAutoSizedRenderTexture(
int width,
int height,

bool bindTextureMS,
bool useDynamicScale,
VRTextureUsage vrUsage,
RenderTextureMemoryless memoryless
RenderTextureMemoryless memoryless,
string name
)
{
// Here user made a mistake in setting up msaa/bindMS, hence the warning

bindTextureMS = bindTextureMS,
useDynamicScale = useDynamicScale,
vrUsage = vrUsage,
memorylessMode = memoryless
memorylessMode = memoryless,
name = CoreUtils.GetRenderTargetAutoName(width, height, colorFormat, name, mips : useMipMap, enableMSAA: allocForMSAA, msaaSamples : s_ScaledRTCurrentMSAASamples)
};
rt.Create();

rth.m_EnableRandomWrite = enableRandomWrite;
rth.useScaling = true;
rth.m_Name = name;
s_AutoSizedRTs.Add(rth);
return rth;
}

RenderTargetIdentifier[] m_NameIDs = new RenderTargetIdentifier[2];
bool m_EnableMSAA = false;
bool m_EnableRandomWrite = false;
string m_Name;
Vector2 scaleFactor = Vector2.one;
ScaleFunc scaleFunc;

bindTextureMS = false, // Somehow, this can be true even if antiAliasing == 1. Leads to Unity-internal binding errors.
useDynamicScale = refRT.useDynamicScale,
vrUsage = refRT.vrUsage,
memorylessMode = refRT.memorylessMode
memorylessMode = refRT.memorylessMode,
name = CoreUtils.GetRenderTargetAutoName(refRT.width, refRT.height, refRT.format, m_Name, mips : refRT.useMipMap)
};
newRT.Create();

38
ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/Common.hlsl


// Using pow often result to a warning like this
// "pow(f, e) will not work for negative f, use abs(f) or conditionally handle negative values if you expect them"
// PositivePow remove this warning when you know the value is positive or 0 and avoid inf/NAN.
// PositivePow remove this warning when you know the value is positive or 0 and avoid inf/NAN.
// Note: https://msdn.microsoft.com/en-us/library/windows/desktop/bb509636(v=vs.85).aspx pow(0, >0) == 0
TEMPLATE_2_REAL(PositivePow, base, power, return pow(abs(base), power))

0, 0, 1, 0,
0, 0, 0, 1};
// Use case examples:
// (position = positionCS) => (clipSpaceTransform = use default)
// (position = positionVS) => (clipSpaceTransform = UNITY_MATRIX_P)
// (position = positionWS) => (clipSpaceTransform = UNITY_MATRIX_VP)
float4 ComputeClipSpaceCoordinates(float3 position, float4x4 clipSpaceTransform = k_identity4x4)
float4 ComputeClipSpacePosition(float2 positionNDC, float deviceDepth)
float4 positionCS = mul(clipSpaceTransform, float4(position, 1.0));
float4 positionCS = float4(positionNDC * 2.0 - 1.0, deviceDepth, 1.0);
// Our clip space is correct, but the NDC is flipped.
// Conceptually, it should be (positionNDC.y = 1.0 - positionNDC.y), but this is more efficient.
// Our world space, view space, screen space and NDC space are Y-up.
// Our clip space is flipped upside-down due to poor legacy Unity design.
// The flip is baked into the projection matrix, so we only have to flip
// manually when going from CS to NDC and back.
positionCS.y = -positionCS.y;
#endif

// (position = positionCS) => (clipSpaceTransform = use default)
// (position = positionVS) => (clipSpaceTransform = UNITY_MATRIX_P)
// (position = positionWS) => (clipSpaceTransform = UNITY_MATRIX_VP)
float2 ComputeNormalizedDeviceCoordinates(float3 position, float4x4 clipSpaceTransform = k_identity4x4)
float4 ComputeClipSpacePosition(float3 position, float4x4 clipSpaceTransform = k_identity4x4)
float4 positionCS = ComputeClipSpaceCoordinates(position, clipSpaceTransform);
return positionCS.xy * (rcp(positionCS.w) * 0.5) + 0.5;
return mul(clipSpaceTransform, float4(position, 1.0));
float4 ComputeClipSpacePosition(float2 positionNDC, float deviceDepth)
// Use case examples:
// (position = positionCS) => (clipSpaceTransform = use default)
// (position = positionVS) => (clipSpaceTransform = UNITY_MATRIX_P)
// (position = positionWS) => (clipSpaceTransform = UNITY_MATRIX_VP)
float2 ComputeNormalizedDeviceCoordinates(float3 position, float4x4 clipSpaceTransform = k_identity4x4)
float4 positionCS = float4(positionNDC * 2.0 - 1.0, deviceDepth, 1.0);
float4 positionCS = ComputeClipSpacePosition(position, clipSpaceTransform);
// Our clip space is correct, but the NDC is flipped.
// Conceptually, it should be (positionNDC.y = 1.0 - positionNDC.y), but this is more efficient.
// Our world space, view space, screen space and NDC space are Y-up.
// Our clip space is flipped upside-down due to poor legacy Unity design.
// The flip is baked into the projection matrix, so we only have to flip
// manually when going from CS to NDC and back.
return positionCS;
return positionCS.xy * (rcp(positionCS.w) * 0.5) + 0.5;
}
float3 ComputeViewSpacePosition(float2 positionNDC, float deviceDepth, float4x4 invProjMatrix)

1
ScriptableRenderPipeline/Core/CoreRP/Shadow/Shadow.cs


m_Shadowmap.hideFlags = HideFlags.DontSaveInEditor | HideFlags.DontSaveInBuild;
m_Shadowmap.dimension = TextureDimension.Tex2DArray;
m_Shadowmap.volumeDepth = (int) m_Slices;
m_Shadowmap.name = CoreUtils.GetRenderTargetAutoName(shadowmap.width, shadowmap.height, shadowmap.format, "Shadow", mips : shadowmap.useMipMap);
m_ShadowmapId = new RenderTargetIdentifier( m_Shadowmap );
}

2
ScriptableRenderPipeline/Core/CoreRP/TextureCache.cs


using System;
using UnityEngine;
using System.Collections.Generic;
using UnityEngine.Rendering;

for (int m = 0; m < m_NumPanoMipLevels; m++)
{
m_StagingRTs[m] = new RenderTexture(Mathf.Max(1, panoWidthTop >> m), Mathf.Max(1, panoHeightTop >> m), 0, RenderTextureFormat.ARGBHalf) { hideFlags = HideFlags.HideAndDontSave };
m_StagingRTs[m].name = CoreUtils.GetRenderTargetAutoName(Mathf.Max(1, panoWidthTop >> m), Mathf.Max(1, panoHeightTop >> m), RenderTextureFormat.ARGBHalf, String.Format("PanaCache{0}", m));
}
if (m_CubeBlitMaterial)

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/DebugDisplayLatlong.shader


{
Pass
{
ZWrite Off
ZWrite On
ZTest Always
Blend Off
Cull Off

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/DebugFullScreen.shader


{
arrow_coord.y = 1.0 - arrow_coord.y;
}
arrow_coord *= _ScreenToTargetScale;
arrow_coord *= _ScreenToTargetScale.xy;
float2 mv_arrow = SampleMotionVectors(arrow_coord);

10
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Camera/HDCameraUI.cs


public static readonly CED.IDrawer SectionCaptureSettings = CED.FoldoutGroup(
"Capture Settings",
(s, p, o) => s.isSectionExpandedCaptureSettings,
true,
FoldoutOption.Indent,
CED.Action(Drawer_FieldOcclusionCulling),
CED.Action(Drawer_FieldNormalizedViewPort));

true,
FoldoutOption.Indent,
#if ENABLE_MULTIPLE_DISPLAYS
CED.Action(Drawer_SectionMultiDisplay),
#endif

public static readonly CED.IDrawer SectionXRSettings = CED.FadeGroup(
(s, d, o, i) => s.isSectionAvailableXRSettings,
false,
FadeOption.Animate,
true,
FoldoutOption.Indent,
false,
FadeOption.Animate,
CED.Select(
(s, d, o) => s.frameSettingsUI,
(s, d, o) => d.frameSettings,

16
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/Reflection/HDReflectionProbeUI.Drawers.cs


CED.Action(Drawer_ReflectionProbeMode),
CED.FadeGroup((s, p, o, i) => s.IsSectionExpandedMode((ReflectionProbeMode)i),
true,
FadeOption.Indent | FadeOption.Animate,
CED.noop, // Baked
CED.Action(Drawer_ModeSettingsRealtime), // Realtime
CED.Action(Drawer_ModeSettingsCustom) // Custom

public static readonly CED.IDrawer SectionInfluenceVolumeSettings = CED.FoldoutGroup(
"Influence volume settings",
(s, p, o) => s.isSectionExpandedInfluenceVolume,
true,
FoldoutOption.Indent,
false,
FadeOption.Animate,
CED.Action(Drawer_InfluenceBoxSettings), // Box
CED.Action(Drawer_InfluenceSphereSettings) // Sphere
)/*,

public static readonly CED.IDrawer SectionSeparateProjectionVolumeSettings = CED.FadeGroup(
(s, p, o, i) => s.isSectionExpandedSeparateProjection,
false,
FadeOption.Animate,
true,
FoldoutOption.Indent,
false,
FadeOption.Animate,
CED.Action(Drawer_ProjectionBoxSettings), // Box
CED.Action(Drawer_ProjectionSphereSettings) // Sphere
)

public static readonly CED.IDrawer SectionCaptureSettings = CED.FoldoutGroup(
"Capture settings",
(s, p, o) => s.isSectionExpandedCaptureSettings,
true,
FoldoutOption.Indent,
CED.Action(Drawer_CaptureSettings)
);

true,
FoldoutOption.Indent,
CED.Action(Drawer_AdditionalSettings)
);

8
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/Reflection/PlanarReflectionProbeUI.Drawers.cs


public static readonly CED.IDrawer SectionFoldoutInfluenceSettings = CED.FoldoutGroup(
"Influence Settings",
(s, d, o) => s.isSectionExpandedInfluenceSettings,
true,
FoldoutOption.Indent,
CED.Action(Drawer_SectionInfluenceSettings)
);

SectionFoldoutCaptureSettings = CED.FoldoutGroup(
"Capture Settings",
(s, d, o) => s.isSectionExpandedCaptureSettings,
true,
FoldoutOption.Indent,
CED.Action(Drawer_SectionCaptureSettings),
CED.FadeGroup(
(s, d, o, i) =>

case 1: return s.isSectionExpandedCaptureStaticSettings;
}
},
false,
FadeOption.Animate,
SectionCaptureMirrorSettings,
SectionCaptureStaticSettings)
);

CED.FadeGroup(
(s, d, o, i) => s.IsSectionExpandedReflectionProbeMode((ReflectionProbeMode)i),
true,
FadeOption.Animate | FadeOption.Indent,
SectionProbeModeBakedSettings,
SectionProbeModeRealtimeSettings,
SectionProbeModeCustomSettings

6
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/Reflection/Volume/InfluenceVolumeUI.Drawers.cs


CED.Action(Drawer_FieldShapeType),
CED.FadeGroup(
(s, d, o, i) => s.IsSectionExpanded_Shape((ShapeType)i),
true,
FadeOption.Animate | FadeOption.Indent,
SectionShapeBox,
SectionShapeSphere
)

CED.FoldoutGroup(
"Influence Volume",
(s, d, o) => s.isSectionExpandedShape,
true,
FoldoutOption.Indent,
false,
FadeOption.Animate,
SectionShapeBox,
SectionShapeSphere
)

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/Reflection/Volume/ProxyVolumeUI.cs


CED.Action(Drawer_FieldShapeType),
CED.FadeGroup(
(s, d, o, i) => s.IsSectionExpanded_Shape((ShapeType)i),
true,
FadeOption.Animate | FadeOption.Indent,
SectionShapeBox,
SectionShapeSphere
)

14
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/FrameSettingsUI.cs


public static CED.IDrawer SectionRenderingPasses = CED.FoldoutGroup(
"Rendering Passes",
(s, p, o) => s.isSectionExpandedRenderingPasses,
true,
FoldoutOption.Indent,
CED.LabelWidth(200, CED.Action(Drawer_SectionRenderingPasses))
);

true,
FoldoutOption.Indent,
false,
FadeOption.Animate,
true,
FadeOption.Animate | FadeOption.Indent,
CED.Action(Drawer_FieldRenderAlphaTestOnlyInDeferredPrepass))),
CED.Action(Drawer_SectionOtherRenderingSettings)
)

(s, d, o, i) => s.isSectionExpandedXRSupported,
false,
FadeOption.Animate,
true,
FoldoutOption.Indent,
true,
FoldoutOption.Indent,
CED.LabelWidth(250, CED.Action(Drawer_SectionLightingSettings)));
public AnimBool isSectionExpandedRenderingPasses { get { return m_AnimBools[0]; } }

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


public static CED.IDrawer SectionLightLoopSettings = CED.FoldoutGroup(
"Light Loop Settings",
(s, p, o) => s.isSectionExpandedLightLoopSettings,
true,
FoldoutOption.Indent,
CED.LabelWidth(250, CED.Action(Drawer_SectionLightLoopSettings)));
public AnimBool isSectionExpandedLightLoopSettings { get { return m_AnimBools[0]; } }

22
ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs


m_SSSBufferManager.InitSSSBuffers(m_GbufferManager, m_Asset.renderPipelineSettings);
m_CameraColorBuffer = RTHandle.Alloc(Vector2.one, filterMode: FilterMode.Point, colorFormat: RenderTextureFormat.ARGBHalf, sRGB : false, enableRandomWrite: true, enableMSAA: true);
m_CameraSssDiffuseLightingBuffer = RTHandle.Alloc(Vector2.one, filterMode: FilterMode.Point, colorFormat: RenderTextureFormat.RGB111110Float, sRGB: false, enableRandomWrite: true, enableMSAA: true);
m_CameraColorBuffer = RTHandle.Alloc(Vector2.one, filterMode: FilterMode.Point, colorFormat: RenderTextureFormat.ARGBHalf, sRGB : false, enableRandomWrite: true, enableMSAA: true, name : "CameraColor");
m_CameraSssDiffuseLightingBuffer = RTHandle.Alloc(Vector2.one, filterMode: FilterMode.Point, colorFormat: RenderTextureFormat.RGB111110Float, sRGB: false, enableRandomWrite: true, enableMSAA: true, name: "CameraSSSDiffuseLighting");
m_CameraDepthStencilBuffer = RTHandle.Alloc(Vector2.one, depthBufferBits: DepthBits.Depth24, colorFormat: RenderTextureFormat.Depth, filterMode: FilterMode.Point, bindTextureMS: true, enableMSAA: true);
m_CameraDepthStencilBuffer = RTHandle.Alloc(Vector2.one, depthBufferBits: DepthBits.Depth24, colorFormat: RenderTextureFormat.Depth, filterMode: FilterMode.Point, bindTextureMS: true, enableMSAA: true, name: "CameraDepthStencil");
m_CameraDepthBufferCopy = RTHandle.Alloc(Vector2.one, depthBufferBits: DepthBits.Depth24, colorFormat: RenderTextureFormat.Depth, filterMode: FilterMode.Point, bindTextureMS: true, enableMSAA: true);
m_CameraDepthBufferCopy = RTHandle.Alloc(Vector2.one, depthBufferBits: DepthBits.Depth24, colorFormat: RenderTextureFormat.Depth, filterMode: FilterMode.Point, bindTextureMS: true, enableMSAA: true, name: "CameraDepthStencilCopy");
m_CameraStencilBufferCopy = RTHandle.Alloc(Vector2.one, depthBufferBits: DepthBits.None, colorFormat: RenderTextureFormat.R8, sRGB: false, filterMode: FilterMode.Point, enableMSAA: true); // DXGI_FORMAT_R8_UINT is not supported by Unity
m_CameraStencilBufferCopy = RTHandle.Alloc(Vector2.one, depthBufferBits: DepthBits.None, colorFormat: RenderTextureFormat.R8, sRGB: false, filterMode: FilterMode.Point, enableMSAA: true, name: "CameraStencilCopy"); // DXGI_FORMAT_R8_UINT is not supported by Unity
m_AmbientOcclusionBuffer = RTHandle.Alloc(Vector2.one, filterMode: FilterMode.Bilinear, colorFormat: RenderTextureFormat.R8, sRGB: false, enableRandomWrite: true);
m_AmbientOcclusionBuffer = RTHandle.Alloc(Vector2.one, filterMode: FilterMode.Bilinear, colorFormat: RenderTextureFormat.R8, sRGB: false, enableRandomWrite: true, name: "AmbientOcclusion");
m_VelocityBuffer = RTHandle.Alloc(Vector2.one, filterMode: FilterMode.Point, colorFormat: Builtin.GetVelocityBufferFormat(), sRGB: Builtin.GetVelocityBufferSRGBFlag(), enableMSAA: true);
m_VelocityBuffer = RTHandle.Alloc(Vector2.one, filterMode: FilterMode.Point, colorFormat: Builtin.GetVelocityBufferFormat(), sRGB: Builtin.GetVelocityBufferSRGBFlag(), enableMSAA: true, name: "Velocity");
m_DistortionBuffer = RTHandle.Alloc(Vector2.one, filterMode: FilterMode.Point, colorFormat: Builtin.GetDistortionBufferFormat(), sRGB: Builtin.GetDistortionBufferSRGBFlag());
m_DistortionBuffer = RTHandle.Alloc(Vector2.one, filterMode: FilterMode.Point, colorFormat: Builtin.GetDistortionBufferFormat(), sRGB: Builtin.GetDistortionBufferSRGBFlag(), name: "Distortion");
m_DeferredShadowBuffer = RTHandle.Alloc(Vector2.one, filterMode: FilterMode.Point, colorFormat: RenderTextureFormat.ARGB32, sRGB: false, enableRandomWrite: true);
m_DeferredShadowBuffer = RTHandle.Alloc(Vector2.one, filterMode: FilterMode.Point, colorFormat: RenderTextureFormat.ARGB32, sRGB: false, enableRandomWrite: true, name: "DeferredShadow");
m_DebugColorPickerBuffer = RTHandle.Alloc(Vector2.one, filterMode: FilterMode.Point, colorFormat: RenderTextureFormat.ARGBHalf, sRGB: false);
m_DebugFullScreenTempBuffer = RTHandle.Alloc(Vector2.one, filterMode: FilterMode.Point, colorFormat: RenderTextureFormat.ARGBHalf, sRGB: false);
m_DebugColorPickerBuffer = RTHandle.Alloc(Vector2.one, filterMode: FilterMode.Point, colorFormat: RenderTextureFormat.ARGBHalf, sRGB: false, name: "DebugColorPicker");
m_DebugFullScreenTempBuffer = RTHandle.Alloc(Vector2.one, filterMode: FilterMode.Point, colorFormat: RenderTextureFormat.ARGBHalf, sRGB: false, name: "DebugFullScreen");
}
}

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


Vector3 camPosWS = camera.transform.position;
// We need to properly reset this here otherwise if we go from 1 light to no visible light we would keep the old reference active.
m_CurrentSunLight = null;
m_CurrentSunLightShadowIndex = -1;
// Note: Light with null intensity/Color are culled by the C++, no need to test it here
if (cullResults.visibleLights.Count != 0 || cullResults.visibleReflectionProbes.Count != 0)
{

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

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/LightLoopDef.hlsl


if (cacheType == ENVCACHETYPE_TEXTURE2D)
{
//_Env2DCaptureVP is in capture space
float4 ndc = ComputeClipSpaceCoordinates(texCoord, _Env2DCaptureVP[index]);
float4 ndc = ComputeClipSpacePosition(texCoord, _Env2DCaptureVP[index]);
ndc *= rcp(ndc.w);
ndc.xy = ndc.xy * 0.5 + 0.5;

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


void Initialize()
{
if(m_TempRenderTexture == null)
if (m_TempRenderTexture == null)
m_TempRenderTexture.hideFlags = HideFlags.HideAndDontSave;
m_TempRenderTexture.name = CoreUtils.GetRenderTargetAutoName(m_ProbeSize, m_ProbeSize, RenderTextureFormat.ARGBHalf, "PlanarReflection", mips : true);
m_ConvolutionTargetTexture.hideFlags = HideFlags.HideAndDontSave;
m_ConvolutionTargetTexture.name = CoreUtils.GetRenderTargetAutoName(m_ProbeSize, m_ProbeSize, RenderTextureFormat.ARGBHalf, "PlanarReflectionConvolution", mips: true);
m_ConvolutionTargetTexture.Create();
m_ConvertTextureMaterial = CoreUtils.CreateEngineMaterial("Hidden/SRP/BlitCubeTextureFace");

public void Release()
{
if(m_TextureCache != null)
if (m_TextureCache != null)
if(m_TempRenderTexture != null)
if (m_TempRenderTexture != null)
if (m_ConvolutionTargetTexture != null)
{
m_ConvolutionTargetTexture.Release();
m_ConvolutionTargetTexture = null;
}
m_ProbeBakingState = null;
}

RenderTexture convolutionSourceTexture = null;
if (texture2D != null)
{
// if the size if different from the cache probe size or if the input texture format is compressed, we need to convert it
// 1) to a format for which we can generate mip maps
// if the size if different from the cache probe size or if the input texture format is compressed, we need to convert it
// 1) to a format for which we can generate mip maps
// 2) to the proper reflection probe cache size
var sizeMismatch = texture2D.width != m_ProbeSize || texture2D.height != m_ProbeSize;
var formatMismatch = texture2D.format != TextureFormat.RGBAHalf; // Temporary RT for convolution is always FP16

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


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

{
// Temporary RT used for convolution and compression
m_TempRenderTexture = new RenderTexture(m_ProbeSize, m_ProbeSize, 1, RenderTextureFormat.ARGBHalf);
m_TempRenderTexture.hideFlags = HideFlags.HideAndDontSave;
m_TempRenderTexture.name = CoreUtils.GetRenderTargetAutoName(m_ProbeSize, m_ProbeSize, RenderTextureFormat.ARGBHalf, "PlanarReflection", mips : true);
m_ConvolutionTargetTexture.hideFlags = HideFlags.HideAndDontSave;
m_ConvolutionTargetTexture.name = CoreUtils.GetRenderTargetAutoName(m_ProbeSize, m_ProbeSize, RenderTextureFormat.ARGBHalf, "PlanarReflection", mips : true);
m_ConvolutionTargetTexture.Create();
m_ConvertTextureMaterial = CoreUtils.CreateEngineMaterial("Hidden/SRP/BlitCubeTextureFace");

public void Release()
{
if(m_TextureCache != null)
if (m_TextureCache != null)
if(m_TempRenderTexture != null)
if (m_TempRenderTexture != null)
}
if (m_ConvolutionTargetTexture != null)
{
m_ConvolutionTargetTexture.Release();
m_ConvolutionTargetTexture = null;
}
m_ProbeBakingState = null;
}

RenderTexture convolutionSourceTexture = null;
if (cubeTexture != null)
{
// if the size if different from the cache probe size or if the input texture format is compressed, we need to convert it
// 1) to a format for which we can generate mip maps
// if the size if different from the cache probe size or if the input texture format is compressed, we need to convert it
// 1) to a format for which we can generate mip maps
// 2) to the proper reflection probe cache size
bool sizeMismatch = cubeTexture.width != m_ProbeSize || cubeTexture.height != m_ProbeSize;
bool formatMismatch = cubeTexture.format != TextureFormat.RGBAHalf; // Temporary RT for convolution is always FP16

6
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Reflection/ReflectionSystemInternal.cs


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

public RenderTexture NewRenderTarget(PlanarReflectionProbe probe)
{
var rt = new RenderTexture(m_Parameters.planarReflectionProbeSize, m_Parameters.planarReflectionProbeSize, 0, RenderTextureFormat.ARGBHalf);
// No hide and don't save for this one
rt.name = "PlanarProbeRT " + probe.name;
rt.name = CoreUtils.GetRenderTargetAutoName(m_Parameters.planarReflectionProbeSize, m_Parameters.planarReflectionProbeSize, RenderTextureFormat.ARGBHalf, "PlanarProbeRT");
rt.Create();
return rt;
}

3
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/VolumetricLighting.cs


for (int i = 0; i < n; i++)
{
this.lightingRTEX[i] = new RenderTexture(w, h, 0, RenderTextureFormat.ARGBHalf, RenderTextureReadWrite.Linear);
this.lightingRTEX[i].hideFlags = HideFlags.HideAndDontSave;
this.lightingRTEX[i].name = CoreUtils.GetRenderTargetAutoName(w, h, RenderTextureFormat.ARGBHalf, String.Format("Volumetric{0}", i));
this.lightingRTID[i] = new RenderTargetIdentifier(this.lightingRTEX[i]);
}
}

4
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Decal/DBufferManager.cs


for (int dbufferIndex = 0; dbufferIndex < m_BufferCount; ++dbufferIndex)
{
m_RTs[dbufferIndex] = RTHandle.Alloc(Vector2.one, colorFormat: rtFormat[dbufferIndex], sRGB: sRGBFlags[dbufferIndex], filterMode: FilterMode.Point);
m_RTs[dbufferIndex] = RTHandle.Alloc(Vector2.one, colorFormat: rtFormat[dbufferIndex], sRGB: sRGBFlags[dbufferIndex], filterMode: FilterMode.Point, name: string.Format("DBuffer{0}", dbufferIndex));
m_HTile = RTHandle.Alloc(size => new Vector2Int((size.x + 7) / 8, (size.y + 7) / 8), filterMode: FilterMode.Point, colorFormat: RenderTextureFormat.R8, sRGB: false, enableRandomWrite: true); // Enable UAV
m_HTile = RTHandle.Alloc(size => new Vector2Int((size.x + 7) / 8, (size.y + 7) / 8), filterMode: FilterMode.Point, colorFormat: RenderTextureFormat.R8, sRGB: false, enableRandomWrite: true, name: "DBufferHTile"); // Enable UAV
}
override public void DestroyBuffers()

4
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/GBufferManager.cs


for (int gbufferIndex = 0; gbufferIndex < m_GBufferCount; ++gbufferIndex)
{
m_RTs[gbufferIndex] = RTHandle.Alloc(Vector2.one, colorFormat: rtFormat[gbufferIndex], sRGB: sRGBFlags[gbufferIndex], filterMode: FilterMode.Point);
m_RTs[gbufferIndex] = RTHandle.Alloc(Vector2.one, colorFormat: rtFormat[gbufferIndex], sRGB: sRGBFlags[gbufferIndex], filterMode: FilterMode.Point, name: string.Format("GBuffer{0}", gbufferIndex));
m_RTIDs[gbufferIndex] = m_RTs[gbufferIndex].nameID;
m_TextureShaderIDs[gbufferIndex] = HDShaderIDs._GBufferTexture[gbufferIndex];
m_RTIDsNoShadowMask[gbufferIndex] = HDShaderIDs._GBufferTexture[gbufferIndex];

{
m_RTs[m_GBufferCount] = RTHandle.Alloc(Vector2.one, colorFormat: Builtin.GetShadowMaskBufferFormat(), sRGB: Builtin.GetShadowMaskSRGBFlag(), filterMode: FilterMode.Point);
m_RTs[m_GBufferCount] = RTHandle.Alloc(Vector2.one, colorFormat: Builtin.GetShadowMaskBufferFormat(), sRGB: Builtin.GetShadowMaskSRGBFlag(), filterMode: FilterMode.Point, name: "GBufferShadowMask");
m_RTIDs[m_GBufferCount] = new RenderTargetIdentifier(m_RTs[m_GBufferCount]);
m_TextureShaderIDs[m_GBufferCount] = HDShaderIDs._ShadowMaskTexture;
}

1
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/GGXConvolution/RuntimeFilterIBL.cs


m_GgxIblSampleData.autoGenerateMips = false;
m_GgxIblSampleData.enableRandomWrite = true;
m_GgxIblSampleData.filterMode = FilterMode.Point;
m_GgxIblSampleData.name = CoreUtils.GetRenderTargetAutoName(m_GgxIblMaxSampleCount, k_GgxIblMipCountMinusOne, RenderTextureFormat.ARGBHalf, "GGXIblSampleData");
m_GgxIblSampleData.Create();
m_ComputeGgxIblSampleDataCS.SetTexture(m_ComputeGgxIblSampleDataKernel, "output", m_GgxIblSampleData);

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


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

m_InitPreFGD = CoreUtils.CreateEngineMaterial("Hidden/HDRenderPipeline/PreIntegratedFGD");
m_PreIntegratedFGD = new RenderTexture(128, 128, 0, RenderTextureFormat.ARGB2101010, RenderTextureReadWrite.Linear);
m_PreIntegratedFGD.hideFlags = HideFlags.HideAndDontSave;
m_PreIntegratedFGD.name = CoreUtils.GetRenderTargetAutoName(128, 128, RenderTextureFormat.ARGB2101010, "PreIntegratedFGD");
m_PreIntegratedFGD.Create();
m_LtcData = new Texture2DArray(k_LtcLUTResolution, k_LtcLUTResolution, 3, TextureFormat.RGBAHalf, false /*mipmap*/, true /* linear */)

7
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/MaterialUtilities.hlsl


positionCS.xy = positionCS.xy / positionCS.w;
previousPositionCS.xy = previousPositionCS.xy / previousPositionCS.w;
return (positionCS.xy - previousPositionCS.xy);
float2 velocity = (positionCS.xy - previousPositionCS.xy);
#if UNITY_UV_STARTS_AT_TOP
velocity.y = -velocity.y;
#endif
return velocity;
#else
return float2(0.0, 0.0);
#endif

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


{
// In case of full forward we must allocate the render target for forward SSS (or reuse one already existing)
// TODO: Provide a way to reuse a render target
m_ColorMRTs[0] = RTHandle.Alloc(Vector2.one, filterMode: FilterMode.Point, colorFormat: RenderTextureFormat.ARGB32, sRGB: true);
m_ColorMRTs[0] = RTHandle.Alloc(Vector2.one, filterMode: FilterMode.Point, colorFormat: RenderTextureFormat.ARGB32, sRGB: true, name: "SSSBuffer");
m_ExternalBuffer[0] = false;
}
else

if (ShaderConfig.k_UseDisneySSS == 0 || NeedTemporarySubsurfaceBuffer())
{
// Caution: must be same format as m_CameraSssDiffuseLightingBuffer
m_CameraFilteringBuffer = RTHandle.Alloc(Vector2.one, filterMode: FilterMode.Point, colorFormat: RenderTextureFormat.RGB111110Float, sRGB: false, enableRandomWrite: true, enableMSAA: true); // Enable UAV
m_CameraFilteringBuffer = RTHandle.Alloc(Vector2.one, filterMode: FilterMode.Point, colorFormat: RenderTextureFormat.RGB111110Float, sRGB: false, enableRandomWrite: true, enableMSAA: true, name: "SSSCameraFiltering"); // Enable UAV
m_HTile = RTHandle.Alloc(size => new Vector2Int((size.x + 7) / 8, (size.y + 7) / 8), filterMode: FilterMode.Point, colorFormat: RenderTextureFormat.R8, sRGB: false, enableRandomWrite: true); // Enable UAV
m_HTile = RTHandle.Alloc(size => new Vector2Int((size.x + 7) / 8, (size.y + 7) / 8), filterMode: FilterMode.Point, colorFormat: RenderTextureFormat.R8, sRGB: false, enableRandomWrite: true, name: "SSSHtile"); // Enable UAV
}
public RTHandle GetSSSBuffer(int index)

6
ScriptableRenderPipeline/HDRenderPipeline/HDRP/RenderPipelineResources/BufferPyramid.cs


public void CreateBuffers()
{
m_ColorPyramidBuffer = RTHandle.Alloc(size => CalculatePyramidSize(size), filterMode: FilterMode.Trilinear, colorFormat: RenderTextureFormat.ARGBHalf, sRGB: false, useMipMap: true, autoGenerateMips: false);
m_DepthPyramidBuffer = RTHandle.Alloc(size => CalculatePyramidSize(size), filterMode: FilterMode.Trilinear, colorFormat: RenderTextureFormat.RFloat, sRGB: false, useMipMap: true, autoGenerateMips: false, enableRandomWrite: true); // Need randomReadWrite because we downsample the first mip with a compute shader.
m_ColorPyramidBuffer = RTHandle.Alloc(size => CalculatePyramidSize(size), filterMode: FilterMode.Trilinear, colorFormat: RenderTextureFormat.ARGBHalf, sRGB: false, useMipMap: true, autoGenerateMips: false, name: "ColorPymarid");
m_DepthPyramidBuffer = RTHandle.Alloc(size => CalculatePyramidSize(size), filterMode: FilterMode.Trilinear, colorFormat: RenderTextureFormat.RFloat, sRGB: false, useMipMap: true, autoGenerateMips: false, enableRandomWrite: true, name: "DepthPyramid"); // Need randomReadWrite because we downsample the first mip with a compute shader.
}
public void DestroyBuffers()

for (int i = currentLodCount; i < lodCount; ++i)
{
int mipIndexCopy = i + 1; // Don't remove this copy! It's important for the value to be correctly captured by the lambda.
RTHandle newMip = RTHandle.Alloc(size => CalculatePyramidMipSize(CalculatePyramidSize(size), mipIndexCopy), colorFormat: format, sRGB: false, enableRandomWrite: true, useMipMap: false, filterMode: FilterMode.Bilinear);
RTHandle newMip = RTHandle.Alloc(size => CalculatePyramidMipSize(CalculatePyramidSize(size), mipIndexCopy), colorFormat: format, sRGB: false, enableRandomWrite: true, useMipMap: false, filterMode: FilterMode.Bilinear, name: string.Format("PyramidMip{0}", i));
mipList.Add(newMip);
}
}

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/RenderPipelineResources/CopyDepthBuffer.shader


float Frag(Varyings input) : SV_Depth
{
PositionInputs posInputs = GetPositionInput(input.positionCS, _ScreenSize.zw);
PositionInputs posInputs = GetPositionInput(input.positionCS.xy, _ScreenSize.zw);
return LOAD_TEXTURE2D(_InputDepthTexture, posInputs.positionSS).x;
}

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Sky/SkyManager.cs


{
m_VisualSky.skySettings = GetSkySetting(VolumeManager.instance.stack);
m_BakingSky.skySettings = SkyManager.GetBakingSkySettings();
// Update needs to happen before testing if the component is active other internal data structure are not properly updated yet.
VolumeManager.instance.Update(m_LightingOverrideVolumeStack, camera.camera.transform, m_LightingOverrideLayerMask);
if(VolumeManager.instance.IsComponentActiveInMask<VisualEnvironment>(m_LightingOverrideLayerMask))

8
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Sky/SkyRenderingContext.cs


// Reallocate everything
if (m_SkyboxCubemapRT == null)
{
m_SkyboxCubemapRT = RTHandle.Alloc(resolution, resolution, colorFormat: RenderTextureFormat.ARGBHalf, sRGB: false, dimension: TextureDimension.Cube, useMipMap: true, autoGenerateMips: false, filterMode: FilterMode.Trilinear);
m_SkyboxCubemapRT = RTHandle.Alloc(resolution, resolution, colorFormat: RenderTextureFormat.ARGBHalf, sRGB: false, dimension: TextureDimension.Cube, useMipMap: true, autoGenerateMips: false, filterMode: FilterMode.Trilinear, name: "SkyboxCubemap");
m_SkyboxGGXCubemapRT = RTHandle.Alloc(resolution, resolution, colorFormat: RenderTextureFormat.ARGBHalf, sRGB: false, dimension: TextureDimension.Cube, useMipMap: true, autoGenerateMips: false, filterMode: FilterMode.Trilinear);
m_SkyboxGGXCubemapRT = RTHandle.Alloc(resolution, resolution, colorFormat: RenderTextureFormat.ARGBHalf, sRGB: false, dimension: TextureDimension.Cube, useMipMap: true, autoGenerateMips: false, filterMode: FilterMode.Trilinear, name: "SkyboxGGXCubemap");
}
if (m_SupportsMIS && (m_SkyboxConditionalCdfRT == null))

int height = (int)LightSamplingParameters.TextureHeight;
// + 1 because we store the value of the integral of the cubemap at the end of the texture.
m_SkyboxMarginalRowCdfRT = RTHandle.Alloc(height + 1, 1, colorFormat: RenderTextureFormat.RFloat, sRGB: false, useMipMap: false, enableRandomWrite: true, filterMode: FilterMode.Point);
m_SkyboxMarginalRowCdfRT = RTHandle.Alloc(height + 1, 1, colorFormat: RenderTextureFormat.RFloat, sRGB: false, useMipMap: false, enableRandomWrite: true, filterMode: FilterMode.Point, name: "SkyboxMarginalRowCdf");
m_SkyboxMarginalRowCdfRT = RTHandle.Alloc(width, height, colorFormat: RenderTextureFormat.RFloat, sRGB: false, useMipMap: false, enableRandomWrite: true, filterMode: FilterMode.Point);
m_SkyboxMarginalRowCdfRT = RTHandle.Alloc(width, height, colorFormat: RenderTextureFormat.RFloat, sRGB: false, useMipMap: false, enableRandomWrite: true, filterMode: FilterMode.Point, name: "SkyboxMarginalRowCdf");
}
m_CubemapScreenSize = new Vector4((float)resolution, (float)resolution, 1.0f / (float)resolution, 1.0f / (float)resolution);

480
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/2xxx_Lighting/2004_AnimatedCookie.unity


debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &310391693
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 310391697}
- component: {fileID: 310391696}
- component: {fileID: 310391695}
- component: {fileID: 310391694}
m_Layer: 0
m_Name: Cube
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!65 &310391694
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 310391693}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!23 &310391695
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 310391693}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 2100000, guid: 103ca662e1fa84944b9ee1e16c87d411, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &310391696
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 310391693}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &310391697
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 310391693}
m_LocalRotation: {x: -0, y: 0.5571776, z: -0, w: 0.8303934}
m_LocalPosition: {x: -1.2623653, y: -1.252886, z: 0.009568691}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 67.722, z: 0}
--- !u!1001 &464542051
--- !u!1001 &106603448
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2

- target: {fileID: 4295600896743834, guid: b186ef7597e8a464c9a4af7b87825a5f, type: 2}
- target: {fileID: 4295600896743834, guid: 7dde90a97c3ee4d4da77e66970eb07eb, type: 2}
- target: {fileID: 4295600896743834, guid: b186ef7597e8a464c9a4af7b87825a5f, type: 2}
- target: {fileID: 4295600896743834, guid: 7dde90a97c3ee4d4da77e66970eb07eb, type: 2}
- target: {fileID: 4295600896743834, guid: b186ef7597e8a464c9a4af7b87825a5f, type: 2}
- target: {fileID: 4295600896743834, guid: 7dde90a97c3ee4d4da77e66970eb07eb, type: 2}
- target: {fileID: 4295600896743834, guid: b186ef7597e8a464c9a4af7b87825a5f, type: 2}
- target: {fileID: 4295600896743834, guid: 7dde90a97c3ee4d4da77e66970eb07eb, type: 2}
- target: {fileID: 4295600896743834, guid: b186ef7597e8a464c9a4af7b87825a5f, type: 2}
- target: {fileID: 4295600896743834, guid: 7dde90a97c3ee4d4da77e66970eb07eb, type: 2}
- target: {fileID: 4295600896743834, guid: b186ef7597e8a464c9a4af7b87825a5f, type: 2}
- target: {fileID: 4295600896743834, guid: 7dde90a97c3ee4d4da77e66970eb07eb, type: 2}
- target: {fileID: 4295600896743834, guid: b186ef7597e8a464c9a4af7b87825a5f, type: 2}
- target: {fileID: 4295600896743834, guid: 7dde90a97c3ee4d4da77e66970eb07eb, type: 2}
- target: {fileID: 4295600896743834, guid: b186ef7597e8a464c9a4af7b87825a5f, type: 2}
- target: {fileID: 4295600896743834, guid: 7dde90a97c3ee4d4da77e66970eb07eb, type: 2}
value: 1
value: 5
m_SourcePrefab: {fileID: 100100000, guid: b186ef7597e8a464c9a4af7b87825a5f, type: 2}
m_IsPrefabAsset: 0
m_ParentPrefab: {fileID: 100100000, guid: 7dde90a97c3ee4d4da77e66970eb07eb, type: 2}
m_IsPrefabParent: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabParentObject: {fileID: 0}
serializedVersion: 6
serializedVersion: 5
m_Component:
- component: {fileID: 499890214}
- component: {fileID: 499890213}

--- !u!108 &499890213
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 499890212}
m_Enabled: 1

m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_Cookie: {fileID: 0}
m_Cookie: {fileID: 8600000, guid: eaba383e664a66c4eb5abedfea3a0bd2, type: 2}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0

--- !u!4 &499890214
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabParentObject: {fileID: 0}
m_LocalRotation: {x: 0.31387484, y: -0.13971134, z: 0.046752267, w: 0.9379646}
m_LocalRotation: {x: 0.3048264, y: -0.26365578, z: 0.08822832, w: 0.91092384}
m_LocalEulerAnglesHint: {x: 37.004, y: -16.944, z: 0}
m_LocalEulerAnglesHint: {x: 37.004, y: -32.285, z: 0}
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 499890212}
m_Enabled: 1

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

useOldInspector: 0
featuresFoldout: 1
showAdditionalSettings: 0
--- !u!1001 &979291416
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 400000, guid: 35676372ff25f7942a8cfe7ddf9c7878, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 35676372ff25f7942a8cfe7ddf9c7878, type: 3}
propertyPath: m_LocalPosition.y
value: -2.5
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 35676372ff25f7942a8cfe7ddf9c7878, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 35676372ff25f7942a8cfe7ddf9c7878, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 35676372ff25f7942a8cfe7ddf9c7878, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 35676372ff25f7942a8cfe7ddf9c7878, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 35676372ff25f7942a8cfe7ddf9c7878, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 35676372ff25f7942a8cfe7ddf9c7878, type: 3}
propertyPath: m_RootOrder
value: 3
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 35676372ff25f7942a8cfe7ddf9c7878, type: 3}
m_IsPrefabAsset: 0
--- !u!1001 &1119926722
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 2}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 2}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 2}
propertyPath: m_LocalPosition.z
value: -10
objectReference: {fileID: 0}
- target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 2}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 2}
m_IsPrefabAsset: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabParentObject: {fileID: 0}
serializedVersion: 6
serializedVersion: 5
m_Component:
- component: {fileID: 1203214750}
- component: {fileID: 1203214749}

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

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

--- !u!108 &1203214749
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1203214746}
m_Enabled: 1

--- !u!4 &1203214750
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabParentObject: {fileID: 0}
m_LocalRotation: {x: 0.31506547, y: -0.63303536, z: 0.3150653, w: 0.6330354}
m_LocalPosition: {x: -0.41421214, y: 1.0843633, z: -6.4392176}
m_LocalRotation: {x: 0.0782498, y: -0.0000009657103, z: 0.00000093192267, w: 0.9969338}
m_LocalPosition: {x: -0.112, y: -0.785, z: -3.18}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 52.920002, y: -90.00001, z: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 8.976001, y: 0, z: 0}
--- !u!1 &1308252988
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1308252992}
- component: {fileID: 1308252991}
- component: {fileID: 1308252990}
- component: {fileID: 1308252989}
m_Layer: 0
m_Name: Point Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1308252989
MonoBehaviour:
m_ObjectHideFlags: 2
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1308252988}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c6c2871f720b2af4e9210febdac74517, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Version: 1
shadowResolution: 512
shadowDimmer: 1
shadowFadeDistance: 10000
enableContactShadows: 0
contactShadowLength: 0
contactShadowDistanceScaleFactor: 0.5
contactShadowMaxDistance: 50
contactShadowFadeDistance: 5
contactShadowSampleCount: 8
shadowCascadeCount: 4
shadowCascadeRatios:
- 0.05
- 0.2
- 0.3
shadowCascadeBorders:
- 0.2
- 0.2
- 0.2
- 0.2
shadowAlgorithm: 0
shadowVariant: 4
shadowPrecision: 0
shadowData:
format: 4
data: 0bd7a33b0000803f
shadowDatas:
- format: 4
data: 0bd7a33b0000803f
--- !u!114 &1308252990
MonoBehaviour:
m_ObjectHideFlags: 2
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1308252988}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7a68c43fe1f2a47cfa234b5eeaa98012, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Version: 1
m_InnerSpotPercent: 0
lightDimmer: 1
fadeDistance: 10000
affectDiffuse: 1
affectSpecular: 1
lightTypeExtent: 0
spotLightShape: 0
shapeWidth: 0.5
shapeHeight: 0.5
aspectRatio: 1
shapeRadius: 0
maxSmoothness: 1
applyRangeAttenuation: 1
useOldInspector: 0
featuresFoldout: 1
showAdditionalSettings: 0
--- !u!108 &1308252991
Light:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1308252988}
m_Enabled: 1
serializedVersion: 8
m_Type: 2
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_CookieSize: 10
m_Shadows:
m_Type: 0
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_Lightmapping: 4
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &1308252992
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1308252988}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 4.43, z: 3.32}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1313195638
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 2}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 2}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 2}
propertyPath: m_LocalPosition.z
value: -10
objectReference: {fileID: 0}
- target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 2}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 114733060649624252, guid: c07ace9ab142ca9469fa377877c2f1e7,
type: 2}
propertyPath: height
value: 480
objectReference: {fileID: 0}
- target: {fileID: 114733060649624252, guid: c07ace9ab142ca9469fa377877c2f1e7,
type: 2}
propertyPath: width
value: 853
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 2}
m_IsPrefabParent: 0
--- !u!1001 &1350848243
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 400000, guid: 35676372ff25f7942a8cfe7ddf9c7878, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 35676372ff25f7942a8cfe7ddf9c7878, type: 3}
propertyPath: m_LocalPosition.y
value: -3
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 35676372ff25f7942a8cfe7ddf9c7878, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 35676372ff25f7942a8cfe7ddf9c7878, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 35676372ff25f7942a8cfe7ddf9c7878, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 35676372ff25f7942a8cfe7ddf9c7878, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 35676372ff25f7942a8cfe7ddf9c7878, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 35676372ff25f7942a8cfe7ddf9c7878, type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 35676372ff25f7942a8cfe7ddf9c7878, type: 3}
m_IsPrefabParent: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabParentObject: {fileID: 0}
serializedVersion: 6
serializedVersion: 5
m_Component:
- component: {fileID: 1519212457}
- component: {fileID: 1519212456}

--- !u!136 &1519212454
CapsuleCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1519212453}
m_Material: {fileID: 0}

--- !u!23 &1519212455
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1519212453}
m_Enabled: 1

--- !u!33 &1519212456
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1519212453}
m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0}

m_CorrespondingSourceObject: {fileID: 0}
m_PrefabParentObject: {fileID: 0}
m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068}
m_LocalPosition: {x: -2.698, y: -2.539, z: -5.774}
m_LocalRotation: {x: 0.27660874, y: 0.27660787, z: -0.6507587, w: 0.65076023}
m_LocalPosition: {x: 0.32, y: -1.74405, z: 0.9788184}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 46.056004, y: 0, z: -90.00001}

6
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/2xxx_Lighting/2004_AnimatedCookie/AnimatedCookie_CRT2.asset


--- !u!86 &8600000
CustomRenderTexture:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: AnimatedCookie_CRT2
m_ImageContentsHash:

m_DownscaleFallback: 0
m_Width: 256
m_Height: 256
m_Width: 64
m_Height: 64
m_AntiAliasing: 1
m_DepthFormat: 0
m_ColorFormat: 0

1
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/EditorPlayModeTests.asset


- 3xxx_DebugView/3007_CameraMotionVector_RotateY.unity
- 3xxx_DebugView/3008_CameraMotionVector_RotateZ.unity
- 3xxx_DebugView/3009_CameraMotionVector_FOV.unity
- 2xxx_Lighting/2004_AnimatedCookie.unity

1
Tests/Scripts/Editor/Tests_Editor.asmdef


"com.unity.render-pipelines.high-defintion.Editor",
"com.unity.render-pipelines.lightweight.Editor",
"GraphicTests",
"com.unity.render-pipelines.testbed-pipelines",
"com.unity.postprocessing.Runtime",
"com.unity.render-pipelines.core.IncludePaths",
"com.unity.render-pipelines.core.Runtime",

13
Tests/Scripts/GraphicTests/Framework/SetupSceneForRenderPipelineTest.cs


if (additionalCameraData != null)
{
HDRenderPipelineAsset m_Asset = (HDRenderPipelineAsset) renderPipelines[index];
/*
FrameSettings srcFrameSettings;
additionalCameraData.UpdateDirtyFrameSettings(true, m_Asset.GetFrameSettings());
srcFrameSettings = additionalCameraData.GetFrameSettings();
FrameSettings m_FrameSettings = new FrameSettings();
// Get the effective frame settings for this camera taking into account the global setting and camera type
FrameSettings.InitializeFrameSettings(cameraToUse, m_Asset.GetRenderPipelineSettings(), srcFrameSettings, ref m_FrameSettings);
*/
additionalCameraData.UpdateDirtyFrameSettings(true, m_Asset.GetFrameSettings() );
}
}

4
Tests/Scripts/GraphicTests/Framework/TestFrameworkTools.cs


public static Dictionary<string, string> renderPipelineAssets = new Dictionary<string, string>()
{
{ "HDRP", "HDRenderPipeline/CommonAssets/HDRP_GraphicTests_Asset.asset" },
{ "HDRP", "HDRenderPipeline/CommonAssets/RP_Assets/HDRP_Test_Def.asset" },
{ "LWRP", "LightweightPipeline/LightweightPipelineAsset.asset" }
};

relativePath = splitPaths.Last(),
templatePath = splitPaths.Last(),
threshold = 0.02f,
frameWait = 100
frameWait = 5
};
if (fixtureParam)

3
Tests/Scripts/Tests.asmdef


"com.unity.render-pipelines.core.IncludePaths",
"com.unity.render-pipelines.core.Runtime",
"com.unity.render-pipelines.high-definition.Runtime",
"com.unity.render-pipelines.lightweight.Runtime",
"com.unity.render-pipelines.testbed-pipelines"
"com.unity.render-pipelines.lightweight.Runtime"
],
"optionalUnityReferences": [
"TestAssemblies"

32
build.py


import os
import json
import logging
import platform
import subprocess
packages = {
("com.unity.render-pipelines.core", os.path.join("ScriptableRenderPipeline", "Core")),
("com.unity.render-pipelines.high-definition", os.path.join("ScriptableRenderPipeline", "HDRenderPipeline")),
("com.unity.render-pipelines.lightweight", os.path.join("ScriptableRenderPipeline", "LightweightPipeline"))
}
def prepare(logger):
file_path = os.path.join("./ScriptableRenderPipeline", "master-package.json")

# helper function for preparations of tests
def copy_path_to_project(path, repo_path, project_path, logger):
def copy_path_to_project(path, repo_path, project_target_path, logger):
shutil.copytree(os.path.join(repo_path, path), os.path.join(project_path, "Assets", path))
if platform.system() == "Windows":
subprocess.call(["robocopy", os.path.join(repo_path, path), os.path.join(project_target_path, os.path.dirname(path)), "/e", "/np"])
else:
shutil.copytree(os.path.join(repo_path, path),os.path.join(project_target_path, path))
def copy_file_to_project(path, repo_path, project_target_path, logger):
logger.info("Copying {}".format(path))
if platform.system() == "Windows":
subprocess.call(["robocopy", os.path.join(repo_path, os.path.dirname(path)), os.path.join(project_target_path, os.path.dirname(path)), os.path.basename(path), "/np"])
else:
shutil.copy(os.path.join(repo_path, path), os.path.join(project_target_path, path))
copy_path_to_project("ImageTemplates", repo_path, project_path, logger)
copy_path_to_project("Tests", repo_path, project_path, logger)
dest_path = os.path.join(project_path, "Assets", "ScriptableRenderLoop")
copy_path_to_project("ImageTemplates", repo_path, dest_path, logger)
copy_path_to_project("Tests", repo_path, dest_path, logger)
copy_file_to_project("SRPMARKER", repo_path, dest_path, logger)
copy_file_to_project("SRPMARKER.meta", repo_path, dest_path, logger)
copy_file_to_project("ImageTemplates.meta", repo_path, dest_path, logger)
copy_file_to_project("Tests.meta", repo_path, dest_path, logger)
if __name__ == "__main__":
import sys

557
ImageTemplates/HDRenderPipeline/Scenes/2xxx_Lighting/2004_AnimatedCookie.unity.png

之前 之后
宽度: 853  |  高度: 480  |  大小: 90 KiB

83
ImageTemplates/HDRenderPipeline/Scenes/2xxx_Lighting/2004_AnimatedCookie.unity.png.meta


fileFormatVersion: 2
guid: 59060e3dbacd1a84aa02d2b91ad93611
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 5
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -1
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

48
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/2xxx_Lighting/2004_AnimatedCookie/AnimatedCookie_CRT3.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!86 &8600000
CustomRenderTexture:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: AnimatedCookie_CRT3
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
m_Width: 64
m_Height: 64
m_AntiAliasing: 1
m_DepthFormat: 0
m_ColorFormat: 0
m_MipMap: 0
m_GenerateMips: 1
m_SRGB: 0
m_UseDynamicScale: 0
m_BindMS: 0
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 0
m_Aniso: 1
m_MipBias: 0
m_WrapU: 0
m_WrapV: 0
m_WrapW: 0
m_Dimension: 4
m_VolumeDepth: 1
m_Material: {fileID: 2100000, guid: 0e992de49cc7c5347a1d2fba4351bec9, type: 2}
m_InitSource: 0
m_InitMaterial: {fileID: 0}
m_InitColor: {r: 0.112679005, g: 1, b: 0, a: 1}
m_InitTexture: {fileID: 0}
m_UpdateMode: 1
m_InitializationMode: 0
m_UpdateZoneSpace: 0
m_CurrentUpdateZoneSpace: 0
m_UpdateZones: []
m_UpdatePeriod: 0
m_ShaderPass: 0
m_CubemapFaceMask: 63
m_DoubleBuffered: 0
m_WrapUpdateZones: 0

8
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/2xxx_Lighting/2004_AnimatedCookie/AnimatedCookie_CRT3.asset.meta


fileFormatVersion: 2
guid: b99e10a48bae1014fb3681ddd8a61871
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 8600000
userData:
assetBundleName:
assetBundleVariant:

1001
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/2xxx_Lighting/2004_AnimatedCookie/LoopVideo.mp4
文件差异内容过多而无法显示
查看文件

30
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/2xxx_Lighting/2004_AnimatedCookie/LoopVideo.mp4.meta


fileFormatVersion: 2
guid: 264ed4e8432b7d64eb6f12505f4694f4
VideoClipImporter:
externalObjects: {}
serializedVersion: 2
useLegacyImporter: 0
quality: 0.5
isColorLinear: 1
frameRange: 0
startFrame: -1
endFrame: -1
colorSpace: 0
deinterlace: 0
encodeAlpha: 0
flipVertical: 0
flipHorizontal: 0
importAudio: 0
targetSettings:
0:
enableTranscoding: 0
codec: 0
resizeFormat: 0
aspectRatio: 0
customWidth: 996
customHeight: 886
bitrateMode: 2
spatialQuality: 2
userData:
assetBundleName:
assetBundleVariant:

8
Tests/Scripts/Editor/Renderloop.meta


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

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

正在加载...
取消
保存