Commit Graph

285 Commits

Author SHA1 Message Date
Romain Guy
880642ef4a Fix crash in glTF sample for Android 2020-03-12 14:27:11 -07:00
Romain Guy
02c7a22d43 Remove build time warning 2020-03-10 08:41:28 -07:00
Pixelflinger
8866e2829f Add a quality option to dynamic-scaling
It controls the quality of the upsampling filter. This can help a lot
if heavy scaling is needed to maintain performance, it also helps if
MSAA is not enabled.

There are 3 quality levels, low, medium and high. 1, 4 and 9 bilinear
taps are used for each level respectively. The high quality setting
employs a tent filter.
2020-03-08 22:28:10 -07:00
Romain Guy
641b58c409 Be explicit about which NDK to use (#2221) 2020-03-06 16:53:41 -08:00
Romain Guy
84b215c3b0 Switch to AGP 3.6.1 2020-03-05 17:11:47 -08:00
Romain Guy
b176b2f0e6 Remove broken setLensProjection API (#2192) 2020-03-02 14:35: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
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
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
Romain Guy
3cfc6981a4 Only build OpenGL and Vulkan shaders in Android samples 2020-02-25 10:24:25 -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
Romain Guy
799e837f35 Upgrade to latest AGP 2020-02-24 12:28:29 -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
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
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
Pixelflinger
4dd3d7ab5e Greatly improve SSAO quality by using better samples
The power parameter now really controls the contrast. It's default value
is now 1, instead of 0.
2020-02-19 22:09:53 -08:00
Ben Doherty
62810d8c87 Rework array texture support (#2136) 2020-02-19 10:52:12 -08:00
Philip Rideout
ca81d48432 gltfio-lite: add BLEND material
This increases the size to 538K.
2020-02-18 11:55:47 -08:00
Philip Rideout
b9c857130a Introduce gltfio-lite.
This is 466 KB insted of the usual 850 KB. It assumes that users do not
need spec-gloss, non-lit, or a special transparency mode.

(uncompressed SO size on arm64)

We can add a new maven project for this next week.
2020-02-18 11:55:47 -08:00
Pixelflinger
3a273b1837 fix a typo when thresholding for bloom
- also use step() to implement the threshold
- improve bloomOptions documentation
2020-02-15 22:19:35 -08:00
Romain Guy
5e6ff5a44f Update to a more recent version of AGP 2020-02-14 15:26:05 -08:00
Philip Rideout
65129d1b52 filament-utils-android: fix recent crash regression. 2020-02-14 14:56:38 -08:00
Philip Rideout
54d9d870ee gltfio size reduction 3/3: compile gltfio directly
This takes libgltfio-jni.so from 882 KB to 850 KB
2020-02-14 14:56:38 -08:00
Philip Rideout
ffff6dd580 gltfio size reduction 2/3: proper shared linking
This takes libgltfio-jni.so from 966 KB to 882 KB
This takes libfilament-jni.so from 810 KB to 802 KB
2020-02-14 14:56:38 -08:00
Philip Rideout
dc4a1ed5e5 gltfio size reduction 1/3: add more opt flags
This takes libgltfio-jni.so from 1.5 MB to 966 KB.
2020-02-14 14:56:38 -08:00
Mathias Agopian
8bbf0ce9ef Bloom can now have a dirt texture applied 2020-02-13 20:51:43 -08:00
Mathias Agopian
651ccb183e New mathfwd.h header
math/mathwfd.h forward declares all {mat|vec}{2|3|4}<> classes,
which allows us to remove their respective #include in a lot of
our public headers.
Our math headers are full of templates, so this should help build times
a bit.

Also we want to keep the public headers as minimalist as possible.
2020-02-12 15:30:13 -08:00
Philip Rideout
02b377c244 gltfio: remove locale.cpp dependency
For Android and wasm we do not use the filesystem and therefore do not
need `utils::Path`.

```
libgltfio-jni.so BEFORE 1.9 MB (693 KB gzipped)
libgltfio-jni.so AFTER  1.4 MB (542 KB gzipped)
```
2020-02-12 10:03:06 -08:00
Mathias Agopian
b17c51e340 Add a threshold option (enabled by default) for bloom.
Threshold can be either on or off, and only thresholds at 1.0 when 
activated (in pre-exposed mode).

This allows to use very high strengths values for the bloom without
softening the rest of the image, and is useful for artistic considerations.
2020-02-11 16:15:04 -08:00
Philip Rideout
a61bc51271 Add Java bindings for SurfaceOrientation.
Note that libgeometry is already included in `filament-android`, this
simply exposes more of its existing functionality.

The Java version of SurfaceOrientation is similar to the JavaScript
version because we are bundling it into the main Filament package, even
though it is a separate library in C++. This is much simpler than
creating a brand new Java package.

New Android sample that tests this is forthcoming.

Fixes #1729.
2020-02-11 12:38:06 -08:00
Mathias Agopian
bccb8260e2 Implement a Bloom post-process effect 2020-02-11 12:15:57 -08:00
Philip Rideout
4665f6027f Add dynamic raster states to MaterialInstance.
Fulfills a request from tirichards@.

This is similar in some ways to dynamic backface culling but simpler
because there is no interaction with double-sided lighting.

For reference, dynamic backface culling was implemented with #1936, #1877, #1641.
2020-02-10 14:33:14 -08:00
Philip Rideout
415aeef95b gltfio JNI: fix broken getName() method. 2020-02-07 17:15:28 -08:00
Philip Rideout
cabd9be5f0 ModelViewer now implements OnTouchListener for convenience. 2020-02-07 15:20:41 -08:00
Philip Rideout
45e6e6eb18 sample-gltf-viewer now supports landscape orientation. 2020-02-07 15:20:41 -08:00
Philip Rideout
317d78d7c6 sample-gltf-viewer: enable gzip compression for bin and ktx. 2020-02-05 18:45:30 -08:00
Philip Rideout
8020f7eb78 gltfio: add plural version of popRenderable 2020-02-04 12:47:32 -08:00
Philip Rideout
e8e847a662 gltfio: various cleanup in response to PR review 2020-02-04 12:47:32 -08:00
Philip Rideout
d2c883877d gltfio: hide entities with not-yet-ready textures.
This feature adds one new method to `FilamentAsset` and uses it in our
Kotlin, JavaScript, and C++ helpers:

    utils::Entity popRenderable() noexcept;

This pops a ready renderable off an internal queue, or returns 0 if no
renderables have become ready. It provides a simple way for clients to
gradually add renderables to the scene as they become ready. Previously
clients could only get the entire list of entities, regardless of
whether they had Renderable components or complete textures.

To facilitate this feature, this PR adds a new internal-only class to
gltfio called `DependencyGraph`, which is a temporary object used for
bookkeeping during the asynchronous load.

`DependencyGraph` discovers ready-to-render entities by tracking the
textures that each entity depends on. This is a graph because
renderables connect to a set of material instances, which in turn
connect to a set of parameter names, which in turn connect to a set of
texture objects. These relationships are not easily inspectable using
the Filament API or ECS.
2020-02-04 12:47:32 -08:00
Philip Rideout
c681cd243a gltfio: Introduce the asynchronous API and use it.
We were already using jobs for decoding PNG and JPEG files, but we were
doing a join. This add three methods to ResourceLoader that allow
clients to amortize the decoding process across multiple frames, even on
single-threaded platforms like WebGL.

This PR adds async loading to the following demos:
- samples/gltf_viewer (now shows a progress bar in the UI)
- android/sample-gltf-viewer
- web/samples/helmet.html

Fixes #1876.
2020-01-31 09:20:48 -08:00
Mathias Agopian
218c3af11b Fix documentation about Camera's field-of-view. 2020-01-30 11:32:46 -08:00
Mathias Agopian
610dca88a3 Remove everything related to the depth-prepass
depth-preass is no longer supported.
2020-01-29 13:32:45 -08:00
Romain Guy
00a6a68b9c Update Gradle plugin 2020-01-29 11:52:20 -08:00
Philip Rideout
ff66e980eb Add ResourceLoader::hasResourceData. 2020-01-28 14:51:02 -08:00