Commit Graph
2552 Commits
Author SHA1 Message Date
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
Pixelflinger 00f1c3dae9 [GL backend] ensure that Handle<> are synchronously constructed
Until now, only the memory of Hw handes was allocated synchronously,
handles were constructed later asynchronously. This was error prone
with the few (but growing) synchronous calls we have.

Now we have an init<> call that allocates and constructs handles synchronously,
the asynchronous construction if needed, is still performed with construct<>,
which is now implemented as "destroy+construct", this is okay because
most of our handles have trivial dtors.

This fixes a race with TimerQuery and Fence. Fences are still not fully 
working though, but at least won't access uninitialized memory.
Currently backend fences MUST be used trough FFence.
2020-04-06 16:44:35 -07:00
Ben Doherty bb88487b79 Fix test_material_parser build issue creating resource directory (#2350) 2020-04-06 15:33:25 -07:00
Romain Guy 92b7ee97f5 Kill specular AO at low roughness (#2348)
On metals (made only of specular light), specular AO can
create large black spots. This change simply kills specular
AO to avoid this artifact. In practice we should take into
account multiple bounces but this is rasterization...
2020-04-06 15:30:32 -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
Benjamin Doherty 27f4504dfc Implement timer queries for Metal backend 2020-04-03 18:10:39 -07:00
Pixelflinger fb0e89d969 fix a race-condition in JobSystem
mThreadMap needs to be protected as it's accessed from multiple threads.
2020-04-03 17:25:17 -07:00
Ben Doherty 2ad932f345 Convert from half to full angles for gltfio spot lights (#2340) 2020-04-03 17:06:03 -07:00
Philip Rideout d8ac60009c FilamentApp: use angle bracket syntax for includes. 2020-04-03 16:28:38 -07:00
Philip Rideout 37e2f46e10 Move FilamentApp into libs/filamentapp.
This will make it easier to migrate gltf_viewer into tools.

This is not a rewrite of FilamentApp, just a baby step.
2020-04-03 16:28:38 -07:00
Romain Guy 17dd44fd91 Fix documentation bug: the definition of SPOT and FOCUSED_SPOT was inverted. 2020-04-03 15:53:33 -07:00
Philip Rideout 26297feba7 WebGL: fix typo in default SSAO options. 2020-04-03 12:37:40 -07:00
Philip Rideout 05bc60f953 Bump version number to 1.5.2 v1.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 c79f5a1a29 JobSystem: replace TLS with tid mapping. 2020-04-02 14:53:20 -07:00
Philip Rideout e072e30841 Expose Engine's JobSystem. 2020-04-02 14:53:20 -07:00
Pixelflinger aa770d54ae fix a potential use-after-free
It's possible for a timer query to be destroyed before the result is
known, in this case, we don't want to write through that pointer!
2020-04-02 12:02:21 -07:00
Romain Guy 559642d54c Move IBL settings in their own category 2020-04-02 10:49:07 -07:00
Philip Rideout 583157d4ef Remove vk_ prefix from desktop samples. 2020-04-02 09:06:50 -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 e8a7d9f0c2 add support for timer queries in the backends
This adds a simple query API to the backend.
There are 2 methods to create/destroy queries, which are
essentially futures.  And 3 methods to mesure elapsed time:
beginTimerQuery/endTimerQuery and getTimerQueryValue.
The begin/end pair is not nestable.

On the GL backend side, there are 2 implementations of this, one uses
arb_timer_query or disjoint_timer_query, the other uses fences.
We need both implementations because on some GPUs, including
qualcomm's elapsed-time timer query is useless, as it measures
cpu time. 

Metal/Vulkan implementations will be part of subsequent PRs. Vulkan
will be able to implement this with vkWriteTimestamp which is
reported to be accurate.

An immediate benefit is that we can now get frame times on MacOS, which
should allow it to use dynamic-resolution.
2020-04-01 22:18:50 -07:00
Pixelflinger a389de3deb enable dynamic-resolution in android gltf viewer 2020-04-01 22:18:50 -07:00
Romain Guy 06eca637b0 Remove a mul from specular AO computations 2020-03-31 22:55:05 -07:00
Romain Guy 201bd2c845 Fix release action v1.5.1 2020-03-31 18:09:29 -07:00
Romain Guy e6500a8b3b Update web docs 2020-03-31 18:07:40 -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
Pixelflinger 4248eb148e fix uninitialized variable which could cause clearing errors 2020-03-31 15:31:54 -07:00
Pixelflinger 73c2a87444 fix a clearing bug with imported rendertargets
the view clear flags would not be honored when rendering directly
into an imported render target.

note: now that this works this could cause an issue when using
multiple views side-by-side and one of them doesn't have a skybox,
that view will trigger a clear of the whole buffer (because clears
clear everything, not just the viewport).
A solution will come in a later PR.

Fixes #2312
2020-03-31 15:31:38 -07:00
Philip Rideout 55d0063ced Fix "no texture bound" warnings in WebGL. 2020-03-31 15:20:18 -07:00
Ben Doherty ca70489556 Add a material parser presubmit check (#2313) 2020-03-31 15:04:01 -07:00
Philip Rideout 8d817ac787 ShadowMap: Fix potentially wrong EntityManager. 2020-03-31 14:39:09 -07:00
Romain Guy 9a550d69b8 Fix Github actions 2020-03-31 09:33:28 -07:00
Romain Guy 07d6aebafc Update release action v1.5.0 2020-03-30 21:48:41 -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
Ben Doherty c88bbc21d0 Link hello-gltf iOS project with Draco (#2311) 2020-03-30 17:11:49 -07:00
Romain Guy 917edec0a7 Update RELEASE_NOTES.md 2020-03-30 16:22:45 -07:00
Philip Rideout 34959dd5e8 New version number for release notes, npm, maven. 2020-03-30 16:19:37 -07:00
Ben Doherty 82ab74efb0 Update RELEASE_NOTES and LightManager documentation for spot shadows (#2310) 2020-03-30 16:14:07 -07:00
Pixelflinger 968dbdb847 make sure "structure" pass is culled when not needed
the structure (depth path) wasn't culled even if both ssao and
contact-shadows were disabled.
2020-03-30 16:13:41 -07:00
Philip Rideout e43466d2bc Enable Draco for WebGL and iOS. 2020-03-30 15:58:55 -07:00
Philip Rideout cdf03f91c9 Apply Draco compression to FlightHelmet. 2020-03-30 15:58:55 -07:00
Philip Rideout abe70caeae Bump material version to prep for release. 2020-03-30 15:58:35 -07:00