Commit Graph

235 Commits

Author SHA1 Message Date
Romain Guy
4085336db5 Cleanup integration 2021-09-01 08:14:11 -07:00
Romain Guy
c666a79d12 Cleanup notebook 2021-08-31 19:52:56 -07:00
Romain Guy
22a464f76f Update notebook 2021-08-31 19:47:46 -07:00
Romain Guy
60e88a6069 Add Mathematica notebook for Rec.709 to LMSR matrix 2021-08-31 19:29:10 -07:00
Romain Guy
dcfc27857f Update WebGL demos (#4564) 2021-08-30 12:45:02 -07:00
Romain Guy
91b5cc4bea Fix inverse tone mapping issues (#4437)
Bring color grading back into the Rec.709 color space to match
previous behaviors. This change also implements an exact inverse
tone map function for the "Filmic" operator.
2021-08-02 18:53:35 -07:00
Romain Guy
5c0da86e04 Fade specular AO from bent normals at grazing angles (#4411)
This helps prevent over-darkening but it's an artistic hack.
We need to check how we compute the bent normals as it seems we
find occlusion where there is no occlusion. The effect is
particularly visible on clear coat materials like a car's body.
2021-07-30 16:02:12 -07:00
Romain Guy
a77a9ade29 New tone mapper API (#4330)
* WIP New tone mapper API

* Implement tone mapper constructors and destructors

* Add new genertic tone mapper

* Make the generic tone mapper available in our sample UIs

* Fix warnings and crashes

* Fix generic tone mapper and graph mappers in the UI

* Add Java APIs for ToneMapper

* Implement copy/move operators for GenericToneMapper
2021-07-19 17:19:53 -07:00
Philip Rideout
0a2fa36d5a API CHANGE: honor user-defined precision, rename SamplerPrecision. (#4287)
* API CHANGE: honor user-defined precision, rename SamplerPrecision.

matc now honors 'precision' on non-samplers in mat files, and
the filamat API now allows clients to specify precision for
non-samplers.

This involved flattening a union that is internal to filamat.

* MaterialBuilder: Add Java bindings for precision.
2021-07-09 17:32:08 -07:00
Philip Rideout
92628ade8e Remote UI: auto load last loaded model. (#4277)
The most recently loaded model is now automatically re-loaded if you
re-start the sampler-gltf-viewer app.

Super useful in my case for `rgb-lights.glb` :)
2021-07-09 08:46:58 -07:00
Romain Guy
5a61d28eee Add Java bindings for transparent shadow (#4272)
* Add Java bindings for transparent shadow

* Fix JNI binding typo

* Fix typo
2021-07-08 12:50:18 -07:00
Romain Guy
9bd3684893 Add support for transparent shadows (#3298)
* Add support for transparent shadows

This solution uses an 8x8 Bayer matrix. We could find a better
noise. We also need better filtering of the shadow maps. A PCF
is barely enough and VSM fails without blurring.

* Use a fixed Bayer matrix, fix pre-caching of depth shaders

* Use gradient noise instead of fixed bayer pattern

* Update docs
2021-07-08 10:31:52 -07:00
Mathias Agopian
efcc690f42 update remote ui 2021-07-07 17:45:58 -07:00
Romain Guy
7f2a189641 Update docs 2021-07-07 13:50:37 -07:00
Philip Rideout
f4558fee1d Update remote UI. 2021-06-30 09:44:05 -07:00
Philip Rideout
eb483281dc Update remote control web app. 2021-06-28 15:10:50 -07:00
Mathias Agopian
19c7949cc4 update remote ui 2021-06-25 17:32:19 -07:00
Mathias Agopian
e7b90f9c12 update remote ui 2021-06-25 15:18:33 -07:00
Mathias Agopian
0d61d47f28 update remote ui 2021-06-25 13:21:23 -07:00
Philip Rideout
e7ed85ec94 Update WebGL tutorials. 2021-06-16 14:24:47 -07:00
Philip Rideout
5d1d4ff4d6 Update web site with latest WebGL artifacts. 2021-06-16 14:17:12 -07:00
Romain Guy
04ada346b0 Materials can now provide custom lighting/shading (#4142)
* Materials can now provide custom lighting/shading

When a material uses the "lit" shading model, customSurfaceShading can
be enabled to replace Filament's lighting implementation. When this
feature is enabled, the material *must* provide the following function
in the fragment shader block:

    vec3 surfaceShading(
            const MaterialInputs materialInputs,
            const ShadingData shadingData,
            const LightData lightData
    ) {
        return vec3(1.0); // custom lighting here
    }

Please refer to the docs in Materials.html for more information about
this feature and the different values provided by the data structures
passed to the function.

* Update docs

* Update docs/Materials.md.html

Co-authored-by: Philip Rideout <philiprideout@gmail.com>

Co-authored-by: Philip Rideout <philiprideout@gmail.com>
2021-06-16 09:53:58 -07:00
Romain Guy
94ff2ea6b1 Add support for KHR_materials_specular to glTF (#4046)
* Add support for KHR_materials_specular to glTF

* Add support for IOR to ubershaders

* Update release notes

* Remove unused variable, fix comment
2021-05-27 17:33:24 -07:00
Philip Rideout
097fac4cca Add support for drag-and-drop HDR.
This adds Java bindings for IBLPrefilterContext and uses them
in `sample-gltf-viewer`.
2021-05-25 12:46:52 -07:00
Philip Rideout
3500101816 Repair live WebGL demos.
Fixes #4027.
2021-05-25 12:22:05 -07:00
Philip Rideout
2e40bb46e7 Fix minor typos. 2021-05-21 11:34:08 -07:00
Benjamin Doherty
8d8729be8e Remote UI: update viewer with new URL input 2021-05-13 16:46:26 -07:00
Philip Rideout
c1c5776439 Serialization: enforce correctness for bool.
If expecting a bool and receiving anything other than true or false,
this is invalid and should fail. This change triggered a unit test
failure which uncovered several actual problems.
2021-05-10 13:27:41 -07:00
Philip Rideout
f5ee074674 Remote UI: fix lensFlare serialization. 2021-05-10 12:11:25 -07:00
Mathias Agopian
0c787b94b8 update remote ui 2021-05-10 11:22:55 -07:00
Mathias Agopian
c23a7343d4 update remote ui 2021-05-07 16:57:05 -07:00
Mathias Agopian
d1c8d42bd2 update remote ui 2021-05-07 15:19:15 -07:00
Romain Guy
459f70f7b4 Update docs 2021-05-03 17:55:32 -07:00
Romain Guy
f5adbbddb8 Fix typo 2021-04-27 20:33:58 -07:00
Mathias Agopian
036bfa9b20 Materials now have a quality property.
We used to have that before, but it was hardcoded and depended on
mobile vs. desktop.
With this change, users can set the quality on the material itself.
The default match the current settings. There are 3 quality levels:

low: enables optimization that might not be 100% correct 
     (e.g. abs(x) instead of sqrt(x*x))

normal: like low, but doesn't sacrifices correctness.

high: could be improved upsampling, etc...
2021-04-27 14:20:50 -07:00
Romain Guy
9c123a59ab New experimental tone mapper (#3850)
* New experimental tone mapper

The new tone mapper proposed in this change replaces Uchimura (see
below) and is composed of two distinct algorithms:

- The first is the customizable compression curve from Timothy Lotte
  (from GDC 2015). The curve's default parameters were chosen to
  match the overall appearance (contrast) of the ACES curves used
  as our current default tone mapper. This was done to provide a
  good migration path to making this new solution the default in
  a future version of Filament.
  The compression curve can be customized via its contrast, shoulder,
  input middle gray, output middle gray, and maximum "HDR value"
  (scene referred).
  It is important to note that the compression is only applied to
  the luminance of the input scene referred value.
- The second is a novel approach by Troy Sobotka called Exposure
  Value Invariant Luminance Scaling (or EVILS). This solution works
  on the largest chromatic channel of the input value as opposed
  to mapping all RGB channels as we do in our other tone mappers.
  The algorithm effectively scales all channel by a ratio that
  depends on both the compressed luminance from the first stage
  and the luminance of input value normalized by the largest
  channel.

This new solution offers important benefits as it manages to
preserve chromaticity for high input values. It is also designed
to provide a desirable rolloff to white on overexposure. This
means that even without gamut mapping, this solution avoids many
hue skews (red to orange, blue to purple, etc.). The results
provided by this solution are much more natural and make using
other color grading tools much easier.

* Use std::pow instead of pow

* Fix Web builds
2021-04-26 18:09:37 -07:00
Ben Doherty
03d74f1313 Update web docs, add note about shadowMultiplier (#3855) 2021-04-26 12:05:25 -07:00
Mathias Agopian
9914eb84a4 Fix documentation for getNormalizedViewportCoord
Fixes #3821
2021-04-23 22:39:01 -07:00
Philip Rideout
3c09d8784a Minor fixups for drag-and-drop viewer page. 2021-04-15 10:11:05 -07:00
Philip Rideout
09bda8a1dc Add glTF viewer to public website.
This will allow folks to drop a GLB into the following page to get a
WebGL preview. It always uses the latest version of Filament via unpkg.

https://google.github.io/filament/viewer

After the next release we can also use the `<filament-viewer>` component
itself from unpkg and remove the local copy.
2021-04-14 10:42:38 -07:00
Mathias Agopian
9302a2e711 update remote controler 2021-04-06 21:18:18 -07:00
Philip Rideout
4f49cdbd1e Update remote control web page. 2021-04-06 14:17:07 -07:00
Philip Rideout
7d604cd05b Add script that updates remote UI.
This script makes it easy to update the web page at
https://google.github.io/filament/remote/ even if you do not have the
emscripten SDK. It works by downloadinug the latest continuous web
build, then placing the wasm file in the right place.

After running the script, the user must make a git commit to finish the
operation.
2021-04-02 12:34:16 -07:00
Philip Rideout
e19dff18c3 Add JSON unit test, fix ring count output.
Shockingly there were no unit tests that did a simple write-then-read.
This is important because it's easy to forget details such as trailing
commas and the fact that uint8_t is a char.
2021-04-01 21:06:44 -07:00
Philip Rideout
deee5d2815 Update the remote web page. 2021-04-01 18:00:49 -07:00
Philip Rideout
3161f6a8f1 Remote UI now handles keyboard input. 2021-03-30 08:15:01 -07:00
Philip Rideout
4197afba49 Web site: update Filament in /remote. 2021-03-24 08:24:00 -07:00
Philip Rideout
dced766999 Update Remote Control page. 2021-03-10 10:51:19 -08:00
Philip Rideout
61b1542468 Add new remote page to site. 2021-03-08 08:57:57 -08:00
Philip Rideout
50799f3760 Replace QR code page with something better. 2021-03-02 18:36:38 -08:00