Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
Version Updated
The version number for this package has increased due to a version update of a related graphics package.

### Added
- Exposed the API to access HDRP shader pass names.

### Fixed
- Fixed a null reference exception when creating a diffusion profile asset.
- Fixed the diffusion profile not being registered as a dependency of the ShaderGraph.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,60 +1,101 @@
namespace UnityEngine.Rendering.HighDefinition
{
static class HDShaderPassNames
/// <summary>Pass names and shader ids used in HDRP. these names can be used as filters when rendering objects in a custom pass or a DrawRenderers() call.</summary>
public static class HDShaderPassNames
{
// ShaderPass string - use to have consistent name through the code
/// <summary>Empty pass name.</summary>
public static readonly string s_EmptyStr = "";
/// <summary>Forward pass name.</summary>
public static readonly string s_ForwardStr = "Forward";
/// <summary>Depth Only pass name.</summary>
public static readonly string s_DepthOnlyStr = "DepthOnly";
/// <summary>Depth Forward Only pass name.</summary>
public static readonly string s_DepthForwardOnlyStr = "DepthForwardOnly";
/// <summary>Forward Only pass name.</summary>
public static readonly string s_ForwardOnlyStr = "ForwardOnly";
/// <summary>GBuffer pass name.</summary>
public static readonly string s_GBufferStr = "GBuffer";
/// <summary>GBuffer With Prepass pass name.</summary>
public static readonly string s_GBufferWithPrepassStr = "GBufferWithPrepass";
/// <summary>Legacy Unlit cross pipeline pass name.</summary>
public static readonly string s_SRPDefaultUnlitStr = "SRPDefaultUnlit";
/// <summary>Motion Vectors pass name.</summary>
public static readonly string s_MotionVectorsStr = "MotionVectors";
/// <summary>Distortion Vectors pass name.</summary>
public static readonly string s_DistortionVectorsStr = "DistortionVectors";
/// <summary>Transparent Depth Prepass pass name.</summary>
public static readonly string s_TransparentDepthPrepassStr = "TransparentDepthPrepass";
/// <summary>Transparent Backface pass name.</summary>
public static readonly string s_TransparentBackfaceStr = "TransparentBackface";
/// <summary>Transparent Depth Postpass pass name.</summary>
public static readonly string s_TransparentDepthPostpassStr = "TransparentDepthPostpass";
/// <summary>RayTracing Prepass pass name.</summary>
public static readonly string s_RayTracingPrepassStr = "RayTracingPrepass";
/// <summary>Visibility DXR pass name.</summary>
public static readonly string s_RayTracingVisibilityStr = "VisibilityDXR";
/// <summary>PathTracing DXR pass name.</summary>
public static readonly string s_PathTracingDXRStr = "PathTracingDXR";
/// <summary>META pass name.</summary>
public static readonly string s_MetaStr = "META";
/// <summary>Shadow Caster pass name.</summary>
public static readonly string s_ShadowCasterStr = "ShadowCaster";
/// <summary>FullScreen Debug pass name.</summary>
public static readonly string s_FullScreenDebugStr = "FullScreenDebug";
/// <summary>DBuffer Projector pass name.</summary>
public static readonly string s_DBufferProjectorStr = DecalSystem.s_MaterialDecalPassNames[(int)DecalSystem.MaterialDecalPass.DBufferProjector];
/// <summary>Decal Projector Forward Emissive pass name.</summary>
public static readonly string s_DecalProjectorForwardEmissiveStr = DecalSystem.s_MaterialDecalPassNames[(int)DecalSystem.MaterialDecalPass.DecalProjectorForwardEmissive];
/// <summary>DBuffer Mesh pass name.</summary>
public static readonly string s_DBufferMeshStr = DecalSystem.s_MaterialDecalPassNames[(int)DecalSystem.MaterialDecalPass.DBufferMesh];
/// <summary>Decal Mesh Forward Emissive pass name.</summary>
public static readonly string s_DecalMeshForwardEmissiveStr = DecalSystem.s_MaterialDecalPassNames[(int)DecalSystem.MaterialDecalPass.DecalMeshForwardEmissive];

// ShaderPass name
/// <summary>Empty shader tag id.</summary>
public static readonly ShaderTagId s_EmptyName = new ShaderTagId(s_EmptyStr);
/// <summary>Forward shader tag id.</summary>
public static readonly ShaderTagId s_ForwardName = new ShaderTagId(s_ForwardStr);
/// <summary>Depth Only shader tag id.</summary>
public static readonly ShaderTagId s_DepthOnlyName = new ShaderTagId(s_DepthOnlyStr);
/// <summary>Depth Forward Only shader tag id.</summary>
public static readonly ShaderTagId s_DepthForwardOnlyName = new ShaderTagId(s_DepthForwardOnlyStr);
/// <summary>Forward Only shader tag id.</summary>
public static readonly ShaderTagId s_ForwardOnlyName = new ShaderTagId(s_ForwardOnlyStr);
/// <summary>GBuffer shader tag id.</summary>
public static readonly ShaderTagId s_GBufferName = new ShaderTagId(s_GBufferStr);
/// <summary>GBufferWithPrepass shader tag id.</summary>
public static readonly ShaderTagId s_GBufferWithPrepassName = new ShaderTagId(s_GBufferWithPrepassStr);
/// <summary>Legacy Unlit cross pipeline shader tag id.</summary>
public static readonly ShaderTagId s_SRPDefaultUnlitName = new ShaderTagId(s_SRPDefaultUnlitStr);
/// <summary>Motion Vectors shader tag id.</summary>
public static readonly ShaderTagId s_MotionVectorsName = new ShaderTagId(s_MotionVectorsStr);
/// <summary>Distortion Vectors shader tag id.</summary>
public static readonly ShaderTagId s_DistortionVectorsName = new ShaderTagId(s_DistortionVectorsStr);
/// <summary>Transparent Depth Prepass shader tag id.</summary>
public static readonly ShaderTagId s_TransparentDepthPrepassName = new ShaderTagId(s_TransparentDepthPrepassStr);
/// <summary>Transparent Backface shader tag id.</summary>
public static readonly ShaderTagId s_TransparentBackfaceName = new ShaderTagId(s_TransparentBackfaceStr);
/// <summary>Transparent Depth Postpass shader tag id.</summary>
public static readonly ShaderTagId s_TransparentDepthPostpassName = new ShaderTagId(s_TransparentDepthPostpassStr);
/// <summary>RayTracing Prepass shader tag id.</summary>
public static readonly ShaderTagId s_RayTracingPrepassName = new ShaderTagId(s_RayTracingPrepassStr);
/// <summary>FullScreen Debug shader tag id.</summary>
public static readonly ShaderTagId s_FullScreenDebugName = new ShaderTagId(s_FullScreenDebugStr);

/// <summary>DBuffer Mesh shader tag id.</summary>
public static readonly ShaderTagId s_DBufferMeshName = new ShaderTagId(s_DBufferMeshStr);
/// <summary>Decal Mesh Forward Emissive shader tag id.</summary>
public static readonly ShaderTagId s_DecalMeshForwardEmissiveName = new ShaderTagId(s_DecalMeshForwardEmissiveStr);

// Legacy name
public static readonly ShaderTagId s_AlwaysName = new ShaderTagId("Always");
public static readonly ShaderTagId s_ForwardBaseName = new ShaderTagId("ForwardBase");
public static readonly ShaderTagId s_DeferredName = new ShaderTagId("Deferred");
public static readonly ShaderTagId s_PrepassBaseName = new ShaderTagId("PrepassBase");
public static readonly ShaderTagId s_VertexName = new ShaderTagId("Vertex");
public static readonly ShaderTagId s_VertexLMRGBMName = new ShaderTagId("VertexLMRGBM");
public static readonly ShaderTagId s_VertexLMName = new ShaderTagId("VertexLM");
internal static readonly ShaderTagId s_AlwaysName = new ShaderTagId("Always");
internal static readonly ShaderTagId s_ForwardBaseName = new ShaderTagId("ForwardBase");
internal static readonly ShaderTagId s_DeferredName = new ShaderTagId("Deferred");
internal static readonly ShaderTagId s_PrepassBaseName = new ShaderTagId("PrepassBase");
internal static readonly ShaderTagId s_VertexName = new ShaderTagId("Vertex");
internal static readonly ShaderTagId s_VertexLMRGBMName = new ShaderTagId("VertexLMRGBM");
internal static readonly ShaderTagId s_VertexLMName = new ShaderTagId("VertexLM");
}

// Pre-hashed shader ids - naming conventions are a bit off in this file as we use the same
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ protected override void Execute(CustomPassContext ctx)
stencilState = new StencilState(false),
};

PerObjectData renderConfig = ctx.hdCamera.frameSettings.IsEnabled(FrameSettingsField.Shadowmask) ? HDUtils.k_RendererConfigurationBakedLightingWithShadowMask : HDUtils.k_RendererConfigurationBakedLighting;
PerObjectData renderConfig = ctx.hdCamera.frameSettings.IsEnabled(FrameSettingsField.Shadowmask) ? HDUtils.GetBakedLightingWithShadowMaskRenderConfig() : HDUtils.GetBakedLightingRenderConfig();

var result = new RendererListDesc(shaderPasses, ctx.cullingResults, ctx.hdCamera.camera)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ public class HDUtils
internal const PerObjectData k_RendererConfigurationBakedLighting = PerObjectData.LightProbe | PerObjectData.Lightmaps | PerObjectData.LightProbeProxyVolume;
internal const PerObjectData k_RendererConfigurationBakedLightingWithShadowMask = k_RendererConfigurationBakedLighting | PerObjectData.OcclusionProbe | PerObjectData.OcclusionProbeProxyVolume | PerObjectData.ShadowMask;

/// <summary>Returns the render configuration for baked static lighting, this value can be used in a RendererListDesc call to render Lit objects.</summary>
public static PerObjectData GetBakedLightingRenderConfig() => k_RendererConfigurationBakedLighting;
/// <summary>Returns the render configuration for baked static lighting with shadow masks, this value can be used in a RendererListDesc call to render Lit objects when shadow masks are enabled.</summary>
public static PerObjectData GetBakedLightingWithShadowMaskRenderConfig() => k_RendererConfigurationBakedLightingWithShadowMask;

/// <summary>Default HDAdditionalReflectionData</summary>
static internal HDAdditionalReflectionData s_DefaultHDAdditionalReflectionData { get { return ComponentSingleton<HDAdditionalReflectionData>.instance; } }
/// <summary>Default HDAdditionalLightData</summary>
Expand Down