Commit Graph

312 Commits

Author SHA1 Message Date
Romain Guy
db18b2e07b Add the ability to build speific ABIs for Android (#2367)
For instance to build only 64 bit variants:
./build.sh -q x86_64,arm64-v8a release

This change also cleans up build.sh and Gradle files.
2020-04-08 15:06:47 -07:00
Alexey Pelykh
56d9e1f727 Fix Gltfio.init(): call Filament.init() as well 2020-04-07 10:01:51 -07:00
Romain Guy
bf0dc32ee3 Change specularAmbientOcclusion from boolean to enum (#2352)
The user can now choose amongst 3 specular AO methods:
- None, specAO is off
- Simple, specAO is inferred from roughness and diffuse AO
- Bent normals, specAO is computed accurately from cone intersections

The last method is more expensive but produces the best results.

This change also fixes a few issues:
- Rename materialRefraction() and materialRefractionType() for
  consistency
- Fixes user time in shaders
2020-04-07 09:19:48 -07:00
Pixelflinger
746e273336 rework how dynamic resolution scaling is specified
- now the DynamicResolutionOptions don't specify the target frame rate,
  they only specify how to scale this given view

- there is a new FrameRateOptions setting on Renderer, which is used
  to specify the desired target frame rate for the whole Renderer

- the frame rate is now specified as a "frame interval" in units of
  the display frame period.

- the display frame period is (indirectly) set via DisplayInfo.

In other words, the use must set (and update) DisplayInfo properly
(the default are reasonable, but assume 60 Hz). They must also set the
desired interval (default is 1, which is probably what you want).
Finally they must enable dynamic scaling per View, the defaults are
also reasonable.

Currently Renderer doesn't attempt (yet) to actually target the
requested frame rate, so it's up to the caller to push frames at the
desired speed. however, dynamic resolution, like before, will attempt
to shrink work to fit the target.
2020-04-06 16:55:24 -07:00
Pixelflinger
b2dd6683be Add a way to query and set Display information
Renderer can now be given a DisplayInfo that contains some
important information about the current display. This will be used
for frame-pacing and dynamic-resolution.

This is most relevant on Android, where we can accurately query these
parameters. Added support for that in our samples.


This also sets the minSDK to 19 (including gltf viewer's), since this is
the version we support. We were cheating before by under-reporting our
minSdk.
2020-04-06 16:55:24 -07:00
Pixelflinger
526898e7d6 add vsync timestamp to Renderer::beginFrame() API 2020-04-06 16:55:24 -07:00
Romain Guy
72056ee9e3 Fix support for 565 textures (#2347)
* Fix support for 565 textures

This requires exposing a new USHORT_565 pixel data type.

* Update JS bindings
2020-04-06 12:01:41 -07:00
Romain Guy
6330b1625c Udpate to AGP 3.6.2 2020-04-06 09:28:54 -07:00
Philip Rideout
05bc60f953 Bump version number to 1.5.2 2020-04-02 17:15:04 -07:00
Ben Doherty
df2caf4f62 Expose setCulling to public RenderableManager API (#2331) 2020-04-02 17:07:19 -07:00
Philip Rideout
2dbe0b64be gltfio misc fixups 2020-04-02 14:54:19 -07:00
Philip Rideout
44422b3d69 Remove gltf_baker and related libraries. 2020-04-02 09:06:29 -07:00
Philip Rideout
f084e50829 Remove old bloom samples to avoid confusion.
These should not be confused with our core bloom feature. For testing
the RenderTarget API, it would be better to create a small focused demo.
2020-04-02 09:05:36 -07:00
Pixelflinger
a389de3deb enable dynamic-resolution in android gltf viewer 2020-04-01 22:18:50 -07:00
Romain Guy
db6636aff8 Preserve dependency version 2020-03-31 17:39:21 -07:00
Romain Guy
ef35654ce9 Update to v1.5.1 2020-03-31 16:06:44 -07:00
Romain Guy
32604e2c57 Fix sample-textured-object 2020-03-30 18:54:46 -07:00
Romain Guy
adb107afc2 Fix sample-gltf-viewer 2020-03-30 18:53:14 -07:00
Romain Guy
8d9bd5f4fa Fix flavor dependencies, introduce flavors for filament-utils 2020-03-30 18:28:18 -07:00
Philip Rideout
34959dd5e8 New version number for release notes, npm, maven. 2020-03-30 16:19:37 -07:00
Philip Rideout
a922e914b4 Enable Draco for Android. 2020-03-27 16:32:44 -07:00
Romain Guy
232bf728c6 Update readme for Windows 2020-03-27 09:31:50 -07:00
Philip Rideout
0d32c58e41 gltfio: add support for Draco (desktop only)
This needs a bit more testing before merging, but I wanted to put up the
PR for review. I will look into supporting Android after we land this.

Fixes #1932.
2020-03-26 19:52:26 -07:00
Pixelflinger
cb356606d9 fog improvements
- handle heightFalloff=0 (i.e. fog doesn't depend on height) correctly,
  previously, a divide-by-zero on the cpu side would get in the way.
  The fix is to clamp heightFalloff to a small-enough value, and to
  make sure that this is handled correctly in the shader.

- default fog distance is 0 instead of 1m

- inScatteringSize parameter should be allowed to be large in samples
2020-03-26 16:01:56 -07:00
Pixelflinger
b4f5a4a0a0 Fog improvements
- optimized the fog computations
- fixed issues with the skybox
- added the option of getting the fog color modulated by the IBL envmap
2020-03-24 22:29:25 -07:00
Mathias Agopian
0c6d96c407 Add support for basic fog (#2256)
* Add support for basic fog

* address reviewers comments
2020-03-19 18:01:07 -07:00
Mathias Agopian
d54ceff7a3 Add support for screen-space contact shadows (#2245)
* Add support for screen-space contact shadows

This CL adds support and always enables it.
toggles and setting in the next CL (same PR).

* Plumb settings for screen-space contact shadows

screen-space contact shadows is handled like a shadow option,
parameters (including on/off) are set in the LightManager, using
the existing ShadowOptions API.

Additionally there is a per-renderable toggle.

Both toggles are off by default.

* Allow contact shadows when shadowing is auto-disabled


Shadowing can be auto-disabled when for instance there are no
shadow casters in the scene. We still allow contact shadows in
that case.

This would allow for instance, to make the vegetation on a terrain
not shadow-casting, and still get some shadowing there by using
contact shadows instead.

* apply micro-shadowing after contact shadows

also, don't compute contact shadows when we know we're fully shadowed.
2020-03-16 22:39:24 -07:00
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