Commit Graph

334 Commits

Author SHA1 Message Date
Romain Guy
a019de3363 Add (improved) color grading UI to gltf-viewer (#2676) 2020-06-12 08:30:43 -07:00
Ben Doherty
b2c63b6cd2 Add support to gltfio for glTF cameras (#2663) 2020-06-11 13:57:01 -07:00
Romain Guy
4bf21876b4 Add new color grading feature, vibrance (#2656)
* Add new color grading feature, vibrance

* Address code review comment
2020-06-09 08:34:10 -07:00
Romain Guy
b4d2a1991a Add new curves color grading tool (#2651)
* Add new curves color grading tool

* Add release notes
2020-06-08 12:17:53 -07:00
Romain Guy
2fcca9677d Add Ushimura tone mapping operator
Also fix potential negative values when applying white balance
during color grading.
2020-06-04 15:17:08 -07:00
Romain Guy
23b62e2d12 Add ASC CDL (Color decision list) to color grading (#2635)
A CDL is made of slope/offset/power, and is roughly equivalent
to lift/gamma/gain.
2020-06-03 19:01:22 -07:00
Romain Guy
1aa57fc425 Color grading: add saturation and contrast (#2627)
* Add transforms for ACEScct and enabling/disabling color grading in sample

* Add saturation and contrast adjustments

* Rename ACES to ACES_LEGACY and introduce ACES

ACES_LEGACY is ACES with a brightness boost to match our old
tone mapping operator.
2020-06-02 22:54:00 -07:00
Romain Guy
fbb8742cbd Add new color grading feature: shadows/mid-tones/highlights (#2623)
* Add new color grading feature: shadows/mid-tones/highlights

This feature can be used to color correct specific tonal ranges.
The tonal zones can be precisely controlled.
2020-06-02 12:28:38 -07:00
Philip Rideout
a3e336921e gltfio: improve performance by assuming assets are well-formed.
glTF assets are required to provide min/max attributes for POSITION,
so in theory we never need to compute the AABB. However the option is
still there.

This PR also makes it so that Java clients can choose this option,
previously it was hardcoded for all non-native clients.
2020-06-01 10:30:09 -07:00
Romain Guy
c49ffcc354 Add channel mixer and docs to ColorGrading (#2618) 2020-06-01 09:07:34 -07:00
Romain Guy
50adc1f661 Add per-view color grading LUT (#2615)
* Add the ability to set a ColorGrading LUT per View

In this change, material_sandbox allows to change the tone mapping
operator at runtime.

* Add Mathematica notebook used to explore white balance

The implementation is meant to reproduce the temperature/tint sliders
founds in Adobe Lightroom. The temperature can be offset from 2,000K
to 50,000K using a slider between -100 and +100 (-1.0 to 1.0 in our
API). The range of tint was modelled after the range used for the
temperature.

* Fix various issues

- A refactoring wrongly remamed the color grading pass
- Setting a View's ColorGrading to null selects the
  default color grading options

* Implement white balance in ColorGrading
2020-05-31 19:24:42 -07:00
Romain Guy
3ef37f8925 Prep work for proper color grading (#2611)
* Prep work for proper color grading

* Bring back local colorGrading bool to drive that pass

* Fix formatting issue

* Add missing case for the color grading pass

* Fix formatting issues

* Formatting issues
2020-05-29 15:29:15 -07:00
Philip Rideout
2d62daf5e8 Add sample for testing glTF instancing.
Fixes #1513.
2020-05-29 07:43:44 -07:00
Philip Rideout
764d4198bc Add headless support to FilamentApp and frame_generator.
These changes make it easier to test headless rendering in macOS.

I verified that this works using the frame_generator tool, however
it requires the fixes in PR #2529.
2020-05-14 16:41:39 -07:00
Ben Doherty
0e00dbb967 Add up and down movement to free flight camera (#2494) 2020-05-06 18:30:43 -07:00
Philip Rideout
8c7fbb2e01 Fix stale IBL string in shadowtest sample. 2020-05-01 16:45:59 -07:00
Pixelflinger
4e873e8007 A new depth of field (DoF) post-process effect 2020-04-30 13:22:28 -07:00
Ben Doherty
e985546e81 Set a clear color when no IBL is present (#2440) 2020-04-28 17:57:12 -07:00
Romain Guy
8036d65adf Don't trip assert in debug 2020-04-25 17:01:28 -07:00
Romain Guy
0a387e16d9 More key fixes for ImGui 2020-04-25 16:15:32 -07:00
Romain Guy
1ec45c670b Fix more ImGui key clashes 2020-04-25 16:10:53 -07:00
Romain Guy
2c29c67df0 Cleanup on exit 2020-04-25 14:10:13 -07:00
Romain Guy
1d73027df6 Use a different key for spotLightEnabled 2020-04-25 13:59:36 -07:00
Benjamin Doherty
9dcb1181f3 Fix camera mode optstr 2020-04-22 16:38:22 -07:00
Ben Doherty
09d9bbb035 Add camera flag to gltf_viewer and material_sandbox (#2438) 2020-04-22 15:23:18 -07:00
Pixelflinger
44c6ba2618 more clear fixes
- there was a case where setting a clear color on the Renderer
  would clear a blended view with that color instead of transparent
  pixels.

- move configuring the ui view into ImGuiHelper

- fix gltf_viewer sidebar so its background is not uninitialized
2020-04-22 00:43:37 -07:00
Philip Rideout
a55b75a739 Remove monkey mesh dependency from samples.
The only apps that need this filamesh are suzanne and hellopbr. This
change allows us to modify + test Filament without re-invoking resgen.
2020-04-20 18:25:43 -07:00
Philip Rideout
cc61707cc2 Improve build turnaround by breaking dependencies.
This adds a new "backend_headers" target because small changes to any
backend cpp file was resulting in a huge build, causing materials to be
rebuilt, etc. Note that filabridge only needs DriverEnums, nothing else.
2020-04-20 15:37:21 -07:00
Philip Rideout
26f6349487 Update MoltenVK, enable validation. 2020-04-17 17:53:40 -07:00
Romain Guy
ddef5ec3c4 Change how emissive works (#2415)
Emissive was previously defined in exposure compensation stops, which
was confusing to many. It is now a value in nits, with the alpha
channel controlling how much the camera exposure affects the emissive.
At 0, the emissive value is just added to the final pixel color, at
1 the emissive value is multiplied by the exposure just like with
regular lights.

The intensity of the emissive property can be computed from an
exposure value (EV) easily with the following formula:

emissive.rgb = emissive.rgb * pow(2.0, EV - 3.0);

This formula is available as Exposure::luminance(float) already
in Filament.
2020-04-17 17:42:21 -07:00
Philip Rideout
0691283a99 Fix crash in "strobecolor" test. 2020-04-17 11:49:50 -07:00
Philip Rideout
1e4fa12f21 Fix IBL in hellopbr. 2020-04-17 11:47:55 -07:00
Philip Rideout
e20442cad7 Use default backend in shadowtest. 2020-04-17 11:42:15 -07:00
Philip Rideout
854fcc7eac Desktop samples now use default backend.
There is nothing specific to Vulkan in these tests, I meant to remove
the backend override when I removed the `vk_` prefix last week.
2020-04-13 13:55:32 -07:00
Mathias Agopian
1b36f82c1e API BREAKAGE: this change aims to fix multi-view support (#2376)
* API BREAKAGE: this change aims to fix multi-view support


What has changed:
- View doesn't have a notion of clear color anymore
- View doesn't have a notion of discard flags anymore
- The clear color and color-buffer discard/clear flags are moved to Renderer
- Skybox can now be set to a constant color
- View have a blend-mode

What does is all mean:
"Clearing" (i.e.) setting its background is now handled by Skybox, by
setting a constant color to the Skybox. This should take care of
drawing views side by side.

When a view needs to be drawn on top of another, it's BlendMode needs to
be set to TRANSLUCENT and of course and, generally, it wither won't have
a skybox, or will have one that sets some translucent pixels.

As an optimization, a View with BlendMode::OPAQUE will have its
background cleared with the color specified in Renderer.

If the SwapChain already has some content, it's now possible to set
the Renderer to not discard the content, together with TRANSLUCENT views,
it's possible to draw on top of that content.


It is NOT possible to share depth/stencil buffers between views.

Fixes: #2369, #2372, #2364

* Address reviewers comments.

Note: WebGL is still broken with this PR
2020-04-10 15:54:14 -07:00
Ben Doherty
a60ee4914f Fix getRootAssetsPath on Windows (#2375) 2020-04-09 13:01:25 -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
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
Philip Rideout
e072e30841 Expose Engine's JobSystem. 2020-04-02 14:53:20 -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
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
Romain Guy
92b2dd835d Add support for bent normals (#2303)
* Add support for bent normals

Bent normals can be enabled via the bentNormal property of a material.
When specular occlusion is enabled, bent normals improve the quality
of the computation.

* Save a couple of multiplications in bent specular AO
2020-03-29 17:00:03 -07:00
Romain Guy
40aad197da Fixes various issues (#2292)
* Fixes various issues

- Fix gltf_baker crash
- Fix Python3 discovery on macOS
- Fix TBB CMake warning
- Fix bent normals baking

* Find Python 3 on Windows
2020-03-26 22:53:44 -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
Ben Doherty
f1aaf16082 Add spot light controls to material_sandbox (#2270) 2020-03-26 13:29:39 -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