Commit Graph

3432 Commits

Author SHA1 Message Date
Philip Rideout
eeccfed8e4 Rewrite and enhance test_FeedbackLoops.
Previously this test was actually finding a ReadPixels failure on Intel
GPU's, rather than a failure of feedback loop behavior. This was due to
the fact that it was calling ReadPixels on a non-zero miplevel, which
seems to be unsupported on Intel GPU's.

The test now follows the downsample phase with an upsample phase, just
like the real bloom effect. This allows us to issue ReadPixels on the
base level, thus making the test more targetted to rendering feedback
loops.
2021-01-29 15:06:57 -08:00
Philip Rideout
893ed861e9 gltfio on Java: free material cache in AssetLoader#destroy
Fixes #3469
2021-01-29 14:42:54 -08:00
Romain Guy
411ae23512 Update Kotlin, Gradle and NDK dependencies (#3470)
* Update Kotlin, Gradle and NDK dependencies

* Update CI build
2021-01-29 12:09:08 -08:00
Romain Guy
8f05984551 Update release notes 2021-01-29 09:31:36 -08:00
Romain Guy
4567b01c1d Multi-thread shaders generation when compiling materials (#3464)
* Stop using members as globals between methods

* Multi-thread shaders generation with JobSystem

* Pass JobSystem to MaterialBuilder::build()

* Fix MeshAssimp to use the new API

* Allow the Java API to pass a job system via Engine

* Update docs

* Apply suggestions from code review

Co-authored-by: Philip Rideout <philiprideout@gmail.com>
2021-01-29 09:30:37 -08:00
Philip Rideout
29315f9a1b gltfio: fix crash during async texture decode.
Recall that we now use shared_ptr to simplify lifetime management of
cgltf source data (#3413).

Before this commit, we were only using shared_ptr to retain the source
data during buffer uploads. After this commit, we are using it to retain
source data during texture decoding.

Fixes #3428.
2021-01-29 09:06:32 -08:00
Ben Doherty
d4a2d30a1c Fix sporatic data race warning seen in Google3 (#3462) 2021-01-27 16:38:38 -08:00
Philip Rideout
cec5f3e988 gltfio: disable shader optimizations by default
Note that ubershaders (which are always used on Android and WebGL) are
still optimized by default.
2021-01-27 11:40:51 -08:00
Romain Guy
02501c6e60 Modulate emissive by alpha on blended objects (#3459)
This prevents light from being emitted from completely
transparent pixels.
2021-01-26 16:35:49 -08:00
Ben Doherty
4d8da14c1f Update universal library option in build.sh for Apple silicon (#3458) 2021-01-26 16:34:46 -08:00
Philip Rideout
4fae917fb5 Introduce optional ping-ping bloom implementation.
Second attempt after abandoning #3451.

Feedback loops do not work with Chrome or Intel GPU's, so we now have an
optional ping-pong implementation of Bloom.

Issue #2338.
2021-01-26 15:08:39 -08:00
Philip Rideout
c84036c8c4 Update JavaScript bindings and demo to prep for Bloom workaround. 2021-01-26 13:18:03 -08:00
Philip Rideout
34429f5490 Add unit test for feedback loops.
This test passes on my Radeon GPU MacBook but fails with an Intel GPU.
2021-01-26 13:12:46 -08:00
Philip Rideout
59c2d5bef3 Plumbing for disabling feedback loops on Intel.
This is a follow-on to #3451, which adds optional ping-pong support to
the bloom generator.
2021-01-26 13:12:24 -08:00
Ben Doherty
a3412c4f45 Remove shadow cascade visualization from unlit variants (#3455) 2021-01-26 11:20:54 -08:00
Philip Rideout
564d846be5 Repair backend unit tests on macOS.
This fixes "illegal hardware instruction" seen on my MacBook, which
is the same as #1839, but triggered only in a test environment where
the main thread is the same as the driver thread, and filament is built
with HAS_THREADING enabled.
2021-01-26 08:57:16 -08:00
Romain Guy
41186340c9 Change visibility of a few color grading options 2021-01-25 08:49:25 -08:00
Ben Doherty
96bba71739 Update combine-static-libs.sh script to work with universal binaries (#3447) 2021-01-22 15:57:43 -08:00
Adrian Perez
5ab7a9e3ab Add swap() methods to Allocator.h (#3445)
* Add swap() methods to Allocator.h

This allows StructureOfArraysBase's move constructor to compile.
Removed an apparent workaround in SingleInstanceComponentManager.

* swap can be noexcept

* Add swap() methods to Allocator.h

This allows StructureOfArraysBase's move constructor to compile.

Co-authored-by: Mathias Agopian <pixelflinger@gmail.com>
2021-01-22 15:45:20 -08:00
Mathias Agopian
4c30067dac fix missing froxel
Fix a possible out-of-bound access when reading the x-planes array. 
Also account for the fact that the loops filling the froxels assume
stl-like iterators (1-past the end on the right), while the indices
themselves were right-inclusive.

fixes #3142
2021-01-19 17:31:43 -08:00
Philip Rideout
243ba77025 gltfio: support animation in dynamically-added instances.
I tested this by viewing CesiumMan with our `gltf_instances` sample app.

There is now a need for some general refactoring in gltfio. I feel that
the high-level objects have become too tightly coupled to each other.

Fixes #3137.
2021-01-19 16:37:54 -08:00
Mathias Agopian
229f1f6d95 make sure the ResourceAllocator stays below the cache size limit
Only items older than a certain value were purged from the cache,
this allowed the cache to grow unbounded before this age limit was
reached.

We now purge the cache at each frame if it's above the size threshold.

Fixes #3381
2021-01-19 15:20:37 -08:00
Mathias Agopian
bc2eae2ecd fix filament_test on aarch64 mac
don't use slog from a static variable, because it might not have been
constructed yet, due to static initialized order.
For some reason, this happens on aarch64 macs, but this was actually
a real problem.
2021-01-19 15:20:11 -08:00
Philip Rideout
e468ec91b7 Metal: honor inverseFrontFaces RasterState.
Fixes #3402.
2021-01-19 10:35:14 -08:00
Philip Rideout
ca2829461a Add options to planar reflection demo.
By default, the demo now reflects the camera instead of the renderable.
However this can be changed via the command line. Users can now change
the backend too.
2021-01-19 09:16:50 -08:00
Philip Rideout
7805687f7a Update emsdk version in README. 2021-01-16 09:17:56 -08:00
Mathias Agopian
af82aaa0fc remove unused code that causes warnings 2021-01-15 14:38:01 -08:00
Mathias Agopian
410ecfd014 support for Apple Silicon macs
- add darwin-aarch64 support to bluegl
- remove all aarch64 conditions in our cmakefiles, the architecture
  is better handled in the source files (to allow fat binaries later)
2021-01-15 14:02:19 -08:00
Mathias Agopian
0df1f9fcce hack libfilament_jni to compile on Apple Silicon
The problem is that we're trying to link against an x86 jdk and that
fails, in turn preventing the library to link.
2021-01-15 14:02:19 -08:00
Mirsfang
45f7e07832 fix material use (#3417)
* fix material use

* Update filament/src/PostProcessManager.cpp

Co-authored-by: Mathias Agopian <pixelflinger@gmail.com>
2021-01-15 13:59:09 -08:00
Mathias Agopian
1aefe741b2 update libpng to 1.6.37 2021-01-15 12:10:03 -08:00
Mathias Agopian
d1842919cf update zlib to 1.2.11 2021-01-15 12:10:03 -08:00
Philip Rideout
6473771f1e Update Draco to 1.4.1
Tested with gltf_viewer release macOS on:

- CesiumMan/glTF-Draco/CesiumMan.gltf
- MorphPrimitivesTest/glTF-Draco/MorphPrimitivesTest.gltf
2021-01-15 11:03:29 -08:00
Philip Rideout
2d57a82b49 Add simple RenderTarget demo (planar reflection)
When we removed the old "ghetto bloom" demo, we ceased to have any
samples demonstrating the RenderTarget API. This demo is a fairly simple
demonstration of planar reflection.
2021-01-14 16:27:18 -08:00
Romain Guy
dc2d55c409 Update static documentation 2021-01-14 10:29:38 -08:00
Romain Guy
c0b8e98a93 Update documentation to fix broken links 2021-01-14 10:28:56 -08:00
Philip Rideout
8252bbe512 gltf_viewer: fix very sporadic crash when exiting.
This could occur when trying to exit the app while textures
are still being decoded.
2021-01-13 09:48:36 -08:00
Philip Rideout
a4817f3e2a Simplify lifetime management of cgltf_data.
The gltfio API allows users to destroy ResourceLoader or FilamentAsset
even when various asynchronous work (e.g. uploading buffers to the GPU)
has not yet been completed. This was achieved in an error-prone manner
using manual reference counting and an internal management object called
AssetPool.

This PR refactors gltfio by wrapping cgltf_data in shared_ptr, which I
usually try to avoid. However in this case it provides the precisely the
functionality that is needed.

I tested this PR for memory leaks and crashes by hacking gltf_viewer
and monitoring memory usage in Activity Monitor.

This fixes #3383 and makes it easier to implement some missing features,
such as animation support for instanced assets.
2021-01-13 09:44:56 -08:00
Philip Rideout
fa879b4bd0 gltf_viewer: call asyncCancelLoad in drop handler
Relates to #3383
2021-01-08 09:40:39 -08:00
Ben Doherty
005e4ba2ec Fix Filament RenderingTest (#3407) 2021-01-07 12:10:53 -08:00
Romain Guy
d2299c4502 List supported glTF 2.0 features 2021-01-06 14:20:46 -08:00
Philip Rideout
5c666c254e gltfio: Improve robustness when decoding textures.
Bad texture files would cause the background decoder thread to never
finish and would generate textures with 0x0 dimensions, which eventually
triggers GL_INVALID_VALUE.

To recap, gltfio texture loading has two phases: the first phase is
synchronous and uses stbi_info to gather texture info. The second phase
is asynchronous and uses stbi_load to do the actual decoding.

During the first phase, we now check the return code from stbi_info
rather than assuming that it worked.  :)

Fixes #3344
2021-01-05 12:00:29 -08:00
ritwik
a09c17bd4f Make install gltfio_resources and gltfio_resources_lite for desktop builds also 2021-01-05 10:35:13 -08:00
Ben Doherty
57df4481e9 Update Material query API to work with subpasses (#3203)
* Update Material query API to work with subpasses

* Add JNI binding
2020-12-23 13:27:04 -08:00
Ben Doherty
47af85aed1 Remove libSPIRV-Tools-shared from spirv-tools (#3390) 2020-12-23 13:26:14 -08:00
Ben Doherty
44fc295913 Unbind texture from all sampler groups upon destroy (#3386) 2020-12-22 11:34:05 -08:00
Philip Rideout
6878b0be36 build.sh: Add TypeScript bindings to the tgz file.
This makes the tgz consistent with the npm package. Fixes #3268.

Note that we already stopped packaging the old HTML docs. Going forward,
we would like to use the TS declarations as documentation because they
must be kept up to date anyway, and they already contain type
information. This was discussed in #3250.
2020-12-21 17:27:46 -08:00
Romain Guy
6c222bf4e3 Update README 2020-12-15 14:48:38 -08:00
Romain Guy
eb70fd5dee Sample the proper channel for sheenRoughness 2020-12-12 18:05:02 -08:00
Romain Guy
986a3869cc Fix struct initialization 2020-12-12 17:40:48 -08:00