The user can now choose amongst 3 specular AO methods:
- None, specAO is off
- Simple, specAO is inferred from roughness and diffuse AO
- Bent normals, specAO is computed accurately from cone intersections
The last method is more expensive but produces the best results.
This change also fixes a few issues:
- Rename materialRefraction() and materialRefractionType() for
consistency
- Fixes user time in shaders
- now the DynamicResolutionOptions don't specify the target frame rate,
they only specify how to scale this given view
- there is a new FrameRateOptions setting on Renderer, which is used
to specify the desired target frame rate for the whole Renderer
- the frame rate is now specified as a "frame interval" in units of
the display frame period.
- the display frame period is (indirectly) set via DisplayInfo.
In other words, the use must set (and update) DisplayInfo properly
(the default are reasonable, but assume 60 Hz). They must also set the
desired interval (default is 1, which is probably what you want).
Finally they must enable dynamic scaling per View, the defaults are
also reasonable.
Currently Renderer doesn't attempt (yet) to actually target the
requested frame rate, so it's up to the caller to push frames at the
desired speed. however, dynamic resolution, like before, will attempt
to shrink work to fit the target.
Renderer can now be given a DisplayInfo that contains some
important information about the current display. This will be used
for frame-pacing and dynamic-resolution.
This is most relevant on Android, where we can accurately query these
parameters. Added support for that in our samples.
This also sets the minSDK to 19 (including gltf viewer's), since this is
the version we support. We were cheating before by under-reporting our
minSdk.
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.