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.
until now we allowed any resolution for SSAO, but it didn't make
much sense, especially that the depth pass is now used for other things.
To keep things more manageable, we only allow 0.5 and 1.0 scale
factor settings (respectively quarter and full resolution).
The presence of a special Gradle property is now used to exclude Vulkan
support from the build. By making Vulkan "always on" for local
development, we can avoid stale CMake cache issues that arise from
toggling the Gradle property. It also lets you avoid adding the flag
to Android Studio preferences.
This is motivated by testing and does not indicate production readiness.
Clients still need to pass VULKAN into the Engine constructor to select
the Vulkan backend.
To keep APK size down and keep CI fast, we are continuing to exclude
Vulkan from official Android builds.
After syncing this change, you might need to use `./build.sh -c` to
clobber various build caches.
This removes (rather than deprecates) all public constructors that
take a native pointer without an accompanying Engine.
Most notably, MaterialInstance had a public pointer constructor which
is now package private. This means that FilamentAsset needs an Engine,
so it now takes the one from AssetLoader.
Tested locally by hacking gltf-viewer on Android, added the following
lines to MainActivity:
```kotlin
for (mat in modelViewer.asset!!.materialInstances) {
Log.d("gltf-viewer", mat.name)
}
```
* Fix filament-utils-android build on Windows
* Update build.gradle
* nit: use char version instead
* Fix No signature of method: java.lang.String.replace() is applicable for argument types: (Character, String) values: [\, /]
deprecated Texture(long nativeTexture) in favor of
Texture(Engine, long nativeTexture), there is no difference
currently, but in the future Texture(Engine, long nativeTexture)
will be able to validate the native pointer.
The JNI layer already does this, but can only track objects it created,
sometimes developers might create filament objects on the native side
and wrap them into java objects and this might cause a failure to
detected when objects are double-destroyed.
However, this can often be caught by the native code -- so, when the
native side is asked to destroy an object that doesn't exist, we now
return an error (exception if enabled) and we throw an exception
on the java side.
Filament typically doesn't do this kind of tests, however these bugs
can be very hard to find, and the cost is small.
When no name is provided during instance creation, it does NOT inherit
the name of its parent material. This is because instances should be
lightweight and users can already do instance->getMaterial()->getName().
In a subsequent PR, this feature will be exercised and tested via the
gltfio AssetLoader.
Fixes#2485.
- we were allocating objects with a destructor in the command stream
which is always invalid because there is no guarantee that when
the callback is called, the underlaying memory is still valid
(and it wasn't).
- AutoBuffer move-ctor wasn't moving some of its state, which would
lead to destroying the same ref several times.
- bokeh rotates with the aperture diameter
- match sample count on cpu and cpu sides which affects CoC calculation
- feather blur radius to avoid visible "steps" in bokeh size
- contact shadows are now supported for point and spot lights
- and are now independent from regular shadows, that is they can
be enabled without enabling regular shadows
The only limitation currently is that the distance and step count for
ALL contact shadow are taken from the directional light options.
Static JNI lookups were causing issues with multiple libraries.
We now do the lookups when we need them as they are effectively
just hashmap lookups and we do them only in places where the
work we need to perform will be much larger than a simple hash
map lookup anyway.
This chane also manually registers filament-utils JNI bindings
to get rid of unnecessary symboles. We should do the same for
other Filament libraries (the symbols are pretty long and
we now have many of them).
ignoring beginFrame() return value is allowed, but doing so would
leave filament in an invalid state.
we now make sure that we don't execute any code after determining whether
the frame should be skipped, and execute the remainder of beginFrame()
upon the first call to render(View*).
We also make sure the FrameSkipper can deal with its endFrame() being
called when the current fence hasn't signaled.
* API BREAKAGE: this change aims to fix multi-view support
What has changed:
- View doesn't have a notion of clear color anymore
- View doesn't have a notion of discard flags anymore
- The clear color and color-buffer discard/clear flags are moved to Renderer
- Skybox can now be set to a constant color
- View have a blend-mode
What does is all mean:
"Clearing" (i.e.) setting its background is now handled by Skybox, by
setting a constant color to the Skybox. This should take care of
drawing views side by side.
When a view needs to be drawn on top of another, it's BlendMode needs to
be set to TRANSLUCENT and of course and, generally, it wither won't have
a skybox, or will have one that sets some translucent pixels.
As an optimization, a View with BlendMode::OPAQUE will have its
background cleared with the color specified in Renderer.
If the SwapChain already has some content, it's now possible to set
the Renderer to not discard the content, together with TRANSLUCENT views,
it's possible to draw on top of that content.
It is NOT possible to share depth/stencil buffers between views.
Fixes: #2369, #2372, #2364
* Address reviewers comments.
Note: WebGL is still broken with this PR
* Expose Java API to control discard flags
This change also adds the new sample sample-multi-view that shows
how to use discard flags to render multiple views.
* Disable clears