Commit Graph

23 Commits

Author SHA1 Message Date
Philip Rideout
fff76bfa3e Resurrect the NOOP driver. 2018-12-04 14:34:16 -08:00
Philip Rideout
7366bdb500 More KtxUtility improvements.
This makes it easier for C++ clients to use KTX files and simplifies
the JavaScript bindings.
2018-11-30 13:16:47 -08:00
Mathias Agopian
815fb36b98 code size optimizations
- prevent unrolling of some loops. e.g. one loop generated more than
  1 KB of code!
2018-11-21 13:46:07 -08:00
Mathias Agopian
5bcc4cfff1 Improve the slow-path of creating a program
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.
2018-11-21 13:46:07 -08:00
prideout
776284b2b5 Raise sampler limit to 16.
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.
2018-11-20 16:05:16 -08:00
prideout
cfa9895b96 Improve error reporting for bindings overflow.
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
2018-11-20 15:28:02 -08:00
Mathias Agopian
f52087ec1e Attempt to upload streaming ubo data more efficiently
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.
2018-11-01 11:30:38 -07:00
Mathias Agopian
912b301790 Try to bring some sanity to our UBO structures
- 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
2018-10-24 15:11:54 -07:00
Mathias Agopian
8452c4f8f2 Add usage hints to the driver 2018-10-16 16:23:24 -07:00
Mathias Agopian
b374340ebb skinning allows 256 bones again, but disallow skews. 2018-10-16 15:56:30 -07:00
Mathias Agopian
b4c77166b7 fix normals when skinning with non-uniform scales 2018-10-11 18:46:42 -07:00
Philip Rideout
fc672aa8a4 API CHANGE: remove deprecated RGBM enum. 2018-10-09 12:41:39 -07:00
Philip Rideout
c6cef9ff9c NEW API: add RGBM flag to Texture.
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.
2018-10-08 11:33:06 -07:00
tpsiaki
9516080d21 Add support for mirroring the current view to a different swap chain. (#339)
* 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.
2018-10-06 00:04:07 +02:00
Mathias Agopian
eaf82961de Don’t use GLES 3.1 features on GLES 3.0 contextes
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
2018-10-02 15:19:38 -07:00
Philip Rideout
3ad0574878 Add ASTC support to Suzanne. 2018-10-02 07:46:51 -07:00
Ben Doherty
a2b304def9 Update comment in Variant.h (#242)
Update comment so the labels match the description
2018-09-13 11:11:52 -07:00
Romain Guy
c82b679740 Fix binding of integer attributes (#168)
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.
2018-08-28 10:59:38 -07:00
Romain Guy
80c3c3d321 Fix skinning on Vulkan (#162) 2018-08-27 17:53:02 -07:00
Romain Guy
4585b8f896 Add clearCoatNormal property (#131)
* 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
2018-08-24 08:56:44 -07:00
Mathias Agopian
8d2b3b2229 froxelization fixes (#70)
* 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.
2018-08-09 23:07:24 -07:00
Mathias Agopian
d6746e1140 Set max number of lights to 255 instead of 256 (#66)
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.
2018-08-09 17:30:59 -07:00
Romain Guy
b3d758f3b3 Initial commit 2018-08-03 10:38:22 -07:00