Skip to content

Commit 0994b71

Browse files
skhiatsebastienlagarde
authored andcommitted
[Fix] Lens Flare visible when being behind a camera with Panini Projection on (case 1370214) (#6293)
* Fix panini for LensFlare * Add changelog
1 parent ae5ff5f commit 0994b71

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

com.unity.render-pipelines.core/Runtime/PostProcessing/LensFlareCommonSRP.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,12 @@ static public void DoLensFlareDataDrivenCommon(Material lensFlareShader, LensFla
666666
}
667667

668668
Vector3 diffToObject = positionWS - cameraPositionWS;
669+
// Check if the light is forward, can be an issue with,
670+
// the math associated to Panini projection
671+
if (Vector3.Dot(cam.transform.forward, diffToObject) < 0.0f)
672+
{
673+
continue;
674+
}
669675
float distToObject = diffToObject.magnitude;
670676
float coefDistSample = distToObject / comp.maxAttenuationDistance;
671677
float coefScaleSample = distToObject / comp.maxAttenuationScale;

com.unity.render-pipelines.high-definition/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
4848
- Fixed light unit conversion after changing mid gray value.
4949
- Fixed Focus distance in path traced depth of field now takes into account the focus mode setting (volume vs camera).
5050
- Fixed stencil buffer resolve when MSAA is enabled so that OR operator is used instead of picking the last sample.
51+
- Fixed Lens Flare visible when being behind a camera with Panini Projection on (case 1370214);
5152

5253
### Changed
5354
- Maximum light count per fine prunned tile (opaque deferred) is now 63 instead of 23.

0 commit comments

Comments
 (0)