Commit Graph
114 Commits
Author SHA1 Message Date
Romain Guy 104105c937 Fix the build 2020-01-08 18:01:18 -08:00
Romain Guy 44d08ce41e Fixup javadocs 2020-01-08 17:55:17 -08:00
Romain Guy f5d5afba74 Re-organize Android Gradle files (#2013)
* 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
2020-01-07 18:37:45 -08:00
Daniel Lehmann 892302442f Fix Backend enum in Java to be consistent with C definition (#2006)
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.
2020-01-06 16:27:15 -08:00
Philip Rideout 97d53bf7e9 Remove warnings about deadlock. 2019-12-13 10:25:38 -08:00
Philip Rideout 509bfb5b5e Add warnings (hopefully temporary) about macOS deadlock. 2019-12-11 14:49:23 -08:00
Pixelflinger dd8c0a759f Improve IBL's diffuse
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.
2019-12-10 12:26:52 -08:00
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
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
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
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
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 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
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
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
Mathias Agopian b81ff060ae Remove HARD Fence public API
This API will be hard to implement on all backends (e.g. Vulkan) and
isn't that useful other than for timing.
2019-09-20 17:57:48 -07:00
Philip Rideout 8fc94f127b Add language bindings for setCullingMode. 2019-09-18 18:12:02 -07:00
Philip Rideout b03172f4a2 Java bindings: fix CUSTOM attribute mismatch.
Fix #1578
2019-09-03 15:49:22 -07:00
Philip Rideout e74c33ce04 Java bindings now define CUSTOM / MORPH attribs.
Fixes #1578.
2019-08-29 17:13:28 -07:00
Romain Guy 74aaaed4db Code cleanup 2019-08-29 09:34:12 -07:00
Mathias Agopian ad3bc4a6f7 ran "optimize imports" on all files
This removed a few unneeded imports.
2019-08-28 15:19:50 -07:00
Mathias Agopian d30429e891 make getNativeObject() public
this allows mixed java/native apps to use filament objects on both
sides more easily
2019-08-12 21:56:49 -07:00
Romain Guy 5d57dee18d Add API to enable/disable shadows on a light (#1492) 2019-08-07 17:39:33 -07:00
Mathias Agopian e176dea383 Add API to extract the color/intensity of the IBL dominant light 2019-08-04 23:16:34 -07:00
Mathias Agopian b1cdd5452f API to query the direction of the IBL
Initialized the directional light direction to the
IBL direction in material_sandbox and gltf_viewer.
2019-08-01 12:49:40 -07:00