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
1 change: 1 addition & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed shadowmask UI now correctly showing shadowmask disable
- Made more explicit the warning about raytracing and asynchronous compute. Also fixed the condition in which it appears.
- Fixed a null ref exception in static sky when the default volume profile is invalid.
- Fixed issue with screen-space shadows not enabled properly when RT is disabled (case 1235821)

### Changed
- Improve MIP selection for decals on Transparents
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,27 +246,22 @@ void RenderScreenSpaceShadows(HDCamera hdCamera, CommandBuffer cmd)
return;
}

if (hdCamera.frameSettings.IsEnabled(FrameSettingsField.RayTracing))
using (new ProfilingScope(cmd, ProfilingSampler.Get(HDProfileId.ScreenSpaceShadows)))
{
using (new ProfilingScope(cmd, ProfilingSampler.Get(HDProfileId.ScreenSpaceShadows)))
{
// First of all we handle the directional light
RenderDirectionalLightScreenSpaceShadow(cmd, hdCamera);
// First of all we handle the directional light
RenderDirectionalLightScreenSpaceShadow(cmd, hdCamera);

if (hdCamera.frameSettings.IsEnabled(FrameSettingsField.RayTracing))
{
// We handle the other light sources
RenderLightScreenSpaceShadows(hdCamera, cmd);
}

// We do render the debug view
EvaluateShadowDebugView(cmd, hdCamera);
// We do render the debug view
EvaluateShadowDebugView(cmd, hdCamera);

// Big the right texture
cmd.SetGlobalTexture(HDShaderIDs._ScreenSpaceShadowsTexture, m_ScreenSpaceShadowTextureArray);
}
}
else
{
// We bind the black texture in this case
BindBlackShadowTexture(cmd);
// Bind the right texture
cmd.SetGlobalTexture(HDShaderIDs._ScreenSpaceShadowsTexture, m_ScreenSpaceShadowTextureArray);
}
}

Expand Down Expand Up @@ -911,12 +906,20 @@ void RenderPunctualScreenSpaceShadow(CommandBuffer cmd, HDCamera hdCamera

void EvaluateShadowDebugView(CommandBuffer cmd, HDCamera hdCamera)
{
ComputeShader shadowFilter = m_Asset.renderPipelineRayTracingResources.shadowFilterCS;

// If this is the right debug mode and the index we are asking for is in the range
HDRenderPipeline hdrp = (RenderPipelineManager.currentPipeline as HDRenderPipeline);
if (FullScreenDebugMode.ScreenSpaceShadows == hdrp.m_CurrentDebugDisplaySettings.data.fullScreenDebugMode)
{
if (!hdrp.rayTracingSupported)
{
// In this case we have not rendered any screenspace shadows, so push a black texture on the debug display
hdrp.PushFullScreenDebugTexture(hdCamera, cmd, TextureXR.GetBlackTextureArray(), FullScreenDebugMode.ScreenSpaceShadows);
return;
}

// TODO: move the debug kernel outside of the ray tracing resources
ComputeShader shadowFilter = m_Asset.renderPipelineRayTracingResources.shadowFilterCS;

// Texture dimensions
int texWidth = hdCamera.actualWidth;
int texHeight = hdCamera.actualHeight;
Expand Down