Commit Graph

7280 Commits

Author SHA1 Message Date
Sungun Park
bce91c56dd Merge branch 'rc/1.54.1' into release v1.54.1 2024-08-27 23:30:37 +00:00
Sungun Park
eb12e06387 Revert two depth relevant changes (#8083)
This reverts commits
- b70aa43727 "depth clamp cannot work with VSM"
- 6c0bd360b3 "Add support for depth clamp and use it for shadows"
2024-08-27 00:27:32 +00:00
Ben Doherty
40ce15cfbd Support tagging driver handles with a name (#8038) 2024-08-24 09:19:02 -07:00
Powei Feng
aa5f36e1e3 Bump version to 1.54.1 2024-08-20 08:55:19 -07:00
Powei Feng
c1a3450d9c Merge branch 'rc/1.54.0' into release v1.54.0 2024-08-20 08:55:18 -07:00
Powei Feng
28ef805e5d Release Filament 1.54.0 2024-08-20 08:55:10 -07:00
Mathias Agopian
6c0bd360b3 Add support for depth clamp and use it for shadows
vk, metal and desktop gl all support depth clamp, GLES/android also does
with ANGLE. Add support for it in the backends.

use depth clamp to improve directional shadow quality; this allows
to render everything that's behind the camera at the same "zero" depth,
so we can reduce the depth range we need.

Fixes #6293
2024-08-19 17:13:30 -07:00
Mathias Agopian
063affb612 more improvement of csm display 2024-08-19 17:13:03 -07:00
Mathias Agopian
9c857f64ae improve split-view mode
- side panel doesn't overlap with content anymore
2024-08-19 17:13:03 -07:00
Mathias Agopian
5966b5dd8f fix shadow cascade computations
shadow cascades where not calculated properly because part of the 
calculation took the cascade near/far into account, while another
part didn't. This resulted in cascades being too large. It didn't
create wrong shadows, but reduced (and in some case canceled) the
usefulness of the cascade.

We fix the problem by always  using the projection matrix only for
describing the cascade's frustum, as opposed to just passing the
near/far plane distances.

Now the calculation of each cascade is completely self contained and
identical.


We also improve the orientation of the light frustum:
We can rotate the light frustum around the light direction axis, so
it aligns with the view direction, this generally result in smaller
light frustums. This cannot be used in stable mode.
2024-08-19 16:30:16 -07:00
Mathias Agopian
1795c40591 fix typo when calculation shadowmap frustum
min() and lowest() are different!
2024-08-19 00:03:44 -07:00
Mathias Agopian
26f4239d8c fix a few issues with shadowing
A recent change broken the optional "depth clamp" as well as the 
computation of the far plane of the light frustum. There was also
a case where DEBUG builds could assert.

- The far plane was no longer being "optimized" (i.e. moved as close
as possible), which resulted in less optimal use of the shadow texture.
the far plane can be moved as close as the farthest visible shadow 
caster.

- After the camera/light frustums intersection we now see of the 2D
bounds seen from the light are empty and if so we bail, which prevents
an assertion later.

- finally, the "DEPTH_CLAMP" option is also updated for the new code
structure.
2024-08-16 16:00:37 -07:00
Mathias Agopian
ad29b9c70a fix several issue with the debug datasource in View
- the last View created was always overriding previous View's datasource
- because of lazy registering of the data source it was possible that
  the registering lambda was called after the view was destroyed, leading
  to crashes
- all view would share the same PID parameters and these would be
  initialized to default value instead of the user provided value. so
  debug build would behave differently.

With this change we improve things:
- now only the first view gets to publish its data source. it's still
  not ideal, but works for our use case with gltf_Viewer
- the view can now unregister itself when it's destroyed
- only the view that successfully registered uses the debug PID values
  and publishes its data source.
- the normal parameters are used until we query the datasource (from
  imgui), so by default the behavior is now identical to release builds


This fixes a crash in gltf_viewer when opening the Debug panel.
2024-08-16 09:38:54 -07:00
Sungun Park
1c817026f2 Remove unused code (#8043) 2024-08-14 15:41:10 +00:00
Powei Feng
4396a1a776 Fix misnumbered version in RELEASE_NOTES 2024-08-13 16:30:07 -07:00
Powei Feng
44a954b559 Fix misnumbered version in RELEASE_NOTES 2024-08-13 16:28:33 -07:00
Powei Feng
d88ab8d527 Bump version to 1.54.0 2024-08-13 16:22:56 -07:00
Powei Feng
a109a52f3d Merge branch 'rc/1.53.5' into release v1.53.5 2024-08-13 15:59:20 -07:00
Powei Feng
cdd0147a17 Release Filament 1.53.5 2024-08-13 15:59:08 -07:00
Sungun Park
9de29a475e Add warning for the incompatibility of stereo type (#8031)
Print a warning in case the sterescopic type in a compiled package is
different than what's in the engine's setting. The application may
proceed, but it could end up visual glitches when enabling stereoscopic
rendering.

This requires the stereoscopic type to be written into the package,
which needs a material version bump.
2024-08-13 01:31:10 +00:00
Mathias Agopian
7f97363d9c fix debug build 2024-08-12 15:09:06 -07:00
Mathias Agopian
d88b4c1bc3 Add a way to retrieve the count of all resources
This is intended for debugging.

BUGS=[358111049]
2024-08-12 14:50:43 -07:00
Mathias Agopian
3badf9db18 read all valid pending timer queries each frame
This reduces the latency of the timer query result; with the previous
code the latency could only increase, but there is no reason to wait
a whole frame for reading the next available result.

We just loop over them until we find one that has not signaled; instead
of doing one per frame.
2024-08-12 14:50:20 -07:00
Mathias Agopian
929f793cf3 clean-up RenderPass a bit
make mCommandBegin and mCommandEnd const* const, this allows to make
sort() And resize() static, and instanceify() almost static..
2024-08-12 14:49:57 -07:00
Mathias Agopian
06bffaa650 fix a couple precondition checks logs 2024-08-12 14:49:44 -07:00
Ben Doherty
2e2f111435 Re-enable missing packing/unpacking functions in ESSL, fix IMG shader compilation (#8030) 2024-08-12 10:23:52 -07:00
Mathias Agopian
06f9626429 improve GL backend debug markers
we now have two levels of debug markers. Those that come from the "user"
(i.e. filament itself) are now always enabled and generate both 
systrace and gl markers. the 2nd level is internal and always
disabled by default. Of enabled at compile time it'll emit markers for
each driver API method.
2024-08-09 15:25:33 -07:00
Mathias Agopian
fa0e20a699 always validate Engine::config 2024-08-08 22:46:57 -07:00
Mathias Agopian
59593830e5 Fix skipFrame incorrectly asserts in some cases
BUGS=[357992376]
2024-08-08 13:24:38 -07:00
Mathias Agopian
112f9d742c assert when a program compilation fails
The current behavior is to get a UB, which usually is a crash. So this
is better.
2024-08-08 13:24:08 -07:00
Ben Doherty
8ba20eb03c Metal: fix static texture target on more devices (#8022) 2024-08-08 13:04:42 -07:00
Ben Doherty
1c0370d5d7 Remove flaky assertion in ShadowMap (#8023) 2024-08-08 13:04:30 -07:00
Benjamin Doherty
a7b4b9d3a6 Merge branch 'rc/1.53.4' into release v1.53.4 2024-08-08 12:12:36 -07:00
Benjamin Doherty
e253051867 Bump version to 1.53.5 2024-08-08 12:12:36 -07:00
Benjamin Doherty
56f714633d Release Filament 1.53.4 2024-08-08 12:12:27 -07:00
Benjamin Doherty
f0bc338c80 Revert: inject the missing packing/unpacking function in ESSL 3.0 2024-08-07 16:18:02 -07:00
Benjamin Doherty
44d082049c Revert: inject the missing packing/unpacking function in ESSL 3.0 2024-08-06 15:11:25 -07:00
Benjamin Doherty
9750ddb9db Add type_traits header 2024-08-05 10:59:46 -07:00
Benjamin Doherty
239b43e34d Add type_traits header 2024-08-05 10:59:14 -07:00
Mathias Agopian
ec2ee9db7a minor cleanups in CommanmdBufferQueue
- use the same code on both ends of updating the free space. i.e.
  both side compute the "used" space in exactly the same way.
  the math was the same before, but the code was different which
  could be confusing.

- assert for overflow before queuing the buffer. It wouldn't matter
  anyways, because it's done with the condition lock held, so the
  consumer would never have a chance to deuque it. still, less 
  confusing.
2024-08-05 10:06:44 -07:00
Mathias Agopian
1ce1e335a0 gl backend: add a couple missing systrace events 2024-08-02 23:21:34 -07:00
Sungun Park
5fe356e446 Fix ResourceAllocator compile error on Windows (#8011)
This commit 730bc99025 introduced a new
dependency on ResourceAllocator because of the new field
`std::unique_ptr<ResourceAllocator> mResourceAllocator{};` in
details/Renderer.h

This requires cpp files including details/Renderer.h to include
ResourceAllocator.h as well.

This compile issue only happens on the Windows compiler, Visual Studio.
2024-08-02 14:54:02 -07:00
Eliza Velasquez
14ddadd2f6 Fix ES2/anisotropy bug in updateSamplerGroup
This function attempts to set texture parameters in these two cases, but the
texture is not guaranteed to be bound. Perhaps it once was, but the assumption
broke at some point.
2024-08-01 16:44:52 -07:00
Mathias Agopian
a2f5b635d1 don't mix seq_cst with other memory orders
this change shouldn't have any impact on ARM, however, according
to cppreference it's not safe to mix seq_cst with other memory
orders:

"as soon as atomic operations that are not tagged memory_order_seq_cst 
enter the picture, the sequential consistency guarantee for the program 
is lost"
2024-07-31 10:11:01 -07:00
Mathias Agopian
324dcd3c86 early exit in fog to improve performance 2024-07-31 10:10:48 -07:00
Sungun Park
1888c97245 Merge branch 'rc/1.53.3' into release v1.53.3 2024-07-31 16:23:06 +00:00
Sungun Park
c43c58af5d Bump version to 1.53.4 2024-07-31 16:23:06 +00:00
Sungun Park
4125802644 Release Filament 1.53.3 2024-07-31 16:22:54 +00:00
Balaji M
2d21fcbe55 [gltfio] Initialize mCgltfBuffersLoaded to fix crash (#7999)
Value of mCgltfBuffersLoaded is sometimes retained across creation of FAssetLoader which skips loading the buffer in AssetLoaderExtended#createPrimitive leading to null pointer crash
2024-07-31 02:12:04 +00:00
Sungun Park
6b43762dc7 Fix a crash for IBL resource loading (#8001)
This fixes a crash introduced by a8ace2891d

The refactored FrameInfoManager can cause a crash when IBL resource loading
happens because now the getLastFrameInfo() references an invalid value via the
`front` method. Return the default FrameInfo to resolve this.

Also fix a null pointer reference bug for OpenGLTimer::State, which
happenes when the renderer for IBLPrefilterContext is destroyed.
2024-07-29 15:31:59 -07:00