We were conflating two concepts in our comments about the roughness
remapping, which was confusing. Also changed the remapping so it
matches a log2 mapping in our default configuration.
When dealing with thin objects we really have two thicknesses to
consider, the thickness in the direction of the normal, which
corresponds to the value used for solid objects, and the thickness of
the object's walls, which generally is a constant.
Reusing thickness in the later case is problematic for assets that have
a thickness map, but are rendered hollow.
In the future we can even imagine handling double-sided hollow objects
by using the thickness information -- e.g. a hollow cube.
Normally the IOR is deduced from the reflectance, but now we allow to
specify the IOR instead or in addition to the reflectance.
In the later case, it's possible to create physically impossible
materials, but this can be useful for artistic reasons.
This new sample differs from "Hello Camera" in that it exercises all
three ways of using Stream. It also uses Canvas instead of Camera2 to
draw into the external texture. It shows two sets of stripes, one
animated using the shader and the other animated using Canvas. If the
two stripes are aligned, then the stream is perfectly synchronized.
Users can tap the screen to cycle between the three modes.
This simple Kotlin app projects a live feed on the side of a cube.
It looks very similar to the `lit-cube` demo but there is a new Kotlin
class called `CameraHelper` that creates Camera2 objects, starts
the capture session, creates the Filament texture, etc.
For now, this app uses SurfaceTexture. This is a starting point and
provides a testing ground for tentative improvements to our Stream API.
* Add the ability to modify clip space coordinates in the vertex shader
This introduces MaterialVertexInputs.clipSpaceTransform, a mat4 that
is applied to gl_Position before exiting the vertex stage.
* Address code review comments
Inspired by our recent scissor change (#1639) but motivated by gltfio,
which was forced to create a ton of ubershaders (see #1562).
Tested with:
gltf_viewer -u ../glTF-Sample-Models/2.0/TextureSettingsTest/glTF/TextureSettingsTest.gltf
* Improve materials under white furnace test
Two major changes:
- Mobile target now implements a cheaper variant of the off specular
peak bias (which moves the reflected vector towards the normal).
This greatly helps with rough surfaces that may otherwise point
toward a bright part of the IBL.
- The indirect diffuse love is now properly attenuated to avoid adding
the energy reflected by the specular layer. This allows dielectrics
to be correctly energy conserving under a white furnace.
- Tweak the (hacky) clear coat layer attenuation to behave properly
under a white furnace.
* Use the same reflected vector modification everywhere
This works by aliasing CUSTOM0 - CUSTOM7 to morphing attributes, and by
extending our existing skinning variant.
This PR was tested against some upcoming changes to gltfio.
Issue #1149, #1417
This is a prep step for the upcoming morph feature and does not require
a bump to our material version number.
Stay tuned for a new sample app that demonstrates this feature.
* Add screen and multiply blending modes
This change also fixes a sorting issue: different sorting modes
were sorted in different buckets which is incorrect. We want
to sort only by distance.
* Update release notes and Java API
* Fix build error
This replaces the previous "curvature to roughness" method. Both are related
and rely on the screen space variance of geometric normals but this new
solution offers more control (the screen space variance and the clamping
threshold can be controlled).