浏览代码

Merge remote-tracking branch 'refs/remotes/origin/master' into 2018.1-experimental

/main
sebastienlagarde 7 年前
当前提交
c24e9827
共有 42 个文件被更改,包括 2570 次插入580 次删除
  1. 25
      ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/BSDF.hlsl
  2. 31
      ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/CommonMaterial.hlsl
  3. 8
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.Handles.cs
  4. 11
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/Reflection/HDReflectionProbeUI.Drawers.cs
  5. 14
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/Reflection/PlanarReflectionProbeUI.Drawers.cs
  6. 56
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Material/StackLit/BaseMaterialUI.cs
  7. 278
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Material/StackLit/StackLitUI.cs
  8. 11
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs
  9. 3
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipelineAsset.cs
  10. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDStringConstants.cs
  11. 16
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightEvaluation.hlsl
  12. 3
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/LightLoopDef.hlsl
  13. 6
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Reflection/ReflectionProbeCullResults.cs
  14. 34
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Reflection/ReflectionSystemInternal.cs
  15. 20
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Reflection/ReflectionSystemParameters.cs
  16. 83
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/DensityVolumeManager.cs
  17. 36
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/VolumeVoxelization.compute
  18. 52
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/VolumetricLighting.cs
  19. 25
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/VolumetricLighting.cs.hlsl
  20. 100
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/DensityVolume.cs
  21. 24
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.hlsl
  22. 93
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/StackLit/StackLit.cs
  23. 188
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/StackLit/StackLit.cs.hlsl
  24. 949
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/StackLit/StackLit.hlsl
  25. 93
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/StackLit/StackLit.shader
  26. 171
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/StackLit/StackLitData.hlsl
  27. 102
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/StackLit/StackLitProperties.hlsl
  28. 16
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/RenderPipelineResources/BufferPyramidProcessor.cs
  29. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/ShaderVariablesFunctions.hlsl
  30. 6
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Sky/AtmosphericScattering/VolumetricFog.cs
  31. 178
      Tests/UTF_Suites_HDRP/Resources/HDRP_Deferred.asset
  32. 174
      Tests/UTF_Suites_HDRP/Resources/HDRP_Forward.asset
  33. 8
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/Volumetric.meta
  34. 128
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/VolumeTextureAtlas.cs
  35. 11
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/VolumeTextureAtlas.cs.meta
  36. 108
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/Volumetric/Texture3DCreationEditor.cs
  37. 11
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/Volumetric/Texture3DCreationEditor.cs.meta
  38. 11
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/Volumetric/DensityVolumeEditor.cs.meta
  39. 63
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/Volumetric/DensityVolumeEditor.cs
  40. 0
      /ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/DensityVolume.cs.meta
  41. 0
      /ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/DensityVolume.cs

25
ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/BSDF.hlsl


// Conversion FO/IOR
TEMPLATE_2_REAL(IorToFresnel0, transmittedIor, incidentIor, return Sq((transmittedIor - incidentIor) / (transmittedIor + incidentIor)) )
real IorToFresnel0(real transmittedIor, real incidentIor = 1.0)
real IorToFresnel0(real transmittedIor)
return Sq((transmittedIor - incidentIor) / (transmittedIor + incidentIor));
return IorToFresnel0(transmittedIor, 1.0);
// Note: Don't handle the case fresnel0 == 1
real Fresnel0ToIor(real fresnel0)
{
real sqrtF0 = sqrt(fresnel0);
return (1.0 + sqrtF0) / (1.0 - sqrtF0);
}
// Note: We don't handle the case fresnel0 == 1
//real Fresnel0ToIor(real fresnel0)
//{
// real sqrtF0 = sqrt(fresnel0);
// return (1.0 + sqrtF0) / (1.0 - sqrtF0);
//}
TEMPLATE_1_REAL(Fresnel0ToIor, fresnel0, return ((1.0 + sqrt(fresnel0)) / (1.0 - sqrt(fresnel0))) )
// This function is a coarse approximation of computing fresnel0 for a different top than air (here clear coat of IOR 1.5) when we only have fresnel0 with air interface
// This function is equivalent to IorToFresnel0(Fresnel0ToIor(fresnel0), 1.5)

{
real3 nf0 = Sq(n + 1.0) * f0 - Sq(f0 - 1.0);
return nf0 / (1.0 - f0);
}
// same as regular refract except there is not the test for total internal reflection + the vector is flipped for processing
real3 CoatRefract(real3 X, real3 N, real ieta)
{
real XdotN = saturate(dot(N, X));
return ieta * X + (sqrt(1 + ieta * ieta * (XdotN * XdotN - 1)) - ieta * XdotN) * N;
}
//-----------------------------------------------------------------------------

31
ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/CommonMaterial.hlsl


roughnessB = roughness * (1 - anisotropy);
}
void ConvertRoughnessToAnisotropy(real roughnessT, real roughnessB, out real anisotropy)
{
anisotropy = ((roughnessT - roughnessB) / (roughnessT + roughnessB + 0.0001));
}
// Same as ConvertAnisotropyToRoughness but
// roughnessT and roughnessB are clamped, and are meant to be used with punctual and directional lights.
void ConvertAnisotropyToClampRoughness(real perceptualRoughness, real anisotropy, out real roughnessT, out real roughnessB)

return sqrt(2.0 / (variance + 2.0));
}
// same as regular refract except there is not the test for total internal reflection + the vector is flipped for processing
real3 CoatRefract(real3 X, real3 N, real ieta)
// ----------------------------------------------------------------------------
// Helper for Disney parametrization
// ----------------------------------------------------------------------------
float3 ComputeDiffuseColor(float3 baseColor, float metallic)
{
return baseColor * (1.0 - metallic);
}
float3 ComputeFresnel0(float3 baseColor, float metallic, float dielectricF0)
real XdotN = saturate(dot(N, X));
return ieta * X + (sqrt(1 + ieta * ieta * (XdotN * XdotN - 1)) - ieta * XdotN) * N;
return lerp(dielectricF0.xxx, baseColor, metallic);
// Parallax mapping
// Helper for normal blending
// ----------------------------------------------------------------------------
// ref https://www.gamedev.net/topic/678043-how-to-blend-world-space-normals/#entry5287707

return normalize(real3(n1.xy * n2.z + n2.xy * n1.z, n1.z * n2.z));
}
// ----------------------------------------------------------------------------
// Helper for triplanar
// ----------------------------------------------------------------------------
// Ref: http://http.developer.nvidia.com/GPUGems3/gpugems3_ch01.html / http://www.slideshare.net/icastano/cascades-demo-secrets
real3 ComputeTriplanarWeights(real3 normal)
{

uvZY = float2(position.z, position.y);
}
// ----------------------------------------------------------------------------
// Helper for detail map operation
// ----------------------------------------------------------------------------
real LerpWhiteTo(real b, real t)
{
real oneMinusT = 1.0 - t;

real oneMinusT = 1.0 - t;
return real3(oneMinusT, oneMinusT, oneMinusT) + b * t;
}
#endif // UNITY_COMMON_MATERIAL_INCLUDED

8
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.Handles.cs


[DrawGizmo(GizmoType.Selected)]
static void DrawSelectedGizmo(ReflectionProbe reflectionProbe, GizmoType gizmoType)
{
var e = GetEditorFor(reflectionProbe);
if (e == null || !e.sceneViewEditing)
return;
var reflectionData = reflectionProbe.GetComponent<HDAdditionalReflectionData>();
Gizmos_Influence(reflectionProbe, reflectionData, null, false);

[DrawGizmo(GizmoType.NonSelected)]
static void DrawNonSelectedGizmo(ReflectionProbe reflectionProbe, GizmoType gizmoType)
{
var e = GetEditorFor(reflectionProbe);
if (e == null || !e.sceneViewEditing)
return;
var reflectionData = reflectionProbe.GetComponent<HDAdditionalReflectionData>();
if (reflectionData != null)
HDReflectionProbeEditorUtility.ChangeVisibility(reflectionProbe, false);

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


EditorGUI.showMixedValue = false;
if (EditorGUI.EndChangeCheck())
s.SetShapeTarget(p.influenceShape.intValue);
if (p.proxyVolumeComponent.objectReferenceValue != null)
{
var proxy = (ReflectionProxyVolumeComponent)p.proxyVolumeComponent.objectReferenceValue;
if ((int)proxy.proxyVolume.shapeType != p.influenceShape.enumValueIndex)
EditorGUILayout.HelpBox(
"Proxy volume and influence volume have different shape types, this is not supported.",
MessageType.Error,
true
);
}
}
static void Drawer_IntensityMultiplier(HDReflectionProbeUI s, SerializedHDReflectionProbe p, Editor owner)

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


(s, d, o) => d.influenceVolume,
InfluenceVolumeUI.SectionFoldoutShape
),
CED.Action(Drawer_DifferentShapeError),
SectionFoldoutInfluenceSettings,
SectionFoldoutCaptureSettings,
CED.Select(

{
// EditorGUILayout.PropertyField(d.captureMirrorPlaneLocalPosition, _.GetContent("Plane Position"));
// EditorGUILayout.PropertyField(d.captureMirrorPlaneLocalNormal, _.GetContent("Plane Normal"));
}
static void Drawer_DifferentShapeError(PlanarReflectionProbeUI s, SerializedPlanarReflectionProbe d, Editor o)
{
var proxy = d.proxyVolumeReference.objectReferenceValue as ReflectionProxyVolumeComponent;
if (proxy != null && (int)proxy.proxyVolume.shapeType != d.influenceVolume.shapeType.enumValueIndex)
{
EditorGUILayout.HelpBox(
"Proxy volume and influence volume have different shape types, this is not supported.",
MessageType.Error,
true
);
}
}
static void Drawer_SectionCaptureSettings(PlanarReflectionProbeUI s, SerializedPlanarReflectionProbe d, Editor o)

56
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Material/StackLit/BaseMaterialUI.cs


set { m_MaterialProperty.vectorValue = value; }
}
public Property(BaseMaterialGUI parent, string propertyName, string guiText, bool isMandatory = true)
: this(parent, propertyName, guiText, string.Empty, isMandatory)
public Property(BaseMaterialGUI parent, string propertyName, string guiText, bool isMandatory = true, Func<object, bool> isVisible = null)
: this(parent, propertyName, guiText, string.Empty, isMandatory, isVisible)
public Property(BaseMaterialGUI parent, string propertyName, string guiText, string toolTip, bool isMandatory = true)
: base(parent)
public Property(BaseMaterialGUI parent, string propertyName, string guiText, string toolTip, bool isMandatory = true, Func<object, bool> isVisible = null)
: base(parent, isVisible)
{
m_GuiContent = new GUIContent(guiText, toolTip);
PropertyName = propertyName;

private readonly string[] m_Options;
private readonly int[] m_Values = null;
public ComboProperty(BaseMaterialGUI parent, string propertyName, string guiText, string[] options, bool isMandatory = true)
: base(parent, propertyName, guiText, isMandatory)
public ComboProperty(BaseMaterialGUI parent, string propertyName, string guiText, string[] options, bool isMandatory = true, Func<object, bool> isVisible = null)
: base(parent, propertyName, guiText, isMandatory, isVisible)
public ComboProperty(BaseMaterialGUI parent, string propertyName, string guiText, string toolTip, string[] options, bool isMandatory = true)
: base(parent, propertyName, guiText, toolTip, isMandatory)
public ComboProperty(BaseMaterialGUI parent, string propertyName, string guiText, string toolTip, string[] options, bool isMandatory = true, Func<object, bool> isVisible = null)
: base(parent, propertyName, guiText, toolTip, isMandatory, isVisible)
public ComboProperty(BaseMaterialGUI parent, string propertyName, string guiText, string[] options, int[] values, bool isMandatory = true)
: base(parent, propertyName, guiText, isMandatory)
public ComboProperty(BaseMaterialGUI parent, string propertyName, string guiText, string[] options, int[] values, bool isMandatory = true, Func<object, bool> isVisible = null)
: base(parent, propertyName, guiText, isMandatory, isVisible)
public ComboProperty(BaseMaterialGUI parent, string propertyName, string guiText, string toolTip, string[] options, int[] values, bool isMandatory = true)
: base(parent, propertyName, guiText, toolTip, isMandatory)
public ComboProperty(BaseMaterialGUI parent, string propertyName, string guiText, string toolTip, string[] options, int[] values, bool isMandatory = true, Func<object, bool> isVisible = null)
: base(parent, propertyName, guiText, toolTip, isMandatory, isVisible)
{
m_Options = options;
m_Values = values;

public class DiffusionProfileProperty : Property
{
public DiffusionProfileProperty(BaseMaterialGUI parent, string propertyName, string guiText, string toolTip, bool isMandatory = true)
: base(parent, propertyName, guiText, toolTip, isMandatory)
public DiffusionProfileProperty(BaseMaterialGUI parent, string propertyName, string guiText, string toolTip, bool isMandatory = true, Func<object, bool> isVisible = null)
: base(parent, propertyName, guiText, toolTip, isMandatory, isVisible)
{
}

private MaterialProperty m_ExtraProperty;
public TextureOneLineProperty(BaseMaterialGUI parent, string propertyName, string guiText, bool isMandatory = true)
: base(parent, propertyName, guiText, isMandatory)
public TextureOneLineProperty(BaseMaterialGUI parent, string propertyName, string guiText, bool isMandatory = true, Func<object, bool> isVisible = null)
: base(parent, propertyName, guiText, isMandatory, isVisible)
public TextureOneLineProperty(BaseMaterialGUI parent, string propertyName, string guiText, string toolTip, bool isMandatory = true)
: base(parent, propertyName, guiText, toolTip, isMandatory)
public TextureOneLineProperty(BaseMaterialGUI parent, string propertyName, string guiText, string toolTip, bool isMandatory = true, Func<object, bool> isVisible = null)
: base(parent, propertyName, guiText, toolTip, isMandatory, isVisible)
public TextureOneLineProperty(BaseMaterialGUI parent, string propertyName, string extraPropertyName, string guiText, string toolTip, bool isMandatory = true)
: base(parent, propertyName, guiText, toolTip, isMandatory)
public TextureOneLineProperty(BaseMaterialGUI parent, string propertyName, string extraPropertyName, string guiText, string toolTip, bool isMandatory = true, Func<object, bool> isVisible = null)
: base(parent, propertyName, guiText, toolTip, isMandatory, isVisible)
{
ExtraPropertyName = extraPropertyName;
}

public bool m_IsNormalMap;
public TextureProperty(BaseMaterialGUI parent, string propertyName, string constantPropertyName, string guiText, bool useConstantAsTint, bool isMandatory = true, bool isNormalMap = false)
: this(parent, propertyName, constantPropertyName, guiText, string.Empty, useConstantAsTint, isMandatory, isNormalMap)
public TextureProperty(BaseMaterialGUI parent, string propertyName, string constantPropertyName, string guiText, bool useConstantAsTint, bool isMandatory = true, bool isNormalMap = false, Func<object, bool> isVisible = null)
: this(parent, propertyName, constantPropertyName, guiText, string.Empty, useConstantAsTint, isMandatory, isNormalMap, isVisible)
public TextureProperty(BaseMaterialGUI parent, string propertyName, string constantPropertyName, string guiText, string toolTip, bool useConstantAsTint, bool isMandatory = true, bool isNormalMap = false)
: base(parent, propertyName, guiText, toolTip, isMandatory)
public TextureProperty(BaseMaterialGUI parent, string propertyName, string constantPropertyName, string guiText, string toolTip, bool useConstantAsTint, bool isMandatory = true, bool isNormalMap = false, Func<object, bool> isVisible = null)
: base(parent, propertyName, guiText, toolTip, isMandatory, isVisible)
{
m_IsNormalMap = isNormalMap;

// Display the remap of texture values.
Vector2 remap = m_RemapProperty.VectorValue;
EditorGUI.BeginChangeCheck();
EditorGUILayout.MinMaxSlider(m_RemapProperty.PropertyText, ref remap.x, ref remap.y,
0.0f, 1.0f);
EditorGUILayout.MinMaxSlider(m_RemapProperty.PropertyText, ref remap.x, ref remap.y, 0.0f, 1.0f);
m_InvertRemapProperty.OnGUI();
if (m_InvertRemapProperty.IsValid)
{
m_InvertRemapProperty.OnGUI();
}
}
}

278
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Material/StackLit/StackLitUI.cs


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

protected const string k_Metallic = "_Metallic";
protected const string k_MetallicMap = "_MetallicMap";
protected const string k_MetallicMapUV = "_MetallicMapUV";
protected const string k_MetallicRemap = "_MetallicRemap";
protected const string k_MetallicRemapInverted = "_MetallicRemapInverted";
protected const string k_MetallicRange = "_MetallicRange";
protected const string k_DielectricIor = "_DielectricIor";
protected const string k_Smoothness1 = "_SmoothnessA";
protected const string k_Smoothness1Map = "_SmoothnessAMap";
protected const string k_Smoothness1MapUV = "_SmoothnessAMapUV";
protected const string k_Smoothness1Remap = "_SmoothnessARemap";
protected const string k_Smoothness1RemapInverted = "_SmoothnessARemapInverted";
protected const string k_Smoothness1Range = "_SmoothnessARange";
protected const string k_SmoothnessA = "_SmoothnessA";
protected const string k_SmoothnessAMap = "_SmoothnessAMap";
protected const string k_SmoothnessAMapUV = "_SmoothnessAMapUV";
protected const string k_AmbientOcclusion = "_AmbientOcclusion";
protected const string k_AmbientOcclusionMap = "_AmbientOcclusionMap";
protected const string k_AmbientOcclusionMapUV = "_AmbientOcclusionMapUV";
// Emissive
protected const string k_EmissiveColor = "_EmissiveColor";
protected const string k_EmissiveColorMap = "_EmissiveColorMap";

// Coat
protected const string k_EnableCoat = "_EnableCoat";
protected const string k_CoatSmoothness = "_CoatSmoothness";
protected const string k_CoatSmoothnessMap = "_CoatSmoothnessMap";
protected const string k_CoatSmoothnessMapUV = "_CoatSmoothnessMapUV";
protected const string k_CoatIor = "_CoatIor";
protected const string k_CoatThickness = "_CoatThickness";
protected const string k_CoatExtinction = "_CoatExtinction";
protected const string k_EnableSubsurfaceScattering = "_EnableSubsurfaceScattering";
protected const string k_SubsurfaceMaskRemap = "_SubsurfaceMaskRemap";
protected const string k_SubsurfaceMaskRemapInverted = "_SubsurfaceMaskRemapInverted";
protected const string k_SubsurfaceMaskRange = "_SubsurfaceMaskRange";
protected const string k_EnableTransmission = "_EnableTransmission";
protected const string k_ThicknessRemap = "_ThicknessRemap";
protected const string k_ThicknessRemapInverted = "_ThicknessRemapInverted";
protected const string k_ThicknessRange = "_ThicknessRange";
protected const string k_Smoothness2 = "_SmoothnessB";
protected const string k_Smoothness2Map = "_SmoothnessBMap";
protected const string k_Smoothness2MapUV = "_SmoothnessBMapUV";
protected const string k_Smoothness2Remap = "_SmoothnessBRemap";
protected const string k_Smoothness2RemapInverted = "_SmoothnessBRemapInverted";
protected const string k_Smoothness2Range = "_SmoothnessBRange";
protected const string k_EnableDualSpecularLobe = "_EnableDualSpecularLobe";
protected const string k_SmoothnessB = "_SmoothnessB";
protected const string k_SmoothnessBMap = "_SmoothnessBMap";
protected const string k_SmoothnessBMapUV = "_SmoothnessBMapUV";
//// transparency params
//protected MaterialProperty transmissionEnable = null;
//protected const string kTransmissionEnable = "_TransmissionEnable";
// Anisotropy
protected const string k_EnableAnisotropy = "_EnableAnisotropy";
protected const string k_Anisotropy = "_Anisotropy";
protected const string k_AnisotropyMap = "_AnisotropyMap";
protected const string k_AnisotropyMapUV = "_AnisotropyMapUV";
// Iridescence
protected const string k_EnableIridescence = "_EnableIridescence";
protected const string k_IridescenceIor = "_IridescenceIor";
protected const string k_IridescenceThickness = "_IridescenceThickness";
protected const string k_IridescenceThicknessMap = "_IridescenceThicknessMap";
protected const string k_IridescenceThicknessMapUV = "_IridescenceThicknessMapUV";
// Stencil is use to control lighting mode (regular, split lighting)
protected const string kStencilRef = "_StencilRef";
protected const string kStencilWriteMask = "_StencilWriteMask";
protected const string kStencilRefMV = "_StencilRefMV";
protected const string kStencilWriteMaskMV = "_StencilWriteMaskMV";
//protected MaterialProperty ior = null;
//protected const string kIor = "_Ior";
//protected MaterialProperty transmittanceColor = null;
//protected const string kTransmittanceColor = "_TransmittanceColor";
//protected MaterialProperty transmittanceColorMap = null;
//protected const string kTransmittanceColorMap = "_TransmittanceColorMap";
//protected MaterialProperty atDistance = null;
//protected const string kATDistance = "_ATDistance";
//protected MaterialProperty thicknessMultiplier = null;
//protected const string kThicknessMultiplier = "_ThicknessMultiplier";
//protected MaterialProperty refractionModel = null;
//protected const string kRefractionModel = "_RefractionModel";
//protected MaterialProperty refractionSSRayModel = null;
//protected const string kRefractionSSRayModel = "_RefractionSSRayModel";
private Property EnableSSS;
private Property EnableTransmission;
private Property EnableCoat;
private Property EnableAnisotropy;
private Property EnableDualSpecularLobe;
private Property EnableIridescence;
public StackLitGUI()
{

new Property(this, k_DoubleSidedNormalMode, "Normal mode", "This will modify the normal base on the selected mode. Mirror: Mirror the normal with vertex normal plane, Flip: Flip the normal.", false),
});
//
EnableSSS = new Property(this, k_EnableSubsurfaceScattering, "Enable Subsurface Scattering", "Enable Subsurface Scattering", true);
EnableTransmission = new Property(this, k_EnableTransmission, "Enable Transmission", "Enable Transmission", true);
EnableCoat = new Property(this, k_EnableCoat, "Enable Coat", "Enable coat layer with true vertical physically based BSDF mixing", true);
EnableAnisotropy = new Property(this, k_EnableAnisotropy, "Enable Anisotropy", "Enable anisotropy, correct anisotropy for punctual light but very coarse approximated for reflection", true);
EnableDualSpecularLobe = new Property(this, k_EnableDualSpecularLobe, "Enable Dual Specular Lobe", "Enable a second specular lobe, aim to simulate a mix of a narrow and a haze lobe that better match measured material", true);
EnableIridescence = new Property(this, k_EnableIridescence, "Enable Iridescence", "Enable physically based iridescence layer", true);
// All material properties
new GroupProperty(this, "_MaterialFeatures", "Material Features", new BaseProperty[]
{
EnableDualSpecularLobe,
EnableAnisotropy,
EnableCoat,
EnableIridescence,
EnableSSS,
EnableTransmission
}),
new TextureProperty(this, k_Smoothness1Map, k_Smoothness1, "Smoothness", "Smoothness", false, false),
// TODO: Special case for normal maps.
new Property(this, k_DielectricIor, "DieletricIor", "IOR use for dielectric material (i.e non metallic material)", false),
new TextureProperty(this, k_SmoothnessAMap, k_SmoothnessA, "Smoothness", "Smoothness", false, false),
//new TextureProperty(this, k_BaseColorMap, k_BaseColor, "Dielectric IoR", "Index of Refraction for Dielectric", false),
new TextureProperty(this, k_AmbientOcclusionMap, k_AmbientOcclusion, "AmbientOcclusion", "AmbientOcclusion Map", false, false),
new GroupProperty(this, "_Emissive", "Emissive", new BaseProperty[]
new GroupProperty(this, "_DualSpecularLobe", "Dual Specular Lobe", new BaseProperty[]
new TextureProperty(this, k_EmissiveColorMap, k_EmissiveColor, "Emissive Color", "Emissive", true, false),
new Property(this, k_EmissiveIntensity, "Emissive Intensity", "Emissive", false),
new Property(this, k_AlbedoAffectEmissive, "Albedo Affect Emissive", "Specifies whether or not the emissive color is multiplied by the albedo.", false),
}),
new TextureProperty(this, k_SmoothnessBMap, k_SmoothnessB, "Smoothness B", "Smoothness B", false, false),
new Property(this, k_LobeMix, "Lobe Mix", "Lobe Mix", false),
}, _ => EnableDualSpecularLobe.BoolValue == true),
//new GroupProperty(this, "_Coat", "Coat", new BaseProperty[]
//{
// new TextureProperty(this, k_BaseColorMap, k_BaseColor, "SmoothnessCoat", "smoothnessCoat", false, false),
// new TextureProperty(this, k_BaseColorMap, k_BaseColor, "Index Of Refraction", "iorCoat", false, false),
// new TextureProperty(this, k_BaseColorMap, k_BaseColor, "Normal", "normal Coat", false, false),
//}),
new GroupProperty(this, "_Anisotropy", "Anisotropy", new BaseProperty[]
{
new Property(this, k_Anisotropy, "Anisotropy", "Anisotropy of base layer", false),
// TODO: Tangent map and rotation
}, _ => EnableAnisotropy.BoolValue == true),
new GroupProperty(this, "_SSS", "Sub-Surface Scattering", new BaseProperty[]
new GroupProperty(this, "_Coat", "Coat", new BaseProperty[]
new DiffusionProfileProperty(this, k_DiffusionProfile, "Diffusion Profile", "A profile determines the shape of the SSS/transmission filter.", false),
new TextureProperty(this, k_SubsurfaceMaskMap, k_SubsurfaceMask, "Subsurface mask map (R)", "Determines the strength of the subsurface scattering effect.", false, false),
}/*, _ => _materialId == MaterialId.SubSurfaceScattering*/),
new TextureProperty(this, k_CoatSmoothnessMap, k_CoatSmoothness, "Coat smoothness", "Coat smoothness", false),
new Property(this, "_CoatIor", "Coat IOR", "Index of refraction", false),
new Property(this, "_CoatThickness", "Coat Thickness", "Coat thickness", false),
new Property(this, "_CoatExtinction", "Coat Absorption", "Coat absorption tint (the thicker the coat, the more that color is removed)", false),
}, _ =>EnableCoat.BoolValue == true),
new GroupProperty(this, "_Lobe2", "Second Specular Lobe", new BaseProperty[]
new GroupProperty(this, "_Iridescence", "Iridescence", new BaseProperty[]
new TextureProperty(this, k_Smoothness2Map, k_Smoothness2, "Smoothness2", "Smoothness2", false, false),
new Property(this, k_LobeMix, "Lobe Mix", "Lobe Mix", false),
}),
new Property(this, "_IridescenceIor", "IOR", "Index of refraction of iridescence layer", false),
new Property(this, "_IridescenceThickness", "Thickness", "Iridescence thickness (Remap to 0..3000nm)", false),
}, _ => EnableIridescence.BoolValue == true),
//new GroupProperty(this, "_Anisotropy", "Anisotropy", new BaseProperty[]
//{
// new TextureProperty(this, k_BaseColorMap, k_BaseColor, "Anisotropy Strength", "anisotropy strength", false),
// new TextureProperty(this, k_BaseColorMap, k_BaseColor, "Rotation", "rotation", false),
// new TextureProperty(this, k_BaseColorMap, k_BaseColor, "Tangent", "tangent", false),
//}),
new GroupProperty(this, "_SSS", "Sub-Surface Scattering", new BaseProperty[]
{
new DiffusionProfileProperty(this, k_DiffusionProfile, "Diffusion Profile", "A profile determines the shape of the SSS/transmission filter.", false),
new TextureProperty(this, k_SubsurfaceMaskMap, k_SubsurfaceMask, "Subsurface mask map (R)", "Determines the strength of the subsurface scattering effect.", false, false),
}, _ => EnableSSS.BoolValue == true ),
new DiffusionProfileProperty(this, k_DiffusionProfile, "Diffusion Profile", "A profile determines the shape of the SSS/transmission filter.", false),
new DiffusionProfileProperty(this, k_DiffusionProfile, "Diffusion Profile", "A profile determines the shape of the SSS/transmission filter.", false, _ => EnableSSS.BoolValue == false),
}),
}, _ => EnableTransmission.BoolValue == true),
//new GroupProperty(this, "_Iridescence", "Iridescence", new BaseProperty[]
//{
// new TextureProperty(this, k_BaseColorMap, k_BaseColor, "Index of Refraction", "Index of Refraction for Iridescence", false),
// new TextureProperty(this, k_BaseColorMap, k_BaseColor, "Thickness", "Thickness", false),
//}),
new GroupProperty(this, "_Emissive", "Emissive", new BaseProperty[]
{
new TextureProperty(this, k_EmissiveColorMap, k_EmissiveColor, "Emissive Color", "Emissive", true, false),
new Property(this, k_EmissiveIntensity, "Emissive Intensity", "Emissive", false),
new Property(this, k_AlbedoAffectEmissive, "Albedo Affect Emissive", "Specifies whether or not the emissive color is multiplied by the albedo.", false),
}),
//new GroupProperty(this, "_Glint", "Glint", new BaseProperty[]
//{
// new TextureProperty(this, k_BaseColorMap, k_BaseColor, "Density", "Density:", false),
// new TextureProperty(this, k_BaseColorMap, k_BaseColor, "Tint", "Tint", false),
//}),
new GroupProperty(this, "_Debug", "Debug", new BaseProperty[]
{
new Property(this, "_DebugEnable", "Debug Enable", "Switch to a debug version of the shader", false),
new Property(this, "_DebugLobeMask", "DebugLobeMask", "xyz is Lobe 0 1 2 Enable, w is Enable VLayering", false),
new Property(this, "_DebugAniso", "DebugAniso", "x is Hack Enable, y is factor", false),
}),
});
}

protected static void SetupTextureMaterialProperty(Material material, string basePropertyName)
{
// TODO: Caution this can generate a lot of garbage collection call ?
string useMapPropertyName = basePropertyName + "UseMap";
string mapPropertyName = basePropertyName + "Map";
string remapPropertyName = basePropertyName + "Remap";

if (material.GetTexture(mapPropertyName))
{
Vector4 rangeVector = material.GetVector(remapPropertyName);
if (material.GetFloat(invertPropertyName) > 0.0f)
if (material.HasProperty(invertPropertyName) && material.GetFloat(invertPropertyName) > 0.0f)
{
float s = rangeVector.x;
rangeVector.x = rangeVector.y;

if (doubleSidedEnable)
{
BaseLitGUI.DoubleSidedNormalMode doubleSidedNormalMode = (BaseLitGUI.DoubleSidedNormalMode)material.GetFloat(k_DoubleSidedNormalMode);
BaseLitGUI.DoubleSidedNormalMode doubleSidedNormalMode =
(BaseLitGUI.DoubleSidedNormalMode) material.GetFloat(k_DoubleSidedNormalMode);
switch (doubleSidedNormalMode)
{
case BaseLitGUI.DoubleSidedNormalMode.Mirror: // Mirror mode (in tangent space)

}
}
//NOTE: For SSS in forward and split lighting, obviously we don't have a gbuffer pass,
// so no stencil tagging there, but velocity? To check...
CoreUtils.SetKeyword(material, "_NORMALMAP_TANGENT_SPACE", true);
CoreUtils.SetKeyword(material, "_NORMALMAP", material.GetTexture(k_NormalMap));
SetupTextureMaterialProperty(material, k_Smoothness1);
SetupTextureMaterialProperty(material, k_Smoothness2);
SetupTextureMaterialProperty(material, k_SmoothnessA);
SetupTextureMaterialProperty(material, k_SmoothnessB);
SetupTextureMaterialProperty(material, k_AmbientOcclusion);
SetupTextureMaterialProperty(material, k_Anisotropy);
SetupTextureMaterialProperty(material, k_IridescenceThickness);
SetupTextureMaterialProperty(material, k_CoatSmoothness);
(TextureProperty.UVMapping)material.GetFloat(k_BaseColorMapUV),
(TextureProperty.UVMapping)material.GetFloat(k_MetallicMapUV),
(TextureProperty.UVMapping)material.GetFloat(k_NormalMapUV),
(TextureProperty.UVMapping)material.GetFloat(k_Smoothness1MapUV),
(TextureProperty.UVMapping)material.GetFloat(k_Smoothness2MapUV),
(TextureProperty.UVMapping)material.GetFloat(k_EmissiveColorMapUV),
(TextureProperty.UVMapping)material.GetFloat(k_SubsurfaceMaskMapUV),
(TextureProperty.UVMapping)material.GetFloat(k_ThicknessMapUV),
(TextureProperty.UVMapping) material.GetFloat(k_BaseColorMapUV),
(TextureProperty.UVMapping) material.GetFloat(k_MetallicMapUV),
(TextureProperty.UVMapping) material.GetFloat(k_NormalMapUV),
(TextureProperty.UVMapping) material.GetFloat(k_SmoothnessAMapUV),
(TextureProperty.UVMapping) material.GetFloat(k_SmoothnessBMapUV),
(TextureProperty.UVMapping) material.GetFloat(k_AmbientOcclusionMapUV),
(TextureProperty.UVMapping) material.GetFloat(k_EmissiveColorMapUV),
(TextureProperty.UVMapping) material.GetFloat(k_SubsurfaceMaskMapUV),
(TextureProperty.UVMapping) material.GetFloat(k_ThicknessMapUV),
(TextureProperty.UVMapping) material.GetFloat(k_AnisotropyMapUV),
(TextureProperty.UVMapping) material.GetFloat(k_IridescenceThicknessMapUV),
(TextureProperty.UVMapping) material.GetFloat(k_CoatSmoothnessMapUV),
bool requireUv2 = false;
bool requireUv3 = false;
// Set keyword for mapping
//bool requireUv2 = false;
//bool requireUv3 = false;
requireUv2 = requireUv2 || uvIndices[i] == TextureProperty.UVMapping.UV2;
requireUv3 = requireUv3 || uvIndices[i] == TextureProperty.UVMapping.UV3;
//requireUv2 = requireUv2 || uvIndices[i] == TextureProperty.UVMapping.UV2;
//requireUv3 = requireUv3 || uvIndices[i] == TextureProperty.UVMapping.UV3;
CoreUtils.SetKeyword(material, "_USE_TRIPLANAR", requireTriplanar);
//CoreUtils.SetKeyword(material, "_USE_UV2", requireUv2);
//CoreUtils.SetKeyword(material, "_USE_UV3", requireUv3);
CoreUtils.SetKeyword(material, "_USE_TRIPLANAR", requireTriplanar);
bool dualSpecularLobeEnabled = material.HasProperty(k_EnableDualSpecularLobe) && material.GetFloat(k_EnableDualSpecularLobe) > 0.0f;
CoreUtils.SetKeyword(material, "_MATERIAL_FEATURE_DUAL_SPECULAR_LOBE", dualSpecularLobeEnabled);
bool anisotropyEnabled = material.HasProperty(k_EnableAnisotropy) && material.GetFloat(k_EnableAnisotropy) > 0.0f;
CoreUtils.SetKeyword(material, "_MATERIAL_FEATURE_ANISOTROPY", anisotropyEnabled);
bool iridescenceEnabled = material.HasProperty(k_EnableIridescence) && material.GetFloat(k_EnableIridescence) > 0.0f;
CoreUtils.SetKeyword(material, "_MATERIAL_FEATURE_IRIDESCENCE", iridescenceEnabled);
bool transmissionEnabled = material.HasProperty(k_EnableAnisotropy) && material.GetFloat(k_EnableAnisotropy) > 0.0f;
CoreUtils.SetKeyword(material, "_MATERIAL_FEATURE_TRANSMISSION", transmissionEnabled);
bool sssEnabled = material.HasProperty(k_EnableSubsurfaceScattering) && material.GetFloat(k_EnableSubsurfaceScattering) > 0.0f;
CoreUtils.SetKeyword(material, "_MATERIAL_FEATURE_SUBSURFACE_SCATTERING", sssEnabled);
bool coatEnabled = material.HasProperty(k_EnableCoat) && material.GetFloat(k_EnableCoat) > 0.0f;
CoreUtils.SetKeyword(material, "_MATERIAL_FEATURE_COAT", coatEnabled);
// TEMP - Remove once dev is finish
bool debugEnabled = material.HasProperty("_DebugEnable") && material.GetFloat("_DebugEnable") > 0.0f;
CoreUtils.SetKeyword(material, "_STACKLIT_DEBUG", debugEnabled);
// Set the reference value for the stencil test - required for SSS
int stencilRef = (int)StencilLightingUsage.RegularLighting;
if (sssEnabled)
{
stencilRef = (int)StencilLightingUsage.SplitLighting;
}
// As we tag both during velocity pass and Gbuffer pass we need a separate state and we need to use the write mask
material.SetInt(kStencilRef, stencilRef);
material.SetInt(kStencilWriteMask, (int)HDRenderPipeline.StencilBitMask.LightingMask);
material.SetInt(kStencilRefMV, (int)HDRenderPipeline.StencilBitMask.ObjectVelocity);
material.SetInt(kStencilWriteMaskMV, (int)HDRenderPipeline.StencilBitMask.ObjectVelocity);
}
}
} // namespace UnityEditor

11
ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs


// HD use specific GraphicsSettings
GraphicsSettings.lightsUseLinearIntensity = true;
GraphicsSettings.lightsUseColorTemperature = true;
// HD should always use the new batcher
//GraphicsSettings.useScriptableRenderPipelineBatching = true;
SupportedRenderingFeatures.active = new SupportedRenderingFeatures()
{

continue;
}
if (camera.cameraType != CameraType.Reflection)
// TODO: Render only visible probes
ReflectionSystem.RenderAllRealtimeViewerDependentProbesFor(ReflectionProbeType.PlanarReflection, camera);
if (camera.cameraType != CameraType.Reflection
// Planar probes rendering is not currently supported for orthographic camera
// Avoid rendering to prevent error log spamming
&& !camera.orthographic)
// TODO: Render only visible probes
ReflectionSystem.RenderAllRealtimeViewerDependentProbesFor(ReflectionProbeType.PlanarReflection, camera);
// Init material if needed
// TODO: this should be move outside of the camera loop but we have no command buffer, ask details to Tim or Julien to do this

3
ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipelineAsset.cs


{
return new ReflectionSystemParameters
{
maxPlanarReflectionProbes = renderPipelineSettings.lightLoopSettings.planarReflectionProbeCacheSize,
maxPlanarReflectionProbePerCamera = renderPipelineSettings.lightLoopSettings.planarReflectionProbeCacheSize,
maxActivePlanarReflectionProbe = 512,
planarReflectionProbeSize = renderPipelineSettings.lightLoopSettings.planarReflectionTextureSize
};
}

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDStringConstants.cs


public static readonly int _VolumeBounds = Shader.PropertyToID("_VolumeBounds");
public static readonly int _VolumeData = Shader.PropertyToID("_VolumeData");
public static readonly int _NumVisibleDensityVolumes = Shader.PropertyToID("_NumVisibleDensityVolumes");
public static readonly int _VolumeMaskAtlas = Shader.PropertyToID("_VolumeMaskAtlas");
public static readonly int _VolumeMaskDimensions = Shader.PropertyToID("_VolumeMaskDimensions");
}
}

16
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightEvaluation.hlsl


// This files include various function uses to evaluate lights
// To use deferred directional shadow with cascaded shadow map,
// To use deferred directional shadow with cascaded shadow map,
// it is required to define USE_DEFERRED_DIRECTIONAL_SHADOWS before including this files
//-----------------------------------------------------------------------------

float3 indirectSpecularOcclusion;
};
void GetScreenSpaceAmbientOcclusion(float2 positionSS, float NdotV, float perceptualRoughness, float specularOcclusionFromData, out AmbientOcclusionFactor aoFactor)
void GetScreenSpaceAmbientOcclusion(float2 positionSS, float NdotV, float perceptualRoughness, float ambientOcclusionFromData, float specularOcclusionFromData, out AmbientOcclusionFactor aoFactor)
{
// Note: When we ImageLoad outside of texture size, the value returned by Load is 0 (Note: On Metal maybe it clamp to value of texture which is also fine)
// We use this property to have a neutral value for AO that doesn't consume a sampler and work also with compute shader (i.e use ImageLoad)

float roughness = PerceptualRoughnessToRoughness(perceptualRoughness);
float specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(NdotV), indirectAmbientOcclusion, roughness);
aoFactor.indirectAmbientOcclusion = lerp(_AmbientOcclusionParam.rgb, float3(1.0, 1.0, 1.0), indirectAmbientOcclusion);
aoFactor.indirectSpecularOcclusion = lerp(_AmbientOcclusionParam.rgb, float3(1.0, 1.0, 1.0), min(specularOcclusionFromData, specularOcclusion));
aoFactor.indirectAmbientOcclusion = lerp(_AmbientOcclusionParam.rgb, float3(1.0, 1.0, 1.0), min(ambientOcclusionFromData, indirectAmbientOcclusion));
aoFactor.indirectSpecularOcclusion = lerp(_AmbientOcclusionParam.rgb, float3(1.0, 1.0, 1.0), min(specularOcclusionFromData, specularOcclusion));
void GetScreenSpaceAmbientOcclusionMultibounce(float2 positionSS, float NdotV, float perceptualRoughness, float specularOcclusionFromData, float3 diffuseColor, float3 fresnel0, out AmbientOcclusionFactor aoFactor)
void GetScreenSpaceAmbientOcclusionMultibounce(float2 positionSS, float NdotV, float perceptualRoughness, float ambientOcclusionFromData, float specularOcclusionFromData, float3 diffuseColor, float3 fresnel0, out AmbientOcclusionFactor aoFactor)
{
// Use GTAOMultiBounce approximation for ambient occlusion (allow to get a tint from the diffuseColor)
// Note: When we ImageLoad outside of texture size, the value returned by Load is 0 (Note: On Metal maybe it clamp to value of texture which is also fine)

float roughness = PerceptualRoughnessToRoughness(perceptualRoughness);
float specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(NdotV), indirectAmbientOcclusion, roughness);
aoFactor.indirectAmbientOcclusion = GTAOMultiBounce(indirectAmbientOcclusion, diffuseColor);
aoFactor.directAmbientOcclusion = GTAOMultiBounce(min(specularOcclusionFromData, specularOcclusion), fresnel0);
aoFactor.indirectSpecularOcclusion = GTAOMultiBounce(directAmbientOcclusion, diffuseColor);
aoFactor.indirectSpecularOcclusion = GTAOMultiBounce(min(specularOcclusionFromData, specularOcclusion), fresnel0);
aoFactor.indirectAmbientOcclusion = GTAOMultiBounce(min(ambientOcclusionFromData, indirectAmbientOcclusion), diffuseColor);
aoFactor.directAmbientOcclusion = GTAOMultiBounce(directAmbientOcclusion, diffuseColor);
}

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


#define SINGLE_PASS_CONTEXT_SAMPLE_REFLECTION_PROBES 0
#define SINGLE_PASS_CONTEXT_SAMPLE_SKY 1
bool IsEnvIndexCubemap(int index) { return (index & 1) == ENVCACHETYPE_CUBEMAP; }
bool IsEnvIndexTexture2D(int index) { return (index & 1) == ENVCACHETYPE_TEXTURE2D; }
// Note: index is whatever the lighting architecture want, it can contain information like in which texture to sample (in case we have a compressed BC6H texture and an uncompressed for real time reflection ?)
// EnvIndex can also be use to fetch in another array of struct (to atlas information etc...).
// Cubemap : texCoord = direction vector

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


internal ReflectionProbeCullResults(ReflectionSystemParameters parameters)
{
Assert.IsTrue(parameters.maxPlanarReflectionProbes >= 0, "Maximum number of planar reflection probe must be positive");
Assert.IsTrue(parameters.maxPlanarReflectionProbePerCamera >= 0, "Maximum number of planar reflection probe must be positive");
m_PlanarReflectionProbeIndices = new int[parameters.maxPlanarReflectionProbes];
m_VisiblePlanarReflectionProbes = new PlanarReflectionProbe[parameters.maxPlanarReflectionProbes];
m_PlanarReflectionProbeIndices = new int[parameters.maxPlanarReflectionProbePerCamera];
m_VisiblePlanarReflectionProbes = new PlanarReflectionProbe[parameters.maxPlanarReflectionProbePerCamera];
}
public void CullPlanarReflectionProbes(CullingGroup cullingGroup, PlanarReflectionProbe[] planarReflectionProbes)

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


m_Parameters = parameters;
// Runtime collections
m_PlanarReflectionProbeBounds = new Dictionary<PlanarReflectionProbe, BoundingSphere>(parameters.maxPlanarReflectionProbes);
m_PlanarReflectionProbesArray = new PlanarReflectionProbe[parameters.maxPlanarReflectionProbes];
m_PlanarReflectionProbeBoundsArray = new BoundingSphere[parameters.maxPlanarReflectionProbes];
m_PlanarReflectionProbe_RealtimeUpdate_WorkArray = new PlanarReflectionProbe[parameters.maxPlanarReflectionProbes];
m_PlanarReflectionProbeBounds = new Dictionary<PlanarReflectionProbe, BoundingSphere>(parameters.maxActivePlanarReflectionProbe);
m_PlanarReflectionProbesArray = new PlanarReflectionProbe[parameters.maxActivePlanarReflectionProbe];
m_PlanarReflectionProbeBoundsArray = new BoundingSphere[parameters.maxActivePlanarReflectionProbe];
m_PlanarReflectionProbe_RealtimeUpdate_WorkArray = new PlanarReflectionProbe[parameters.maxPlanarReflectionProbePerCamera];
// Persistent collections
m_PlanarReflectionProbes = new HashSet<PlanarReflectionProbe>();

var cullingGroup = new CullingGroup();
cullingGroup.targetCamera = camera;
cullingGroup.SetBoundingSpheres(m_PlanarReflectionProbeBoundsArray);
cullingGroup.SetBoundingSphereCount(m_PlanarReflectionProbeBounds.Count);
cullingGroup.SetBoundingSphereCount(Mathf.Min(m_PlanarReflectionProbeBounds.Count, m_PlanarReflectionProbeBoundsArray.Length));
results.PrepareCull(cullingGroup, m_PlanarReflectionProbesArray);
}

if ((probeType & ReflectionProbeType.PlanarReflection) != 0)
{
var length = Mathf.Min(m_PlanarReflectionProbe_PerCamera_RealtimeUpdate.Count, m_PlanarReflectionProbe_RealtimeUpdate_WorkArray.Length);
m_PlanarReflectionProbe_PerCamera_RealtimeUpdate.CopyTo(m_PlanarReflectionProbe_RealtimeUpdate_WorkArray);
var index = 0;
foreach (var p in m_PlanarReflectionProbe_PerCamera_RealtimeUpdate)
{
m_PlanarReflectionProbe_RealtimeUpdate_WorkArray[index] = p;
if (++index >= length)
break;
}
#if DEBUG
var discarded = m_PlanarReflectionProbe_PerCamera_RealtimeUpdate.Count - length;
if (discarded > 0)
Debug.LogWarningFormat("There are more planar probe than supported in a single rendering, {0} probes discardeds", discarded);
#endif
// 1. Allocate if necessary target texture
var renderCamera = GetRenderCamera();

foreach (var planarReflectionProbe in m_PlanarReflectionProbe_DirtyBounds)
UpdatePlanarReflectionProbeBounds(planarReflectionProbe);
m_PlanarReflectionProbeBounds.Values.CopyTo(m_PlanarReflectionProbeBoundsArray, 0);
m_PlanarReflectionProbeBounds.Keys.CopyTo(m_PlanarReflectionProbesArray, 0);
var length = m_PlanarReflectionProbeBoundsArray.Length;
var index = 0;
foreach (var k in m_PlanarReflectionProbeBounds)
{
m_PlanarReflectionProbeBoundsArray[index] = k.Value;
m_PlanarReflectionProbesArray[index] = k.Key;
if (++index >= length)
break;
}
}
}

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


namespace UnityEngine.Experimental.Rendering.HDPipeline
{
/// <summary>
/// Holds settings for the reflection system.
/// </summary>
maxPlanarReflectionProbes = 512,
maxPlanarReflectionProbePerCamera = 128,
maxActivePlanarReflectionProbe = 512,
public int maxPlanarReflectionProbes;
/// <summary>
/// Maximum number of planar reflection that can be found in a cull result.
/// </summary>
public int maxPlanarReflectionProbePerCamera;
/// <summary>
/// Maximum number of active planar reflection in the world.
/// </summary>
public int maxActivePlanarReflectionProbe;
/// <summary>
/// Size of the planar probe textures.
/// </summary>
public int planarReflectionProbeSize;
}
}

83
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/DensityVolumeManager.cs


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

private DensityVolumeManager()
{
volumes = new List<HomogeneousDensityVolume>();
}
public static DensityVolumeManager manager
{

}
}
private List<HomogeneousDensityVolume> volumes = null;
public VolumeTextureAtlas volumeAtlas = null;
private bool atlasNeedsRefresh = false;
//TODO: hardcoded size....:-(
public static int volumeTextureSize = 32;
public void RegisterVolume(HomogeneousDensityVolume volume)
private DensityVolumeManager()
{
volumes = new List<DensityVolume>();
volumeAtlas = new VolumeTextureAtlas(TextureFormat.Alpha8, volumeTextureSize);
volumeAtlas.OnAtlasUpdated += AtlasUpdated;
}
private List<DensityVolume> volumes = null;
public void RegisterVolume(DensityVolume volume)
volume.OnTextureUpdated += TriggerVolumeAtlasRefresh;
if (volume.parameters.volumeMask != null)
{
volumeAtlas.AddTexture(volume.parameters.volumeMask);
}
public void DeRegisterVolume(HomogeneousDensityVolume volume)
public void DeRegisterVolume(DensityVolume volume)
volume.OnTextureUpdated -= TriggerVolumeAtlasRefresh;
if (volume.parameters.volumeMask != null)
{
volumeAtlas.RemoveTexture(volume.parameters.volumeMask);
}
public DensityVolume[] PrepareDensityVolumeData(CommandBuffer cmd)
{
//Update volumes
foreach (DensityVolume volume in volumes )
{
volume.PrepareParameters();
}
public HomogeneousDensityVolume[] GetAllVolumes()
if (atlasNeedsRefresh)
{
atlasNeedsRefresh = false;
VolumeAtlasRefresh();
}
volumeAtlas.GenerateVolumeAtlas(cmd);
return volumes.ToArray();
}
private void VolumeAtlasRefresh()
{
volumeAtlas.ClearTextures();
foreach (DensityVolume volume in volumes )
{
if (volume.parameters.volumeMask != null)
{
volumeAtlas.AddTexture(volume.parameters.volumeMask);
}
}
}
private void TriggerVolumeAtlasRefresh()
return volumes.ToArray();
atlasNeedsRefresh = true;
}
private void AtlasUpdated()
{
foreach(DensityVolume volume in volumes )
{
volume.parameters.textureIndex = volumeAtlas.GetTextureIndex(volume.parameters.volumeMask);
}
}
}
}

36
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/VolumeVoxelization.compute


//--------------------------------------------------------------------------------------------------
StructuredBuffer<OrientedBBox> _VolumeBounds;
StructuredBuffer<DensityVolumeProperties> _VolumeData;
StructuredBuffer<DensityVolumeData> _VolumeData;
TEXTURE3D(_VolumeMaskAtlas);
RW_TEXTURE3D(float4, _VBufferDensity); // RGB = sqrt(scattering), A = sqrt(extinction)

float4 _VBufferSampleOffset; // Not used by this shader
float _CornetteShanksConstant; // Not used by this shader
uint _NumVisibleDensityVolumes;
float2 _VolumeMaskDimensions; //x = 1/totalTextures , y = 1/textureSize
float SampleVolumeMask(DensityVolumeData volumeData, float3 voxelCenterUV)
{
float offset = volumeData.textureIndex * _VolumeMaskDimensions.x;
float clampBorder = 0.5f * _VolumeMaskDimensions.y;
//scale and bias the UVs and then take fractional part, will be in [0,1] range
voxelCenterUV = frac(voxelCenterUV * volumeData.textureTiling + volumeData.textureScroll);
voxelCenterUV.z = voxelCenterUV.z * _VolumeMaskDimensions.x;
voxelCenterUV.z += offset;
voxelCenterUV.z = clamp(voxelCenterUV.z, offset + clampBorder, offset + _VolumeMaskDimensions.x - clampBorder);
float maskValue = SAMPLE_TEXTURE3D_LOD(_VolumeMaskAtlas, s_linear_clamp_sampler, voxelCenterUV, 0).a;
return maskValue;
}
void FillVolumetricDensityBuffer(PositionInputs posInput, float3 rayOriginWS, float3 rayUnDirWS,
float3 voxelAxisRight, float3 voxelAxisUp, float3 voxelAxisForward)

// Express the voxel center in the local coordinate system of the box.
float3 voxelCenterBS = mul(voxelCenterWS - obb.center, transpose(obbFrame));
float3 voxelCenterUV = voxelCenterBS / obbExtents;
float3 voxelCenterUV = (voxelCenterBS / obbExtents) * 0.5 + 0.5;
#if SOFT_VOXELIZATION
// We need to determine which is the face closest to 'voxelCenterBS'.

if (overlapFraction > 0)
{
float scatteringAndExtinctionMask = 1.0f;
//Sample the volumeMask
if (_VolumeData[volumeIndex].textureIndex != -1)
{
scatteringAndExtinctionMask = SampleVolumeMask(_VolumeData[volumeIndex], voxelCenterUV);
}
voxelScattering += overlapFraction * _VolumeData[volumeIndex].scattering;
voxelExtinction += overlapFraction * _VolumeData[volumeIndex].extinction;
voxelScattering += overlapFraction * _VolumeData[volumeIndex].scattering * scatteringAndExtinctionMask;
voxelExtinction += overlapFraction * _VolumeData[volumeIndex].extinction * scatteringAndExtinctionMask;
}
#ifndef USE_CLUSTERED_LIGHTLIST

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


{
public Vector3 scattering; // [0, 1], prefer sRGB
public float extinction; // [0, 1], prefer sRGB
public Vector3 textureTiling;
public int textureIndex; //
public Vector3 textureScroll;
public static DensityVolumeData GetNeutralValues()
{

data.extinction = 0;
data.textureIndex = -1;
data.textureTiling = Vector3.one;
data.textureScroll = Vector3.zero;
return data;
}

return meanFreePath * scattering;
}
}
[Serializable]
public struct DensityVolumeParameters
{
public Color albedo; // Single scattering albedo: [0, 1]. Alpha is ignored
public float meanFreePath; // In meters: [1, 1000000]. Should be chromatic - this is an optimization!
public float asymmetry; // Controls the phase function: [-1, 1]
public void Constrain()
{
albedo.r = Mathf.Clamp01(albedo.r);
albedo.g = Mathf.Clamp01(albedo.g);
albedo.b = Mathf.Clamp01(albedo.b);
albedo.a = 1.0f;
meanFreePath = Mathf.Clamp(meanFreePath, 1.0f, float.MaxValue);
asymmetry = Mathf.Clamp(asymmetry, -1.0f, 1.0f);
}
public DensityVolumeData GetData()
{
DensityVolumeData data = new DensityVolumeData();
data.extinction = VolumeRenderingUtils.ExtinctionFromMeanFreePath(meanFreePath);
data.scattering = VolumeRenderingUtils.ScatteringFromExtinctionAndAlbedo(data.extinction, (Vector3)(Vector4)albedo);
return data;
}
} // class VolumeParameters
public struct DensityVolumeList
{

m_VisibleVolumeData.Clear();
// Collect all visible finite volume data, and upload it to the GPU.
HomogeneousDensityVolume[] volumes = DensityVolumeManager.manager.GetAllVolumes();
DensityVolume[] volumes = DensityVolumeManager.manager.PrepareDensityVolumeData(cmd);
HomogeneousDensityVolume volume = volumes[i];
DensityVolume volume = volumes[i];
// TODO: cache these?
var obb = OrientedBBox.Create(volume.transform);

// Compose the matrix which allows us to compute the world space view direction.
Matrix4x4 transform = HDUtils.ComputePixelCoordToWorldSpaceViewDirectionMatrix(vFoV, resolution, camera.viewMatrix, false);
Texture3D volumeAtlas = DensityVolumeManager.manager.volumeAtlas.volumeAtlas;
Vector2 volumeAtlasDimensions = new Vector2(0.0f, 0.0f);
if (volumeAtlas != null)
{
volumeAtlasDimensions.x = volumeAtlas.width / volumeAtlas.depth; // 1 / number of textures
volumeAtlasDimensions.y = 1.0f / volumeAtlas.width;
}
cmd.SetComputeTextureParam(m_VolumeVoxelizationCS, kernel, HDShaderIDs._VolumeMaskAtlas, volumeAtlas);
cmd.SetComputeVectorParam(m_VolumeVoxelizationCS, HDShaderIDs._VolumeMaskDimensions, volumeAtlasDimensions);
int w = (int)resolution.x;
int h = (int)resolution.y;

25
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/VolumetricLighting.cs.hlsl


#ifndef VOLUMETRICLIGHTING_CS_HLSL
#define VOLUMETRICLIGHTING_CS_HLSL
// Generated from UnityEngine.Experimental.Rendering.HDPipeline.DensityVolumeProperties
// Generated from UnityEngine.Experimental.Rendering.HDPipeline.DensityVolumeData
struct DensityVolumeProperties
struct DensityVolumeData
float3 textureTiling;
int textureIndex;
float3 textureScroll;
// Accessors for UnityEngine.Experimental.Rendering.HDPipeline.DensityVolumeProperties
// Accessors for UnityEngine.Experimental.Rendering.HDPipeline.DensityVolumeData
float3 GetScattering(DensityVolumeProperties value)
float3 GetScattering(DensityVolumeData value)
float GetExtinction(DensityVolumeProperties value)
float GetExtinction(DensityVolumeData value)
}
float3 GetTextureTiling(DensityVolumeData value)
{
return value.textureTiling;
}
int GetTextureIndex(DensityVolumeData value)
{
return value.textureIndex;
}
float3 GetTextureScroll(DensityVolumeData value)
{
return value.textureScroll;
}

100
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/DensityVolume.cs


using System;
using UnityEngine.Rendering;
[Serializable]
public struct DensityVolumeParameters
{
public Color albedo; // Single scattering albedo [0, 1]. Alpha is ignored
public float meanFreePath; // In meters [1, inf]. Should be chromatic - this is an optimization!
public float asymmetry; // Only used if (isLocal == false)
public Texture3D volumeMask;
public int textureIndex;
public Vector3 textureScrollingSpeed;
public Vector3 textureTiling;
private Vector3 volumeScrollingAmount;
public DensityVolumeParameters(Color color, float _meanFreePath, float _asymmetry)
{
albedo = color;
meanFreePath = _meanFreePath;
asymmetry = _asymmetry;
volumeMask = null;
textureIndex = -1;
textureScrollingSpeed = Vector3.zero;
textureTiling = Vector3.one;
volumeScrollingAmount = textureScrollingSpeed;
}
public void Update()
{
//Update scrolling based on deltaTime
if (volumeMask != null)
{
volumeScrollingAmount = volumeScrollingAmount + (textureScrollingSpeed * Time.deltaTime);
}
}
public void Constrain()
{
albedo.r = Mathf.Clamp01(albedo.r);
albedo.g = Mathf.Clamp01(albedo.g);
albedo.b = Mathf.Clamp01(albedo.b);
albedo.a = 1.0f;
meanFreePath = Mathf.Clamp(meanFreePath, 1.0f, float.MaxValue);
asymmetry = Mathf.Clamp(asymmetry, -1.0f, 1.0f);
volumeScrollingAmount = Vector3.zero;
}
public DensityVolumeData GetData()
{
DensityVolumeData data = new DensityVolumeData();
data.extinction = VolumeRenderingUtils.ExtinctionFromMeanFreePath(meanFreePath);
data.scattering = VolumeRenderingUtils.ScatteringFromExtinctionAndAlbedo(data.extinction, (Vector3)(Vector4)albedo);
data.textureIndex = textureIndex;
data.textureScroll = volumeScrollingAmount;
data.textureTiling = textureTiling;
return data;
}
} // class DensityVolumeParameters
[AddComponentMenu("Rendering/Homogeneous Density Volume", 1100)]
public class HomogeneousDensityVolume : MonoBehaviour
[AddComponentMenu("Rendering/Density Volume", 1100)]
public class DensityVolume : MonoBehaviour
public DensityVolumeParameters parameters;
public DensityVolumeParameters parameters = new DensityVolumeParameters(Color.grey, 10.0f, 0.0f);
public HomogeneousDensityVolume()
private Texture3D previousVolumeMask = null;
public Action OnTextureUpdated;
//Gather and Update any parameters that may have changed
public void PrepareParameters()
parameters.albedo = new Color(0.5f, 0.5f, 0.5f);
parameters.meanFreePath = 10.0f;
parameters.asymmetry = 0.0f;
//Texture has been updated notify the manager
if (previousVolumeMask != parameters.volumeMask)
{
NotifyUpdatedTexure();
previousVolumeMask = parameters.volumeMask;
}
parameters.Update();
}
private void NotifyUpdatedTexure()
{
if (OnTextureUpdated != null)
{
OnTextureUpdated();
}
}
private void Awake()

24
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.hlsl


return ((featureFlags & flag) != 0);
}
float3 ComputeDiffuseColor(float3 baseColor, float metallic)
{
return baseColor * (1.0 - metallic);
}
float3 ComputeFresnel0(float3 baseColor, float metallic, float dielectricF0)
{
return lerp(dielectricF0.xxx, baseColor, metallic);
}
// Assume that bsdfData.diffusionProfile is init
void FillMaterialSSS(uint diffusionProfile, float subsurfaceMask, inout BSDFData bsdfData)
{

preLightData.transparentTransmittance = exp(-bsdfData.absorptionCoefficient * refraction.dist);
// Empirical remap to try to match a bit the refraction probe blurring for the fallback
// Use IblPerceptualRoughness so we can handle approx of clear coat.
preLightData.transparentSSMipLevel = sqrt(preLightData.iblPerceptualRoughness) * uint(_ColorPyramidScale.z);
preLightData.transparentSSMipLevel = pow(preLightData.iblPerceptualRoughness, 1.3) * uint(max(_ColorPyramidScale.z - 1, 0));
#endif
return preLightData;

float3 F = preLightData.specularFGD;
float iblMipLevel = PerceptualRoughnessToMipmapLevel(preLightData.iblPerceptualRoughness);
// Specific case for Texture2Ds, their convolution is a gaussian one and not a GGX one.
// So we use another roughness mip mapping.
if (IsEnvIndexTexture2D(lightData.envIndex))
{
// Empirical remapping
iblMipLevel = PositivePow(preLightData.iblPerceptualRoughness, 0.8) * uint(max(_ColorPyramidScale.z - 1, 0));
}
float4 preLD = SampleEnv(lightLoopContext, lightData.envIndex, R, iblMipLevel);
weight *= preLD.a; // Used by planar reflection to discard pixel

AmbientOcclusionFactor aoFactor;
// Use GTAOMultiBounce approximation for ambient occlusion (allow to get a tint from the baseColor)
#if 0
GetScreenSpaceAmbientOcclusion(posInput.positionSS, preLightData.NdotV, bsdfData.perceptualRoughness, bsdfData.specularOcclusion, aoFactor);
GetScreenSpaceAmbientOcclusion(posInput.positionSS, preLightData.NdotV, bsdfData.perceptualRoughness, 1.0, bsdfData.specularOcclusion, aoFactor);
GetScreenSpaceAmbientOcclusionMultibounce(posInput.positionSS, preLightData.NdotV, bsdfData.perceptualRoughness, bsdfData.specularOcclusion, bsdfData.diffuseColor, bsdfData.fresnel0, aoFactor);
GetScreenSpaceAmbientOcclusionMultibounce(posInput.positionSS, preLightData.NdotV, bsdfData.perceptualRoughness, 1.0, bsdfData.specularOcclusion, bsdfData.diffuseColor, bsdfData.fresnel0, aoFactor);
#endif
// Add indirect diffuse + emissive (if any) - Ambient occlusion is multiply by emissive which is wrong but not a big deal

93
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/StackLit/StackLit.cs


using System;
using UnityEngine.Rendering;
//using System.Runtime.InteropServices;
namespace UnityEngine.Experimental.Rendering.HDPipeline
{

public enum MaterialFeatureFlags
{
LitStandard = 1 << 0
StackLitStandard = 1 << 0,
StackLitDualSpecularLobe = 1 << 1,
StackLitAnisotropy = 1 << 2,
StackLitCoat = 1 << 3,
StackLitIridescence = 1 << 4,
StackLitSubsurfaceScattering = 1 << 5,
StackLitTransmission = 1 << 6,
};
//-----------------------------------------------------------------------------

[SurfaceDataAttributes("Material Features")]
public uint materialFeatures;
// Standard
// Bottom interface (2 lobes BSDF)
// Standard parametrization
[SurfaceDataAttributes("Ambient Occlusion")]
public float ambientOcclusion;
[SurfaceDataAttributes("Metallic")]
public float metallic;
[SurfaceDataAttributes("IOR")]
public float dielectricIor;
// Dual specular lobe
[SurfaceDataAttributes("Smoothness B")]
public float perceptualSmoothnessB;

[SurfaceDataAttributes("Metallic")]
public float metallic;
// Anisotropic
[SurfaceDataAttributes("Tangent", true)]
public Vector3 tangentWS;
[SurfaceDataAttributes("Anisotropy")]
public float anisotropy; // anisotropic ratio(0->no isotropic; 1->full anisotropy in tangent direction, -1->full anisotropy in bitangent direction)
// Iridescence
[SurfaceDataAttributes("IridescenceIor")]
public float iridescenceIor;
[SurfaceDataAttributes("IridescenceThickness")]
public float iridescenceThickness;
// Top interface and media (clearcoat)
[SurfaceDataAttributes("Coat Smoothness")]
public float coatPerceptualSmoothness;
[SurfaceDataAttributes("Coat IOR")]
public float coatIor;
[SurfaceDataAttributes("Coat Thickness")]
public float coatThickness;
[SurfaceDataAttributes("Coat Extinction Coefficient")]
public Vector3 coatExtinction;
// SSS
[SurfaceDataAttributes("Diffusion Profile")]
public uint diffusionProfile;
[SurfaceDataAttributes("Subsurface Mask")]
public float subsurfaceMask;
// Transmission
// + Diffusion Profile
[SurfaceDataAttributes("Thickness")]
public float thickness;
// Bottom interface (2 lobes BSDF)
// Standard parametrization
public float ambientOcclusion;
// Dual specular lobe
// Anisotropic
[SurfaceDataAttributes("", true)]
public Vector3 tangentWS;
[SurfaceDataAttributes("", true)]
public Vector3 bitangentWS;
//public fixed float test[2];
// Top interface and media (clearcoat)
public float coatRoughness;
public float coatPerceptualRoughness;
public float coatIor;
public float coatThickness;
public Vector3 coatExtinction;
// iridescence
public float iridescenceIor;
public float iridescenceThickness;
// SSS
public uint diffusionProfile;
public float subsurfaceMask;
// Transmission
// + Diffusion Profile
public float thickness;
public bool useThickObjectMode; // Read from the diffusion profile
public Vector3 transmittance; // Precomputation of transmittance
//-----------------------------------------------------------------------------
// Init precomputed textures
//-----------------------------------------------------------------------------

188
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/StackLit/StackLit.cs.hlsl


//
// UnityEngine.Experimental.Rendering.HDPipeline.StackLit+MaterialFeatureFlags: static fields
//
#define MATERIALFEATUREFLAGS_LIT_STANDARD (1)
#define MATERIALFEATUREFLAGS_STACK_LIT_STANDARD (1)
#define MATERIALFEATUREFLAGS_STACK_LIT_DUAL_SPECULAR_LOBE (2)
#define MATERIALFEATUREFLAGS_STACK_LIT_ANISOTROPY (4)
#define MATERIALFEATUREFLAGS_STACK_LIT_COAT (8)
#define MATERIALFEATUREFLAGS_STACK_LIT_IRIDESCENCE (16)
#define MATERIALFEATUREFLAGS_STACK_LIT_SUBSURFACE_SCATTERING (32)
#define MATERIALFEATUREFLAGS_STACK_LIT_TRANSMISSION (64)
//
// UnityEngine.Experimental.Rendering.HDPipeline.StackLit+SurfaceData: static fields

#define DEBUGVIEW_STACKLIT_SURFACEDATA_NORMAL (1302)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_NORMAL_VIEW_SPACE (1303)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_SMOOTHNESS_A (1304)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_SMOOTHNESS_B (1305)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_LOBE_MIXING (1306)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_METALLIC (1307)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_AMBIENT_OCCLUSION (1302)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_METALLIC (1303)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_IOR (1304)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_NORMAL (1305)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_NORMAL_VIEW_SPACE (1306)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_SMOOTHNESS_A (1307)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_SMOOTHNESS_B (1308)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_LOBE_MIXING (1309)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_TANGENT (1310)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_ANISOTROPY (1311)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_IRIDESCENCE_IOR (1312)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_IRIDESCENCE_THICKNESS (1313)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_COAT_ROUGHNESS (1314)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_COAT_IOR (1315)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_COAT_THICKNESS (1316)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_COAT_EXTINCTION_COEFFICIENT (1317)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_DIFFUSION_PROFILE (1318)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_SUBSURFACE_MASK (1319)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_THICKNESS (1320)
//
// UnityEngine.Experimental.Rendering.HDPipeline.StackLit+BSDFData: static fields

#define DEBUGVIEW_STACKLIT_BSDFDATA_FRESNEL0 (1402)
#define DEBUGVIEW_STACKLIT_BSDFDATA_NORMAL_WS (1403)
#define DEBUGVIEW_STACKLIT_BSDFDATA_NORMAL_VIEW_SPACE (1404)
#define DEBUGVIEW_STACKLIT_BSDFDATA_PERCEPTUAL_ROUGHNESS_A (1405)
#define DEBUGVIEW_STACKLIT_BSDFDATA_PERCEPTUAL_ROUGHNESS_B (1406)
#define DEBUGVIEW_STACKLIT_BSDFDATA_LOBE_MIXING (1407)
#define DEBUGVIEW_STACKLIT_BSDFDATA_ROUGHNESS_AT (1408)
#define DEBUGVIEW_STACKLIT_BSDFDATA_ROUGHNESS_AB (1409)
#define DEBUGVIEW_STACKLIT_BSDFDATA_ROUGHNESS_BT (1410)
#define DEBUGVIEW_STACKLIT_BSDFDATA_ROUGHNESS_BB (1411)
#define DEBUGVIEW_STACKLIT_BSDFDATA_ANISOTROPY (1412)
#define DEBUGVIEW_STACKLIT_BSDFDATA_AMBIENT_OCCLUSION (1403)
#define DEBUGVIEW_STACKLIT_BSDFDATA_NORMAL_WS (1404)
#define DEBUGVIEW_STACKLIT_BSDFDATA_NORMAL_VIEW_SPACE (1405)
#define DEBUGVIEW_STACKLIT_BSDFDATA_PERCEPTUAL_ROUGHNESS_A (1406)
#define DEBUGVIEW_STACKLIT_BSDFDATA_PERCEPTUAL_ROUGHNESS_B (1407)
#define DEBUGVIEW_STACKLIT_BSDFDATA_LOBE_MIX (1408)
#define DEBUGVIEW_STACKLIT_BSDFDATA_TANGENT_WS (1409)
#define DEBUGVIEW_STACKLIT_BSDFDATA_BITANGENT_WS (1410)
#define DEBUGVIEW_STACKLIT_BSDFDATA_ROUGHNESS_AT (1411)
#define DEBUGVIEW_STACKLIT_BSDFDATA_ROUGHNESS_AB (1412)
#define DEBUGVIEW_STACKLIT_BSDFDATA_ROUGHNESS_BT (1413)
#define DEBUGVIEW_STACKLIT_BSDFDATA_ROUGHNESS_BB (1414)
#define DEBUGVIEW_STACKLIT_BSDFDATA_ANISOTROPY (1415)
#define DEBUGVIEW_STACKLIT_BSDFDATA_COAT_ROUGHNESS (1416)
#define DEBUGVIEW_STACKLIT_BSDFDATA_COAT_PERCEPTUAL_ROUGHNESS (1417)
#define DEBUGVIEW_STACKLIT_BSDFDATA_COAT_IOR (1418)
#define DEBUGVIEW_STACKLIT_BSDFDATA_COAT_THICKNESS (1419)
#define DEBUGVIEW_STACKLIT_BSDFDATA_COAT_EXTINCTION (1420)
#define DEBUGVIEW_STACKLIT_BSDFDATA_IRIDESCENCE_IOR (1421)
#define DEBUGVIEW_STACKLIT_BSDFDATA_IRIDESCENCE_THICKNESS (1422)
#define DEBUGVIEW_STACKLIT_BSDFDATA_DIFFUSION_PROFILE (1423)
#define DEBUGVIEW_STACKLIT_BSDFDATA_SUBSURFACE_MASK (1424)
#define DEBUGVIEW_STACKLIT_BSDFDATA_THICKNESS (1425)
#define DEBUGVIEW_STACKLIT_BSDFDATA_USE_THICK_OBJECT_MODE (1426)
#define DEBUGVIEW_STACKLIT_BSDFDATA_TRANSMITTANCE (1427)
// Generated from UnityEngine.Experimental.Rendering.HDPipeline.StackLit+SurfaceData
// PackingRules = Exact

float3 baseColor;
float ambientOcclusion;
float metallic;
float dielectricIor;
float metallic;
float3 tangentWS;
float anisotropy;
float iridescenceIor;
float iridescenceThickness;
float coatPerceptualSmoothness;
float coatIor;
float coatThickness;
float3 coatExtinction;
uint diffusionProfile;
float subsurfaceMask;
float thickness;
};
// Generated from UnityEngine.Experimental.Rendering.HDPipeline.StackLit+BSDFData

uint materialFeatures;
float3 diffuseColor;
float3 fresnel0;
float ambientOcclusion;
float3 tangentWS;
float3 bitangentWS;
float coatRoughness;
float coatPerceptualRoughness;
float coatIor;
float coatThickness;
float3 coatExtinction;
float iridescenceIor;
float iridescenceThickness;
uint diffusionProfile;
float subsurfaceMask;
float thickness;
bool useThickObjectMode;
float3 transmittance;
};
//

result = surfacedata.baseColor;
needLinearToSRGB = true;
break;
case DEBUGVIEW_STACKLIT_SURFACEDATA_AMBIENT_OCCLUSION:
result = surfacedata.ambientOcclusion.xxx;
break;
case DEBUGVIEW_STACKLIT_SURFACEDATA_METALLIC:
result = surfacedata.metallic.xxx;
break;
case DEBUGVIEW_STACKLIT_SURFACEDATA_IOR:
result = surfacedata.dielectricIor.xxx;
break;
case DEBUGVIEW_STACKLIT_SURFACEDATA_NORMAL:
result = surfacedata.normalWS * 0.5 + 0.5;
break;

case DEBUGVIEW_STACKLIT_SURFACEDATA_LOBE_MIXING:
result = surfacedata.lobeMix.xxx;
break;
case DEBUGVIEW_STACKLIT_SURFACEDATA_METALLIC:
result = surfacedata.metallic.xxx;
case DEBUGVIEW_STACKLIT_SURFACEDATA_TANGENT:
result = surfacedata.tangentWS * 0.5 + 0.5;
break;
case DEBUGVIEW_STACKLIT_SURFACEDATA_ANISOTROPY:
result = surfacedata.anisotropy.xxx;
break;
case DEBUGVIEW_STACKLIT_SURFACEDATA_IRIDESCENCE_IOR:
result = surfacedata.iridescenceIor.xxx;
break;
case DEBUGVIEW_STACKLIT_SURFACEDATA_IRIDESCENCE_THICKNESS:
result = surfacedata.iridescenceThickness.xxx;
break;
case DEBUGVIEW_STACKLIT_SURFACEDATA_COAT_ROUGHNESS:
result = surfacedata.coatPerceptualSmoothness.xxx;
break;
case DEBUGVIEW_STACKLIT_SURFACEDATA_COAT_IOR:
result = surfacedata.coatIor.xxx;
break;
case DEBUGVIEW_STACKLIT_SURFACEDATA_COAT_THICKNESS:
result = surfacedata.coatThickness.xxx;
break;
case DEBUGVIEW_STACKLIT_SURFACEDATA_COAT_EXTINCTION_COEFFICIENT:
result = surfacedata.coatExtinction;
break;
case DEBUGVIEW_STACKLIT_SURFACEDATA_DIFFUSION_PROFILE:
result = GetIndexColor(surfacedata.diffusionProfile);
break;
case DEBUGVIEW_STACKLIT_SURFACEDATA_SUBSURFACE_MASK:
result = surfacedata.subsurfaceMask.xxx;
break;
case DEBUGVIEW_STACKLIT_SURFACEDATA_THICKNESS:
result = surfacedata.thickness.xxx;
break;
}
}

case DEBUGVIEW_STACKLIT_BSDFDATA_FRESNEL0:
result = bsdfdata.fresnel0;
break;
case DEBUGVIEW_STACKLIT_BSDFDATA_AMBIENT_OCCLUSION:
result = bsdfdata.ambientOcclusion.xxx;
break;
case DEBUGVIEW_STACKLIT_BSDFDATA_NORMAL_WS:
result = bsdfdata.normalWS * 0.5 + 0.5;
break;

case DEBUGVIEW_STACKLIT_BSDFDATA_PERCEPTUAL_ROUGHNESS_B:
result = bsdfdata.perceptualRoughnessB.xxx;
break;
case DEBUGVIEW_STACKLIT_BSDFDATA_LOBE_MIXING:
case DEBUGVIEW_STACKLIT_BSDFDATA_LOBE_MIX:
case DEBUGVIEW_STACKLIT_BSDFDATA_TANGENT_WS:
result = bsdfdata.tangentWS * 0.5 + 0.5;
break;
case DEBUGVIEW_STACKLIT_BSDFDATA_BITANGENT_WS:
result = bsdfdata.bitangentWS * 0.5 + 0.5;
break;
case DEBUGVIEW_STACKLIT_BSDFDATA_ROUGHNESS_AT:
result = bsdfdata.roughnessAT.xxx;
break;

break;
case DEBUGVIEW_STACKLIT_BSDFDATA_ANISOTROPY:
result = bsdfdata.anisotropy.xxx;
break;
case DEBUGVIEW_STACKLIT_BSDFDATA_COAT_ROUGHNESS:
result = bsdfdata.coatRoughness.xxx;
break;
case DEBUGVIEW_STACKLIT_BSDFDATA_COAT_PERCEPTUAL_ROUGHNESS:
result = bsdfdata.coatPerceptualRoughness.xxx;
break;
case DEBUGVIEW_STACKLIT_BSDFDATA_COAT_IOR:
result = bsdfdata.coatIor.xxx;
break;
case DEBUGVIEW_STACKLIT_BSDFDATA_COAT_THICKNESS:
result = bsdfdata.coatThickness.xxx;
break;
case DEBUGVIEW_STACKLIT_BSDFDATA_COAT_EXTINCTION:
result = bsdfdata.coatExtinction;
break;
case DEBUGVIEW_STACKLIT_BSDFDATA_IRIDESCENCE_IOR:
result = bsdfdata.iridescenceIor.xxx;
break;
case DEBUGVIEW_STACKLIT_BSDFDATA_IRIDESCENCE_THICKNESS:
result = bsdfdata.iridescenceThickness.xxx;
break;
case DEBUGVIEW_STACKLIT_BSDFDATA_DIFFUSION_PROFILE:
result = GetIndexColor(bsdfdata.diffusionProfile);
break;
case DEBUGVIEW_STACKLIT_BSDFDATA_SUBSURFACE_MASK:
result = bsdfdata.subsurfaceMask.xxx;
break;
case DEBUGVIEW_STACKLIT_BSDFDATA_THICKNESS:
result = bsdfdata.thickness.xxx;
break;
case DEBUGVIEW_STACKLIT_BSDFDATA_USE_THICK_OBJECT_MODE:
result = (bsdfdata.useThickObjectMode) ? float3(1.0, 1.0, 1.0) : float3(0.0, 0.0, 0.0);
break;
case DEBUGVIEW_STACKLIT_BSDFDATA_TRANSMITTANCE:
result = bsdfdata.transmittance;
break;
}
}

949
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/StackLit/StackLit.hlsl
文件差异内容过多而无法显示
查看文件

93
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/StackLit/StackLit.shader


_MetallicMapChannel("Metallic Map Channel", Float) = 0.0
_MetallicMapChannelMask("Metallic Map Channel Mask", Vector) = (1, 0, 0, 0)
_MetallicRemap("Metallic Remap", Vector) = (0, 1, 0, 0)
[ToggleUI] _MetallicRemapInverted("Invert Metallic Remap", Float) = 0.0
_DielectricIor("DielectricIor IOR", Range(1.0, 2.5)) = 1.5
[HideInInspector] _SmoothnessAMapShow("SmoothnessA Map Show", Float) = 0
_SmoothnessA("SmoothnessA", Range(0.0, 1.0)) = 1.0

[ToggleUI] _SmoothnessARemapInverted("Invert SmoothnessA Remap", Float) = 0.0
[HideInInspector] _SmoothnessARange("SmoothnessA Range", Vector) = (0, 1, 0, 0)
[ToggleUI] _EnableDualSpecularLobe("Enable Dual Specular Lobe", Float) = 0.0 // UI only
[HideInInspector] _SmoothnessBMapShow("SmoothnessB Map Show", Float) = 0
_SmoothnessB("SmoothnessB", Range(0.0, 1.0)) = 1.0
_SmoothnessBMap("SmoothnessB Map", 2D) = "white" {}

[HideInInspector] _SmoothnessBRange("SmoothnessB Range", Vector) = (0, 1, 0, 0)
_LobeMix("Lobe Mix", Range(0.0, 1.0)) = 0
[ToggleUI] _DebugEnable("Debug Enable", Float) = 0.0 // UI only
_DebugLobeMask("DebugLobeMask", Vector) = (1, 1, 1, 1)
_DebugAniso("DebugAniso", Vector) = (1, 0, 0, 1000.0)
// TODO: TangentMap, AnisotropyMap and CoatIorMap (SmoothnessMap ?)
[ToggleUI] _EnableAnisotropy("Enable Anisotropy", Float) = 0.0 // UI only
_Anisotropy("Anisotropy", Range(-1.0, 1.0)) = 0.0
_AnisotropyMap("Anisotropy Map", 2D) = "white" {}
_AnisotropyUseMap("Anisotropy Use Map", Float) = 0
_AnisotropyMapUV("Anisotropy Map UV", Float) = 0.0
_AnisotropyMapUVLocal("Anisotropy Map UV Local", Float) = 0.0
_AnisotropyMapChannel("Anisotropy Map Channel", Float) = 0.0
_AnisotropyMapChannelMask("Anisotropy Map Channel Mask", Vector) = (1, 0, 0, 0)
_AnisotropyRemap("Anisotropy Remap", Vector) = (0, 1, 0, 0)
[HideInInspector] _AnisotropyRange("Anisotropy Range", Vector) = (0, 1, 0, 0)
[ToggleUI] _EnableCoat("Enable Coat", Float) = 0.0 // UI only
[HideInInspector] _CoatSmoothnessMapShow("CoatSmoothness Show", Float) = 0
_CoatSmoothness("CoatSmoothness", Range(0.0, 1.0)) = 1.0
_CoatSmoothnessMap("CoatSmoothness Map", 2D) = "white" {}
_CoatSmoothnessUseMap("CoatSmoothness Use Map", Float) = 0
_CoatSmoothnessMapUV("CoatSmoothness Map UV", Float) = 0.0
_CoatSmoothnessMapUVLocal("CoatSmoothness Map UV Local", Float) = 0.0
_CoatSmoothnessMapChannel("CoatSmoothness Map Channel", Float) = 0.0
_CoatSmoothnessMapChannelMask("CoatSmoothness Map Channel Mask", Vector) = (1, 0, 0, 0)
_CoatSmoothnessRemap("CoatSmoothness Remap", Vector) = (0, 1, 0, 0)
[ToggleUI] _CoatSmoothnessRemapInverted("Invert CoatSmoothness Remap", Float) = 0.0
[HideInInspector] _CoatSmoothnessRange("CoatSmoothness Range", Vector) = (0, 1, 0, 0)
_CoatIor("Coat IOR", Range(1.0001, 2.0)) = 1.5
_CoatThickness("Coat Thickness", Range(0.0, 0.99)) = 0.0
_CoatExtinction("Coat Extinction Coefficient", Color) = (1,1,1) // in thickness^-1 units
[HideInInspector] _NormalMapShow("NormalMap Show", Float) = 0.0
_NormalMap("NormalMap", 2D) = "bump" {} // Tangent space normal map
_NormalMapUV("NormalMapUV", Float) = 0.0

[HideInInspector] _AmbientOcclusionMapShow("AmbientOcclusion Map Show", Float) = 0
_AmbientOcclusion("AmbientOcclusion", Range(0.0, 1.0)) = 1
_AmbientOcclusionMap("AmbientOcclusion Map", 2D) = "white" {}
_AmbientOcclusionUseMap("AmbientOcclusion Use Map", Float) = 0
_AmbientOcclusionMapUV("AmbientOcclusion Map UV", Float) = 0.0
_AmbientOcclusionMapUVLocal("AmbientOcclusion Map UV Local", Float) = 0.0
_AmbientOcclusionMapChannel("AmbientOcclusion Map Channel", Float) = 0.0
_AmbientOcclusionMapChannelMask("AmbientOcclusion Map Channel Mask", Vector) = (1, 0, 0, 0)
_AmbientOcclusionRemap("AmbientOcclusion Remap", Vector) = (0, 1, 0, 0)
[HideInInspector] _AmbientOcclusionRange("AmbientOcclusion Range", Vector) = (0, 1, 0, 0)
[HideInInspector] _EmissiveColorMapShow("Emissive Color Map Show", Float) = 0.0
_EmissiveColor("Emissive Color", Color) = (1, 1, 1)
_EmissiveColorMap("Emissive Color Map", 2D) = "white" {}

[ToggleUI] _AlbedoAffectEmissive("Albedo Affect Emissive", Float) = 0.0
[ToggleUI] _EnableSubsurfaceScattering("Enable Subsurface Scattering", Float) = 0.0
_DiffusionProfile("Diffusion Profile", Int) = 0
_SubsurfaceMaskUSeMap("Subsurface Mask Use Map", Float) = 0
_SubsurfaceMaskUseMap("Subsurface Mask Use Map", Float) = 0
_SubsurfaceMaskMapUVLocal("Subsurface Mask UV Local", Float) = 0.0
[ToggleUI] _SubsurfaceMaskRemapInverted("Invert Subsurface Mask Remap", Float) = 0.0
[ToggleUI] _EnableTransmission("Enable Transmission", Float) = 0.0
_ThicknessMapUVLocal("Thickness Map UV Local", Float) = 0.0
[ToggleUI] _EnableIridescence("Enable Iridescence", Float) = 0.0 // UI only
_IridescenceIor("Coat IOR", Range(1.0, 2.0)) = 1.5
_IridescenceThickness("_IridescenceThickness", Range(0.0, 1.0)) = 0.0
_IridescenceThicknessMap("IridescenceThickness Color Map", 2D) = "black" {}
_IridescenceThicknessUseMap("IridescenceThickness Use Map", Float) = 0
_IridescenceThicknessMapUV("IridescenceThickness Map UV", Float) = 0.0
_IridescenceThicknessMapLocal("IridescenceThickness Map UV Local", Float) = 0.0
_IridescenceThicknessMapChannel("IridescenceThickness Mask Map Channel", Float) = 0.0
_IridescenceThicknessMapChannelMask("IridescenceThickness Mask Map Channel Mask", Vector) = (1, 0, 0, 0)
[HideInInspector] _IridescenceThicknessRange("IridescenceThickness Range", Vector) = (0, 1, 0, 0)
_DistortionVectorMap("DistortionVectorMap", 2D) = "black" {}
[ToggleUI] _DistortionEnable("Enable Distortion", Float) = 0.0

// Sections show values.
[HideInInspector] _MaterialFeaturesShow("_MaterialFeaturesShow", Float) = 1.0
[HideInInspector] _DebugShow("_DebugShow", Float) = 0.0
[HideInInspector] _Lobe2Show("_Lobe2Show", Float) = 0.0
[HideInInspector] _DualSpecularLobeShow("_DualSpecularLobeShow", Float) = 0.0
[HideInInspector] _GlintShow("_GlintShow", Float) = 0.0
// Caution: C# code in BaseLitUI.cs call LightmapEmissionFlagsProperty() which assume that there is an existing "_EmissionColor"
// value that exist to identify if the GI emission need to be enabled.

// but we need it right away for toggle with LayerTexCoord mapping so we might need them
// from the Frag input right away. See also ShaderPass/StackLitSharePass.hlsl.
#pragma shader_feature _NORMALMAP
#pragma shader_feature _MASKMAPA
#pragma shader_feature _MASKMAPB
#pragma shader_feature _EMISSIVE_COLOR_MAP
// Keyword for transparent
#pragma shader_feature _SURFACE_TYPE_TRANSPARENT
#pragma shader_feature _ _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY

// MaterialFeature are used as shader feature to allow compiler to optimize properly
#pragma shader_feature _MATERIAL_FEATURE_DUAL_SPECULAR_LOBE
#pragma shader_feature _MATERIAL_FEATURE_ANISOTROPY
#pragma shader_feature _MATERIAL_FEATURE_COAT
#pragma shader_feature _MATERIAL_FEATURE_IRIDESCENCE
#pragma shader_feature _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
#pragma shader_feature _MATERIAL_FEATURE_TRANSMISSION
#pragma shader_feature _STACKLIT_DEBUG
//enable GPU instancing support
#pragma multi_compile_instancing

#define UNITY_MATERIAL_STACKLIT // Need to be define before including Material.hlsl
// If we use subsurface scattering, enable output split lighting (for forward pass)
#if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT)
#define OUTPUT_SPLIT_LIGHTING
#endif
//-------------------------------------------------------------------------------------
// Include

171
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/StackLit/StackLitData.hlsl


#include "CoreRP/ShaderLibrary/Sampling/SampleUVMapping.hlsl"
#include "../MaterialUtilities.hlsl"
////-----------------------------------------------------------------------------
//// Texture Mapping (think of LayerTexCoord as simply TexCoordMappings,
//// ie no more layers here - cf Lit materials)
////-----------------------------------------------------------------------------
//
////
//// For easier copying of code for now use a LayerTexCoord wrapping struct.
//// We don't have details yet.
////
//// NEWLITTODO: Eventually, we could quickly share GetBuiltinData of LitBuiltinData.hlsl
//// in our GetSurfaceAndBuiltinData( ) here, since we will use the LayerTexCoord identifier,
//// and an identical ComputeLayerTexCoord( ) prototype
////
//struct LayerTexCoord
//{
// UVMapping base;
//
// // Store information that will be share by all UVMapping
// float3 vertexNormalWS; // TODO: store also object normal map for object triplanar
//};
//
//// Want to use only one sampler for normalmap/bentnormalmap either we use OS or TS. And either we have normal map or bent normal or both.
////
//// Note (compared to Lit shader):
////
//// We don't have a layered material with which we are sharing code here like the LayeredLit shader, but we can also save a couple of
//// samplers later if we use bentnormals.
////
//// _IDX suffix is meaningless here, could use the name SAMPLER_NORMALMAP_ID instead of SAMPLER_NORMALMAP_IDX and replace all
//// indirect #ifdef _NORMALMAP_TANGENT_SPACE_IDX #ifdef and _NORMALMAP_IDX tests with the more direct
//// shader_feature keywords _NORMALMAP_TANGENT_SPACE and _NORMALMAP.
////
//// (Originally in the LayeredLit shader, shader_feature keywords like _NORMALMAP become _NORMALMAP0 but since files are shared,
//// LitDataIndividualLayer will use a generic _NORMALMAP_IDX defined before its inclusion by the client LitData or LayeredLitData.
//// That way, LitDataIndividualLayer supports multiple inclusions)
#ifdef _NORMALMAP_TANGENT_SPACE
#if defined(_NORMALMAP)
#define SAMPLER_NORMALMAP_ID sampler_NormalMap
// TODO:
//#elif defined(_BENTNORMALMAP)
//#define SAMPLER_NORMALMAP_ID sampler_BentNormalMap
#endif
#else
// TODO:
//#error STACKLIT_USES_ONLY_TANGENT_SPACE_FOR_NOW
//#if defined(_NORMALMAP)
//#define SAMPLER_NORMALMAP_ID sampler_NormalMapOS
//#elif defined(_BENTNORMALMAP)
//#define SAMPLER_NORMALMAP_ID sampler_BentNormalMapOS
//#endif
#endif
//-----------------------------------------------------------------------------
// Texture Mapping
//-----------------------------------------------------------------------------

// We forbid scale in case of object space as it make no sense
// Decompress normal ourselve
float3 normalOS = SampleTexture2DTriplanarScaleBias(TEXTURE2D_PARAM(textureName, samplerName), textureNameUV, textureNameUVLocal, textureNameST, uvMapping) * 2.0 - 1.0;
float3 normalOS = SampleTexture2DTriplanarScaleBias(TEXTURE2D_PARAM(textureName, samplerName), textureNameUV, textureNameUVLocal, textureNameST, uvMapping).xyz * 2.0 - 1.0;
// no need to renormalize normalOS for SurfaceGradientFromPerturbedNormal
return SurfaceGradientFromPerturbedNormal(uvMapping.vertexNormalWS, TransformObjectToWorldDir(normalOS));
}

InitializeMappingData(input, uvMapping);
// -------------------------------------------------------------
// Surface Data:
// Surface Data
// -------------------------------------------------------------
float alpha = SAMPLE_TEXTURE2D_SCALE_BIAS(_BaseColorMap).a * _BaseColor.a;

DoAlphaTest(alpha, _AlphaCutoff);
#endif
// Standard
surfaceData.baseColor = SAMPLE_TEXTURE2D_SCALE_BIAS(_BaseColorMap).rgb * _BaseColor.rgb;
float3 gradient = SAMPLE_TEXTURE2D_NORMAL_SCALE_BIAS(_NormalMap, float2(_NormalScale.xx));

surfaceData.perceptualSmoothnessA = lerp(_SmoothnessARange.x, _SmoothnessARange.y, surfaceData.perceptualSmoothnessA);
surfaceData.perceptualSmoothnessA = lerp(_SmoothnessA, surfaceData.perceptualSmoothnessA, _SmoothnessAUseMap);
surfaceData.metallic = dot(SAMPLE_TEXTURE2D_SCALE_BIAS(_MetallicMap), _MetallicMapChannelMask);
surfaceData.metallic = lerp(_MetallicRange.x, _MetallicRange.y, surfaceData.metallic);
surfaceData.metallic = lerp(_Metallic, surfaceData.metallic, _MetallicUseMap);
surfaceData.dielectricIor = _DielectricIor;
surfaceData.ambientOcclusion = dot(SAMPLE_TEXTURE2D_SCALE_BIAS(_AmbientOcclusionMap), _AmbientOcclusionMapChannelMask);
surfaceData.ambientOcclusion = lerp(_AmbientOcclusionRange.x, _AmbientOcclusionRange.y, surfaceData.ambientOcclusion);
surfaceData.ambientOcclusion = lerp(_AmbientOcclusion, surfaceData.ambientOcclusion, _AmbientOcclusionUseMap);
// These static material feature allow compile time optimization
surfaceData.materialFeatures = MATERIALFEATUREFLAGS_STACK_LIT_STANDARD;
// Feature dependent data
#ifdef _MATERIAL_FEATURE_DUAL_SPECULAR_LOBE
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_STACK_LIT_DUAL_SPECULAR_LOBE;
surfaceData.lobeMix = _LobeMix;
#else
surfaceData.lobeMix = 0.0;
surfaceData.perceptualSmoothnessB = 1.0;
#endif
// TODOSTACKLIT: lobe weighting
surfaceData.lobeMix = _LobeMix;
#ifdef _MATERIAL_FEATURE_ANISOTROPY
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_STACK_LIT_ANISOTROPY;
// TODO: manage anistropy map
//surfaceData.anisotropy = dot(SAMPLE_TEXTURE2D_SCALE_BIAS(_AnistropyMap), _AnistropyMapChannelMask);
//surfaceData.anisotropy = lerp(_AnistropyRange.x, _AnistropyRange.y, surfaceData.anisotropy);
surfaceData.anisotropy = _Anisotropy; // In all cases we must multiply anisotropy with the map
#else
surfaceData.anisotropy = 0.0;
#endif
surfaceData.tangentWS = normalize(input.worldToTangent[0].xyz); // The tangent is not normalize in worldToTangent for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT
#ifdef _MATERIAL_FEATURE_COAT
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_STACK_LIT_COAT;
surfaceData.coatPerceptualSmoothness = dot(SAMPLE_TEXTURE2D_SCALE_BIAS(_CoatSmoothnessMap), _CoatSmoothnessMapChannelMask);
surfaceData.coatPerceptualSmoothness = lerp(_CoatSmoothnessRange.x, _CoatSmoothnessRange.y, surfaceData.coatPerceptualSmoothness);
surfaceData.coatPerceptualSmoothness = lerp(_CoatSmoothness, surfaceData.coatPerceptualSmoothness, _CoatSmoothnessUseMap);
surfaceData.coatIor = _CoatIor;
surfaceData.coatThickness = _CoatThickness;
surfaceData.coatExtinction = _CoatExtinction; // in thickness^-1 units
#else
surfaceData.coatPerceptualSmoothness = 0.0;
surfaceData.coatIor = 1.0001;
surfaceData.coatThickness = 0.0;
surfaceData.coatExtinction = float3(1.0, 1.0, 1.0);
#endif
#ifdef _MATERIAL_FEATURE_IRIDESCENCE
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_STACK_LIT_IRIDESCENCE;
surfaceData.iridescenceIor = _IridescenceIor;
surfaceData.iridescenceThickness = dot(SAMPLE_TEXTURE2D_SCALE_BIAS(_IridescenceThicknessMap), _IridescenceThicknessMapChannelMask);
surfaceData.iridescenceThickness = lerp(_IridescenceThicknessRange.x, _IridescenceThicknessRange.y, surfaceData.iridescenceThickness);
surfaceData.iridescenceThickness = lerp(_IridescenceThickness, surfaceData.iridescenceThickness, _IridescenceThicknessUseMap);
#else
surfaceData.iridescenceIor = 1.0;
surfaceData.iridescenceThickness = 0.0;
#endif
#if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) || defined(_MATERIAL_FEATURE_TRANSMISSION)
surfaceData.diffusionProfile = _DiffusionProfile;
#else
surfaceData.diffusionProfile = 0;
#endif
// TODO: Ambient occlusion, detail mask.
surfaceData.metallic = dot(SAMPLE_TEXTURE2D_SCALE_BIAS(_MetallicMap), _MetallicMapChannelMask);
surfaceData.metallic = lerp(_MetallicRange.x, _MetallicRange.y, surfaceData.metallic);
surfaceData.metallic = lerp(_Metallic, surfaceData.metallic, _MetallicUseMap);
#ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_STACK_LIT_SUBSURFACE_SCATTERING;
surfaceData.subsurfaceMask = dot(SAMPLE_TEXTURE2D_SCALE_BIAS(_SubsurfaceMaskMap), _SubsurfaceMaskMapChannelMask);
surfaceData.subsurfaceMask = lerp(_SubsurfaceMaskRange.x, _SubsurfaceMaskRange.y, surfaceData.subsurfaceMask);
surfaceData.subsurfaceMask = lerp(_SubsurfaceMask, surfaceData.subsurfaceMask, _SubsurfaceMaskUseMap);
#else
surfaceData.subsurfaceMask = 0.0;
#endif
// These static material feature allow compile time optimization
// TODO: As we add features, or-set the flags eg MATERIALFEATUREFLAGS_LIT_* with #ifdef
// on corresponding _MATERIAL_FEATURE_* shader_feature kerwords (set by UI) so the compiler
// knows the value of surfaceData.materialFeatures.
surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD;
#ifdef _MATERIAL_FEATURE_TRANSMISSION
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_STACK_LIT_TRANSMISSION;
surfaceData.thickness = dot(SAMPLE_TEXTURE2D_SCALE_BIAS(_ThicknessMap), _ThicknessMapChannelMask);
surfaceData.thickness = lerp(_ThicknessRange.x, _ThicknessRange.y, surfaceData.thickness);
surfaceData.thickness = lerp(_Thickness, surfaceData.thickness, _ThicknessUseMap);
#else
surfaceData.thickness = 1.0;
#endif
// -------------------------------------------------------------
// Surface Data Part 2 (outsite GetSurfaceData( ) in Lit shader):

#if defined(DEBUG_DISPLAY)
if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE)
{
surfaceData.baseColor = GetTextureDataDebug(_DebugMipMapMode, texcoords[_BaseColorMapUV], _BaseColorMap, _BaseColorMap_TexelSize, _BaseColorMap_MipInfo, surfaceData.baseColor);
surfaceData.metallic = 0;
if (_BaseColorMapUV != TEXCOORD_INDEX_TRIPLANAR)
{
surfaceData.baseColor = GetTextureDataDebug(_DebugMipMapMode, uvMapping.texcoords[_BaseColorMapUV][_BaseColorMapUVLocal], _BaseColorMap, _BaseColorMap_TexelSize, _BaseColorMap_MipInfo, surfaceData.baseColor);
}
else
{
surfaceData.baseColor = float3(0.0, 0.0, 0.0);
}
surfaceData.metallic = 0.0;
}
#endif

builtinData.opacity = alpha;
builtinData.bakeDiffuseLighting = float3(0.0, 0.0, 0.0);
builtinData.bakeDiffuseLighting = SampleBakedGI(input.positionWS, surfaceData.normalWS, input.texCoord1, input.texCoord2);
// Emissive Intensity is only use here, but is part of BuiltinData to enforce UI parameters as we want the users to fill one color and one intensity
builtinData.emissiveIntensity = _EmissiveIntensity; // We still store intensity here so we can reuse it with debug code

// TODO:
//NEWLITTODO: shader feature SHADOWS_SHADOWMASK not there yet.
#ifdef SHADOWS_SHADOWMASK
float4 shadowMask = SampleShadowMask(input.positionWS, input.texCoord1);
builtinData.shadowMask0 = shadowMask.x;
builtinData.shadowMask1 = shadowMask.y;
builtinData.shadowMask2 = shadowMask.z;
builtinData.shadowMask3 = shadowMask.w;
#else
#endif
#if (SHADERPASS == SHADERPASS_DISTORTION) || defined(DEBUG_DISPLAY)
float3 distortion = SAMPLE_TEXTURE2D(_DistortionVectorMap, sampler_DistortionVectorMap, input.texCoord0).rgb;

102
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/StackLit/StackLitProperties.hlsl


TEXTURE2D(_BaseColorMap);
SAMPLER(sampler_BaseColorMap);
TEXTURE2D(_AmbientOcclusionMap);
SAMPLER(sampler_AmbientOcclusionMap);
TEXTURE2D(_MetallicMap);
SAMPLER(sampler_MetallicMap);

TEXTURE2D(_NormalMap);
SAMPLER(sampler_NormalMap);
TEXTURE2D(_AnisotropyMap);
SAMPLER(sampler_AnisotropyMap);
TEXTURE2D(_CoatSmoothnessMap);
SAMPLER(sampler_CoatSmoothnessMap);
TEXTURE2D(_IridescenceThicknessMap);
SAMPLER(sampler_IridescenceThicknessMap);
TEXTURE2D(_SubsurfaceMaskMap);
SAMPLER(sampler_SubsurfaceMaskMap);

TEXTURE2D(_EmissiveColorMap);
SAMPLER(sampler_EmissiveColorMap);
TEXTURE2D(_NormalMap);
SAMPLER(sampler_NormalMap);
CBUFFER_START(UnityPerMaterial)

float4 _MetallicMapChannelMask;
float4 _MetallicRange;
float _DielectricIor;
float _SmoothnessA;
float _SmoothnessAUseMap;
float _SmoothnessAMapUV;

float4 _SmoothnessAMap_MipInfo;
float4 _SmoothnessAMapChannelMask;
float4 _SmoothnessARange;
float4 _DebugLobeMask;
float4 _DebugAniso;
float _NormalScale;
float _NormalMapUV;
float _NormalMapUVLocal;
float _NormalMapObjSpace;
float4 _NormalMap_ST;
float4 _NormalMap_TexelSize;
float4 _NormalMap_MipInfo;
float _AmbientOcclusion;
float _AmbientOcclusionUseMap;
float _AmbientOcclusionMapUV;
float _AmbientOcclusionMapUVLocal;
float4 _AmbientOcclusionMap_ST;
float4 _AmbientOcclusionMap_TexelSize;
float4 _AmbientOcclusionMap_MipInfo;
float4 _AmbientOcclusionMapChannelMask;
float4 _AmbientOcclusionRange;
float _SmoothnessB;
float _SmoothnessBUseMap;
float _SmoothnessBMapUV;

float4 _SmoothnessBRange;
float _LobeMix;
float _NormalScale;
float _NormalMapUV;
float _NormalMapUVLocal;
float _NormalMapObjSpace;
float4 _NormalMap_ST;
float4 _NormalMap_TexelSize;
float4 _NormalMap_MipInfo;
float _Anisotropy;
float _AnisotropyUseMap;
float _AnisotropyMapUV;
float _AnisotropyMapUVLocal;
float4 _AnisotropyMap_ST;
float4 _AnisotropyMap_TexelSize;
float4 _AnisotropyMap_MipInfo;
float4 _AnisotropyMapChannelMask;
float4 _AnisotropyRange;
float3 _EmissiveColor;
float4 _EmissiveColorMap_ST;
float4 _EmissiveColorMap_TexelSize;
float4 _EmissiveColorMap_MipInfo;
float _EmissiveColorMapUV;
float _EmissiveColorMapUVLocal;
float _EmissiveIntensity;
float _AlbedoAffectEmissive;
float _CoatSmoothness;
float _CoatSmoothnessUseMap;
float _CoatSmoothnessMapUV;
float _CoatSmoothnessMapUVLocal;
float4 _CoatSmoothnessMap_ST;
float4 _CoatSmoothnessMap_TexelSize;
float4 _CoatSmoothnessMap_MipInfo;
float4 _CoatSmoothnessMapChannelMask;
float4 _CoatSmoothnessRange;
float _CoatIor;
float _CoatThickness;
float3 _CoatExtinction;
float _IridescenceThickness;
float _IridescenceThicknessUseMap;
float _IridescenceThicknessMapUV;
float _IridescenceThicknessMapUVLocal;
float4 _IridescenceThicknessMap_ST;
float4 _IridescenceThicknessMap_TexelSize;
float4 _IridescenceThicknessMap_MipInfo;
float4 _IridescenceThicknessMapChannelMask;
float4 _IridescenceThicknessRange;
float _IridescenceIor;
int _DiffusionProfile;
float _SubsurfaceMaskMapUVLocal;
float4 _SubsurfaceMaskMap_ST;
float4 _SubsurfaceMaskMap_TexelSize;
float4 _SubsurfaceMaskMap_MipInfo;

float _Thickness;
float _ThicknessUseMap;
float _ThicknessMapUV;
float _ThicknessMapUVLocal;
float3 _EmissiveColor;
float4 _EmissiveColorMap_ST;
float4 _EmissiveColorMap_TexelSize;
float4 _EmissiveColorMap_MipInfo;
float _EmissiveColorMapUV;
float _EmissiveColorMapUVLocal;
float _EmissiveIntensity;
float _AlbedoAffectEmissive;
float _AlphaCutoff;
float4 _DoubleSidedConstants;

16
ScriptableRenderPipeline/HDRenderPipeline/HDRP/RenderPipelineResources/BufferPyramidProcessor.cs


cmd.SetComputeTextureParam(m_DepthPyramidCS, kernel, _Source, src);
cmd.SetComputeTextureParam(m_DepthPyramidCS, kernel, _Result, dest);
// The compute shader work in texture space
// So we must provide the texture's size
srcWorkMip.width, srcWorkMip.height,
(1.0f / srcMip.width) * scale.x, (1.0f / srcMip.height) * scale.y)
src.rt.width, src.rt.height,
(1.0f / src.rt.width), (1.0f / src.rt.height))
);
cmd.DispatchCompute(

1
);
var dstMipWidthToCopy = Mathf.Min(targetTexture.rt.width >> (i + 1), dstWorkMip.width);
var dstMipHeightToCopy = Mathf.Min(targetTexture.rt.height >> (i + 1), dstWorkMip.height);
var dstMipWidthToCopy = Mathf.Min(Mathf.Min(targetTexture.rt.width >> (i + 1), dstWorkMip.width), mips[i].rt.width);
var dstMipHeightToCopy = Mathf.Min(Mathf.Min(targetTexture.rt.height >> (i + 1), dstWorkMip.height), mips[i].rt.height);
// If we could bind texture mips as UAV we could avoid this copy...(which moreover copies more than the needed viewport if not fullscreen)
cmd.CopyTexture(mips[i], 0, 0, 0, 0, dstMipWidthToCopy, dstMipHeightToCopy, targetTexture, 0, i + 1, 0, 0);

cmd.SetComputeVectorParam(
m_ColorPyramidCS,
_Size,
new Vector4(dest.width, dest.height, 1f / dest.width, 1f / dest.height)
new Vector4(src.width >> 1, src.height >> 1, 1f / (src.width >> 1), 1f / (src.height >> 1))
);
cmd.DispatchCompute(
m_ColorPyramidCS,

1
);
var dstMipWidthToCopy = Mathf.Min(targetTexture.width >> (i + 1), dstWorkMip.width);
var dstMipHeightToCopy = Mathf.Min(targetTexture.height >> (i + 1), dstWorkMip.height);
var dstMipWidthToCopy = Mathf.Min(Mathf.Min(targetTexture.width >> (i + 1), dstWorkMip.width), mips[i].width);
var dstMipHeightToCopy = Mathf.Min(Mathf.Min(targetTexture.height >> (i + 1), dstWorkMip.height), mips[i].height);
// If we could bind texture mips as UAV we could avoid this copy...(which moreover copies more than the needed viewport if not fullscreen)
cmd.CopyTexture(

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/ShaderVariablesFunctions.hlsl


return mul((float3x3)GetViewToHClipMatrix(), directionVS);
}
// This function always return the absolute position in WS either the CameraRelative mode is enabled or not
float3 GetAbsolutePositionWS(float3 positionWS)
{
#if (SHADEROPTIONS_CAMERA_RELATIVE_RENDERING != 0)

}
// This function always return the camera relative position in WS either the CameraRelative mode is enabled or not
float3 GetCameraRelativePositionWS(float3 positionWS)
{
#if (SHADEROPTIONS_CAMERA_RELATIVE_RENDERING != 0)

6
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Sky/AtmosphericScattering/VolumetricFog.cs


public override void PushShaderParameters(CommandBuffer cmd, FrameSettings frameSettings)
{
DensityVolumeParameters param;
param.albedo = albedo;
param.meanFreePath = meanFreePath;
param.asymmetry = asymmetry;
DensityVolumeParameters param = new DensityVolumeParameters(albedo, meanFreePath, asymmetry);
DensityVolumeData data = param.GetData();

178
Tests/UTF_Suites_HDRP/Resources/HDRP_Deferred.asset


defaultTestSettings: {fileID: 0}
defaultRenderPipeline: {fileID: 11400000, guid: d7fe5f39d2c099a4ea1f1f610af309d7,
type: 2}
alternateSettings:
- renderPipeline: {fileID: 11400000, guid: e0b837a0b8013cb4380a2f1286170857, type: 2}
testSettings: {fileID: 0}
- renderPipeline: {fileID: 11400000, guid: ae88914339ad0504eaca3f858706b8ad, type: 2}
testSettings: {fileID: 0}
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1101_Unlit.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1101_Unlit.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1101_Unlit.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1101_Unlit.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1102_Unlit_Distortion.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1102_Unlit_Distortion.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1102_Unlit_Distortion.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1102_Unlit_Distortion.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1103_Unlit_Distortion_DepthTest.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1103_Unlit_Distortion_DepthTest.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1103_Unlit_Distortion_DepthTest.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1103_Unlit_Distortion_DepthTest.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1201_Lit_Features.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1201_Lit_Features.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1201_Lit_Features.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1201_Lit_Features.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1202_Lit_DoubleSideNormalMode.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1202_Lit_DoubleSideNormalMode.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1202_Lit_DoubleSideNormalMode.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1202_Lit_DoubleSideNormalMode.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1203_Lit_Transparent.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1203_Lit_Transparent.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1203_Lit_Transparent.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1203_Lit_Transparent.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1204_Lit_Transparent_Fog.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1204_Lit_Transparent_Fog.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1204_Lit_Transparent_Fog.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1204_Lit_Transparent_Fog.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1205_Lit_Transparent_Refraction.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1205_Lit_Transparent_Refraction.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1205_Lit_Transparent_Refraction.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1205_Lit_Transparent_Refraction.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1206_Lit_Transparent_Distortion.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1206_Lit_Transparent_Distortion.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1206_Lit_Transparent_Distortion.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1206_Lit_Transparent_Distortion.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1207_Lit_Displacement.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1207_Lit_Displacement.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1207_Lit_Displacement.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1207_Lit_Displacement.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1208_Lit_Displacement_POM.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1208_Lit_Displacement_POM.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1208_Lit_Displacement_POM.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1208_Lit_Displacement_POM.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1209_Lit_Displacement_Vertex.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1209_Lit_Displacement_Vertex.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1209_Lit_Displacement_Vertex.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1209_Lit_Displacement_Vertex.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1210_Lit_BentNormal.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1210_Lit_BentNormal.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1210_Lit_BentNormal.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1210_Lit_BentNormal.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1211_Lit_Details.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1211_Lit_Details.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1211_Lit_Details.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1211_Lit_Details.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1212_Lit_Emission.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1212_Lit_Emission.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1212_Lit_Emission.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1212_Lit_Emission.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1301_SubSurfaceScattering.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1301_SubSurfaceScattering.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1301_SubSurfaceScattering.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1301_SubSurfaceScattering.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1302_SSS_MaxRadius.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1302_SSS_MaxRadius.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1302_SSS_MaxRadius.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1302_SSS_MaxRadius.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1303_SSS_Pre-Post.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1303_SSS_Pre-Post.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1303_SSS_Pre-Post.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1303_SSS_Pre-Post.unity
testTypes: 2
minimumUnityVersion: 4
platforms: -1

tests:
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2001_Dynamic_Directional.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2001_Dynamic_Directional.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2001_Dynamic_Directional.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2001_Dynamic_Directional.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2002_Dynamic_Mix.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2002_Dynamic_Mix.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2002_Dynamic_Mix.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2002_Dynamic_Mix.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2003_Light_Parameters.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2003_Light_Parameters.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2003_Light_Parameters.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2003_Light_Parameters.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2004_AnimatedCookie.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2004_AnimatedCookie.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2004_AnimatedCookie.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2004_AnimatedCookie.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2101_GI_Metapass.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2101_GI_Metapass.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2101_GI_Metapass.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2101_GI_Metapass.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2102_GI_Emission.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2102_GI_Emission.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2102_GI_Emission.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2102_GI_Emission.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2103_BakeMixed.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2103_BakeMixed.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2103_BakeMixed.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2103_BakeMixed.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2201_ReflectionProbes_Priority.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2201_ReflectionProbes_Priority.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2201_ReflectionProbes_Priority.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2201_ReflectionProbes_Priority.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2202_ReflectionProbes_Volume.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2202_ReflectionProbes_Volume.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2202_ReflectionProbes_Volume.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2202_ReflectionProbes_Volume.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2203_PlanarProbes.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2203_PlanarProbes.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2203_PlanarProbes.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2203_PlanarProbes.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2301_Shadow_Mask.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2206_ProbeRoughness.unity
scene: {fileID: 102900000, guid: fde2b1b0825ef5f40a0e5069afcca848, type: 3}
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2206_ProbeRoughness.unity
testTypes: 2
minimumUnityVersion: 4
platforms: -1
run: 0
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2301_Shadow_Mask.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2301_Shadow_Mask.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2301_Shadow_Mask.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2401_Light_on_Tesselation.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2401_Light_on_Tesselation.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2401_Light_on_Tesselation.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2401_Light_on_Tesselation.unity
testTypes: 2
minimumUnityVersion: 4
platforms: -1

tests:
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3001_DebugView.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3001_DebugView.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3001_DebugView.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3001_DebugView.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3002_ObjectMotionVector.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3002_ObjectMotionVector.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3002_ObjectMotionVector.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3002_ObjectMotionVector.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3003_CameraMotionVector_TranslateX.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3003_CameraMotionVector_TranslateX.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3003_CameraMotionVector_TranslateX.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3003_CameraMotionVector_TranslateX.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3004_CameraMotionVector_TranslateY.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3004_CameraMotionVector_TranslateY.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3004_CameraMotionVector_TranslateY.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3004_CameraMotionVector_TranslateY.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3005_CameraMotionVector_TranslateZ.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3005_CameraMotionVector_TranslateZ.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3005_CameraMotionVector_TranslateZ.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3005_CameraMotionVector_TranslateZ.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3006_CameraMotionVector_RotateX.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3006_CameraMotionVector_RotateX.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3006_CameraMotionVector_RotateX.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3006_CameraMotionVector_RotateX.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3007_CameraMotionVector_RotateY.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3007_CameraMotionVector_RotateY.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3007_CameraMotionVector_RotateY.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3007_CameraMotionVector_RotateY.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3008_CameraMotionVector_RotateZ.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3008_CameraMotionVector_RotateZ.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3008_CameraMotionVector_RotateZ.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3008_CameraMotionVector_RotateZ.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3009_CameraMotionVector_FOV.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3009_CameraMotionVector_FOV.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3009_CameraMotionVector_FOV.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3009_CameraMotionVector_FOV.unity
testTypes: 2
minimumUnityVersion: 4
platforms: -1

tests:
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/9x_Other/9001_Decals.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/9x_Other/9001_Decals.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/9x_Other/9001_Decals.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/9x_Other/9001_Decals.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/9x_Other/9002_Deferred-and-Forward.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/9x_Other/9002_Deferred-and-Forward.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/9x_Other/9002_Deferred-and-Forward.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/9x_Other/9002_Deferred-and-Forward.unity
suiteVersion: 2
suiteVersion: 8

174
Tests/UTF_Suites_HDRP/Resources/HDRP_Forward.asset


defaultTestSettings: {fileID: 0}
defaultRenderPipeline: {fileID: 11400000, guid: d206727e1fcd98842b54b98db4dfce28,
type: 2}
alternateSettings: []
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1101_Unlit.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1101_Unlit.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1101_Unlit.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1101_Unlit.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1102_Unlit_Distortion.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1102_Unlit_Distortion.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1102_Unlit_Distortion.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1102_Unlit_Distortion.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1103_Unlit_Distortion_DepthTest.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1103_Unlit_Distortion_DepthTest.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1103_Unlit_Distortion_DepthTest.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1103_Unlit_Distortion_DepthTest.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1201_Lit_Features.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1201_Lit_Features.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1201_Lit_Features.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1201_Lit_Features.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1202_Lit_DoubleSideNormalMode.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1202_Lit_DoubleSideNormalMode.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1202_Lit_DoubleSideNormalMode.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1202_Lit_DoubleSideNormalMode.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1203_Lit_Transparent.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1203_Lit_Transparent.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1203_Lit_Transparent.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1203_Lit_Transparent.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1204_Lit_Transparent_Fog.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1204_Lit_Transparent_Fog.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1204_Lit_Transparent_Fog.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1204_Lit_Transparent_Fog.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1205_Lit_Transparent_Refraction.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1205_Lit_Transparent_Refraction.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1205_Lit_Transparent_Refraction.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1205_Lit_Transparent_Refraction.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1206_Lit_Transparent_Distortion.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1206_Lit_Transparent_Distortion.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1206_Lit_Transparent_Distortion.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1206_Lit_Transparent_Distortion.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1207_Lit_Displacement.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1207_Lit_Displacement.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1207_Lit_Displacement.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1207_Lit_Displacement.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1208_Lit_Displacement_POM.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1208_Lit_Displacement_POM.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1208_Lit_Displacement_POM.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1208_Lit_Displacement_POM.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1209_Lit_Displacement_Vertex.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1209_Lit_Displacement_Vertex.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1209_Lit_Displacement_Vertex.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1209_Lit_Displacement_Vertex.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1210_Lit_BentNormal.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1210_Lit_BentNormal.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1210_Lit_BentNormal.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1210_Lit_BentNormal.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1211_Lit_Details.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1211_Lit_Details.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1211_Lit_Details.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1211_Lit_Details.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1212_Lit_Emission.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1212_Lit_Emission.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1212_Lit_Emission.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1212_Lit_Emission.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1301_SubSurfaceScattering.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1301_SubSurfaceScattering.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1301_SubSurfaceScattering.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1301_SubSurfaceScattering.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1302_SSS_MaxRadius.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1302_SSS_MaxRadius.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1302_SSS_MaxRadius.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1302_SSS_MaxRadius.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1303_SSS_Pre-Post.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1303_SSS_Pre-Post.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1303_SSS_Pre-Post.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/1x_Materials/1303_SSS_Pre-Post.unity
testTypes: 2
minimumUnityVersion: 4
platforms: -1

tests:
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2001_Dynamic_Directional.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2001_Dynamic_Directional.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2001_Dynamic_Directional.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2001_Dynamic_Directional.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2002_Dynamic_Mix.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2002_Dynamic_Mix.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2002_Dynamic_Mix.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2002_Dynamic_Mix.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2003_Light_Parameters.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2003_Light_Parameters.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2003_Light_Parameters.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2003_Light_Parameters.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2004_AnimatedCookie.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2004_AnimatedCookie.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2004_AnimatedCookie.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2004_AnimatedCookie.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2101_GI_Metapass.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2101_GI_Metapass.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2101_GI_Metapass.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2101_GI_Metapass.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2102_GI_Emission.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2102_GI_Emission.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2102_GI_Emission.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2102_GI_Emission.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2103_BakeMixed.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2103_BakeMixed.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2103_BakeMixed.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2103_BakeMixed.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2201_ReflectionProbes_Priority.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2201_ReflectionProbes_Priority.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2201_ReflectionProbes_Priority.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2201_ReflectionProbes_Priority.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2202_ReflectionProbes_Volume.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2202_ReflectionProbes_Volume.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2202_ReflectionProbes_Volume.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2202_ReflectionProbes_Volume.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2203_PlanarProbes.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2203_PlanarProbes.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2203_PlanarProbes.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2203_PlanarProbes.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2301_Shadow_Mask.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2206_ProbeRoughness.unity
scene: {fileID: 102900000, guid: fde2b1b0825ef5f40a0e5069afcca848, type: 3}
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2206_ProbeRoughness.unity
testTypes: 2
minimumUnityVersion: 4
platforms: -1
run: 0
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2301_Shadow_Mask.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2301_Shadow_Mask.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2301_Shadow_Mask.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2401_Light_on_Tesselation.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2401_Light_on_Tesselation.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2401_Light_on_Tesselation.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/2x_Lighting/2401_Light_on_Tesselation.unity
testTypes: 2
minimumUnityVersion: 4
platforms: -1

tests:
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3001_DebugView.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3001_DebugView.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3001_DebugView.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3001_DebugView.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3002_ObjectMotionVector.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3002_ObjectMotionVector.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3002_ObjectMotionVector.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3002_ObjectMotionVector.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3003_CameraMotionVector_TranslateX.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3003_CameraMotionVector_TranslateX.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3003_CameraMotionVector_TranslateX.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3003_CameraMotionVector_TranslateX.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3004_CameraMotionVector_TranslateY.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3004_CameraMotionVector_TranslateY.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3004_CameraMotionVector_TranslateY.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3004_CameraMotionVector_TranslateY.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3005_CameraMotionVector_TranslateZ.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3005_CameraMotionVector_TranslateZ.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3005_CameraMotionVector_TranslateZ.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3005_CameraMotionVector_TranslateZ.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3006_CameraMotionVector_RotateX.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3006_CameraMotionVector_RotateX.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3006_CameraMotionVector_RotateX.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3006_CameraMotionVector_RotateX.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3007_CameraMotionVector_RotateY.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3007_CameraMotionVector_RotateY.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3007_CameraMotionVector_RotateY.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3007_CameraMotionVector_RotateY.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3008_CameraMotionVector_RotateZ.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3008_CameraMotionVector_RotateZ.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3008_CameraMotionVector_RotateZ.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3008_CameraMotionVector_RotateZ.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3009_CameraMotionVector_FOV.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3009_CameraMotionVector_FOV.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3009_CameraMotionVector_FOV.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/3x_DebugView/3009_CameraMotionVector_FOV.unity
testTypes: 2
minimumUnityVersion: 4
platforms: -1

tests:
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/9x_Other/9001_Decals.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/9x_Other/9001_Decals.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/9x_Other/9001_Decals.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/9x_Other/9001_Decals.unity
- name: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/9x_Other/9002_Deferred-and-Forward.unity
- name: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/9x_Other/9002_Deferred-and-Forward.unity
scenePath: Assets/SRP/Tests/UTF_Tests_HDRP/Scenes/9x_Other/9002_Deferred-and-Forward.unity
scenePath: Assets/ScriptableRenderPipeline/Tests/UTF_Tests_HDRP/Scenes/9x_Other/9002_Deferred-and-Forward.unity
suiteVersion: 2
suiteVersion: 4

8
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/Volumetric.meta


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

128
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/VolumeTextureAtlas.cs


using System;
using System.Collections.Generic;
using Unity.Collections.LowLevel.Unsafe;
using UnityEngine;
using UnityEngine.Rendering;
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
public class VolumeTextureAtlas
{
private List<Texture3D> textures = null;
//Assuming every volume texture is square and number of depth slices equal to 2D dimensions
private int requiredTextureSize;
private TextureFormat requiredTextureFormat;
public bool needTextureUpdate
{
get;
private set;
}
public Texture3D volumeAtlas
{
get;
private set;
}
public event Action OnAtlasUpdated;
private void NotifyAtlasUpdated()
{
if (OnAtlasUpdated != null)
{
OnAtlasUpdated();
}
}
public VolumeTextureAtlas(TextureFormat atlasFormat, int atlasSize )
{
requiredTextureSize = atlasSize;
requiredTextureFormat = atlasFormat;
textures = new List<Texture3D>();
needTextureUpdate = false;
}
public void ClearTextures()
{
textures.Clear();
needTextureUpdate = true;
}
public void AddTexture(Texture3D volumeTexture)
{
//TODO: we should really just convert the texture to the right size and format...HOWEVER, we dont' support 3D textures at the moment in the ConvertTexture call
if (volumeTexture.width != requiredTextureSize || volumeTexture.height != requiredTextureSize || volumeTexture.depth != requiredTextureSize)
{
Debug.LogError(string.Format("VolumeTextureAtlas: Dimensions of texture {0} does not match expected dimensions of {1}", volumeTexture, requiredTextureSize));
return;
}
if (volumeTexture.format != requiredTextureFormat)
{
Debug.LogError(string.Format("VolumeTextureAtlas: Texture format of texture {0} : {1} does not match expected format of {2}", volumeTexture, volumeTexture.format, requiredTextureSize));
return;
}
if (!textures.Contains(volumeTexture))
{
textures.Add(volumeTexture);
needTextureUpdate = true;
}
}
public void RemoveTexture(Texture3D volumeTexture)
{
if (textures.Contains(volumeTexture))
{
textures.Add(volumeTexture);
needTextureUpdate = true;
}
}
//Generates the volume atlas by converting (if needed) and then copying the textures into one big volume texture.
public void GenerateVolumeAtlas(CommandBuffer cmd)
{
if (needTextureUpdate)
{
if (textures.Count > 0)
{
Color[] colorArray = new Color[0];
volumeAtlas = new Texture3D(requiredTextureSize, requiredTextureSize, requiredTextureSize * textures.Count, requiredTextureFormat, false);
foreach (Texture3D tex in textures)
{
//TODO: Need to have copy texture and convert texture working for Tex3D in order for this to be
//more robust
Color[] texColor = tex.GetPixels();
Array.Resize(ref colorArray, texColor.Length + colorArray.Length);
Array.Copy(texColor, 0, colorArray, colorArray.Length - texColor.Length, texColor.Length);
}
volumeAtlas.SetPixels(colorArray);
volumeAtlas.Apply();
}
else
{
volumeAtlas = null;
}
needTextureUpdate = false;
NotifyAtlasUpdated();
}
}
public int GetTextureIndex(Texture3D tex)
{
return textures.IndexOf(tex);
}
}
}

11
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/VolumeTextureAtlas.cs.meta


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

108
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/Volumetric/Texture3DCreationEditor.cs


using System;
using UnityEngine;
using System.Collections.Generic;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Experimental.Rendering.HDPipeline;
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
//This Editor window is a quick way to generate 3D Textures for the Volumetric system.
//It will take a sourceTexture and slice it up into tiles that will fill a 3D Texture
//The volumetric system has a hardcoded size of 32x32x32 volume texture atlas so this tool makes sure it fits that size.
public class Texture3DCreationEditor : EditorWindow
{
private Texture2D sourceTexture = null;
private string sourcePath = null;
private int tileSize = DensityVolumeManager.volumeTextureSize;
private int numXTiles
{
get { return sourceTexture != null ? sourceTexture.width / tileSize : 0;}
set {}
}
private int numYTiles
{
get{ return sourceTexture != null ? sourceTexture.height / tileSize : 0; }
set {}
}
private bool validData
{
get { return numXTiles * numYTiles >= tileSize; }
set{}
}
[MenuItem("Window/Render Pipeline/Create 3D Texture")]
private static void Init()
{
Texture3DCreationEditor window = (Texture3DCreationEditor)EditorWindow.GetWindow(typeof(Texture3DCreationEditor));
window.titleContent.text = "Create Texture3D Asset";
window.Show();
}
private void OnGUI()
{
EditorGUILayout.BeginVertical(EditorStyles.miniButton);
GUILayout.Button(new GUIContent(" Create Texture3D Asset", ""), EditorStyles.centeredGreyMiniLabel);
EditorGUILayout.Separator();
EditorGUILayout.LabelField("Source Texture");
sourceTexture = (Texture2D)EditorGUILayout.ObjectField(sourceTexture, typeof(Texture2D), false);
EditorGUILayout.HelpBox(String.Format("Volumetric system requires textures of size {0}x{0}x{0} so please ensure the source texture is at least this many pixels.", tileSize), MessageType.Info);
EditorGUILayout.Separator();
if(sourceTexture != null)
{
sourcePath = AssetDatabase.GetAssetPath(sourceTexture);
if (validData)
{
if (GUILayout.Button(new GUIContent("Generate 3D Texture", ""), EditorStyles.toolbarButton))
{
Generate3DTexture();
}
}
else
{
EditorGUILayout.HelpBox("Invalid Source Texture: Source texture size is not enough to create " + tileSize + " depthSlices.", MessageType.Error);
}
}
EditorGUILayout.EndVertical();
}
private void Generate3DTexture()
{
Texture3D texture = new Texture3D(tileSize, tileSize, tileSize, sourceTexture.format, false);
texture.wrapMode = sourceTexture.wrapMode;
texture.wrapModeU = sourceTexture.wrapModeU;
texture.wrapModeV = sourceTexture.wrapModeV;
texture.wrapModeW = sourceTexture.wrapModeW;
texture.filterMode = sourceTexture.filterMode;
texture.mipMapBias = 0;
texture.anisoLevel = 0;
Color[] colorArray = new Color[0];
for(int i = numYTiles - 1; i >= 0; --i)
{
for(int j = 0; j < numXTiles; ++j)
{
Color[] texColor = sourceTexture.GetPixels(j*tileSize, i*tileSize, tileSize, tileSize);
Array.Resize(ref colorArray, texColor.Length + colorArray.Length);
Array.Copy(texColor, 0, colorArray, colorArray.Length - texColor.Length, texColor.Length);
}
}
texture.SetPixels(colorArray);
texture.Apply();
AssetDatabase.CreateAsset(texture, System.IO.Directory.GetParent(sourcePath) + "\\" + sourceTexture.name + "_Texture3D.asset");
}
}
}

11
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/Volumetric/Texture3DCreationEditor.cs.meta


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

11
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/Volumetric/DensityVolumeEditor.cs.meta


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

63
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/Volumetric/DensityVolumeEditor.cs


using UnityEngine;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Experimental.Rendering.HDPipeline;
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
[CanEditMultipleObjects]
[CustomEditor(typeof(DensityVolume))]
class DensityVolumeEditor : Editor
{
private static GUIContent albedoLabel = new GUIContent("Scattering Color");
private static GUIContent meanFreePathLabel = new GUIContent("Mean Free Path");
private static GUIContent volumeTextureLabel = new GUIContent("Volume Texture Mask");
private static GUIContent textureScrollLabel = new GUIContent("Texture Scroll Speed");
private static GUIContent textureTileLabel = new GUIContent("Texture Tiling Amount");
private static GUIContent textureSettingsTitle = new GUIContent("Volume Texture Settings");
private bool showTextureParams = false;
SerializedProperty densityParams;
SerializedProperty albedo;
SerializedProperty meanFreePath;
SerializedProperty volumeTexture;
SerializedProperty textureScroll;
SerializedProperty textureTile;
void OnEnable()
{
densityParams = serializedObject.FindProperty("parameters");
albedo = densityParams.FindPropertyRelative("albedo");
meanFreePath = densityParams.FindPropertyRelative("meanFreePath");
volumeTexture = densityParams.FindPropertyRelative("volumeMask");
textureScroll = densityParams.FindPropertyRelative("textureScrollingSpeed");
textureTile = densityParams.FindPropertyRelative("textureTiling");
if (volumeTexture != null && volumeTexture.objectReferenceValue != null)
{
showTextureParams = true;
}
}
public override void OnInspectorGUI()
{
albedo.colorValue = EditorGUILayout.ColorField(albedoLabel, albedo.colorValue, true, false, false);
EditorGUILayout.PropertyField(meanFreePath, meanFreePathLabel);
EditorGUILayout.Space();
showTextureParams = EditorGUILayout.Foldout(showTextureParams, textureSettingsTitle, true);
if (showTextureParams)
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(volumeTexture, volumeTextureLabel);
EditorGUILayout.PropertyField(textureScroll, textureScrollLabel);
EditorGUILayout.PropertyField(textureTile, textureTileLabel);
EditorGUI.indentLevel--;
}
serializedObject.ApplyModifiedProperties ();
}
}
}

/ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/HomogeneousDensityVolume.cs.meta → /ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/DensityVolume.cs.meta

/ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/HomogeneousDensityVolume.cs → /ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/DensityVolume.cs

正在加载...
取消
保存