Commit Graph

4713 Commits

Author SHA1 Message Date
Mathias Agopian
6310ea46e3 fix dummy ssr history texture target type 2022-03-23 20:47:20 -07:00
LaiJF
ef8e3e5224 Fix typo. (#5355)
* Fix typo.

* Update filament/src/RenderPass.cpp

Co-authored-by: Romain Guy <romain.guy@gmail.com>

Co-authored-by: Mathias Agopian <pixelflinger@gmail.com>
Co-authored-by: Romain Guy <romain.guy@gmail.com>
2022-03-23 11:29:07 -07:00
Mathias Agopian
26cc722f74 remove SPVRemaper lib, fold it into glslang directly
This avoids a duplication of doc.cpp, the largest compilation unit
(about 650KiB).
2022-03-23 11:27:30 -07:00
Philip Rideout
043fdf7a51 Remove lite flavor from android-utils.
We noticed that the lite flavor isn't actually smaller, plus we need to
rework our Android library hierarchy anyway, so for now let's remove
this.
2022-03-23 11:18:25 -07:00
Mathias Agopian
c01105b49a Fix shadow frustum computation wrt projection matrix
Instead of recomputing the Frustum from its 8 vertices, we compute it
from the projection matrix directly. This ensures this works with any
projection matrix.  Building a Frustum object from 8 vertices required
these vertices to be given in a certain order which wasn't correct if
the projection was flipped for instance.

Removed the API to construct a Frustum from vertices.

fixes b/225975881
2022-03-23 09:41:14 -07:00
Philip Rideout
f56f5a300c Temporary workaround for WebGL builds on macOS.
Better fix is to replace etc2comp and astcenc with basis.
2022-03-22 22:21:57 -07:00
Mathias Agopian
8b79f3683e skip work when morphtarget weight is zero
fixes #5344
2022-03-22 22:21:41 -07:00
Benjamin Doherty
319bd123ce Fix, use zero texture array when SSR is of 2022-03-22 22:21:14 -07:00
Benjamin Doherty
e23243a65b Fix build breakage on Windows 2022-03-22 20:43:50 -07:00
Mathias Agopian
c4261a8c10 hide ostream implementation details into ostream.cpp
Fixes #5343
2022-03-22 16:14:13 -07:00
Mathias Agopian
009b58537e move BuilderBase to libutils and rename to PrivateImplementation 2022-03-22 16:14:13 -07:00
Mathias Agopian
e51709a4e8 Size optimizations in UniformInterfaceBlock 2022-03-22 15:28:40 -07:00
Mathias Agopian
78813ed9b7 get rid of ShaderStageFlags.h
move its content to DriverEnums.h, we do this because it is used
in libfilabridge, which has an unspoken rule that it only includes
DriverEnums.h.

filabridge also only has a header dependency, so it can't call any
method, not even operator<<.

Also cleanups and simplifications.
2022-03-22 15:28:40 -07:00
Mathias Agopian
2e649a9f16 size optimizations and cleanups of SamplerInterfaceBlock 2022-03-22 15:28:40 -07:00
Mathias Agopian
d36783cd1d cleanup a bit metal codegen for samplers
the main change here is that we actually go through all "binding points"
instead of hardcoding the ones we currently use.
2022-03-22 15:28:40 -07:00
Philip Rideout
101a59138c Update the zbloat tool
The tool now works with Python 3 and handles binaries that have multiple
embedded material archives.
2022-03-21 16:13:49 -07:00
Benjamin Doherty
3809259f47 Release Filament 1.20.4 2022-03-21 14:45:00 -07:00
Mathias Agopian
e103b28b41 The backend CANNOT depend on filabridge
This would mean that the backend is not independent of our material
system. Thankfully we didn't have too many dependencies that leaked
there.
2022-03-21 13:55:15 -07:00
Mathias Agopian
8e7d0c0df9 Fix a bug in Invocable that prevented function signatures that returned references from working 2022-03-21 13:55:15 -07:00
Mathias Agopian
d8845e5fcc greatly simplify SamplerBinderMap
The main simplification is that we don't need an actual map to retrieve
the global offset of a sampler, it can be easily calculated as:
  global_offset = offset_of_the_block + local_offset
2022-03-21 10:54:00 -07:00
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