In some situations the shadow map would be too aggressively clipped.
This was due to a bug in the box-frustum intersection algorithm, which
could fail when some vertices of the frustum were inside the box, and
some vertices of the box inside the frustum and the total number
of vertices such classified was 8.
* Add support for screen-space contact shadows
This CL adds support and always enables it.
toggles and setting in the next CL (same PR).
* Plumb settings for screen-space contact shadows
screen-space contact shadows is handled like a shadow option,
parameters (including on/off) are set in the LightManager, using
the existing ShadowOptions API.
Additionally there is a per-renderable toggle.
Both toggles are off by default.
* Allow contact shadows when shadowing is auto-disabled
Shadowing can be auto-disabled when for instance there are no
shadow casters in the scene. We still allow contact shadows in
that case.
This would allow for instance, to make the vegetation on a terrain
not shadow-casting, and still get some shadowing there by using
contact shadows instead.
* apply micro-shadowing after contact shadows
also, don't compute contact shadows when we know we're fully shadowed.
- decouple the depth and ssao passes, so that the depth
pass could be used by another client, down the framegraph
- set uniforms/samplers from the execute closure of the color pass,
instead of using a separate pass. This is more correct and it
potentially reduces calls to commitUniforms.
- make setSampler check that the value set is different,
the idea here is that it's much more costly to have to commit the
samplers rather than having to compare them. Also realistically we
don't have a lot of samplers in a frame, so that's not a lot of
compares.
- one downside of this change is that commands for the SSAO pass are
always generated, we will fix that in an upcoming change.
Imported render targets are only partially implemented, which
caused a discard flags bug. It would happen when an imported
render target is used more than once like when using SSrefr
without tone mapping. In that case, the 2nd pass would use the same
discard flags as the first pass.
We make sure to only (and always) clear newly allocated buffers,
but only clear existing buffers based on the user request. This
should allow to share the depth buffer between drawing two
Views (if post-process is disabled). This should also fix
a bug where the intermediate buffer wasn't cleared when blending
a view on to of another.
This should fix#2138
This change adds new commands to matinfo to print dictionaries.
This feature is useful to debug dictionaries, and I just used
it to identify that using a shared dictionary would save ~12 KiB
in the Android build. The macOS build (GLSL + Metal) would go
down to 71 KiB from 136 KiB.
The SPIRV to Metal conversion leaves leading spaces and some
comments. This change also runs the shrinker on optimized Metal
shaders to further reduce the size of shaders.
We were not using the correct offsets, however because everything
was so blurry, it wasn't obvious that something was wrong.
This should result in a bit smoother bloom effect.
It controls the quality of the upsampling filter. This can help a lot
if heavy scaling is needed to maintain performance, it also helps if
MSAA is not enabled.
There are 3 quality levels, low, medium and high. 1, 4 and 9 bilinear
taps are used for each level respectively. The high quality setting
employs a tent filter.
we've had issues with some devices running in arm mode, where they
would throw spurious SIGILL on the WFE instruction used in spin locks.
Since on Android Mutexes are very efficient, we just use that instead.
This might fix#2197
libmath itself doesn't expose any stream operators anymore. However,
libutils is able to automatically print libmath types into its
io::ostream -- however matrices are not formatted nicely.
Added a new optional library, libmathio, that provides std::ostream
operators for all libmath types. libmathio does a better job at
formating matrices.
Also removed apply() and map() from libmath because there were not used
anywhere and they forced us to depend on <functional> in public headers.
The scissor is now always ignored -- i.e. when we clear, the whole
surface is cleared, which echoes how discard flags work.
Geometry must be used to clear only a sub-region of the screen.
This simplifies a lot of things because we had workaround for Adreno
GPUs, which were slow when clearing with the scissor enabled.