Java callbacks are now directly dispatched to their handler, instead
of first going through filament's opportunistic dispatch, reducing
callback latency.
New Api:
- Renderer::renderStandaloneView() is a new method that can be used
outside of beginFrame/endFrame on Views that have a RenderTarget
associated. This can be used as a poor man's compute API.
Improvements to Renderer:
- more aggressively skip lighting/shadowing code that won't be
needed by the current view
- Allow up to 64 KiB to be allocated from the render stream, up from
1 KiB
* API BREAKAGE: this change aims to fix multi-view support
What has changed:
- View doesn't have a notion of clear color anymore
- View doesn't have a notion of discard flags anymore
- The clear color and color-buffer discard/clear flags are moved to Renderer
- Skybox can now be set to a constant color
- View have a blend-mode
What does is all mean:
"Clearing" (i.e.) setting its background is now handled by Skybox, by
setting a constant color to the Skybox. This should take care of
drawing views side by side.
When a view needs to be drawn on top of another, it's BlendMode needs to
be set to TRANSLUCENT and of course and, generally, it wither won't have
a skybox, or will have one that sets some translucent pixels.
As an optimization, a View with BlendMode::OPAQUE will have its
background cleared with the color specified in Renderer.
If the SwapChain already has some content, it's now possible to set
the Renderer to not discard the content, together with TRANSLUCENT views,
it's possible to draw on top of that content.
It is NOT possible to share depth/stencil buffers between views.
Fixes: #2369, #2372, #2364
* Address reviewers comments.
Note: WebGL is still broken with this PR
- 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.
No need for a proper library, this is just a common location to simplify
JNI bindings in other projects like filamat and gltfio.
There is no need to move the one Java source file (`NioUtils.java`)
since downstream libraries will have a dependency on Filament, and
FindClass should work fine.
"mirror" was misleading, like it would apply a symmetry to the frame.
mirrorFrame() is just a blit from a swapchain to another, so it's a
copy.
The Java language API is kept for compatibility.
In this first step, we just "blindly" move everything under src/driver
to a new library libbackend.a. And all headers are moved under
private/backend.
Note that "driver" is renamed "backend", but namespaces are unchanged for now.
Later we'll have to untangle the actual private headers from public
ones and ideally not have any private headers.
THIS CHANGE BREAKS MATERIALS.
This adds getUserTime() in shaders/materials, which returns the time
in second since Renderer::resetUserTime() was called.
Two values are provided, the time in second encoded as a float and
the difference between that and the double value, which together allows
to perform high precision time computation when needed.
This change allows longer running animations in materials. Using only
the float value, give millisecond resolution for more than 4h.
* Add support for save/replay of the current view.
* Add support for having distinct draw/read surfaces.
Adds support to egl & glx drivers for distring draw/read surfaces and
uses this support to implement mirrorFrame using a single blit.
* Use src/dst, Viewport, clean up apis.
* Add SwapChain READABLE Config.
* Commit & setPresentationTime optional on mirror.
* Fix flag check.
* Add documentation for READABLE swap chain config.
* Fix missed s/ExternalContext/Platform/ cases.
* Build break fix.