Commit Graph

4595 Commits

Author SHA1 Message Date
Philip Rideout
0ee540df9c Vulkan: fix hack, allow SSAO to read from all mips.
When we overhauled image layout transitions, we moved as many
transitions as possible into the render pass. However the transition
that we perform for "depth read only" layout needs to be applied to
multiple miplevels, so we cannot use the render pass for that.
2022-02-22 17:34:18 -08:00
Philip Rideout
249f0a80d8 gltfio: be graceful when model has > 4 weights per vert.
We now handle "too many bone weights" in the same way that we handle
"too many UV sets".  i.e. emit an error message and do not panic.

This change allows us to render the model in #5234 quite reasonably.

Fixes #5234.
2022-02-22 17:34:02 -08:00
Philip Rideout
b3368a3fb2 Vulkan: make validation messages slightly easier to read. 2022-02-22 09:10:05 -08:00
Philip Rideout
327576274f Fix web apps that have multiple Filament viewers.
This fixes the emscripten binding errors that we've been seeing
with the <filament-viewer> test page, which prevented us from
including web in the last few Filament releases.

The binding errors were caused by double-initializing the emscripten
module.

I fixed this by allowing clients (e.g. FilamentViewer) to call
Filament.init() more than once. We now accumulate a list of "on ready"
callbacks that get triggered after the emscripten module becomes ready.

As far as I can tell, multiple canvases were actually always broken, and
the viewer test page worked in the past only because we got lucky.
2022-02-22 08:42:36 -08:00
Mathias Agopian
0e7004a7f8 Automatically set read-only depth in the framefraph 2022-02-18 14:42:35 -08:00
Philip Rideout
ca8549549c Fix build break. 2022-02-18 14:41:59 -08:00
Philip Rideout
fa6d9a4b01 Upgrade emsripten to 3.1.5 2022-02-18 14:36:20 -08:00
Mathias Agopian
3693e4909b Workaround feedback loops limitation in GLES 2022-02-18 13:51:01 -08:00
Mathias Agopian
697a8370cb There was still a case where skinning wasn’t correctly default initialized
Fixes: #5185
2022-02-18 13:49:12 -08:00
Philip Rideout
155a362d60 Fix warning. 2022-02-18 13:37:28 -08:00
Philip Rideout
fed95d70b0 Vulkan: ensure that desired present mode is actually supported. 2022-02-18 11:20:52 -08:00
Philip Rideout
cd126138e0 Clean up readOnlyDepthStencil as per code review. 2022-02-18 10:00:06 -08:00
Philip Rideout
7e7398aa92 Assert valid usage of readOnlyDepthStencil in debug builds. 2022-02-18 10:00:06 -08:00
Philip Rideout
ede7c579f9 Add new backend hint to RenderPassParams.
Previously, the Vulkan backend made an educated guess about the depth
write state during the start of the render pass. The logic for this
did not make any sense, so now we're replacing it with an explicit
hint that PostProcessManager sets up. In a sense this gives backends
a sneak peek into the raster state.
2022-02-18 10:00:06 -08:00
Philip Rideout
67aa6f1913 Update old comments about max color attachment count. 2022-02-17 12:55:31 -08:00
Philip Rideout
80eba1de10 VulkanRenderTarget: remove duplicated state tracking.
Now that VulkanRenderTarget is always backed by textures, it no longer
needs to track state that is already tracked by VulkanTexture.
2022-02-17 08:31:02 -08:00
Philip Rideout
5e05a23e94 Vulkan: Remove duplicated layout tracking. 2022-02-16 16:21:07 -08:00
Philip Rideout
8c8061a637 Vulkan: simplify management of "default" render target. 2022-02-16 16:21:07 -08:00
Philip Rideout
9ef3c59698 Vulkan: clean up the SSAO image layout workaround. 2022-02-16 16:21:07 -08:00
Mathias Agopian
5f7c6c2fbf update material version
This this needed by recent SSR changes.
2022-02-16 11:20:28 -08:00
Mathias Agopian
991360da97 Missing public modifier in Texture.java
Fixes #5210
2022-02-16 10:24:20 -08:00
Mathias Agopian
50d9fb2b5b Fix typo in documentation
Fixes #5150
2022-02-16 10:23:59 -08:00
daemyung jang
001a3e3dc8 Set the morph target buffer by builder (#5179) 2022-02-16 09:20:38 -08:00
Romain Guy
b6eca61786 Update Gradle (#5208)
* Update Gradle

* Add comment
2022-02-15 17:01:17 -08:00
Philip Rideout
cc75eb3aa2 Vulkan: add comments explaining layout strategy. 2022-02-15 15:47:17 -08:00
Philip Rideout
f5fda88cf6 Vulkan: clean up ReadPixels and Blit paths.
VulkanSwapChain is now always backed by VulkanTexture, so these
code paths can be simplified.
2022-02-15 15:47:17 -08:00
Philip Rideout
e99f13b14d Fix some RangeMap behavior and improve its unit test.
The existing unit test had an incorrect expectation in what happens
after splicing an existing range. Fixing the unit test revealed an
actual bug in the RangeMap implementation. It should never modify the
lower bound of an existing interval, because that invalidates the
iterator. It should also never retain a pointer or reference to a range
when the range is potentially removed by subsequent codelines.
2022-02-15 15:46:34 -08:00
Romain Guy
08e809bf75 Update Android tooling (#5204)
* Update Android tooling

* Don't update AGP
2022-02-15 13:22:30 -08:00
Mathias Agopian
1d6aeb5de1 Add basic support for instanced renderables
We can now specify an "instance count" per renderable during creation. 
This instance count applies to all render primitives in the 
Renderable.

This will simply draw the renderable "instance count" times. A new
method available to vertex shaders, getInstanceIndex(), allows the
material to discriminate the instances and adjust the position/transform
accordingly.

Typically this is used for particle systems.
2022-02-15 13:11:23 -08:00
Mathias Agopian
d13ccd1c26 instancing support for the backends
We just add an instance count to the backend draw command.
2022-02-15 13:11:23 -08:00
Ben Doherty
54482e6451 Attempt to fix Windows CI builds (#5205) 2022-02-15 11:11:28 -08:00
Romain Guy
9491b36a25 It's ok compiler, it's ok 2022-02-15 08:17:10 -08:00
Mathias Agopian
d387e14d4c cleanup TAA
The new SSR code allows to clean-up TAA code a bit.
TAA should now be more standalone/abstracted.
2022-02-14 16:43:24 -08:00
daemyung jang
5c41b332ad Add Java binding to get morph target names 2022-02-14 16:40:32 -08:00
Benjamin Doherty
fd69c7ed75 Release Filament 1.19.0 2022-02-14 13:46:06 -08:00
Philip Rideout
3ff8d6dc22 Incorporate code review feedback. 2022-02-14 13:00:12 -08:00
Philip Rideout
af6fd21e11 Crucial refactoring of VulkanFboCache and VulkanSwapChain.
Two big changes to simplify and fix layout transitions:

(1) The RenderPassKey struct has been reduced from 88 bytes to 56 bytes
by using custom enum types and bitmasks. It also now has separate fields
for "final" and "initial" image layouts.

(2) VulkanSwapChain now leverages VulkanTexture, which enables it to
share tracking functionality, avoid duplicated state, and have less code
overall.

In a future PR we will clean up the ReadPixels and Blit paths, and also
remove some hacks that appease Vulkan when SSAO is enabled.
2022-02-14 13:00:12 -08:00
Mathias Agopian
5bd5c50c8d Remove unit test that is not very useful. 2022-02-14 12:03:07 -08:00
Elie Michel
2c8d296044 Make sure one use the right combination of version
To avoid `Material version mismatch`
2022-02-14 10:55:55 -08:00
Mathias Agopian
df6a100fcb Improve how we compute the lod from the roughness
The main change here is that for screen-space reflections, the lod
calculation takes the camera distance into account.

We also now correctly take into account that we blur each lod
successively which increases the standard deviation by 10%. This applies
to both refraction and reflection.
2022-02-13 22:53:47 -08:00
Mathias Agopian
3f6188edff Enable rough reflections
This works by first generating a reflection buffer which gets blurred,
then the color pass samples from this buffer according to the roughness
of the surface being rendered.

A lot of the changes here involve utilizing "reserved" variants for
the new "SSR" pass and all the fallout from that.
2022-02-13 22:53:47 -08:00
Mathias Agopian
cc0486b3cc Rework material Variant filters
Variants are no longer just a bit mask, but rather a combination of
some bits, depending on the variant. Because of that the variant filer
must be updated.

Basically we now make a distinction between the "variants" as a public
material API and the actual `Variant` data type.

This change does the impedance match between the two.
2022-02-13 22:53:47 -08:00
Mathias Agopian
8314bafc0e reformat Variant.h
indentation was wrong
2022-02-13 22:53:47 -08:00
daemyung jang
764c695e4e Fix typos 2022-02-12 19:30:19 -08:00
Philip Rideout
808ca42992 Vulkan: fix segfault during shutdown. 2022-02-11 16:45:23 -08:00
Philip Rideout
4a8428318b Refactor VulkanSwapChain to prep for image layout cleanup. 2022-02-11 14:50:51 -08:00
Philip Rideout
c93059783b VulkanDriver: fix VkImageView mismatch in render pass logic. 2022-02-11 14:50:51 -08:00
Mathias Agopian
d21f092645 make sure skinning bones are correctly initialized
Fixes: #5185
2022-02-10 20:34:53 -08:00
daemyung jang
9844803b26 Add function overloading for setMorphTargetBufferAt (#5169) 2022-02-10 15:55:41 -08:00
Philip Rideout
2e0ace5026 WebGL: another fix for BufferDescriptor bindings.
The previous code would convert each element of the source data
into 8 bit-per-element, but we wnat to preserve the original format
that the user provides.

The new solution is to use `slice()` which is a robust way to clone
all the data in a typed array.

This fixes the new regression with Triangle that Ben caught.
2022-02-09 15:41:15 -08:00