- Avoid gotchas with max texture size when static separate enabled
- Simplify addressing logic in a number of places
- Avoid allocating extra HZB that we never use
Details:
- Support rendering/sampling to 2D depth texture array in Nanite and virtual shadow map pass
- Remove some unnecessary HZB-related cvars
- Remove unused permutations from VSM HW raster
#preflight 624f4e5611261bc7b2171208
#rb jamie.hayes
#ROBOMERGE-AUTHOR: andrew.lauritzen
#ROBOMERGE-SOURCE: CL 19679616 via CL 19679656 via CL 19679706
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v938-19570697)
[CL 19680680 by andrew lauritzen in ue5-main branch]
- Check the page table at the ray start as a guess at what resolution is available; iterate in that clipmap
- Support fallback while iterating, albeit at a performance cost
For current mapping strategies, similar performance and comparable quality to the "trilinear-like" solution today
- Resolution changes can now appear more directly at page boundaries rather than explicitly across clipmap boundaries, so depending on the given situation you may see "blocky" versions of the range bands rather than the range bands themselves. Not really a better or worse artifact, but worth noting.
NOTE: Fallbacks to very coarse data should technically also involve significant optimal biases, but we do not want to compute an optimal bias per tap. For now the texel dither optimal bias is sufficient based on the clipmap we are iterating in. We could put a minimum clamp on this but there's a direct tradeoff with losing potentially important fine-scale shadows.
#rb ola.olsson
#ROBOMERGE-AUTHOR: andrew.lauritzen
#ROBOMERGE-SOURCE: CL 19528017 via CL 19528309 via CL 19528326
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v937-19513599)
[CL 19532753 by andrew lauritzen in ue5-main branch]
- Add slope-based depth extrapolation which improves the quality of penumbras on angled receivers. Costs ~10% performance in some cases so maintaining a permutation/cvar (default on) for scalability.
- Change screen ray trace to be a simple "space skipping" ray that terminates as soon as it goes behind geometry and continue VSM trace from that distance. This avoids various contact-shadow-like artifacts and undesirable/inconsistent contact shadows from things that aren't in the VSM. In certain cases if regular contact shadows are desired on top of VSM the engine contact shadows can be enabled, as it is with CSMs.
- Remove a bunch of use of "halfs" in the shaders as they cause some extra ALU on some platforms and don't appear to really be helping with occupancy anymore
- Small bump to minimum normal bias clamp (only affects things very close to the camera)
#rb brian.karis
[FYI] ola.olsson
#ROBOMERGE-AUTHOR: andrew.lauritzen
#ROBOMERGE-SOURCE: CL 19411300 via CL 19411627
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v928-19376421)
[CL 19413239 by andrew lauritzen in ue5-main branch]