Commit Graph

4693 Commits

Author SHA1 Message Date
Mathias Agopian
b2ed544ee8 More cleanups in PostProcessManager 2022-03-21 10:46:55 -07:00
Mathias Agopian
a40ee77326 minor cleanups 2022-03-21 10:46:55 -07:00
Mathias Agopian
85135e60c7 Switch SSR texture to 2D array
At this point there is no benefit from doing this, but we'll need this
in a later PR.
2022-03-21 10:46:55 -07:00
Mathias Agopian
bee9f160fa gaussian passes now handle 2d arrays better
Instead of passing the level and layer explicitly to gaussianBlurPass,
we rely on the information already contained in the handle. i.e. we
honor the "subresource" part of the handle (if it has one).
In other words, it's now possible to pass a subresource (e.g. a layer)
to generateGaussianMipmap or gaussianBlurPass and things should work as
expected.
2022-03-21 10:46:55 -07:00
Mathias Agopian
64c67258b0 fix FrameGraph dependency issue
The problem here would happen when forwarding a subresource (i.e. 
replacing an existing resource by a subresource) and the existing
resource had been written to. In this situation, the subresource's 
parent needs to depend on the subresource (i.e. as if it was written to
by it). This would normally happen during write() but in this situation,
the write had already happened.
2022-03-21 10:46:39 -07:00
Mathias Agopian
49e0f484e9 fix a framegraph dependency issue
the dependency graph would be incorrectly severed in the situation where
a subresource was written to and later its parent was read from.
In this situation, the parent node is in fact a new version of the 
original parent node, so we need a "read" dependency of the orginal to
the copy (otherwise the orginal node is not a dependent of anyone
and gets culled).
2022-03-21 10:46:39 -07:00
Mathias Agopian
dbc78ff0aa Fix screen-space reflections when post-processing and MSAA are off
when we're rendering directly into the swapchain, we can't have a 
history buffer, so in that case we need an intermediate buffer.
2022-03-21 09:10:51 -07:00
Romain Guy
ebca955682 Clear warnings 2022-03-19 12:58:18 -07:00
daemyung jang
d8ea26e305 Update MAX_MORPH_TARGETS to 256 2022-03-18 15:42:02 -07:00
Philip Rideout
37aafdd912 WebGL endFrame: restore additional default state. 2022-03-18 14:23:08 -07:00
Mathias Agopian
edf78afa8e fix warnings from updating macos toolchain 2022-03-17 15:45:09 -07:00
Mathias Agopian
1df4218deb fix python3 detection in cmake 2022-03-17 15:45:09 -07:00
Ben Doherty
1c5715824f Avoid linking clashes with BlueGL and OpenGL (#5323)
Some clients need to link against both Filament and OpenGL. This can lead to symbol clashes under certain circumstances. As a fix, prefix all of our `bluegl` symbols with `bluegl_`. Previously we made this naming change for Windows, but now we'll do it on all platforms for simplicity.
2022-03-17 11:41:38 -07:00
Philip Rideout
6da46b3b62 Repair A2C for opaque views, add field to FrameUniforms. 2022-03-17 10:01:27 -07:00
Philip Rideout
e8d8080928 New behavior for BlendingMode::MASKED.
The existing behavior was surprising for users who draw opaque objects
into a semitransparent views, and this was especially evident with
the labels in `TextureLinearInterpolationTest`.

We now disable blending for MASKED, which is what our existing materials
documentation already says. We also now set the fragment alpha to 1 when
the fragment is not discarded, which prevents the "punch through"
effect. This is consistent with ThreeJS.

Fixes #4576.
2022-03-17 10:01:27 -07:00
Philip Rideout
e7934314ad WebGL: reset VAO and texture bindings when frame ends. 2022-03-17 10:00:51 -07:00
daemyung jang
c79fcf6d8d Fix a typo (#5324) 2022-03-16 08:42:30 -07:00
Mathias Agopian
3eb2a20c7f fix point light lighting with ortho projection
The froxel parameter for the Z slice were not correct.

Fixes #5318
2022-03-15 21:19:25 -07:00
daemyung jang
da99fe63be Make public gltfio's math 2022-03-15 09:11:12 -07:00
daemyung jang
d9067af3a3 Retrieve skins from FilamentAsset 2022-03-15 09:10:52 -07:00
LaiJF
f10bedf186 Fix typo. (#5319) 2022-03-14 19:30:57 -07:00
Mathias Agopian
19b0ad2605 fix a race in jobsystem (2nd attempt)
We were decrementing activeJobCount after removing the job from the
queue, which could cause other threads in the pool to preempt us before
the decrement, causing them to spin forever trying to get a non-existant
job, until the decrement actually happened.

Now we always decrement first and fix-up the count if we couldn't get
a job from the queues. The race is inverted, and doesn't cause threads
to spin a long time.


fixes b/201100123
2022-03-14 16:40:02 -07:00
Philip Rideout
6e7af103d3 Vulkan: misc SwapChain-related cleanup.
This removes some special handling of the default render target lifetime
that is no longer needed, and renames "surface" to "swapChain" where it
is appropriate to do so.
2022-03-14 16:23:31 -07:00
Philip Rideout
8a91723dcf Vulkan cleanup: remove some state from the VulkanDriver class. 2022-03-14 16:23:31 -07:00
Benjamin Doherty
47e30c337e Release Filament 1.20.3 2022-03-14 14:17:25 -07:00
Philip Rideout
fb627d8b66 gltfio: decouple MaterialProvider lifetime from AssetLoader.
This is a gltfio API change (!)

Jave clients now need to call destroy on MaterialProvider.

Previously, the Java AssetLoader took over ownership of a native
material provider upon construction, but this was neither documented
nor consistent with the C++ layer. (This is historical; in the past we
did not expose MaterialProvider to Java.)

One motivation for this (aside from API consistency) is that users may
wish to preserve the material cache from one run to another.

Fixes #5132.
2022-03-14 08:56:33 -07:00
Alexander Biggs
1cb59685c5 Fix precondition for morph weights. (#5308)
Was checking for `MAX - 1` instead of `MAX`.
2022-03-10 16:46:33 -08:00
Mathias Agopian
2b395f1d89 minor ResourceList cleanup 2022-03-10 16:20:36 -08:00
Mathias Agopian
e9718fa346 cleanup attributes/varyings generation
We now have a single varyings.glsl containing our varyings for both
the vertex and fragment shader. This file is included with the right
definition of VARYING as `in` or `out`.

inputs.vs is now renamed attributes.vs
2022-03-10 16:20:18 -08:00
Philip Rideout
81fc2c1d23 Always apply bone matrices, even for non-animated models.
This changes the WebGL and desktop glTF viewers so that they always
call `updateBoneMatrices`, even when there are 0 animations. Note
that our Android sample was already doing this correctly.

When combined with #5301, this fixes #5299, although users would need to
use the `recomputeBoundingBoxes` feature in gltfio (`-r` in the desktop
viewer) for this model to be scaled to fill the viewport, since its
embedded bounds are quite large.
2022-03-10 13:41:35 -08:00
Philip Rideout
dc60f57a9a gltfio: simplify API, make animator always available.
In the past there was an API gotcha because users had to "get" the
animator before releasing the glTF source data. This could have been
surprising because it was a getter method, not a factory method.

This was due to overeager optimization on my part, I wanted to avoid
animator overhead for non-animated models, when in fact it has very
little overhead.

Moreover, the animator is conceivably useful even when there are no
pre-supplied animations (e.g. for applying skins), so let's just create
it unconditionally.

Motivated by #5299.
2022-03-10 11:36:46 -08:00
Mathias Agopian
5c4f12fa00 create only a single "default render target"
we didn't need one per Renderer, and doing so created complexity in the
backends.

fixes #5291
2022-03-10 11:29:17 -08:00
Romain Guy
00ffd9ca74 Update README.md 2022-03-10 11:02:06 -08:00
daemyung jang
166f859c72 Retrieve morph target count from the primitive (#5297)
Morph weights can be zero even if the primitive has morph targets.
2022-03-10 10:56:50 -08:00
daemyung jang
1969186fe1 Compute the rotation between two vectors (#5288)
Co-authored-by: Mathias Agopian <pixelflinger@gmail.com>
2022-03-10 10:42:44 -08:00
Philip Rideout
e1e7854d97 BlueVK: remove flaky operator<< for flags, update GitHub paths.
Two changes:

1) Khronos has moved from "master" to "main".

2) BlueVK was attempting to generate reasonable "operator<<" support for
bit flags but this was buggy due to type aliases. Since we weren't using
it anyway, I simply removed this functionality from BlueVK.
2022-03-08 16:58:21 -08:00
Philip Rideout
9d5220e28e Regenerate BlueVK for Vulkan 1.3. 2022-03-08 16:57:56 -08:00
Philip Rideout
fc0b41d587 VulkanTexture: remove VkAspect state, derive it on the fly.
This fixes a validation warning, since not all depth textures are
necessarily used as depth attachments.
2022-03-08 14:24:44 -08:00
Benjamin Doherty
e4cb861817 Release Filament 1.20.2 2022-03-07 14:09:43 -08:00
Mathias Agopian
640f080ea6 fix TargetBufferInfo uses an union for the face (uint8_t) and layer (uint16_t)
Instead of having 2 fields we're following the vulkan convention of
having only the layer field.

The layer/face convention is still maintained in the public APIs.

fixes #5273
2022-03-04 17:00:37 -08:00
Philip Rideout
eed4b3b839 Add comments about validation to Vulkan backend. 2022-03-04 14:10:14 -08:00
Philip Rideout
f48dafe87e Update remote page to fix invalid generic tone mapper key. 2022-03-04 09:47:53 -08:00
Philip Rideout
daff8fea9f Android Viewer: fix URI bug when dropping some zips.
Dragging a zip file into the Remote Viewer page would fail if it
contained a glTF with `./` prefixes in the `images` section. The best
fix is to use Java's proper URI object rather than trying to parse the
string.
2022-03-04 09:15:37 -08:00
Philip Rideout
51b4a38e20 DriverAPI: add isAutoDepthResolveSupported query. 2022-03-03 14:59:20 -08:00
Philip Rideout
2171e372ce Vulkan: assert if Filament asks to resolve depth in the render pass. 2022-03-03 14:59:20 -08:00
Philip Rideout
1a30709121 Fix Android warnings in Vulkan backend. 2022-03-03 10:37:53 -08:00
Philip Rideout
2ed9b11f50 Bring back initialization of DummyMorphTarget.
This fixes "uninitialized texture" warnings from the Vulkan backend
when viewing Littlest Tokyo in a debug build.
2022-03-02 16:15:57 -08:00
Benjamin Doherty
1797ff5d90 Release Filament 1.20.1 2022-03-02 15:46:41 -08:00
Philip Rideout
8c46e6de9b matdbg: repair invalid JSON and display of active variants.
The JSON response to /api/active became malformed after #4465 because
raw hex strings need to be enclosed by quotes.

This commit changes the variant format in the /api/materials response
to be consistent with one used for /api/active. By using integers
instead of strings, we're avoiding the need to parse integers at run
time.

The JSON error did not appear in the Chrome console because it was being
silenced as a hack to appease "matinfo --web-server". I fix this by
removing the hack and simply emitting a valid response when there's
no live backend.

Also fixed the display of materials, which were always being marked
as active even when they had no active variants.
2022-03-02 15:01:25 -08:00
Philip Rideout
613adfa342 VulkanPipelineCache: fix use-after-free when growing pool.
We held a reference to a cache item after potentially clearing it due to
pool growth. I was able to trigger an error only after enabling ASAN and
loading a large model.  Many thanks to @jeanlemotan for catching this.
2022-03-02 14:59:10 -08:00