This removes a lot of heap allocations/deallocations, and reduces
code size. Most improvements come from using CString and
StaticString instead of std::string and better using move
semantics.
In practice this limits materials to 10 samplers since Filament uses 5
for lights and skips 1 slot for the post-process sampler. This can
probably be optimized.
We now check for sampler overflow during material compilation rather
than waiting for run-time checks. This allows for Kokoro-based
validation of sample materials, and allows developers to catch this
issue in their asset pipeline.
We should also probably raise the upper limit (Qualcomm allows up to 16
samplers in their Vulkan implementation) but that can be a separate PR.
Fixes#507
IF an UBO is marked as STREAM, meaning that data will
change every frame and the buffer content is invalidated
as well, then we use map/unmap buffer in asynchronous
mode to copy the data into the buffer.
This assumes the buffer is sized to be significantly
larger than the average amount of data used every
frame.
- move UBO declarations in UibGenerator, i.e. next
to their Uniform Interface Block definition.
This should help forgetting to update one but
not the other.
- move UniformInterfaceBlock.h and SamplerInferfaceBlock.h under
private/filament/.
- do the same things for samplers
This change will allow the skybox use a compressed texture format.
For now, the old internal format "RGBM" is still honored, but in a
forthcoming change we will replace the enum with UNUSED.
* Add support for save/replay of the current view.
* Add support for having distinct draw/read surfaces.
Adds support to egl & glx drivers for distring draw/read surfaces and
uses this support to implement mirrorFrame using a single blit.
* Use src/dst, Viewport, clean up apis.
* Add SwapChain READABLE Config.
* Commit & setPresentationTime optional on mirror.
* Fix flag check.
* Add documentation for READABLE swap chain config.
* Fix missed s/ExternalContext/Platform/ cases.
* Build break fix.
Fixes#309
- remove some currently unused code that requires
GLES 3.1 headers. It’s not technically a problem,
but it makes the code less confusing. We can
put that back, when we need it.
- Turn off multi-sampling on GLES 3.0
- Add support for EXT_multisampled_render_to_texture
According to the spec, an attribute declared as an integer (ivec* or uvec* in the shaders) but be bound using `glVertexAttribIPointer` instead of `glVertexAttribPointer`. This means we were not binding bone indices correctly for GPU skinning. This issue was hidden by lenient drivers, particularly on Android.
* 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
* fix stack corruption when the scene has more than 255 lights
* fix froxelization with more than 255 lights
Make sure froxelization works when the engine is
configured with more than a maximum of 255 lights.
The main issue was that the froxel structure on the
GPU uses 8 bits to encode the light count (per
froxel). So we have this 255 light max per
froxel limitation. The CPU code now honors this.
With this change we can go back to 256 lights
from 255!
All that said, it’s not recommended to increase
the maximum number of lights because the memory
usage on the CPU explodes. For instance we
go from 4 MiB with 256 lights to 18 MiB for 1024.
This always was the intention because internally
it uses 8-bits buffers instead of 16-bits. One of
our temporary buffer goes from 4 MiB to 2 MiB.
This got mistakenly changed to 256 recently.