Files
filament/libs
Mathias Agopian f619b62877 Handle shadow borders better
All shadow maps need a 1-px border for different reasons.
The directional shadow needs a "not in shadow" border because it uses
the intersection of receivers and casters in light-space.
Other shadow types need a border because of bilinear access at the 
edges. Until now, the spot/point shadow border was handled with the
sampler's CLAMP.

Instead, now, we always generate a border and in one case we fill it
with "not in shadow" (by not rendering into it), in the other cases we
render the 2px larger shadowmap so we get completely correct bilinear 
filter.

Additionally, for PCF, DPCF and PCSS we use a large filter kernel which
accesses data outside the texture, until now this was handled with CLAMP,
but that failed (2 of the edges were not handled in the same way) when 
the shadowmap was smaller than the texture.
We fix this by clamping manually the texture coordinates.


The real motivation for these changes is to allow the use of a
shadow Atlas later.
2022-11-21 15:38:25 -08:00
..
2022-11-21 15:38:25 -08:00
2022-09-27 15:52:40 -07:00
2022-11-16 09:20:00 -08:00
2022-11-04 08:36:36 -07:00
2022-08-24 11:41:10 -07:00
2022-09-27 15:52:40 -07:00
2022-08-24 11:41:10 -07:00
2022-11-16 09:20:22 -08:00