diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/LensFlareCommonSRP.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/LensFlareCommonSRP.cs index a004846a974..82618eb2af5 100644 --- a/com.unity.render-pipelines.core/Runtime/PostProcessing/LensFlareCommonSRP.cs +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/LensFlareCommonSRP.cs @@ -666,6 +666,12 @@ static public void DoLensFlareDataDrivenCommon(Material lensFlareShader, LensFla } Vector3 diffToObject = positionWS - cameraPositionWS; + // Check if the light is forward, can be an issue with, + // the math associated to Panini projection + if (Vector3.Dot(cam.transform.forward, diffToObject) < 0.0f) + { + continue; + } float distToObject = diffToObject.magnitude; float coefDistSample = distToObject / comp.maxAttenuationDistance; float coefScaleSample = distToObject / comp.maxAttenuationScale; diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index a2a5b4620a7..ba8e4a49688 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -62,6 +62,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed light unit conversion after changing mid gray value. - Fixed Focus distance in path traced depth of field now takes into account the focus mode setting (volume vs camera). - Fixed stencil buffer resolve when MSAA is enabled so that OR operator is used instead of picking the last sample. +- Fixed Lens Flare visible when being behind a camera with Panini Projection on (case 1370214); ### Changed - Use RayTracingAccelerationStructure.CullInstances to filter Renderers and populate the acceleration structure with ray tracing instances for improved CPU performance on the main thread.