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 @@ -46,6 +46,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed a warning when enabling tile/cluster debug.
- Fix recursive rendering transmittance over the sky (case 1323945).
- Fixed specular anti aliasing for layeredlit shader.
- Fixed lens flare occlusion issues with transparent depth. It had the wrong depth bound (1365098)

### Changed
- Visual Environment ambient mode is now Dynamic by default.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ TextureHandle RenderPostProcess(RenderGraph renderGraph,
// HDRP to reduce the amount of resolution lost at the center of the screen
source = PaniniProjectionPass(renderGraph, hdCamera, source);

source = LensFlareDataDrivenPass(renderGraph, hdCamera, source);
source = LensFlareDataDrivenPass(renderGraph, hdCamera, source, depthBuffer);

TextureHandle bloomTexture = BloomPass(renderGraph, hdCamera, source);
TextureHandle logLutOutput = ColorGradingPass(renderGraph, hdCamera);
Expand Down Expand Up @@ -3061,11 +3061,12 @@ class LensFlareData
{
public LensFlareParameters parameters;
public TextureHandle source;
public TextureHandle depthBuffer;
public HDCamera hdCamera;
public Vector2Int viewport;
}

TextureHandle LensFlareDataDrivenPass(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle source)
TextureHandle LensFlareDataDrivenPass(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle source, TextureHandle depthBuffer)
{
if (m_LensFlareDataDataDrivenFS && !LensFlareCommonSRP.Instance.IsEmpty())
{
Expand All @@ -3075,6 +3076,7 @@ TextureHandle LensFlareDataDrivenPass(RenderGraph renderGraph, HDCamera hdCamera
passData.parameters = PrepareLensFlareParameters(hdCamera);
passData.viewport = postProcessViewportSize;
passData.hdCamera = hdCamera;
passData.depthBuffer = depthBuffer;
TextureHandle dest = GetPostprocessUpsampledOutputHandle(renderGraph, "Lens Flare Destination");

builder.SetRenderFunc(
Expand All @@ -3083,6 +3085,8 @@ TextureHandle LensFlareDataDrivenPass(RenderGraph renderGraph, HDCamera hdCamera
float width = (float)data.viewport.x;
float height = (float)data.viewport.y;

ctx.cmd.SetGlobalTexture(HDShaderIDs._CameraDepthTexture, data.depthBuffer);

LensFlareCommonSRP.DoLensFlareDataDrivenCommon(
data.parameters.lensFlareShader, data.parameters.lensFlares, data.hdCamera.camera, width, height,
data.parameters.usePanini, data.parameters.paniniDistance, data.parameters.paniniCropToFit,
Expand Down