We will need 6 pre-compiled materials (lit vs nonlit and the 3 blend
modes). This uses CMake's "configure_file" functionality to generate 6
mat files, then invokes matc on each one. They are then combined using
resgen.
- getCameraComponent(Entity) retrieves a Camera component from an entity
- destroyCameraComponent(Entity) destroys just the camera component
attached to an entity.
destroyCamera() are now deprecated because the API is confusing, it's
not immediately clear that it's destroying all component + the entity
itself.
Node: We don't add the corresponding Java APIs yet because there is no
easy way to guarantee they're safe without making sure that
getCameraComponent() will always return the same instance (which it
wouldn't currently).
This makes it easy to draw a transformed box around each renderable for
diagnostic purposes. The API is similar to Animator in that it is
exposed through FilamentAsset but is created lazily and is implementated
outside of FilamentAsset.
gltfio computes two types of bounding boxes: one for renderables (used
for frustum culling) and one for the overall asset (used for
positioning the camera or asset).
Both of these are based on the min+max attributes in the glTF file, but
the asset-level box was incorrect because only two corners of the
transformed AABB were considered.
This CL also adds optional computation of bounding boxes that crawls
through the vertex positions. This is useful when diagnosing potential
issues with the asset's min+max info.
These enhancements are motivated by a culling issue seen with the voxel
Cathedral on sketchfab.
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.
This fixes#935
SamplerBindingMap was always adding the post-process samplers to the
map -- but matc doesn't generate those. This led the vulkan backend
to believe there was a post-process sampler bound, when there wasn't.
This is also technically a bug in the Vulkan backend because it should
have used the SamplerInterfaceBlock to determine which shaders are
actually used instead of blindly going through the whole list and
trusting SamplerBindingMap.
The fix is kind of a hack, but the whole SamplerBindingMap is kind of a
hack anyways.
In my previous NaN-related commit, I added a conditional similar to the
one seen in glMatrix, but this was insufficient for the interpolation
seen in a glTF skinning test because a divide-by-zero was occuring later
in the function. This commit simply adds back the previous protection.
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.