The code that determined the "base slot" (i.e. the buffer object index
for the first morphed attribute) was very fragile and buggy.
MorphHelper now simply looks up the slot index in a stored mapping,
rather than trying to mimic the AssetLoader to determine the base slot.
Until now, most of the models we tested against only morphed the
position attribute, and never had a large set of target weights that
could be non-zero in a given time slice.
MATERIAL BREAKAGE: this change breaks materials
In order to use one less sampler, we now use a UBO instead of a texture
to store the "froxel records". Currently this UBO is limited to 16KiB
vs. 64KiB before with the texture.
We also handle running out of record space better, by using a predefined
record that has all the lights in the scene. This way the scene will be
rendered properly, albeit at a potentially large performance cost.
If expecting a bool and receiving anything other than true or false,
this is invalid and should fail. This change triggered a unit test
failure which uncovered several actual problems.
- move kernel weight computation to the gpu side as a small cost, in
order to simplify the CPU side and reduce the binary size.
- skip samples with a weight of 0, which is a completely coherent
check.
- fix a typo in move ctor
We chose 8 renderbuffer because it seems to be commonly supported
on mobile gpu and is more than 6 which is needed for generating
cubemaps. 4 was the minimum guaranteed by ES3.0.
The main changes here are:
- TargetBufferFlags is now a uint32_t instead of uint8_t
- The number of render buffer supported by filament and supported by
the hardware can now be different. Applications/users now must
query this value if more than 4 is needed.
- added a backend query (used gl terminology)
This is a redo of a previous attempt. There was an issue in the GL
backend that caused MRT to fail on some devices.
We used to have that before, but it was hardcoded and depended on
mobile vs. desktop.
With this change, users can set the quality on the material itself.
The default match the current settings. There are 3 quality levels:
low: enables optimization that might not be 100% correct
(e.g. abs(x) instead of sqrt(x*x))
normal: like low, but doesn't sacrifices correctness.
high: could be improved upsampling, etc...
- create a new FILAMENT_HAS_FEATURE_TEXTURE_GATHER, which can be used
in the shaders to use textureGather.
- A new TARGET_GLES_ENVIRONMENT and TARGET_GL_ENVIRONMENT in addition
to TARGET_METAL_ and TARGET_VULKAN_, for completeness.
- Rename TARGET_LANGUAGE_SPIRV to FILAMENT_VULKAN_SEMANTICS and add
FILAMENT_OPENGL_SEMANTICS for completeness.
- expose the shader model to shaders as: FILAMENT_SHADER_MODEL_ES30 and
FILAMENT_SHADER_MODEL_GL41
Use these new #define where appropriate.
The main change here is that TARGET_MOBILE is now only used for dealing
with the `mediump` default on mobile.
This change also enables textureGather on Metal.
We chose 8 renderbuffer because it seems to be commonly supported
on mobile gpu and is more than 6 which is needed for generating
cubemaps. 4 was the minimum guaranteed by ES3.0.
The main changes here are:
- TargetBufferFlags is now a uint32_t instead of uint8_t
- The number of render buffer supported by filament and supported by
the hardware can now be different. Applications/users now must
query this value if more than 4 is needed.
- added a backend query (used gl terminology)
* New experimental tone mapper
The new tone mapper proposed in this change replaces Uchimura (see
below) and is composed of two distinct algorithms:
- The first is the customizable compression curve from Timothy Lotte
(from GDC 2015). The curve's default parameters were chosen to
match the overall appearance (contrast) of the ACES curves used
as our current default tone mapper. This was done to provide a
good migration path to making this new solution the default in
a future version of Filament.
The compression curve can be customized via its contrast, shoulder,
input middle gray, output middle gray, and maximum "HDR value"
(scene referred).
It is important to note that the compression is only applied to
the luminance of the input scene referred value.
- The second is a novel approach by Troy Sobotka called Exposure
Value Invariant Luminance Scaling (or EVILS). This solution works
on the largest chromatic channel of the input value as opposed
to mapping all RGB channels as we do in our other tone mappers.
The algorithm effectively scales all channel by a ratio that
depends on both the compressed luminance from the first stage
and the luminance of input value normalized by the largest
channel.
This new solution offers important benefits as it manages to
preserve chromaticity for high input values. It is also designed
to provide a desirable rolloff to white on overexposure. This
means that even without gamut mapping, this solution avoids many
hue skews (red to orange, blue to purple, etc.). The results
provided by this solution are much more natural and make using
other color grading tools much easier.
* Use std::pow instead of pow
* Fix Web builds
- move public headers from filament/foo to filament-foo/
to avoid confusion with libfilament's headers
- add support for equirectangular to cubemap conversion
- add support for using an .hdr file directly in all our samples
Fixes issue seen with Vulkan + the quantized version of Avocado.
We already support the quantized glTF extension, which is when this
comes up. Technically this is only needed for Vulkan but gltfio does
not (and should not) know which backend is being used, so we simply
apply these transformations assuming the worst.
In practice this code usually won't be activated, and if even when it
is, it won't hurt loading time as much as other things like large
textures.
* Add Transcoder API for C++ clients.
We will add JavaScript and Java support in a later PR.
* Transcoder: use fixed inner loop in some cases.
This lets clang produce better ARM code for common cases.
* Transcoder: stronger typing in Config, etc.
* Transcoder: add UTILS_RESTRICT and noexcept.
This is the first step at trying to un-hardcode the number of drawbuffer
we support. The ultimate goal is to go from currently 4 to 8.
Until now the maximum render buffer supported was the same than the actual
number of render buffer supported. At some point in the future this will
change, it this will have to be dynamic.
This change is to allow rendering a cubemap in a single pass on h/w that
support it. Many mobile GPU support 8 draw buffers.
- the miplevel wasn't computed correctly
- the random rotation was incorrect
- the default HDR compression was too aggressive
- better validation of the input cubemap
we now store the kernel for each lod in a texture, this has several
advantages:
- the texture can be reused, so we can amortize that cost a bit
- we could generate the texture with a shader, so that we don't
have to do any texture uplaod (TBD).
Until now we were using TARGET_MOBILE in our shaders for both
quality setting and correctness.
With this PR we introduce a new define FILAMENT_QUALITY which currently
can take two value FILAMENT_QUALITY_LOW and FILAMENT_QUALITY_HIGH and
we use that instead of TARGET_MOBILE for quality settings.
Currently, FILAMENT_QUALITY_LOW is selected when TARGET_MOBILE is set.