I’m using spotlight with volumetrics in HDRP project.
The volumetrics seem fine in the closer look, but when the camera goes far from the spotlight,
the core of spotlight starts flickering and ripples appear on the volumetric.
Like this video:
Also, on the camera’s frame settings, make sure you have the “Reprojection” activated for the Volumetric Fog. Alternatively, you might want to upgrade to more recent version of HDRP (and Unity), as you’ll get many more controls over fog quality. However, I understand this might not be possible.
the volumetric fog is a camera-based effect, and the volumetric fog has a limited distance.
Imagine the fog in your frame is divided into tiny cells, that fits within the truncated pyramid formed by the viewing angle of the camera, up to a maximum distance called “Depth Extend” in the Fog volume component (that’s actually called frustum voxel = froxel).
Now, if you want to see the volumetric fog really far away, that froxel will need to be “stretched” along the depth axis of the camera. And you will therefore lose precision along this axis, given that there is a limited number of cells along that axis. This explains the waves you see (= the transition between each slice).
As I said previously, you probably want to upgrade to HDRP 9/10, as it offers the ability to control the exact number of depth slices you want to have in your froxel.
Or, you might as well not use the volumetric system for these lights, and rely on an old school transparent shader applied to a custom mesh to simulate the volumetric effect, like many games did, and still do. But there might be some performance costs associated with the overdraw that the volumetric fog doesn’t have.
tldr: high-quality long-distance volumetric fog is not trivial
Thank you for quick response and detailed explanations.
I confirmed “Reprojection” was on in the project setting,
and set “Slice Distribution Uniformity” as 1 and toggled on “Filter” in Fog setting.
Here is the result:
As the filter blurs volumetrics and a uniform distribution is same level precision regardless of the distance to the camera, it looks far better than previous videos, but still remains flickering on the center of spotlights.
I’m feeling like waving on surface of volumetric and flickering on the core of light differ the source of the problem,
but as you say those flickering may be fixed by controls over fog quality in newer HDRP,
so I will consider upgrading Unity to 2020 and HDRP to 9.
My project relies on multiple 3rd party tools(Enviro, EasyRoads3D, Vegetation Studio, etc),
so I’ll have to look into whether those tools are compatible with 2020 or not.
Since we are doing that great in this thread I also got small fast question.
Basically my volumetric light with fog appears kind of like it is made out of stripes (this is not encoding glich on the attached image), like there are distinct borders between brightens the further form light source the haze is. Is this normal and cannot be changed into smooth transition ?
I was wondering if anyone else is seeing capped performance on HQ Volumetric lighting in 2020.1.x. I opened up a bug report, but fps get capped <40fps on builds only (in editor is fine) (Win/x86-64/.Net4/ILC2PP) or has a workaround.
I don’t see any banding in this image on my monitor. Are you sure the problem isn’t coming from your screen that could have difficulty handling very smooth gradients?
It looks like it was the angle I was looking at the monitor. I’m myself surprised that difference is so noticeable.
I was preparing some explanation to this “issue” so I’m posting the image in case somebody else got this problem.