* Add support for sheenColor and sheenRoughness
This work is necessary to support the glTF extension KHR_materials_sheen.
This change effectively adds the specular lobe from the cloth material
model to the base material model. The cloth model remains useful for
its extra subsurface color feature but also because it's cheaper.
* Add support for KHR_materials_sheen to gltfio
* Update documentation
* Document default shading values
- Use lower depth LOD as the cone radius increases.
This is the same technique we use for SAO.
The better cache access significantly improve performance.
On a test on Pixel4 at 585MHz, SAO pass improves by 30%.
This also helps the algorithm scale with the shadow distance.
- Shadow direction/length no longer dependent on aspect-ratio and camera
orientation.
This is fixed by doing all the computations in screen-space instead of
normalized screen space.
- Shadow parameters are no longer dependent on the field of view.
- Also rename dominantLightShadowing.fs to ssct.fs
- remove zoom parameter, it wasn't very useful.
This is a technique from Naughty Dog used in TLOU2, where we compute
the "ambient" shadowing of a dominant light in screen-space.
This is currently integrated to the SSAO pass.
We borrow a page from the HBAO book here and allow to limit the angle
with the horizon of SSAO samples. This can help reducing the effects
of low tessellation, which tend to create unwanted creases with SSAO.
- inScatteringSize actually cannot be set to zero because it produces
a 0^0 in the shader. So with this change, in-scattering must be
strictly > 0 to enable.
- inScatteringSize on the java side had an incorrect default value of
zero (which of course, now doesn't matter anymore).
- also clamp the fog altitude to 1mm which simplifies the shader quite
a bit for the same result.
Fixes#3069
all parameters of the bilateral blur can now be set from the CPU,
instead of being hardcoded -- this probably prevent the shader compiler
from unrolling the filter, but it's also probably not a big deal.
additionally, we now use a kernel size of 23 (12 samples) when the
SSAO quality is set to HIGH or more.
ssaogen is no longer needed
Higher quality levels used to darken the ssao a lot, now they all have
a consistant look.
Add quality control to material sandbox.
Slightly simplify shader code.
- fix a recent typo that affected SSAO quality
- add a upsampling quality checkbox in material_sandbox
- make use of textureLodOffset instead of texelFetch, so that
we emulate more closely textureGather
- don't hardcode bilateral filter edge-distance in the shader
(still hardcoded on the cpu side)
* Add transforms for ACEScct and enabling/disabling color grading in sample
* Add saturation and contrast adjustments
* Rename ACES to ACES_LEGACY and introduce ACES
ACES_LEGACY is ACES with a brightness boost to match our old
tone mapping operator.
* Add new color grading feature: shadows/mid-tones/highlights
This feature can be used to color correct specific tonal ranges.
The tonal zones can be precisely controlled.
* Add the ability to set a ColorGrading LUT per View
In this change, material_sandbox allows to change the tone mapping
operator at runtime.
* Add Mathematica notebook used to explore white balance
The implementation is meant to reproduce the temperature/tint sliders
founds in Adobe Lightroom. The temperature can be offset from 2,000K
to 50,000K using a slider between -100 and +100 (-1.0 to 1.0 in our
API). The range of tint was modelled after the range used for the
temperature.
* Fix various issues
- A refactoring wrongly remamed the color grading pass
- Setting a View's ColorGrading to null selects the
default color grading options
* Implement white balance in ColorGrading
* Prep work for proper color grading
* Bring back local colorGrading bool to drive that pass
* Fix formatting issue
* Add missing case for the color grading pass
* Fix formatting issues
* Formatting issues
Emissive was previously defined in exposure compensation stops, which
was confusing to many. It is now a value in nits, with the alpha
channel controlling how much the camera exposure affects the emissive.
At 0, the emissive value is just added to the final pixel color, at
1 the emissive value is multiplied by the exposure just like with
regular lights.
The intensity of the emissive property can be computed from an
exposure value (EV) easily with the following formula:
emissive.rgb = emissive.rgb * pow(2.0, EV - 3.0);
This formula is available as Exposure::luminance(float) already
in Filament.
- 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.
* Add ground shadow option to gltf_viewer
The shadow is always positioned at the bottom of the loaded object's
bounding box to ground it perfectly.
* Remove unused include
With this PR screen-space refraction is functional.
Caveats:
The blur passes for supporting rough refractive materials is quite
heavy and increases with the resolution.
SSR uses a gaussian approximation for the brdf and therefore doesn’t
match perfectly cubemap-based refraction and IBL.
The use of MSAA with screen-space effects, while working, is going
to incur a large cost, especially on tilers.