* Add transforms for ACEScct and enabling/disabling color grading in sample
* Add saturation and contrast adjustments
* Rename ACES to ACES_LEGACY and introduce ACES
ACES_LEGACY is ACES with a brightness boost to match our old
tone mapping operator.
Tested in Android Studio by starting sample-gltf-viewer and typing the
following into the debugger:
modelViewer.asset!!.getFirstEntityByName("Drone_Body")
modelViewer.asset!!.getEntitiesByName("Drone_Body")
modelViewer.asset!!.getEntitiesByPrefix("Drone")
* Add new color grading feature: shadows/mid-tones/highlights
This feature can be used to color correct specific tonal ranges.
The tonal zones can be precisely controlled.
glTF assets are required to provide min/max attributes for POSITION,
so in theory we never need to compute the AABB. However the option is
still there.
This PR also makes it so that Java clients can choose this option,
previously it was hardcoded for all non-native clients.
* Add the ability to set a ColorGrading LUT per View
In this change, material_sandbox allows to change the tone mapping
operator at runtime.
* Add Mathematica notebook used to explore white balance
The implementation is meant to reproduce the temperature/tint sliders
founds in Adobe Lightroom. The temperature can be offset from 2,000K
to 50,000K using a slider between -100 and +100 (-1.0 to 1.0 in our
API). The range of tint was modelled after the range used for the
temperature.
* Fix various issues
- A refactoring wrongly remamed the color grading pass
- Setting a View's ColorGrading to null selects the
default color grading options
* Implement white balance in ColorGrading
* Introduce ColorGrading API
A ColorGrading object will eventually be settable on a View to
choose the tone mapping and other color transformations.
There is currently only a single default ColorGrading instance
used by all views.
* Use raw function pointers
* Prep work for proper color grading
* Bring back local colorGrading bool to drive that pass
* Fix formatting issue
* Add missing case for the color grading pass
* Fix formatting issues
* Formatting issues
When animation is applied to the master asset, all instances are
animated.
Instances can also be individually animated via the Animator in
FilamentInstance.
Fixes#1513.
This adds createInstancedAsset() to AssetLoader, which creates a master
asset and a set of slave instances. Vertex buffers, index buffers,
textures, and material instances are shared. Entities and components are
duplicated.
Instances have their own API object that is very simple. Light sources
and material instances are not instanced, so are not accessible through
the instance API object.
The master-slave ownership model lets us avoid complex shared ownership
semantics. The existing cache structures in AssetLoader allow the
implementation of this feature to be fairly simple.
The master asset exposes the union of all entities and allows clients to
modify all instances en masse if they wish. This design also works
naturally with ResourceLoader, which does not need to know about
instancing. For example, asynchronous loading is completely unchanged;
the dependency graph simply contains the union of entities across all
instances.
Support for animation is added in a subsequent commit.
Fixes#1513.
To enable some basic profiling of the gl thread using performance
counters, the "filament.perfcounters" property must be set to 1
(before the Filament Engine is created):
adb shell setprop filament.perfcounters 1
This is so that filament doesn't interfere with simpleperf by default.
This is now the default, and the tone mapper used
is now the same on desktop and mobile.
In the future this will allow us to implement many features such as
color grading at no cpu cost.
OpenGL allows vertex shaders to consume attributes that are never
assigned values from a vertex buffer. When this occurs, GL provides a
default zeroed-out value, or a value from the most recent call to
`glVertexAttrib*v`.
Vulkan does not allow this, so our Vulkan backend provides dummy data by
re-using the position buffer, which we know exists. This was an existing
hack, but it did not always assign a compatible type, which resulted in
validation spew with gltf_viewer + BusterDrone.
This fixes one of the two bugs reported in #2573.
Vulkan complains if a pipeline declares an integer vec2 attribute but
the shader consumes it as "vec2" rather than "ivec2". gltfio was doing
this when supplying dummy texture coordinates.
This fixes one of the two bugs reported in #2573.
Since AO is computed at 1/4 resolution, it is necessary to upsample
the AO buffer. Until now this was done with a bilinear tap, which is
less than ideal as it can creates jaggies at edges.
High quality upsampling can now be enabled and uses a bilateral filter.
The cost is about 2.0 ms at 250MHz on Pixel 4. ES3.1 is required.