We currently use static linking and will continue to do so. This means
that libfilament-jni is a subset of of libgltfio-jni, and libgltfio-jni
will become a subset of the upcoming libutils-jni.
This is a simple layer cake, but requires adding some CMake logic to the
gltfio-android CMakeLists, similar to what we already did for the
filament-android CMakeLists. This prevents an obscure CMake error about
duplicated build artifacts.
Also, previously we required clients to call AssetLoader#init(), this
is now renamed to Gltfio#init(), which is more consistent with
Filament#init().
When UiHelper is set to translucent with setOpaque(false), the
target SurfaceView's surface is set to be composited on top of
the activity's window. There are situations however where one
may want to render regular Views on top of the SurfaceView.
The new setMediaOverlay() API allows exactly that: when this
property is enabled, rendering to a translucent target will
cause the SurfaceView's surface to be composited above other
surfaces, but below the activity's surface.
* Rewrite Maven publish tasks to support multiple flavors
* Don't build filamat with an unused CMake option
* Don't compiler debug in release mode
* ... for real
* Link to BUILDING.md
This was untested because our only glTF Android sample uses glb instead
of JSON. We will soon be adding a new Android demo that uses an actual
gltf file.
This fixes#1841.
* Re-organize Android Gradle files
Clean up our Gradle files, share versioning, etc. and prepare for
publication to sonatype.
* Use androix annotations for desktop
* Add samples as subprojects to root Gradle
* Fix build script
* Don't break when samples aren't compiled
* Better organize the Android Studio project
The C definition was changed to include METAL, moving NOOP further down.
The Java definition never caught up, making NOOP mean METAL and making the
real NOOP unreachable.
This patch puts them back in sync. Also, updated the Java comments to match
the comments from the C definition.
If spherical harmonics are not specified in IndirectLight (i.e.
omitted entirely), we instead use the roughness==1 LOD in the shader.
This produce much better results with absolute HDR environment, and
generally works better more often.
This is now the preferred solution.
For cases where spherical harmonicas are better or preferred, they
can simply be supplied as before.
Sometimes CMake decides to use the JNI bits included with XCode instead
of those from the installed JDK. The header files are located in different
directories. This does the proper include.
This new sample differs from "Hello Camera" in that it exercises all
three ways of using Stream. It also uses Canvas instead of Camera2 to
draw into the external texture. It shows two sets of stripes, one
animated using the shader and the other animated using Canvas. If the
two stripes are aligned, then the stream is perfectly synchronized.
Users can tap the screen to cycle between the three modes.
- we add an 'intensity' parameter that allows to control the strength
of the AO effect. This is useful for aesthetic reasons.
- the default intensity is now 2x that of before this change, which
makes the intensity parameter match AO papers this implementation
is inspired of.
- bias is now z-dependent, which reduces some self shadowing wrt the
depth.
Previously, Streams had two modes (native and texid), this adds a third
mode called "acquired", which allows for copy-free synchronized external
textures in OpenGL and paves the way for Vulkan.
The native mode is now deprecated but texid mode needs to stay around
until all clients can be upgraded.
In an early prototype, this functionality was added directly into
Texture but required quite a bit of additional state tracking, so the
Stream API seemed like a better fit.
This API is probably not necessary for Metal due to Metal's shared
ownership semantics.
This has been tested with a new Android sample that will be added in a
subsequent PR.
This is useful for unit tests. The content of the swapchain can be
read to main memory with Renderer::readPixels().
This PR doesn't implement this new feature in the following backends and
platforms (TODO):
VulkanDriver.cpp
MetalDriver.mm
PlatformWGL.cpp
PlatformWebGL.cpp
PlatformCocoaTouchGL.mm
Filament keeps a global static list of engines for verification purposes
which was being recreated multiple times, causing a panic. After a lot
of experimentation with the build, I was not able to fix this while
keeping the current scheme of dynamically loading both libraries.
As a "solution", we now staticly link filament into gltfio-jni, and ask
clients to load only that.
Fixes#1811.