Search Unity

Bug SRP Lens Flares can shine through objects (HDRP 12.1.8)

Discussion in 'General Graphics' started by MPaluszek, Dec 4, 2022.

  1. MPaluszek

    MPaluszek

    Joined:
    Jan 17, 2019
    Posts:
    20
    I've noticed that sometimes lens flares, with occlusion on, can shine through objects. It can be seen when some of flares are far enough that hey are occluded by their attenuation distance. Reproduction is not stable, but turning some of the flares off and then on usualy triggers it.



    In the video flares on lower part of screen are behind white plane.

    As far as I can understand the code, in `ComputeOcclusion` flare is skipped when intensity is 0 or lower, but in
    `DoLensFlareDataDrivenCommon` intensity is checked after occlusion index is increased. If I'm not mistaken fixes for this are already made, just need to be backported.

    Project with reproduction is in the attachments.

    Reproduced in 2021.2.10f1 and 2021.3.15f1
     

    Attached Files: