(1)
Generating the C file (only used for WebAssembly) causes slowness in the
build so this makes it into an option. Also, we were flushing too often,
which made it even slower.
(2)
Using "static" in a header was causing symbol duplication.
Recall that Vulkan has a right-handed NDC system. Currently, our Vulkan
backend is not handling VERTEX_DOMAIN_DEVICE correctly, but we didn't
notice because the culling mode is not honored yet (a separate PR is on
the way for that).
To fix this, we considered adding a shader-based fixup only for the
device domain and keeping our Vulkanish projection matrix as-is.
However, this would cause the skybox shader to compute an incorrect
wrong eye vector due to in the inconsistent definition of clip space.
After discussion with Mathias and Ben, we decided that the most elegant
fix is for Filament to have only one canonical clip space, which for
now is the clip space that OpenGL requires.
Ben pointed out that spirv-cross has a flag for injecting shader-based
fixups. However we don't invoke spirv-cross for the Vulkan target, and
it's easy just to do this on our own.
This is achieved by pre-scaling the normals
transform so that the resulting normal doesn't have
any large component allowing to do the normalize()
in the fragment shader in mediump.
This must be done for skinning too.
because the shadow map can be “focused”, its
texture coordinates can end-up very large, which
in turn can cause overflows in the calculation of
the PCF positions. Unfortunately some GPUs
abort in that situation, which causes artifacts.
Fix Bug 111455153
This remapping can be confused with roughness, because
linear_roughness = roughness*roughness and
lod = sqrt(linear_roughness)
so the value of lod is roughness, but conceptually
it’s not.
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.
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
* 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
* 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
* 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
* 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.
* 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