Commit Graph

988 Commits

Author SHA1 Message Date
Mathias Agopian
b21dfd5ea2 add a couple way of validating MaterialInstances (#7754)
* add a couple way of validating MaterialInstances

BUGS=[333907416]

* Update filament/include/filament/Engine.h

Co-authored-by: Powei Feng <powei@google.com>

* Update filament/include/filament/Engine.h

Co-authored-by: Powei Feng <powei@google.com>

---------

Co-authored-by: Powei Feng <powei@google.com>
2024-04-16 12:12:20 -07:00
Powei Feng
c8098a4c15 gltfio: add Asset/Resource extended implementations (#7678)
* gltfio: add Asset/Resource extended implementations

 - Add gltfio/src/extended to implement an alternate loader for
   primitives. This is largely based on the implementation in
   AssetLoader/ResourceLoader
 - Able to correctly produce flat shading from gltf that only have
   vertex positions and indices.
 - This is not hooked into current code and should have no
   practical effect on gltfio.
2024-04-16 17:46:48 +00:00
Powei Feng
9e0e3262c3 Release Filament 1.51.4 2024-04-15 11:05:12 -07:00
Sungun Park
4bed88289f Release Filament 1.51.3 2024-04-08 20:49:02 +00:00
Benjamin Doherty
3ec2b47df7 Release Filament 1.51.2 2024-04-01 16:44:33 -07:00
Powei Feng
f12e7f9fbf Release Filament 1.51.1 2024-03-28 11:47:52 -07:00
Mathias Agopian
8398175d9c Add an option to disable use-after-free checks in the backend
BUGS=330403836
2024-03-22 10:24:29 -07:00
Eliza Velasquez
aad45d9119 Fix typo 2024-03-21 19:59:47 +00:00
Eliza Velasquez
5389b37002 Incorporate feedback 2024-03-21 19:59:47 +00:00
Eliza Velasquez
d5fe9e236f Allow rendering thread to pause
This PR adds a new `pause()` option to the `Engine` `Builder` and a new function
`setPaused()` to the `Engine`. While paused, the rendering thread will pause
indefinitely for commands as if none are available. As soon as the rendering
thread is unpaused, the commands are immediately executed.
2024-03-21 19:59:47 +00:00
Mathias Agopian
93b15dac87 The type of geometry of a renderable can now be specified
- dynamic (default) no restriction apply
- static bounds: bounds and world transform can't be changed
- static: additionaly morphing/skinning and vertex/index buffers are
  immutable.

This will allow some optimizations in the future. Currently, we just
store the type but don't do anything with it.
2024-03-19 11:12:25 -07:00
Benjamin Doherty
ba9cb2fe43 Release Filament 1.51.0 2024-03-17 13:12:32 -07:00
Powei Feng
b23ee1bce4 gltfio: add extended tangents job (#7666)
- TangentsJobExtended extracts data from cgltf accessor and
   runs geometry::TangentSpaceMesh on the attributes and computes
   the tangent space.
 - The /extended folder is meant for running this process. Note that
   this API might remesh the input and will require corresponding
   changes that might break previous assumptions.
 - The general flow of the code is modeled after src/TangentsJob.h
 - This is not hooked into current code and should have no
   practical effect on gltfio.
2024-03-15 17:46:08 +00:00
Powei Feng
fa6b4ebd04 gltfio: refactor for clarity (#7652)
- Pull certain utility functions in a separate header and cpp
- Refactor ResourceLoader::loadeResources into smaller methods
2024-03-12 20:31:19 +00:00
Ben Doherty
2e581be8fd Move SwapChain flags into separate file (#7654) 2024-03-12 12:10:43 -07:00
Sungun Park
c1dfd8553d Release Filament 1.50.6 2024-03-11 21:38:10 +00:00
Powei Feng
7eb3b2aaf5 Release Filament 1.50.5 2024-03-06 13:01:10 -08:00
Mathias Agopian
21d938a59f simplify the ResourceAllocator cache eviction strategy
Previously the cache would try to keep its size below a user-settable
value. This was not effective because when that value was too small,
it would cause a lot of churn every frame without actually keeping
the memory usage below the specified value.

We now evict buffer aggressively after they've not been used
(for two frames by default), but we don't cap the size of the cache.
The cache will naturally settle at the size it needs. When dynamic
resolution is used, it might be needed to increase resources 
maximum age, which is a user-settable value still.

This improves performance on mobile on many scenes because the 64MB
default value was too low, causing the crash to thrash.
2024-03-06 11:00:17 -08:00
Mathias Agopian
b921d78fe7 Add support for protected SwapChain.
This is supported only by the PlatformEGL currently. There is not much
that can be done with it either at this point. A protected swapchain is
one that can only be written by a protected context, however, there
is currently no way to create such context.
2024-02-29 10:58:06 -08:00
Powei Feng
b425d63b95 Release Filament 1.50.4 2024-02-27 14:14:49 -08:00
Yuri Schimke
c2b5f08bc7 Fix Renderer FrameRateOptions interval default
From https://github.com/google/filament/issues/7539

And I got to the same conclusion based on f0f7e299d2/filament/src/details/View.cpp (L191)
2024-02-26 14:24:16 -08:00
Romain Guy
36120106cd Add new PBR Neutral tone mapper (#7597)
This tone mapper was designed to preserve the color apperance
of materials. It provides good saturation and contrast while
controlling the highlights.
2024-02-23 14:33:26 -08:00
Sungun Park
d83b3858b3 Add missing changes for NDK version update (#7591)
These are missing parts from the commit
111ad96134.

NDK 26.1.10909125 is used by default

Minimum API level on Android is now API 21 instead of API 19. This allows the use of OpenGL ES 3.1
2024-02-22 15:33:05 -08:00
Mathias Agopian
8b24950429 add the disableParallelShaderCompile option to Engine::Config 2024-02-21 08:47:47 -08:00
Sungun Park
4e6ae2b714 Add stereoscopic type to Engine::Config (#7574)
* Add stereoscopic type to Engine::Config

This new type value will determine the algorithm used when stereoscopic
rendering is enabled.
2024-02-13 20:40:30 -08:00
Sungun Park
a9e8f40287 Release Filament 1.50.3 2024-02-13 00:44:36 +00:00
Powei Feng
7be9cdc7f8 Release Filament 1.50.2 2024-02-06 17:40:03 +00:00
Mathias Agopian
af792e3d18 Resource allocator cache params can be set in Engine::Config
FIXES=[323386395]
2024-02-05 10:26:26 -08:00
Powei Feng
13a23703ad Release Filament 1.50.1 2024-02-01 00:41:19 +00:00
Sungun Park
b676002521 Release Filament 1.50.0 2024-01-23 21:10:06 +00:00
Mathias Agopian
ee6f3fb1dc Add sharpening option to TAA
We use the RCAS algorithm from FSR1. This is useful for when TAA
upscaling is enabled and similar to to what FSR2 is doing.
2024-01-19 14:40:04 -08:00
Mathias Agopian
b9a9586abb taa: add a 32-sample mode and cleanup
32 sample may be more suited to 2x upsampling, it gives 8 samples per
high-res pixel (instead of 4). This is also what FSR 2.0 is using,
which is useful for comparing.
2024-01-19 14:40:04 -08:00
Mathias Agopian
102d2db008 Bokeh aspect ratio (#7482)
* Bokeh aspect ratio

new DoF option to set the bokeh aspect ratio, this can be used to
simulate anamorphic lenses

* Update android/filament-android/src/main/java/com/google/android/filament/View.java

Co-authored-by: Powei Feng <powei@google.com>

* Update web/filament-js/filament.d.ts

Co-authored-by: Powei Feng <powei@google.com>

---------

Co-authored-by: Powei Feng <powei@google.com>
2024-01-10 15:25:28 -08:00
Powei Feng
5c9039e650 Release Filament 1.49.3 2024-01-10 13:55:33 -08:00
Mathias Agopian
9704d27aeb TAA upscaling
This feature is still work in progress. TAA can now optionally
upscale by 4x (this disables dynamic resolution scaling).
2024-01-09 14:07:18 -08:00
Benjamin Doherty
6d06e00934 Release Filament 1.49.2 2024-01-02 14:52:58 -08:00
Mathias Agopian
9d817a0cc9 TAA improvements (#7441)
* TAA improvements

- fix variance + AABB history clipping (we were computing the union
  of both AABB instead of the intersection).
- added a setting for the variance parameter
- added a setting for the jitter pattern
- improved some default values
- fixed a few comments
- smaller code tweaks to facilitate future improvements
2023-12-21 16:51:28 -08:00
princeku07
95ecc3d1e4 Make applyMaterialVariant public 2023-12-19 10:09:42 -08:00
Benjamin Doherty
614990f413 Release Filament 1.49.1 2023-12-18 13:35:28 -08:00
Mathias Agopian
4f94c575c9 fix UiHelper
We shouldn't remove the listener callbacks when a surface is destroyed
by the system (e.g. screen off/on) because then we won't know when
it comes back.

But we still need to do this when the user calls UiHelper.detach() or
when we are attaching to a new surface.

Fixes #7424
2023-12-13 15:21:04 -08:00
Romain Guy
111ad96134 Update dependencies to latest (#7423) 2023-12-11 21:11:54 -08:00
Mathias Agopian
2a67152dda Dynamic "Material constants" support
Material constants (a.k.a: specialization constants) can only be set
during Material creation through Material::Builder.
This change somewhat relaxes that limitation by allowing constants to
be set at runtime on Material directly.

Currently this new API is still private and only supported on FMaterial.

This feature works by invalidating the HwProgram cache of the concerned
Material, causing a shader recompile per variant; so this API is costly
and should be used only for debugging or during app/game configuration.

The TAA material is modified to use constants instead of #defines for
various settings and those are exposed in TaaOptions as well is in 
ViewerGui. So with this change all aspects of the TAA material can
be changed at runtime.
2023-12-11 16:20:47 -08:00
Benjamin Doherty
5418b8c4cc Release Filament 1.49.0 2023-12-11 00:12:52 -08:00
Mathias Agopian
5a9c47bcb5 Improve blitting APIs
- deprecate blit(), renamed to blitDEPRECATED. It's only used in one
  place in copyFrame() now. We can't void it because we don't have
  access to the texture from the RenderTarget.

- add a new blit() api that works with textures instead of render
  targets.

- add a new resolve() api that works with textures instead of render
  targets. doesn't support scaling.

- always use a shader when scaling in the framegraph
  (there was only one place where we used blit)

- use the new blit() for:
	- for mipmap generation on vk (fixme)
	- copying the depth buffer to avoid ssao feedback loop

- use the new resolve() for:
    - manually resolving MSAA color/depth

- Simplify the resolve APIs on the filament side

- implement generateMipmaps for the vulkan backend

simplify MetalBlitter

- remove metal blit workarounds
- don't issue a blit from a renderpass, this only affect Renderer::copyFrame
- We only handle a single texture now (instead of color+depth), so we
  can simplify the code a lot.
  Didn't touch the "slowpath" much, but it now assumes it blits color or
  depth, not both.
2023-12-06 11:22:53 -08:00
Ben Doherty
51c2fa2728 Fix typo in getStereoscopicOptions Java (#7410) 2023-12-06 11:03:51 -08:00
Sungun Park
35a00b1d84 Release Filament 1.48.0 2023-12-05 11:33:03 -08:00
Mathias Agopian
d9ee526a72 fix jni Scene.getEntities
we were using the version of ReleaseIntArrayElements that doesn't
always keep changes to the array.
2023-12-05 09:28:50 -08:00
Mathias Agopian
e7c67d1adb Fix a possible NPE in UiHelper
We were not unregistering the TextureView or SurfaceHolder callbacks on
detach, so they could fire and access an null'ed RenderSurface

FIXES=[308443790]
2023-11-28 10:24:16 -08:00
Powei Feng
000bff5ce1 Release Filament 1.47.0 2023-11-27 14:19:52 -08:00
Ben Doherty
7d31a7f7ea Move stereoscopic debug options to Settings framework (#7347) 2023-11-15 10:51:58 -08:00