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.
Replace with forward declarations if needed and includes in .cpp that
now need them.
The idea here is to have our headers have the least amount of impact as
possible on our clients (e.g. compilation time).
Add bindings for releaseSourceAsset() and fix a double-free issue.
According to the Android Studio profiler, this makes Java memory usage
go from 18.6 MB to 6.5 MB.
glTF specifies that client implementations must support at least two UV
texture coordinate sets but does not seem to have an upper limit.
We use a mapping table in order to honor high-numbered UV set indices,
but our mapping table only accomodates 8 entries.
Fixes#2042
This makes the upcoming Java bindings simpler and improves parity with
existing API conventions.
Note that camutils does not depend on filament and therefore cannot use
BuilderBase.
Note that the Manipulator Builder state is public which breaks with
convention but makes implementation simple and allows C++ clients to
continue using modern initializer syntax if they wish.
This was untested because our only glTF Android sample uses glb instead
of JSON. We will soon be adding a new Android demo that uses an actual
gltf file.
This fixes#1841.
This is in preparation to supporting screen-space effects.
There are two major changes:
- RenderPass is now copiable and intended to be passed by copy to
the execute stage of frame graph passes
- The color pass is in its own function now
This actually simplify RenderPass api.
Rotate the sample pattern at every light direction, which trades
aliasing for noise (which is arguably more pleasant) for IBLs with
very high frequency (i.e. high level of HDR-ness).
This moves the camera manipulator into its own library and adds new
functionality including a new "Google Maps" manipulator and a bookmark
feature to facilitate camera animation.
Java bindings and an Android sample will land later this week.
In glTF, multiple nodes can refer to the same mesh, and each node can be
assigned a unqiue string label. Previously we used NameComponentManager
to annotate entities with mesh labels rather than node labels. This was
wrong because Filament entities are 1:1 with nodes, not meshes.
We still fall back to mesh labels when node labels are not provided.
An version of clang is smarter about generating warnings for template code. `assert` here is not included, so clang generates: `error: use of undeclared identifier 'assert'`
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.
For the street light glb from the Khronos suite, this reduces texture
loading time from 290 ms to 110 ms.
Stay tuned for another feature: notification callbacks.
Related to #1876.
TrackingPolicy::Debug didn't store the base pointer of the Area, and
instead relied on the first allocation to discover it, however, because
of alignment, the first allocation may not match the base pointer.
Because of that there could be an overflow in onRewind(), i.e. we
could rewind to a pointer before the (wrongly computed) base. This
overflow caused the debug memset to go awry and stomped on memory.
This is fixed by passing the base pointer to the constructor of the
TrackingPolicy. This base pointer could be nullptr with certain
allocators, but in that case, onReset/onRewind should never be called;
and this is enforced at compile time.
Also fixed a (luckily) harmless buffer overflow when preparing the
dynamic lights, if the number of lights wasn't a multiple of 4. This
was harmless because we use a linear allocator, so overflows are not
really overflows.
Clients who do not yet have this fix can usually work around this issue
by calling the non-array overload of `MaterialInstance::setParameter`
when the array size is 1.
This was caught by ASAN.
Our algorithm header has many one-liners that compute the "next power of
two length / 2" but they all have the caveat that if the input is
already POT, then the "/ 2" part does not occur.
Usually we deal with this by testing the difference against zero.
However in `partition_point` we were skipping the test, thus causing a
potential out-of-bounds access.
I fixed `partition_point` and added a few more tests for non-POT cases.