Skip to content

Fixed the planar depth texture not being properly created and rendered to (case 1299617). #2926

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 18, 2020
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 @@ -40,6 +40,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed display of LOD Bias and maximum level in frame settings when using Quality Levels
- Fixed an issue when trying to open a look dev env library when Look Dev is not supported.
- Fixed shader graph not supporting indirectdxr multibounce (case 1294694).
- Fixed the planar depth texture not being properly created and rendered to (case 1299617).

### Changed
- Removed the material pass probe volumes evaluation mode.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,17 +294,22 @@ void ExecuteWithRenderGraph(RenderRequest renderRequest,
for (int viewIndex = 0; viewIndex < hdCamera.viewCount; ++viewIndex)
{
BlitFinalCameraTexture(m_RenderGraph, hdCamera, postProcessDest, backBuffer, viewIndex);

if (target.targetDepth != null)
{
BlitFinalCameraTexture(m_RenderGraph, hdCamera, prepassOutput.resolvedDepthBuffer, m_RenderGraph.ImportTexture(target.targetDepth), viewIndex);
}
}

if (aovRequest.isValid)
aovRequest.PushCameraTexture(m_RenderGraph, AOVBuffers.Output, hdCamera, postProcessDest, aovBuffers);
}

// This code is only for planar reflections. Given that the depth texture cannot be shared currently with the other depth copy that we do
// we need to do this seperately.
for (int viewIndex = 0; viewIndex < hdCamera.viewCount; ++viewIndex)
{
if (target.targetDepth != null)
{
BlitFinalCameraTexture(m_RenderGraph, hdCamera, prepassOutput.resolvedDepthBuffer, m_RenderGraph.ImportTexture(target.targetDepth), viewIndex);
}
}

// XR mirror view and blit do device
EndCameraXR(m_RenderGraph, hdCamera);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,13 +341,15 @@ public static void Render(
[Obsolete("Use CreateReflectionProbeRenderTarget with explicit format instead", true)]
public static RenderTexture CreateReflectionProbeRenderTarget(int cubemapSize)
{
return new RenderTexture(cubemapSize, cubemapSize, 1, GraphicsFormat.R16G16B16A16_SFloat)
RenderTexture rt = new RenderTexture(cubemapSize, cubemapSize, 1, GraphicsFormat.R16G16B16A16_SFloat)
{
dimension = TextureDimension.Cube,
enableRandomWrite = true,
useMipMap = true,
autoGenerateMips = false
};
rt.Create();
return rt;
}

/// <summary>
Expand All @@ -358,13 +360,15 @@ public static RenderTexture CreateReflectionProbeRenderTarget(int cubemapSize)
/// <returns>The texture to use as reflection probe target.</returns>
public static RenderTexture CreateReflectionProbeRenderTarget(int cubemapSize, GraphicsFormat format)
{
return new RenderTexture(cubemapSize, cubemapSize, 1, format)
RenderTexture rt = new RenderTexture(cubemapSize, cubemapSize, 1, format)
{
dimension = TextureDimension.Cube,
enableRandomWrite = true,
useMipMap = true,
autoGenerateMips = false
};
rt.Create();
return rt;
}

/// <summary>
Expand All @@ -375,13 +379,15 @@ public static RenderTexture CreateReflectionProbeRenderTarget(int cubemapSize, G
/// <returns>The texture used as planar reflection probe target</returns>
public static RenderTexture CreatePlanarProbeRenderTarget(int planarSize, GraphicsFormat format)
{
return new RenderTexture(planarSize, planarSize, 1, format)
RenderTexture rt = new RenderTexture(planarSize, planarSize, 1, format)
{
dimension = TextureDimension.Tex2D,
enableRandomWrite = true,
useMipMap = true,
autoGenerateMips = false
};
rt.Create();
return rt;
}

/// <summary>
Expand All @@ -391,13 +397,15 @@ public static RenderTexture CreatePlanarProbeRenderTarget(int planarSize, Graphi
/// <returns>The texture used as planar reflection probe target</returns>
public static RenderTexture CreatePlanarProbeDepthRenderTarget(int planarSize)
{
return new RenderTexture(planarSize, planarSize, 1, GraphicsFormat.R32_SFloat)
RenderTexture rt = new RenderTexture(planarSize, planarSize, 1, GraphicsFormat.R32_SFloat)
{
dimension = TextureDimension.Tex2D,
enableRandomWrite = true,
useMipMap = true,
autoGenerateMips = false
};
rt.Create();
return rt;
}

/// <summary>
Expand Down