Commit Graph

2399 Commits

Author SHA1 Message Date
Romain Guy
b176b2f0e6 Remove broken setLensProjection API (#2192) 2020-03-02 14:35:35 -08:00
Ben Doherty
af5805e396 Update XcodeGen and iOS sample projects (#2191) 2020-03-02 12:54:17 -08:00
Romain Guy
b98f45df60 Fix WebGL build (#2189) 2020-02-29 09:14:49 -08:00
Romain Guy
bb2571233d Update RELEASE_NOTES 2020-02-28 23:50:35 -08:00
Romain Guy
00629bac48 Add camera controls to gltf_viewer (#2188)
Exposure: shutter speed, aperture and ISO
Focal length

The shadow plane can now be toggled  at runtime.
2020-02-28 23:46:17 -08:00
Romain Guy
81e7f619eb Try to fix compilation error on Android (#2187)
* Try to fix compilation error on Android

* Try with a newer NDK...
2020-02-28 13:10:16 -08:00
Ben Doherty
b0ab9bb697 Remove unnecessary quotes from shader (#2186) 2020-02-28 10:50:52 -08:00
Romain Guy
ae1e6f43f2 Only compile materials for Vulkan when necessary 2020-02-28 09:51:47 -08:00
Romain Guy
6eba2f145e Properly fetch project properties (#2185) 2020-02-28 09:20:35 -08:00
Romain Guy
13666027cc Switch native code API level back to 21 2020-02-28 07:55:09 -08:00
Ben Doherty
62cef096e1 Refactor computeVisibilityMasks logic, visibility bits (#2179) 2020-02-27 16:28:47 -08:00
Mathias Agopian
af48b60876 split FrameGraphPassResources out of FrameGraph.cpp 2020-02-27 14:15:26 -08:00
Mathias Agopian
b71357a955 Allocators shouldn't crash when allocation fails
The allocator debug code didn't check that allocations where
successful before filling buffers.
2020-02-27 14:15:11 -08:00
Romain Guy
9865a609da Refactor Gradle files (#2180)
We now share all the C++/CMake flags from the root project.
2020-02-27 12:46:01 -08:00
Romain Guy
77bafb295e Fix library loading issue on API level 22 and below (#2178)
This change fixes #2176
2020-02-27 11:30:47 -08:00
Philip Rideout
ba4c9dbd09 Vulkan: use GENERAL layout for render target textures.
This fixes the validation error that occurs when rendering to one
miplevel while sampling from another. It might even be faster since
fewer layout transitions are required.
2020-02-27 09:33:38 -08:00
Mathias Agopian
4e9cf8ac02 Fir a deadlock when exiting on MacOS (GL backend)
Closes #2159

There was two issues:
1) Fence::wait would return prematurely when the the timeout was
   set to WAIT_FOREVER.

2) (At least) when running from the command line, events were not
   read from the main queue. Instead we have to use NSRunLoop instead
   of NSApplication APIs.
2020-02-27 09:33:14 -08:00
Romain Guy
108dae11e9 Add ground shadow option to gltf_viewer (#2174)
* Add ground shadow option to gltf_viewer

The shadow is always positioned at the bottom of the loaded object's
bounding box to ground it perfectly.

* Remove unused include
2020-02-26 17:09:31 -08:00
Benjamin Doherty
16de98291f Fix Metal filtering bug 2020-02-26 16:00:01 -08:00
Benjamin Doherty
547f8917b4 Update comment 2020-02-26 15:58:16 -08:00
Benjamin Doherty
f1da2ca643 Update RELEASE_NOTES 2020-02-26 15:58:16 -08:00
Benjamin Doherty
9e6ea9454f Refactor depth variant 2020-02-26 15:58:16 -08:00
Pixelflinger
fcd7e198c2 First step in reworking how rendertargets work in the framegraph
The ultimate goal is to get rid of the concept of render targets in
the framegraph, and this is the first step. Here RenderTarget doesn't
store the discard flags anymore. These flags are now calculated
per-resource, per-pass.

A side effect of this change is that the discard flags are now slightly
better, as they don't contain attachments that don't exist.
i.e. we won't see the STENCIL flag set for instance.
2020-02-26 15:57:42 -08:00
Pixelflinger
82523bd1d3 Add support for MRT to the backend
- this simply changes the createRenderTarget() API to take an
  'MRT' structure for the color attachment. The MRT structure is
  just a wrapper around an array of four TargetBufferInfo.

- in this PR only implemented for OpenGL
2020-02-26 11:39:57 -08:00
Romain Guy
4ec5fac95c Add support for KHR_materials_clearcoat to gltfio (#2169) 2020-02-26 10:11:34 -08:00
Pixelflinger
7fb3810eb1 cleanup command stream parameter passing
- the tuple<> where we store the parameters should only remove the
  reference, but not decay, so that arrays could theoretically
  be stored (more on this below).

- use std::forward<> instead of std::move<> in Command's ctor, this is
  more appropriate, we just want to forward the arguments unchanged.

- add std::move() to all parameters on the command stream stub, it is
  appropriate here, because we receive parameters by value or r-value 
  references.

All this was an attempt to support C-style arrays as parameters, but
it doesn't work because they are decay'ed to pointers when they
appear as parameters.
2020-02-25 21:29:59 -08:00
Romain Guy
ed2fe83491 Update cgltf to latest (#2168) 2020-02-25 19:21:48 -08:00
Philip Rideout
3fd9c49fb9 Update WebGL docs and website. 2020-02-25 13:50:34 -08:00
Philip Rideout
69c0843d20 MaterialInstance refactor duplicated code. 2020-02-25 13:43:32 -08:00
Philip Rideout
3f7ef9738d Fix regression with getDefaultInstance().
This caused color writes to be disabled in our "hello triangle" samples.

Fixes #2164.
2020-02-25 13:43:32 -08:00
Romain Guy
3cfc6981a4 Only build OpenGL and Vulkan shaders in Android samples 2020-02-25 10:24:25 -08:00
Romain Guy
8b2ea72be2 Fix emissive in unlit shaders
This change applies exposure compensation just like with
lit shaders.
2020-02-25 09:47:06 -08:00
Romain Guy
8eaa1f5e88 Add options to skip samples (#2163)
-DFILAMENT_SKIP_SAMPLES=ON with CMake
-Pfilament_skip_samples with gradle

This change also renames CMake options specific to Filament
to avoid clashes with subprojects.
2020-02-24 18:15:33 -08:00
Pixelflinger
c72f622a87 Minor changes to SAO
- minor uniform optimizations (saves ~0.1ms)
- fix some missing highp precision qualifers
- make it easier to tweak the blur filter
- make sure samples's radius goes from 0 to 1
- update comments
2020-02-24 18:06:49 -08:00
Ben Doherty
8a0505eb6f Fix Metal crash on Catalina (#2161) 2020-02-24 17:18:43 -08:00
Romain Guy
799e837f35 Upgrade to latest AGP 2020-02-24 12:28:29 -08:00
Philip Rideout
4690ce5602 WebGL: Improve the callback API for glTF.
After the native async functionality landed, there was no way for web
clients to be notified that the decoding has finished. This PR changes
the existing `onDone` callback so that it gets called after all textures
have been decoded. (Previously it was called after downloading rather
than decoding.)

This has the side effect of simplifying the API because clients no
longer need to call a finalize function.
2020-02-24 11:38:55 -08:00
Philip Rideout
e972126cea Add missing TypeScript declarations.
This patches up all the holes discovered when I tried porting the
fidelity tests in `model-viewer` to our TypeScript declarations.
2020-02-24 09:35:22 -08:00
Mathias Agopian
db40fd8983 More accurately evaluate the size of MSAA textures 2020-02-22 00:18:30 -08:00
Mathias Agopian
c2db7b8afd fix a crasher when enabling bloom from java 2020-02-21 16:55:59 -08:00
Philip Rideout
f403876784 Fix JNI signature for RenderTarget API.
Fixes #2151
2020-02-21 15:08:47 -08:00
Mathias Agopian
3a9d4c7c77 Another SSAO optimization saving another ~16%
During the SSAO pass, we pack the decoded depth to the GB channels of
the AO texture, which reduces our bandwidth requirements during the
blurring pass, as well as some ALU usage.
It puts SSAO at about 2ms on pixel4/1080p.
2020-02-21 14:15:06 -08:00
Mathias Agopian
e737ece570 rollback misguided "optimization"
use gpu's sin/cos instead of approximation
2020-02-21 14:15:06 -08:00
Philip Rideout
948d19c446 Fix typo in upload script. 2020-02-20 16:31:57 -08:00
Philip Rideout
ee81c9516a gltfio full flavor should use the old aar and maven names.
This should fix the Android build break. We do not want to change the
maven package name for existing gltfio clients.
2020-02-20 15:05:31 -08:00
Pixelflinger
675012a2eb Added a quality level parameter for SSAO
Currently it only selects how many samples are used.
Low,medium,high and ultra respectively map to 7,11,16 and 32 samples.
The default is "low", which is sufficient for most mobile applications.
2020-02-20 11:26:10 -08:00
Pixelflinger
31a4ef10e1 Use a smoother falloff function.
The improvement is really subtle, it makes the SSAO effect a bit 
softer.
2020-02-20 11:26:10 -08:00
Philip Rideout
a0d43d51c9 Add gradle flavor for gltfio-lite.
This cribs the strategy from filamat-lite and also fixes a "more than
one file" gradle error.
2020-02-20 09:45:33 -08:00
Philip Rideout
31035d2b3c Optimize filament-utils (230 KB => 190 KB). 2020-02-20 09:45:33 -08:00
Mathias Agopian
4e8f323e47 Reduced AO processing time by 1/3
This is achieved by computing a small 2x2 box blur in the AO pass
taking advantage of quad shading, which allows to halve the size
of the bilateral blur kernel.

Reducing the size of the blur kernel has a side effect to kick Adreno
gpu into direct mode, which apparently is much faster here.

Overall we go from 3.4ms to 2.4ms on Pixel4.

The quality is impacted, but not severely. This probably assumes 
GPU that have working derivatives.
2020-02-19 22:09:53 -08:00