- Implement shadow fading when using the Orthogonal shadow mode
(like in `master`).
This allows customizing the distance at which directional shadows
start to fade away. Shadow fading will also always start at the same
distance now, regardless of the current shadow mode in use.
This is useful for enclosed levels to prevent shadows from fading
at all with a well-tuned maximum distance.
The default fade start value (0.8) results in fading happening later
in the distance compared to the previous behavior, where fading started
from the last shadow split distance (0.6 in PSSM 4 Splits and
0.1 in PSSM 2 Splits).
This fix works in both GLES3 and GLES2.
The rendering formula in the shader was adjusted to further improve the
sharpness/antialiasing quality balance.
- lawnjelly and Calinou
bc607fb607
On some hardware, modifying gl_FragColor multiple times can cause large performance drops. This PR writes to a standard temporary variable instead, and copies across to gl_FragColor once only at the end of the fragment shader.
This could potentially lead to large gains in performance on affected hardware.
Certain glGet operations require 64 bit versions according to the GLES spec.
The previous code was susceptible to overflow bugs, especially running under ANGLE.
`-Werror=array-bounds` flags when creating a new batch, possibly due to the possibility of the malloc failing (out of memory).
This PR adds an explicit `CRASHNOW` in the hope the compiler will recognise this case is not intended to be recoverable.
Make sure `GLWrapper` is initialized before `glActiveTexture` is called by other parts of the storage initialize(), to prevent benign warnings.
- lawnjelly
857d884026
Although this check shouldn't be able to fail currently, it provides a small level of extra logic checking at only small cost in DEV builds.
- lawnjelly
d7cca42ef6