Commit Graph

3074 Commits

Author SHA1 Message Date
Philip Rideout
b45d45048c Vulkan: fix Android after pause / resume.
This fixes the visual hang that would occur after going to the task
switcher and back.

After recreating the swap chain, all of its associated fences and sync
objects become invalid. Since we were not tracking this, FrameSkipper
was going into an infinite wait after the swap chain was created.
2020-08-11 16:51:45 -07:00
Philip Rideout
fb8c51c5e1 Fix resizing issues with MoltenVK.
This removes the old getClientExtent stuff that I added a while back,
and replaces it with the strategy espoused by the MoltenVK author found
here:

https://github.com/KhronosGroup/MoltenVK/issues/428

I tested this PR on macOS with Vulkan and Metal. I tested both on high
and low DPI displays. I also tried dragging the window between the two
displays.

Android still has issues with rotation, I will deal with that next.

cleanup
2020-08-11 16:51:23 -07:00
Pixelflinger
6a47924482 make use of textureLodOffet where appropriate
this really makes the code easier to read and has a chance to be
more efficient
2020-08-11 10:39:56 -07:00
Philip Rideout
8fdcd8fa62 Vulkan: allow blit to default render target.
This fixes a null pointer exception that we saw after disabling several
View -process effects.
2020-08-11 09:24:29 -07:00
Philip Rideout
6b6f80562f Vulkan: add null checks for Molten. 2020-08-11 09:24:29 -07:00
Pixelflinger
08e411aeac API CHANGE: make ssao options work like all other options
setAmbientOcclusion (and associates) is now deprecated (but still works),
in favor of the new .enabled field in AmbientOcclusionOptions.
2020-08-10 17:23:03 -07:00
Pixelflinger
b3c57a4ee1 add TAA controls in material_sandbox 2020-08-10 13:30:05 -07:00
Pixelflinger
0947f80974 TAA: tweak quality parameters for mobile
on mobile we only use the variance box instead of
min/max+variance, this saves a few hundred us.
2020-08-10 11:14:34 -07:00
Pixelflinger
8155bf04a8 Implement variance clamping
variance clamping further shrinks the min/max AABB
2020-08-10 11:14:34 -07:00
Pixelflinger
815483c5e0 execute structure pass before TAA
This fixes a lot of flickering when SSAO and TAA are enabled.
SSAO TAA shouldn't be done based on a jittered depth buffer, but
rather on jittered samples.
2020-08-10 11:14:34 -07:00
Pixelflinger
05bfa632ff Add TAA java bindings 2020-08-10 11:14:34 -07:00
ruitaocc
931daf3a69 fix typo 2020-08-10 08:58:24 -07:00
Pixelflinger
4821a95f16 Implement basic tamporal antialiasing (TAA)
while this started as a sample to demonstrate how to use the new
frame history feature, this is now solid enough to become a feature.

this version of TAA doesn't use motion vectors, so it is prone to
various artifacts (e.g. ghosting). It also has the typical issues
TAA has (e.g. transparents).

with that said, performace is good and quality is overall superior
to FXAA or MSAAx4.
2020-08-07 20:51:46 -07:00
Romain Guy
4c0a5b5f1d CMake cleanup 2020-08-07 14:21:27 -07:00
@roxlu ☾
4ba95428c2 New options that allow you to specify the buffer sizes. (#2925)
* New options that allow you to specify the buffer sizes.

* Removed debug info

* Style/location fixes
2020-08-07 14:17:44 -07:00
Philip Rideout
732a6c08de Add Texture getters to IndirectLight and Skybox.
Fixes #2851.
2020-08-07 11:49:24 -07:00
Romain Guy
0584cea125 Update website 2020-08-07 11:02:38 -07:00
Romain Guy
058c9cd28b Update docs 2020-08-07 10:55:11 -07:00
Romain Guy
2ce3b88a13 Fix ccache scripts 2020-08-07 09:03:51 -07:00
Philip Rideout
c7c1c01a0e JavaScript: fix typo in clearAssetCache. 2020-08-06 16:47:29 -07:00
Philip Rideout
827e73b682 JavaScript: add clearAssetCache helper. 2020-08-06 16:41:35 -07:00
Philip Rideout
7ada8372f2 gltf_viewer: fix ColorGrading leak. 2020-08-06 15:12:53 -07:00
Philip Rideout
749a4d01af gltfio: fix some small memory leaks.
This fixes two oversights in the FilamentAsset destructor:

- Destroy the faux root Entity.
- If it exists, remove the name component from each Entity.
2020-08-06 15:12:53 -07:00
Philip Rideout
f4004cf047 JavaScript bindings: fix a frequent 4-byte memory leak.
In retrospect, I should've exposed ints to JS instead of entities.
Making this fix is already a TODO, but it will be a tedious change. For
now, this PR fixes two issues that were causing tiny but frequent memory
leaks, according to the emscripten memory leak widget.

(1) Do not include Entity in the list of classes that should only be
passed around by pointer.

(2) Clients should always call delete() on returned Entities.
2020-08-06 14:45:28 -07:00
Philip Rideout
dc74ee2ddc Refactor CallbackUtils. 2020-08-05 17:27:12 -07:00
Philip Rideout
2727cddd7a TextureHelper: add overload with a release callback.
Fixes #2909.
2020-08-05 17:27:12 -07:00
Pixelflinger
4f239c3e3c fix a moveResource which was broken recently
a recent fix actually badly broke moveResource, we were using the
index of the newly created resource instead of the pass index.
2020-08-05 13:10:16 -07:00
Philip Rideout
4bf0d0c0a8 Web: Remove broken webpack example.
This example has fallen out of date, I tried to resurrect it but it
turned out to be non-trivial, given the special nature of emscripten's
generated JavaScript wrappers.

It might be better to provide an example that uses rollup, since that's
the bundler that model-viewer uses, or a simple TypeScript example.

For now, I think our simple HTML + raw JS samples are sufficient.
2020-08-05 11:19:08 -07:00
Pixelflinger
d70f1c0ab2 Infrastructure for frame history data
We can now save an arbitrary (but decided at compile time) number of
entries containing information about previous frames and it for while
drawing the current frame. Typically this is used for such effects as
TAA, screen-space reflection, building probes over time, etc...

Currently the frame history consists of one frame per View. FView 
provides a new (internal) getFrameHistory() method used to access
previous frames entries as well as to save the current's frame
information.

The FrameGraphPassResources (which is available in the execute closure
of a FrameGraph pass) has a new detach() method which can be used to
remove that resource from the FrameGraph lifetime management, at which
point it becomes the responsibility of the caller. Typically this
resource will be stored in the frame history.
2020-08-04 15:01:09 -07:00
Pixelflinger
991861a512 make fg resources creation/destruction more generic
creation/destruction now takes a ResourceAllocatorInterface instead of
a FrameGraph.
2020-08-04 15:01:09 -07:00
Pixelflinger
d0367a359b move ResourceAllocator out of the fg namespace 2020-08-04 15:01:09 -07:00
Mathias Agopian
d2be23045f fix a FG crasher when we have more than 32 passes (#2911)
The FrameGraph cannot store pointers internally because all objects
are stored in vectors. Unfortunately we were storing the writer of
resources as a pointer. 

This is fixed by storing an index instead.
2020-08-04 15:00:38 -07:00
Ben Doherty
4cb903a09e Fix variant-limiting bug in matdbg (#2903) 2020-08-03 11:16:33 -07:00
Philip Rideout
3ca0a8cd8d Transmission should use FADE. (#2908)
Fixed #2907.
2020-08-03 10:51:26 -07:00
Philip Rideout
2c18d7f576 Revert "Transmission should use FADE."
This reverts commit 379f92417f.
2020-08-03 10:45:46 -07:00
Philip Rideout
379f92417f Transmission should use FADE.
Fixed #2907
2020-08-03 10:44:15 -07:00
Ben Doherty
13574f793c Run MergeReturnPass only on mobile (#2901) 2020-07-31 18:40:47 -07:00
Ben Doherty
f69ba63046 Don't crash for invalid Metal programs when using matdbg (#2902) 2020-07-31 18:39:57 -07:00
Pixelflinger
a13620c66d reorganize material folder
Sets of post-process materials are in their own folder now.

Also moved fxaa.fs from shaders/ to materials/ so it's next to the 
material that includes it. This file is not shared with any other
material.
2020-07-31 10:36:44 -07:00
Pixelflinger
b4a35c3ee2 fxaa: highp precision seems overkill 2020-07-30 23:46:09 -07:00
Ben Doherty
a4e3e0c2d1 Ignore commented-out #includes in material files (#2897) 2020-07-30 18:46:16 -07:00
Ben Doherty
1a85c93894 Fix DEBUG identifier used in Log.h (#2895) 2020-07-30 16:43:42 -07:00
Philip Rideout
2c114a9a9f Add mask smoothing to the unlit path. 2020-07-30 15:14:46 -07:00
Philip Rideout
f4d8753c24 MASKED mode now leaves destination alpha intact.
This prevents strange behavior with semi-transparent render targets,
which the model viewer team discovered when testing against the Khronos
alpha test conformance model.
2020-07-30 15:14:46 -07:00
Ben Doherty
6f28da4798 Fix Podspec for 1.8.1 (#2894) 2020-07-30 13:54:12 -07:00
Philip Rideout
a6390355da Fix typos. 2020-07-30 13:50:51 -07:00
Romain Guy
a120e0a4bb Filament 1.8.1 2020-07-30 12:25:53 -07:00
Romain Guy
642fb5859b Filament 1.8.1 v1.8.1 2020-07-30 12:18:38 -07:00
Philip Rideout
b4623c9afc Add lightroom IBL, enable ColorGrading by default in gltf_viewer.
The non-legacy ACES is now default, it looks much better.

I also tested this IBL with WebGL and Android.
2020-07-30 11:39:36 -07:00
ruitaocai
c4546f1777 fix typo (#2892) 2020-07-29 22:46:50 -07:00