This needs a bit more testing before merging, but I wanted to put up the
PR for review. I will look into supporting Android after we land this.
Fixes#1932.
- handle heightFalloff=0 (i.e. fog doesn't depend on height) correctly,
previously, a divide-by-zero on the cpu side would get in the way.
The fix is to clamp heightFalloff to a small-enough value, and to
make sure that this is handled correctly in the shader.
- default fog distance is 0 instead of 1m
- inScatteringSize parameter should be allowed to be large in samples
* 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.
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.
-DFILAMENT_SKIP_SAMPLES=ON with CMake
-Pfilament_skip_samples with gradle
This change also renames CMake options specific to Filament
to avoid clashes with subprojects.
Currently it only selects how many samples are used.
Low,medium,high and ultra respectively map to 7,11,16 and 32 samples.
The default is "low", which is sufficient for most mobile applications.
This is achieved by computing a small 2x2 box blur in the AO pass
taking advantage of quad shading, which allows to halve the size
of the bilateral blur kernel.
Reducing the size of the blur kernel has a side effect to kick Adreno
gpu into direct mode, which apparently is much faster here.
Overall we go from 3.4ms to 2.4ms on Pixel4.
The quality is impacted, but not severely. This probably assumes
GPU that have working derivatives.
This is 466 KB insted of the usual 850 KB. It assumes that users do not
need spec-gloss, non-lit, or a special transparency mode.
(uncompressed SO size on arm64)
We can add a new maven project for this next week.
math/mathwfd.h forward declares all {mat|vec}{2|3|4}<> classes,
which allows us to remove their respective #include in a lot of
our public headers.
Our math headers are full of templates, so this should help build times
a bit.
Also we want to keep the public headers as minimalist as possible.
For Android and wasm we do not use the filesystem and therefore do not
need `utils::Path`.
```
libgltfio-jni.so BEFORE 1.9 MB (693 KB gzipped)
libgltfio-jni.so AFTER 1.4 MB (542 KB gzipped)
```
Threshold can be either on or off, and only thresholds at 1.0 when
activated (in pre-exposed mode).
This allows to use very high strengths values for the bloom without
softening the rest of the image, and is useful for artistic considerations.
Note that libgeometry is already included in `filament-android`, this
simply exposes more of its existing functionality.
The Java version of SurfaceOrientation is similar to the JavaScript
version because we are bundling it into the main Filament package, even
though it is a separate library in C++. This is much simpler than
creating a brand new Java package.
New Android sample that tests this is forthcoming.
Fixes#1729.