Commit Graph

5284 Commits

Author SHA1 Message Date
Mathias Agopian
3e3bd2722f fix lispsm when camera and light direction are aligned
in that case we have to revert to the ortho projection
2022-09-30 16:12:15 -07:00
Mathias Agopian
44fdf83e4c fix multiview mode in gltf_viewer
The "shadow" camera now works again.
2022-09-30 16:12:15 -07:00
Benjamin Doherty
99c4ce67e4 Print warning when Metal reaches memoryless geo limit 2022-09-30 13:59:49 -07:00
Balazs Vegh
71aceec4cf Memoryless storage mode with fallback (Metal) (#6124) 2022-09-30 13:54:54 -07:00
Philip Rideout
98e4cdbd4c gltfio ubershader mode: fix re-loading.
Fixes #6128
2022-09-30 13:54:36 -07:00
Mathias Agopian
86ef0109f4 use the correct gaussian blur shader
we attempted to select a shader which processed the required number of
component, but were always selecting the 4-components version.

this should improve blur performance for VSM.
2022-09-30 13:30:15 -07:00
Mathias Agopian
b4142261c2 trivial typo and ide warnings fixes 2022-09-30 13:30:15 -07:00
Mathias Agopian
359624e8eb Fix gaussian blur kernel computation
This improves significantly VSM shadows with blur,
 but will also improve SSR and the flare.
2022-09-30 13:30:15 -07:00
Mathias Agopian
5bcc11d9e8 fix typo that broke the VSM blur radius setting 2022-09-30 13:30:15 -07:00
Mathias Agopian
5aa414dd24 support for ELVSM and 32 bits xVSM
This basically adds two settings:
- highPrecision at the View level, which controls the bit depth
  of the vsm shadow texture used. This affects all shadowmaps.
- elvsm per shadowmap, which enables Exponential Layered VSM.

the main change in the shaders is that we now always output the 
"negative" EVSM, even when it's not enabled. If no shadowmap uses
ELVSM, then the texture is stil an RG texture and the calculation is
lost (with some luck culled by the shader compiler), either way it's
not a lot of math and it's done only once per shadow texel.

During the color pass, on the other hand, we compute the "negative"
EVSM only if enabled.
2022-09-30 12:04:27 -07:00
Mathias Agopian
1e51b03971 fix VSM 2nd moment calculation
the linear approximation only works with a linear depth, it fails
with our warped depth.
2022-09-30 12:04:27 -07:00
Mathias Agopian
fc484bd319 fix "stable" shadows
We were always adjusting the near/far of the view volume based on the
scene content for shadowing, which defeated the "stable" shadows.

Also changed the default cascade splits from a linear split to a
log2 split, because due to the perspective projection, the log2 split
actually looks linear. Also intuitively, it makes more sense to give
more resolution to the shadows close to the camera.
2022-09-30 12:00:02 -07:00
Mathias Agopian
9c4783142e matc: minor cleanup 2022-09-29 19:34:07 -07:00
Mathias Agopian
4dc03318e8 break circular dependency between Package and Flattener 2022-09-29 19:34:07 -07:00
Philip Rideout
15ba54c4c5 Update README wrt Android Studio Version. 2022-09-29 16:28:50 -07:00
Philip Rideout
342138aecb gltfio: Update Java API. 2022-09-29 16:28:50 -07:00
Philip Rideout
9f53c62e06 gltfio: Update Web API.
Java API changes will come next.
2022-09-29 16:28:50 -07:00
Philip Rideout
2d996033e3 gltfio API change part 2: remove asset-level animator 2022-09-29 16:28:50 -07:00
Philip Rideout
9fa6dc4131 gltfio API change part 1: move all MaterialInstance methods to FilamentInstance 2022-09-29 16:28:50 -07:00
daemyung jang
4930227743 Fix a crash by setting not exist material parameters on ubershader (#6122)
* Fix a crash by setting not exist material parameters on ubershader

* gltfio: add getFeatureMap, remove logic for dummy textures

Co-authored-by: Philip Rideout <philiprideout@gmail.com>
2022-09-29 15:51:35 -07:00
Benjamin Doherty
fbfcce563d Release Filament 1.27.2 2022-09-29 13:11:43 -07:00
Ben Doherty
7f5ad3743b Fixes for 1.27.2 release (#6125) 2022-09-29 13:08:00 -07:00
daemyung jang
981020e72b Get the morph target buffer to the given primitive 2022-09-29 13:01:42 -07:00
Mathias Agopian
7c1a705a07 reduce setSarameter(texture) calls 2022-09-28 22:10:27 -07:00
Mathias Agopian
3d53ae583f switch our min sdk from 19 to 21
this is so that we can support OpenGL ES3.1
2022-09-28 22:08:27 -07:00
Mathias Agopian
dc9f03cbd0 don't attempt to use more texture units than present
to emulate the bindless API in the gl backend we always used the highest
texture unit available. However at feature level 3, we support up to 62
textures, so the that max was bumped to 62 -- however, where we're not
on a feature level 2 device, that texture unit doesn't exist.

Instead we now always use binding 31, which is guaranteed to exist by 
EGL's minspec.
2022-09-28 22:05:05 -07:00
Philip Rideout
de7bca7ef8 gltfio: fix occlusion strength
Fixes #6106
2022-09-28 17:42:29 -07:00
Ben Doherty
f151f56a2e Metal: use argument buffers for SamplerGroups (#6093) 2022-09-28 16:50:11 -07:00
Ben Doherty
fe3d1713a4 Fix generic/Mutex.h not installed on Linux (#6117) 2022-09-28 16:36:38 -07:00
Joel Winarske
2cad3be7a3 Wayland FilamentApp
- move Wayland specific code into getNativeWindow
- make wayland struct static

Signed-off-by: Joel Winarske <joel.winarske@gmail.com>
2022-09-28 16:14:01 -07:00
Thomas Gorisse
5262512eea Fix JNI for TransformManager.getChildren() (#6116) 2022-09-28 11:27:35 -07:00
Mathias Agopian
fabba73b1e Initial support for compute
* minimal backend support for compute
- added api to dispatch a compute shader
- added api to create and bind a ssbo
- added api to read back a buffer
Only implemented in the gl backend

* Add a backend compute test suite
* basic support for compute shaders in matc
this is still very much work-in-progress.
We're not supporting images nor ssbo for now.

* rename UniformInterfaceBlock to BufferInterfaceBlock
* augment BufferInterfaceBlock to support ssbo features
- add support for std430
- add support for ssbo
- add support for variable-size array
- add support for memory qualifiers

* reformat MaterialBuilder
* material format: move subpasses outside of parameters
subpasses now are their own json property instead of being a
"parameter".

* refactor parameter() methods to match Buffer/SamplerInterfaceBlock
We're just shuffling the arguments.

* add support for buffers in .mat files
* filamat now generates buffer blocks (ssbo)
* take feature level into consideration when optimizing shaders
* don't store the 'uniform binding' chunk for level 2 materials
this includes some refactoring/cleanups of MaterialParser

* matinfo: fixes for compute
- separate subpasses from parameters
- don't attempt to print material properties
2022-09-27 15:52:40 -07:00
daemyung jang
d291ec739b Update cgltf to version 1.13 (#6099) 2022-09-23 11:52:57 -07:00
Mathias Agopian
0dc0bbd4f3 LiSPSM is now a user settable option 2022-09-22 09:35:45 -07:00
Mathias Agopian
984a029ce4 fix (again) the box-frustum intersection
it is not true that the whole box is inside the frustum if we have
8 vertices and some frustum vertices are in the box -- that's even
non-sensical.

We now test for this case by checking that we have all (8) vertices of
the box inside the frustum.

This caused some shadows to be missing.
2022-09-22 09:35:28 -07:00
Mathias Agopian
1cbc1f30a6 filamesh: handle empty meshes
empty meshes would cause a OOB read.

b/246719043
2022-09-20 16:45:45 -07:00
Mathias Agopian
08fb39a1e4 Fix buffer overflow in matc
b/247441389
2022-09-20 16:45:45 -07:00
Mathias Agopian
d8a71ce195 minor cleanup and IDE warning suppression 2022-09-20 16:45:45 -07:00
Mathias Agopian
13986c12bc fix out of bounds access in matc
b/247442731
2022-09-20 16:45:45 -07:00
Mathias Agopian
cc64704a82 fix buffer overflow filamat
b/247447117
2022-09-20 16:45:45 -07:00
Benjamin Doherty
df2ad99260 Release Filament 1.27.1 2022-09-20 11:04:07 -07:00
Mathias Agopian
fb1f277b9a attempt to fix android build again 2022-09-20 09:11:42 -07:00
Mathias Agopian
0388161464 fix android debug build 2022-09-19 23:03:12 -07:00
Ben Doherty
e989d5603f Add MetalRingBuffer for future argument buffer management (#6087) 2022-09-19 16:18:54 -07:00
Mathias Agopian
defaa0d008 use ES3.1 headers
We now compile with ES3.1 headers but we make sure we can still compile
with ES3.0 headers (still needed for iOS).
2022-09-18 20:37:43 -07:00
Mathias Agopian
e161ba80f2 cleanup: move string_view over string uses 2022-09-16 18:31:48 -07:00
Philip Rideout
034aaff56c gltfio: FilamentInstance owner is now const.
In the future, we will allow instances to be constructed from
immutable assets (this is a Google feature request) so this PR
prepares for that.
2022-09-16 16:32:49 -07:00
Mathias Agopian
b0fb52c5f4 matinfo: fix feature level print output 2022-09-16 16:22:25 -07:00
Philip Rideout
a05f9c172f gltfio: change instancing behavior for punctual lights 2022-09-16 15:32:18 -07:00
Ben Doherty
adde936d18 Update glslang to c0cf8ad87 (master) (#6076) 2022-09-16 12:29:56 -07:00