* 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
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).
* 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
This fixes two issues related to the Vulkan backend, one being a build
issue and the other being a run-time issue:
(1) Compile-Time Issue
To prevent accidental introduction of padding into hashed structures,
the Vulkan backend was static-asserting the size of the hash input. I
think it's fine to simply use a pragma pack instead.
(2) Run-Time Issue
SibGenerator was erroneuously using BindingPoints::COUNT instead of
UNIFORM_BINDING_COUNT for determining the first sampler binding index.
(Hopefully this logic will go away after some upcoming Vulkan cleanup.)
Since SibGenerator does not include Program, this moves the uniform and
sampler counts into EngineEnums, which might be a good place anyway
since they are ideally "config" constants.
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
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.
- the IGNORE_VIEWPORT flag is gone. It wasn't actually needed and what
it was doing was ambiguous.
- removed the backend viewport() API which wasn't actually needed.
- beginRenderPass() now ALWAYS sets the viewport and scissor but
doesn't necessarily clears honoring the scissor (based on the
IGNORE_SCISSOR flag).
- the GLES backend now just sets the scissor when it needs it, as opposed
to always trying to keep it set. we now rely on state tracking to
de-dup the gl calls.
Filamat public headers were including a private header. This PR fixes
this problem. It also forces filamat to always be compiled to avoid
breaking filamat without noticing. The flag `-l` is not available
anymore in build.sh as a result.
Instead of passing SamplerInterfaceBlocks and a SamplerBindingMap to
Program, we now set a 'sampler group' per binding point:
Program::addSamplerGroup(...)
A sampler group here consists of a list of N 'Sampler' and a 'Sampler'
is just a unique name (unifrom name in the shader) and binding point in
the shader.
That's all the driver layer needs.
With this change we get rid of the code that re-created the uniform
names in the driver -- this should never have been done there. And we
also remove the hash-map lookups in vulkan and metal drivers.
It's only used to get the size of the SamplerGroup.
Actually, Engine also uses the post-process Sib to create the
post-process material, but this should go away when we have
material domains -- so pretend it's not there.
- 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.
With this change, filaflat looses almost all its dependencies on
filabridge (only needs DriverEnums.h) and becomes only a parsing
library that doesn't know anything about materials.
It still knows about "shaders" as blobs of text or data (spirv).
Filaflat itself is used by matinfo and filament.
- UniformBuffer::toBufferDescriptor() now cleans the dirty flags
- SamplerBuffer move ctor and operator now clean the dirty flags of the
moved (source) buffer.
- SamplerBuffer::toCommandStream() can be used to more efficiently copy
a SamplerBuffer into the command stream -- this saves a copy.
- simplified SamplerBuffer's copy and move ctor/operator
- added a few constexpr here and there
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.
The engine tries to be smart by using a single vertex shader when
rendering unskinned, non-alpha masked, non-customized materials.
This leads to a lot of issues when laying down the depth prepass.
This change simply gets rid of this optimization (which wasn't
properly profiled anyway). Correctness is more important.
Fixes#645