Commit Graph

23 Commits

Author SHA1 Message Date
Romain Guy
c1793b09bc Use slightly optimized Schlick on mobile 2018-09-14 09:50:18 -07:00
Romain Guy
96d3846571 Fix Schlick Fresnel when f90 < 1 2018-09-14 09:44:34 -07:00
Romain Guy
41d70cb30a Fix anisotropy BRDF on mobile (#245)
mediump computations are not enough for certain roughness values.
2018-09-13 18:31:08 -07:00
Romain Guy
735d7fedf7 Cleanup comments 2018-09-12 13:49:31 -07:00
Mathias Agopian
01a4f563e7 more important sampling fixes
- compute dot(n,l) correctly
- don’t rely on the provided tangent space for
  now because some meshes have a broken TBN
2018-09-12 13:30:34 -07:00
Mathias Agopian
cd058d36f3 use LoH instead of VoH (they’re equal) 2018-09-12 13:30:34 -07:00
Mathias Agopian
fd8c2b1874 compute the clear coat layer with importance sampling 2018-09-12 13:30:34 -07:00
Mathias Agopian
b0f6cf037d address more comments
- pass the tangent space to the importance sampling
- reorder parameters
2018-09-12 13:30:34 -07:00
Pixelflinger
b9bcf41e74 fix most romain@ comments 2018-09-12 13:30:34 -07:00
Mathias Agopian
5f1bdb0677 importance sampling option for IBL
This will be useful for testing and can be
enabled at compile time by setting
IBL_INTEGRATION to IBL_INTEGRATION_IMPORTANCE_SAMPLING
in *both* indirectLight.cpp and light_indirect.fs

BUGS: clearcoat and subsurface won’t
work well when this is enabled since the prefiltered
cubemap is not available and, we don’t evaluate
those lobes with importance sampling (yet).
Additionally, anisotropy can’t work with our
prefiltered importance sampling, so it still uses
the emulation by bending the normal.
2018-09-12 13:30:34 -07:00
Mathias Agopian
4475cbaf2e fold the lambert brdf into the SH coefs
this saves one multiply in the shader, but most
importantly makes the first SH coefficient a
color and reduces its range

ALL IBLs NEED TO BE REGENERATED using cmgen
2018-09-10 21:09:11 -07:00
Romain Guy
f550fbaa44 Skip lighting and shadowing computations when possible (#210) 2018-09-05 16:04:38 -07:00
Romain Guy
2eac290161 Make shadowMultiplier objets transparent when not lit (#209) 2018-09-05 15:17:31 -07:00
Romain Guy
4585b8f896 Add clearCoatNormal property (#131)
* Add clear coat normal map support

This change allows to set a separate normal map for the clear coat layer of a material.

* Document the new clearCoatNormal property

* Fix typo
2018-08-24 08:56:44 -07:00
Romain Guy
711d8877bf Add comment explaining an odd choice 2018-08-23 14:19:21 -07:00
Romain Guy
65a42a518c Add material_testbed application (#97)
* Add material_testbed application

This application can be used to automatically vary material parameters over multiple frames and capture each frame as a PNG file. This makes it easier to test/compare/etc. It's also useful to generate documentation examples.

* Rename material_testbed to frame_generator
2018-08-14 18:01:31 -07:00
Romain Guy
128ab657df Switch cloth model from Ashikhmin NDF to "Charlie" NDF (#53)
* Add new Cloth NDF

Based on the work by Estevez and Kulla, also known as the "Charlie" sheen.

* Restore DFG computation to GGX

* New proposed approximation for Cloth DFG

* Add "Charlie" cloth DFG approximation to cmgen

* Switch to "Charlie" sheen for cloth shading

* Document the new cloth NDF and DFG approximation
2018-08-08 17:22:41 -07:00
Romain Guy
bb75923b79 Fix post-process shader when not in Vulkan (#41)
* Fix post-process shader when not in Vulkan

The post-process shader must not flip the source texture when we compile for OpenGL. This happens because we use SPIR-V/Vulkan as an intermediate format.

* Fix the Android build

We need to output a location when targeting SPIR-V for mobile.
2018-08-07 18:46:30 -07:00
Ben Doherty
46228e9610 Fix shader compilation on Windows 2018-08-07 17:10:03 -07:00
Romain Guy
da03ef2378 Compile shaders in a separate static library (#34)
* Update build instructions

* Compile shaders in a separate static library

Each shader string is now part of a separate .o file, which should make recompiling filamat/matc a tad more enjoyable.

* Shaders.h belongs to filamat, not filament
2018-08-07 12:47:52 -07:00
Tact Yoshida
ad49986245 Remove execute permissions 2018-08-06 10:36:54 -07:00
Romain Guy
55476e97f0 Fix clear coat attenuation for direct lighting
The diffuse term was erroneously multiplied by (1-Fc)^2 after a previous refactoring. The documentation was correct.
2018-08-05 00:10:04 -07:00
Romain Guy
b3d758f3b3 Initial commit 2018-08-03 10:38:22 -07:00