in particular add a terminate() method to FrameSkipper instead of
destroying driver objects in the destructor -- this matches all other
objects.
also remove dependency on FEngine which wasn't needed.
- move the control code out of FrameInfo and into
View itself. FrameInfo now just gathers information about the
frames instead of also doing part of the control.
- the control code has been refactored into a more formal PIDController.
- a few bugs were fixed in the control loop and default parameters
tuned.
The control loop itself now outputs a relative scale factor instead
of an absolute one. The relative scale factor seems easier to
control and is less jittery, and doesn't have to rely on the "integral"
term of the PID.
It's possible that more tuning is needed, but the scaling is now
more stable.
- remove getProperties() we'll put it back if we need it some day
- use unordered_map because it generates less code than robin_map and
here performance is not critical
- defaults to 31 history points instead of 3, this gives a much better
estimate of the frame rate.
- make sure the calculations work for any definition of our internal
duration<> (it's useful to use milliseconds when dealing with
refresh periods).
- don't round to 8 pixels if the scale factor is exactly 1
- fix a few comments and warnings
* mipgen: Linearized PNG bitmaps (such as normal maps) no longer perform gamma transform on read.
* mipgen: Using "-k normals" argument now works for all file types, not just KTX
* Web: Exposed SurfaceOrientation functions getQuatsHalf4() and getQuatsFloat()
Unfortunately this bug appeared in recent drivers on some devices, it's
virtually impossible to know which device/drivers have this issue, so
the workaround is active for all Adreno GPUs.
glInvalidateFramebuffer is too aggressive and prevents loading of the
GMEM even if it's only called at the end of the render pass.
Statically link SDL2 to make our samples (glTF Viewer, etc.) completely
standalone, and include missing resources (fonts and default environment
map for the IBL).
When supported and enabled, resolve MSAA using an HDR aware filter,
which improves anti-aliasing quality.
This is only supported with backends that support multi-sampled
framebuffer-fetch. Currently, only Metal on iOS and GLES.
Update remote ui.
The DSR options were carried all the way to the final blit that is
sometimes needed to impedence-match our rendering features with the
swapchain. This blit is never a scaling blit, but we were using the
FSR option, which would sometimes trigger the FSR scaling code.
FSR assumes modern OpenGL. The functions that pose problem are in fact
never used in filament, so it doesn't matter how they're implemented.
We use the HLSL version instead.
Java callbacks are now directly dispatched to their handler, instead
of first going through filament's opportunistic dispatch, reducing
callback latency.
All APIs that take a callback as argument now also takes a
CallbackHandler* which is a new interface used to dispatch the
callback.
CallbackHandler* can always be nullptr in which case the behavior is
unchanged.
When CallbackHandler* is specified however, it is used to dispatch the
callback: its post() method is called from a service thread as soon
as possible (this will NEVER be the main thread), CallbackHandler::post
is then responsible for scheduling the callback onto the thread the
user desires. This is intended to make callbacks interoperate with
the platform/OS's own messaging system.
The main issue that gets fixed here are:
- VK_IMAGE_LAYOUT_UNDEFINED cannot be used if the image content is to
be preserved after the transition. Unfortunately, there is more than a
few places in the VK backend where we use VK_IMAGE_LAYOUT_UNDEFINED on
images that are later used as sources.
- accessing an image memory from the host is only supported if the the
layout is PREINITIALIZED or GENERAL. However, images in the staging
pool were transitioned to other layouts and put back into the pool,
later they would be mapped/memcpy'ed into. Instead we now always use
the GENERAL layout and never change it.
- images that where in the pool where transitioned using the miplevel
of the texture we were copying into, however this didn't make sense
because images from the pool don't have mip levels.
As part of these fixes, we also refactor imageLayoutTranstion(),
because there was two copies of this function, one specific to texture
and another one more generic. We now always use the more generic one,
with a new helper for textures.
Note: didn't fix "readPixels" which has at least problem (1), because
it's a tricky implementation, and it requires more toughts.
A new Engine::pumpMessageQueues() method can be used to trigger all
pending user callbacks right away. This can help reducing latency
of certain callbacks such as picking queries.
This is typically called once before calculating the next frame's
parameters (e.g. object positions or appearance that may depend on a
callback result).
Fix some comments and documentation.
This is a pixel accurate implementation of picking. Picking queries
can be created on view, and upon completion a user provided callback
is called with the Entity of the renderable at the queried coordinates
in the viewport.
Picking queries typically have 1 or 2 frame of latency and may impact
performance on some drivers.
It is mostly intended for use by editors, or when latency is not a major
concern. This api should not be used for dragging/moving objects, it is
intended for initial picking only.
Picking is implemented in the structure pass.
The depth buffer value is retrieved and the fragment coordinate is
reconstructed and passed to PickingQueryResult. This can be used in
turn to calculate the view and/or world space position.
This is just a minimal change to get the R_INTEGER format to work.
- if src/dst types are identical, just copy (this avoids a mul and a div)
- add R,RG and INTEGER types