Commit Graph

193 Commits

Author SHA1 Message Date
Mathias Agopian
cbb5d2b423 fix typos and rename refraction to refractionMode 2019-12-08 22:18:18 -08:00
Pixelflinger
ee0080487a finish plumbing for new material parameters 2019-12-08 22:18:18 -08:00
Philip Rideout
8ea6e6ce59 Upgrade hello-camera to use AHardwareBuffer. 2019-12-06 08:46:37 -08:00
Romain Guy
08b83e7ed1 Make including jawt_md.h more resilient (#1922)
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.
2019-12-02 08:45:20 -08:00
Philip Rideout
60ead8c5f3 Add Android sample for testing the Stream API.
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.
2019-11-26 07:58:52 -08:00
Pixelflinger
0da551c7fd More improvements to SSAO
- 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.
2019-11-15 09:42:37 -08:00
Philip Rideout
a7d572f060 Stream API: improve dlsym usage. 2019-11-15 08:40:41 -08:00
Philip Rideout
44e8d57935 Stream API: cleanup as per code review feedback. 2019-11-15 08:40:41 -08:00
Philip Rideout
d85f8164c0 Stream API: add support for acquire / release semantics.
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.
2019-11-15 08:40:41 -08:00
Mathias Agopian
4f540fe7fd Better handling of engine shutdown
- we make sure we don't leak user callbacks or fences
- fix typos
2019-11-05 16:17:46 -08:00
Mathias Agopian
bf72adbb57 Implement Headless SwapChain mode.
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
2019-11-05 12:19:29 -08:00
Mathias Agopian
5462cc0fcf Renderer::readPixels() can now read back from a RenderTarget
Before it was limited to reading back from the SwapChain.
2019-11-04 17:18:39 -08:00
Nicklas Ansman Giertz
52ee07f2fd Add a clarifying comment 2019-11-03 15:03:13 -08:00
Nicklas Ansman Giertz
02ef4a99b7 Add some missing nullability annotations to the gltfio android bindings 2019-11-03 15:03:13 -08:00
Nicklas Ansman Giertz
73a4431a34 Fix some warnings in the gltfio android jni code 2019-11-03 15:03:13 -08:00
Nicklas Ansman Giertz
e252558ef6 Expose FilamentAsset.getResourceUris in the Android bindings 2019-11-03 15:03:13 -08:00
Nicklas Ansman Giertz
5680b5d9a6 Add support for GLTF files in the android gltfio bindings 2019-11-03 15:03:13 -08:00
Philip Rideout
389349198f gltfio-jni: Fix double-init panic caused by build issues.
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.
2019-10-30 09:51:14 -07:00
Philip Rideout
2a229571ad Minor fixes to gltf-bloom demo. 2019-10-29 10:20:28 -07:00
Philip Rideout
3db035520b gltf-bloom now invokes the gltfio animator.
Tested with CesiumMan.
2019-10-28 09:32:39 -07:00
Philip Rideout
618b59932c gltfio: Add Java / Kotlin bindings for Animator.
Fixes #1529.
2019-10-28 09:32:39 -07:00
Ben Doherty
c3d2b3578d Add Javadoc for Colors, Box, and MathUtils (#1796) 2019-10-21 17:59:05 -07:00
Ben Doherty
530fb58337 Add Javadoc to IndexBuffer and VertexBuffer (#1788) 2019-10-16 17:59:53 -07:00
Philip Rideout
3618f14531 Add Android sample for Camera Stream.
This simple Kotlin app projects a live feed on the side of a cube.
It looks very similar to the `lit-cube` demo but there is a new Kotlin
class called `CameraHelper` that creates Camera2 objects, starts
the capture session, creates the Filament texture, etc.

For now, this app uses SurfaceTexture. This is a starting point and
provides a testing ground for tentative improvements to our Stream API.
2019-10-16 09:05:24 -07:00
Romain Guy
9de3e76a53 Remove the use of reflection where it's not necessary (#1782)
Fixes #1510
2019-10-15 17:54:02 -07:00
Ben Doherty
d0bc23473c Fix crash when using Filamat lite library (#1780) 2019-10-15 10:49:59 -07:00
Ben Doherty
fb5ee4a9d0 Add Javadoc comments to Material and MaterialInstance (#1696) 2019-10-08 15:56:26 -07:00
Mathias Agopian
5098b2af77 SwapChain javadoc 2019-10-08 10:31:32 -07:00
Mathias Agopian
5576d6b014 TextureSampler javadoc 2019-10-08 10:31:14 -07:00
Mathias Agopian
b072399229 TransformManager javadoc 2019-10-08 10:30:54 -07:00
Mathias Agopian
4f0ab43d58 Stream Javadoc 2019-10-08 10:27:53 -07:00
Mathias Agopian
0704194460 javadoc for Renderer
also made resetUserTime and getUserTime public
2019-10-07 16:13:56 -07:00
Mathias Agopian
56e747f558 Scene javadoc 2019-10-07 16:13:38 -07:00
Philip Rideout
a080a47268 Add RenderTarget javadoc. 2019-10-04 08:47:55 -07:00
Philip Rideout
82e8104539 Fix javadoc warnings. 2019-10-04 08:47:55 -07:00
Mathias Agopian
20c3d45b9c Engine.flushAndWait() is not needed in most places 2019-10-03 16:04:22 -07:00
Romain Guy
4b669fb1c7 Fix formatting 2019-10-03 14:25:39 -07:00
Mathias Agopian
340f6d721a Texture javadoc 2019-10-03 13:25:06 -07:00
Philip Rideout
489f3ff3c9 Add javadoc for View and Viewport. (#1734)
This CL also fixes warnings in IndirectLight and adds a new C++ getter
to View for consistency with Java.
2019-10-03 08:38:10 -07:00
Mathias Agopian
566d3613d1 Skybox javadoc 2019-10-02 15:58:57 -07:00
Mathias Agopian
e691cfa9e3 javadoc fixes for IndirectLight 2019-10-02 15:57:31 -07:00
Philip Rideout
d550d36637 Add javadoc for RenderableManager, fix javadoc warnings. 2019-10-01 16:09:05 -07:00
Mathias Agopian
3857c1a9b2 javadoc for IndirectLight 2019-10-01 13:32:54 -07:00
Philip Rideout
9de934e2bd Add Java annotations to setMorphWeights.
Noticed this while working on javadoc stuff.
2019-10-01 11:16:15 -07:00
Romain Guy
a67d92c2ca Lower limit from API 21 to API 19 (#1701)
* Lower limit from API 21 to API 19

This was requested by an internal application. API 19 is when OpenGL
ES 3.0 support was added so there is no good reason for us to not
support this API level. The only trick is to avoid referring to the
glTexStorage2DMultisample symbol directly as it only exists in 3.1.

* Compile out code we never use

* Use reflection to handle shared EGL contexts pre-API 21.

* Remove comment

* More fixes required to run on API level 19

- dlym() fails for ashmem on API 19, so we only try on API 26+ instead.
- Older emulation for OpenGL ES 3.0 returns error states for valid API calls so we need to clear the GL error bit before we create the GL driver.
- Activity lifecycle changes since API 19 would cause animations to keep running and to reference destroyed objects.
- EGLContext.getNativeHandle() is new in API 21, we need to use reflection on API 19. The new code path uses the class loading trick to avoid a bytecode verification error on API 19.

* Filament now runs properly on API level 19

This commit adds a new api_level() API to libutils which can be used to
query the platform's API level. On Android it works as expected, other
platforms currently return 0.
2019-09-28 14:13:06 +03:00
Philip Rideout
3a20be1d1a gltfio javadoc: add links, fix formatting. 2019-09-26 14:07:13 -04:00
Philip Rideout
8244f8e9cb Add javadoc comments for gltfio. 2019-09-26 14:07:13 -04:00
Romain Guy
c575fd7395 Add new Camera::setExposure(float) API (#1699)
* Add new setExposure(float) API on Camera

This API can be used to set a specific exposure value. For instance:

camera.setExposure(1.0)

Will set the exposure to 1.0 (or ISO 100, apeture 1.0 and shutter speed 1.2s).
This can be useful to match the lighting setup of other engines/tools. Setting
the exposure to 1.0 can for instance be used to treat lights as being unitless
(a directional light could have a strength of 2.0 for instance).

Fixes #1667

* Update release notes

* Fix Java build error

* Fix Web bindings
2019-09-26 20:08:46 +03:00
Mathias Agopian
829f341de3 Engine and Camera javadoc (#1698) 2019-09-26 11:53:14 +03:00
Romain Guy
d0b5c5cee8 Update compile & targetSdk from 28 to 29 (#1691) 2019-09-25 22:25:43 +03:00