Commit Graph

195 Commits

Author SHA1 Message Date
Romain Guy
e1b773958f Add screen and multiply blending modes (#1241)
* Add screen and multiply blending modes

This change also fixes a sorting issue: different sorting modes
were sorted in different buckets which is incorrect. We want
to sort only by distance.

* Update release notes and Java API

* Fix build error
2019-05-30 10:17:16 -07:00
Romain Guy
0a5c068cb6 Switch specular AA to Tokuyoshi and Kaplanyan (#1218)
This replaces the previous "curvature to roughness" method. Both are related
and rely on the screen space variance of geometric normals but this new
solution offers more control (the screen space variance and the clamping
threshold can be controlled).
2019-05-23 12:56:26 -07:00
Romain Guy
0347fb0441 Add new material properties: specular/multiBounceAmbientOcclusion (#1198) 2019-05-18 14:30:08 -07:00
Romain Guy
841f76f510 Update roughness-prefilter 2019-05-03 12:01:31 -07:00
Ben Doherty
7923964f50 Fix matinfo bug when printing Metal shaders (#1128) 2019-04-23 11:30:37 -07:00
Philip Rideout
4671b7c090 Some matinfo fixes. (#1108)
- Fix the "CString size mismatch" assert seen in debug config.
- Fix the --print-glsl option, which was printing junk.
2019-04-17 12:49:47 -07:00
Philip Rideout
fe2c5f6a9e Fix build issue due to static initialization order. 2019-04-10 14:37:32 -07:00
Philip Rideout
0a0c2497d5 Temporary fix for build break. 2019-04-10 14:28:02 -07:00
Philip Rideout
6663f6584b Simplify matc ParametersProcessor. (#1091)
(1) Merge two same-sized lists into a single map with struct values.

(2) Constify all the string-to-enum maps and move them into the
scope where they are used.

(3) Move a bunch of object methods into static free functions to
simplify the header and reduce code duplication.

(4) The PARAM_KEY_FOO string constants were referenced only once (except
in a few error messages) so replace them with string literals.
2019-04-10 14:07:58 -07:00
Philip Rideout
37cb9247fd Add new shading model to Filament for specularGlossiness. (#1083)
* Add new shading model to Filament for specularGlossiness.

This adds a shading model based on KHR_materials_pbrSpecularGlossiness.
The corollary gltfio change will be in an upcoming PR.

* Improve documentation for specular-glossiness
2019-04-09 13:22:16 -07:00
Romain Guy
ab12d1d1bb Add postLightingColor property to materials (#1057)
* Add postLightingColor property to materials

This property can be used to modify the color computed in the lighting
passes of the materials. That color is blended with the computed color
according to the postLightingBlending option (add, transparent or opaque).

* Remove test

* Update docs

* Address code review comment

* Switch postLightingColor default blend mode to transparent
2019-03-29 10:02:07 -07:00
Mathias Agopian
b26684deed rename namespace filament::driver -> filament::backend 2019-03-26 11:47:47 -07:00
Mathias Agopian
639d05374b update layering: libbackend is now at the bottom
We now have:

backend -> filabridge -> filaflat -> filament
                      -> filamat

Instead of backend depending on filabridge.
2019-03-26 11:47:47 -07:00
Mathias Agopian
8ec3b62715 libbackend header cleanup
This is mostly about moving constant from EngineEnums.h to
the backend, either in Program.h or DriverEnums.h

The goal is that libbackend doesn't depend on EngineEnums.h
2019-03-25 17:55:19 -07:00
Romain Guy
9c69b377b7 Fix #1039 (#1040) 2019-03-25 16:24:19 -07:00
Mathias Agopian
2b5f6cafa6 Separate src/driver into its own library
In this first step, we just "blindly" move everything under src/driver
to a new library libbackend.a. And all headers are moved under
private/backend.

Note that "driver" is renamed "backend", but namespaces are unchanged for now.

Later we'll have to untangle the actual private headers from public
ones and ideally not have any private headers.
2019-03-22 09:45:51 -07:00
Mathias Agopian
a8a37a537a simplify a lot libibl's Image class 2019-03-13 13:45:43 -07:00
Mathias Agopian
13d3ade5bb libibl doesn't need to depend on libimage 2019-03-13 13:45:43 -07:00
Mathias Agopian
54d292bc8a move all libibl APIs in namespace filament::ibl 2019-03-12 22:36:54 -07:00
Mathias Agopian
43ac656a38 Cleanup libibl a bit. Add some basic documentation. 2019-03-12 22:36:54 -07:00
Mathias Agopian
f8fc2dd808 split cmgen into an exe + libibl.a 2019-03-12 22:36:54 -07:00
Mathias Agopian
529c44e548 cleanup cmgen in praparation of lib split
we mostly remove dependencies on includes.
2019-03-12 22:36:54 -07:00
Romain Guy
f02fe33070 Reformat comments 2019-03-07 14:53:33 -08:00
sebavan
906097625e Add Charlie importance sampling to cmgen.exe (#936) 2019-03-06 15:43:07 -08:00
Mathias Agopian
4abe017bc5 cleanup MaterialChunkType.h 2019-03-05 17:54:37 -08:00
Mathias Agopian
0f6f53d501 MaterialChunk doesn't expose the Unflattener in its API
this makes the API more robust, because now it's not possible
to mess up the call to getShader(), by construction.
2019-03-05 17:54:37 -08:00
Mathias Agopian
084fd95489 Factorize all the various getShader() methods
This removes a lot of code and complexity. MaterialParser now has 
a single, generic getShader() method.
2019-03-05 17:54:37 -08:00
Mathias Agopian
ff53515295 Merge [Spirv|Text]DictionaryReadder into DictionaryReader 2019-03-05 17:54:37 -08:00
Mathias Agopian
f2ba48f4a7 Program::shader() now only takes a void* + size
Program::shader() was taking a string before which didn't make sense
for spirv.  Now it's just a blob, in the case of GL/Metal, the blob
must be a null terminated c-string, and the size must include the
terminating null character.

This fixes an out-of-bound access in ShaderBuilder::getShader() (which
doesn't exist anymore), because it was creating a CString passing
a size that included the null terminating char, which is not was CString
expects. CString can now assert() in that case.


driver::Program now uses a std::vector<> for storage, which we should
fix at some point (b/c it's a public header). CString was not suited to
store binary blobs.
2019-03-04 19:00:26 -08:00
Romain Guy
9558f0d6ca Use uniform sampling for cloth DFG (#921) 2019-03-02 14:10:38 -08:00
Mathias Agopian
3297c9bc78 More headers clean-up
- EngineEnums.h is not a private headers as it contained mostly private
stuff

- MaterialEnums.h is still public, but now only contains public stuff.
Private parts were moved to MaterialEnums.h or MaterialBuilder.h

- And finally SamplerBinderMap is moved under private/ as well, since
it's certainly not a public API.

With this change, the public headers of filabridge become more reasonable
and limited.
2019-03-02 00:21:09 -08:00
Mathias Agopian
71762cf55e remove dependency on [Sampler|Uniform]InterfaceBlock.h
it just wasn't needed.
2019-03-01 08:43:01 -08:00
Mathias Agopian
a6a4055a0a don't fully qualify filament namespaces 2019-03-01 08:43:01 -08:00
Mathias Agopian
8d484dd762 break dependency of filaflat on filabridge
filaflat only had on header dependency on filabridge (DriverEnums.h)
and only needed two small enum types.
In fact, I don't think it was right for filaflat to assume any 
particular value for these fields -- this is the responsibility of the
callers.
2019-03-01 08:43:01 -08:00
Mathias Agopian
42875b7809 break dependency of matinfo on MaterialParser 2019-02-28 12:29:56 -08:00
Mathias Agopian
16cef02441 break Unflattener dependency on ChunkCountainer.h 2019-02-28 12:29:56 -08:00
Mathias Agopian
d07222fc3c cleanup: break dependency filamat->filaflat dependency 2019-02-28 12:29:56 -08:00
Mathias Agopian
0dd8414844 minor cleanup, try to remove some uneeded dependencies
this is in praparation for much larger changes
2019-02-28 12:29:56 -08:00
Romain Guy
705c1969b2 Add clearCoatIorChange property to materials (#890)
This property can be used to control the darkening of the base layer
due to a change in index of refraction when going through the clear
coat layer.
2019-02-27 10:30:46 -08:00
Romain Guy
4738e93b83 Replace Cloth DFG approximation with DFG LUT
By removing the Fresnel term (often ommitted from fabric/cloth BRDFs)
we can store the DG term for the cloth BRDF in the 3rd channel of the
existing DFG LUT.
2019-02-21 11:44:52 -08:00
Mathias Agopian
c1c84f6400 minor code and comments cleanups in dfg computations
also added uniform hemisphere sampling function for reference.
2019-02-20 13:52:57 -08:00
Ben Doherty
52ebfb1665 Add Init and Shutdown methods to MaterialBuilder (#840) 2019-02-20 10:44:12 -08:00
Romain Guy
b2f19a1879 Remove incorrect approximations 2019-02-19 18:41:31 -08:00
Philip Rideout
e60744a6e4 Introduce MATERIAL_VERSION and panic.
Material archives already contain two version chunks (post process and
normal) but the renderer was ignoring these. The change makes it so that
matc writes a new MaterialEnums value into these chunks, and the engine
panics when receiving a material version that it does not expect.

This also adds a --version option to matc. No changes were necessary
to matinfo because it already prints out these values.

Fixes #796.
2019-02-19 15:54:58 -08:00
prideout
5ee359cf40 Move math namespace to fix #746. 2019-02-07 09:23:07 -08:00
Adrian Perez
694d5a397e Typo fixes 2019-02-01 11:26:58 -08:00
Ben Doherty
7be3994c96 Add Metal shading language compilation to matc (#752) 2019-01-29 12:44:58 -07:00
Tim van Scherpenzeel
44bfac85e9 added quiet flag 2019-01-29 11:04:58 -08:00
cubeleo
6956154d62 mipgen: Disambiguated string with std:: prefix. (#741) 2019-01-25 09:02:11 -08:00
Romain Guy
f3752a42c8 Document UV flipping behavior and add control attribute (#720)
Materials can disbale this behavior by setting flipUV: false
in the header section of the material definition.

Fixes #672
2019-01-17 11:12:16 -08:00