* Add new public API to query a sampler transform name field.
This new API will let filament users query a Material object
the value of the `transformName` field of a specified sampler
parameter.
The transformName is an optional field, so if its not defined
by the user, it will return a nullptr value.
- A new test was added to test_filamat to validate the serialization.
- A new parameter was added to the test sandboxLit material to
validate the parsing a material with the new field.
* Addressing review comments
- Add java and js bindings for the new API
- Tests for querying the getParameterTransformName
* Use utils::ImmutableCString for transformName
* Updating release notes
* Review comments
* Addressing more review comments
- Fix comments
- For the java binding return an empty string when the
transform is not present.
* Add a Renderer API to force skipping frames
Renderer::skipNextFrames(size_t) can be used to force filament to
pretend the next N frames must be skipped. This is mostly useful for
debugging.
* Add DebugOptions to Settings
We still need to move the "Debug" features of gltf_viewer to this,
but this give us a framework to do it.
Currently there is one debug option that allows to set a number of
frames to skip.
ViewerGui propose a button to skip 10 frames using this framework
* Update libs/viewer/src/Settings.cpp
Co-authored-by: Powei Feng <powei@google.com>
* Update libs/viewer/src/Settings.cpp
Co-authored-by: Powei Feng <powei@google.com>
---------
Co-authored-by: Powei Feng <powei@google.com>
Users can now create a swapchain with MSAA support, which enables direct
rendering to a multi-sampled swapchain image and automatic resolution.
This is only supported by EGL(Android). Other GL platforms (GLX, WGL,
etc) don't support it because the swapchain MSAA settings must be
configured before window creation.
Support for other backends will follow.
BUGS=[433327615]
A few bugs in that area were introduced by #8391. Upscaling is
supposed to perform the final blending if needed, but it didn't.
Transparency/blending is only supported by the bilinear upscaler, which
is automatically selected in that case.
The upscaling pass itself may include a final `RCAS` pass for
sharpening, in that case, blending must be performed then. So we added
the logic for that.
Fixes#9061
- use resgen to package the DFG LUT into filament, instead of using
a large include of a C array.
- add a zstd compression step, which reduces the size from ~100KB to
~75KB.
The overhead of zstd is about 90KB uncompressed, however it will pay
for itself tenfold when we use it to compress material packages.
The new `linearFog` material property, when set to `true` enables a
simplified fog calculation. The fog equation becomes linear which is
unrealistic, but more efficient to compute. In some situations with
a shallow fog range, it doesn't make a huge difference visually.
In this mode, height falloff and in-scattering are ignored.
The linear equation slope is calculated from the regular parameters to
match the slope of the real equation at a camera height. If
`heightFalloff` is disabled, set to 0, the `density` parameter
exactly corresponds to the slope of the equation in [1/m] units.
* gl: amortize shader compilation over N frames
On platforms which don't support parallel shader compilation (e.g. Firefox), we
can sort of emulate it by queueing up any requests to `Material::compile()` and
compiling each shader over multiple frames.
Compiling over consecutive frames slows things quite noticeably. Instead, space
each compilation over a number of ticks (16 chosen arbitrarily).
If we need a program NOW, we can bump a program queued for much later to the
front. We also avoid compiling any queued programs on this same frame to limit
stuttering.
* gl: add flag to disable amortized shader compile
If this flag is on, the new amortized compile code should theoretically never be
executed.
* gl: add CompilerPriorityQueue docs, Java API
* gl: amortize shaders, z3moon feedback
* gl: update CompilerThreadPool
* materials: introduce mutable spec constants
Rationale & design of this feature has been discussed internally.
The current implementation uses a `FixedCapacityVector` to store the new program
handles, but I wouldn't object to replacing it with a hasmap as discussed
offline.
I have compiled but not tested this yet on Android, so I'm not certain that the
API bindings are correctly wired up.
* materials: mutable spec constant feedback
* materials: address mutable spec constant comments
* Add GTAO options into the struct
* Add gtao mat and shader
* Set type specific parameters in ppm
* Fix inconsistent name
* Fix incorrect param type
* Add bent normal calculation
* Fix the gui
* Adjust precision
* Use mix
* Add some comments
* Refactoring
* Update comments
* Add comments for aoOptions
* Update
* Update
* Address the comments
* Split .mat into bent and non-bent
* Update
* Update
* Use sqrt on mobile
* Omit default case
* Commit beamsplitter generated changes
* Use built-in acosFast
* Remove unused function
* Fix the mismatched parameter type
* Some optimizations
* Commit beamsplitter results
* Update the comment
* Update default value
* Commit beamsplitter changes
* Extract common parameters out
This introduces two new methods to `ToneMapper`: `isOneDimensional()` and
`isLDR()`. `ColorGrading` references these values along with other parameters
passed to the builder to determine if we can get away with only generating a
one-dimensional LUT. Meanwhile, `PostProcessManager` takes care of setting the
new spec constants and uniforms for `colorGrading.mat` and
`colorGradingAsSubpass.mat`.
* Enable fgviewer for the users
* Fix incorrect position
* Update
* Support remote debug server
* Enable fgviewer on android
* Link and include fgviewer_resources
* Adjust js to show untitled view
* Implement query to check if texture format is mipmappable
This will allow Filament's users to perform check beforehand.
* add java bindings
* add javascript binding
the new MaterialInstance::setCullingMode(color, shadow) API allows to
set a separate face culling mode for the color pass and the shadow
passes.
FIXES[391679058]
The old version that doesn't take a timeout now always waits forever;
before it waited for a few seconds on Android debug builds.
The new version has an explicit timeout that works on all platforms and
returns success status.
FIXES=[384043020]
SGSR stands for Snapdragon Game Super Resolution. It is an efficient
upscaler for mobile.
Split the upscaling passes into multiple methods in PostProcessManager.
Also, add a way to preserve the alpha channel in the FXAA pass.
* validate MaterialInstance references when destroyed
With this change we now enforce two things:
- All MaterialInstance of a Material must be destroyed when
destroying said Material. This has always been a documented
requirement of the public API, but wasn't enforced (only
a warning was printed).
This new assertion is unconditional.
- A MaterialInstance, when destroyed is no longer in use by any
Renderable.
So before destroying a MaterialInstance, the user of API needs to
ensure that either all Renderable using that MaterialInstance in one
of their Render Primitives are destroyed, or, that these Renderable
using that MaterialInstance are reset to another one or to null.
There is a new RenderableManager::clearMaterialInstanceAt() that can
be used to clear a MaterialInstance on a Render Primitive.
Additionally, a Render Primitive with a null MaterialInstance is now
silently skipped during rendering, instead of a null-dereference.
Finally, that second assert is protected by a new feature flag:
"features.engine.debug.assert_material_instance_in_use". This flag is
enabled on DEBUG builds and disabled on RELEASE builds by default.
The flag can be changed at any time using `Engine::setFeatureFlag()`.
BUGS=[333907416]
* Update filament/src/components/RenderableManager.cpp
Co-authored-by: Powei Feng <powei@google.com>
---------
Co-authored-by: Powei Feng <powei@google.com>