Commit Graph
66 Commits
Author SHA1 Message Date
Philip Rideout 1230fccbf9 JavaScript: Expose bloom and SSAO options.
Fixes #2198.
2020-03-04 08:43:20 -08:00
Romain Guy b176b2f0e6 Remove broken setLensProjection API (#2192) 2020-03-02 14:35:35 -08:00
Romain Guy b98f45df60 Fix WebGL build (#2189) 2020-02-29 09:14:49 -08:00
Mathias Agopian 651ccb183e New mathfwd.h header
math/mathwfd.h forward declares all {mat|vec}{2|3|4}<> classes,
which allows us to remove their respective #include in a lot of
our public headers.
Our math headers are full of templates, so this should help build times
a bit.

Also we want to keep the public headers as minimalist as possible.
2020-02-12 15:30:13 -08:00
Philip Rideout 9358c7313e Remove STL from ResourceLoader API. 2020-02-12 10:03:06 -08:00
Philip Rideout a61bc51271 Add Java bindings for SurfaceOrientation.
Note that libgeometry is already included in `filament-android`, this
simply exposes more of its existing functionality.

The Java version of SurfaceOrientation is similar to the JavaScript
version because we are bundling it into the main Filament package, even
though it is a separate library in C++. This is much simpler than
creating a brand new Java package.

New Android sample that tests this is forthcoming.

Fixes #1729.
2020-02-11 12:38:06 -08:00
Philip Rideout 4665f6027f Add dynamic raster states to MaterialInstance.
Fulfills a request from tirichards@.

This is similar in some ways to dynamic backface culling but simpler
because there is no interaction with double-sided lighting.

For reference, dynamic backface culling was implemented with #1936, #1877, #1641.
2020-02-10 14:33:14 -08:00
Philip Rideout d2c883877d gltfio: hide entities with not-yet-ready textures.
This feature adds one new method to `FilamentAsset` and uses it in our
Kotlin, JavaScript, and C++ helpers:

    utils::Entity popRenderable() noexcept;

This pops a ready renderable off an internal queue, or returns 0 if no
renderables have become ready. It provides a simple way for clients to
gradually add renderables to the scene as they become ready. Previously
clients could only get the entire list of entities, regardless of
whether they had Renderable components or complete textures.

To facilitate this feature, this PR adds a new internal-only class to
gltfio called `DependencyGraph`, which is a temporary object used for
bookkeeping during the asynchronous load.

`DependencyGraph` discovers ready-to-render entities by tracking the
textures that each entity depends on. This is a graph because
renderables connect to a set of material instances, which in turn
connect to a set of parameter names, which in turn connect to a set of
texture objects. These relationships are not easily inspectable using
the Filament API or ECS.
2020-02-04 12:47:32 -08:00
Philip Rideout c681cd243a gltfio: Introduce the asynchronous API and use it.
We were already using jobs for decoding PNG and JPEG files, but we were
doing a join. This add three methods to ResourceLoader that allow
clients to amortize the decoding process across multiple frames, even on
single-threaded platforms like WebGL.

This PR adds async loading to the following demos:
- samples/gltf_viewer (now shows a progress bar in the UI)
- android/sample-gltf-viewer
- web/samples/helmet.html

Fixes #1876.
2020-01-31 09:20:48 -08:00
Philip Rideout ad20a312d6 gltfio: refactor to prep for async API.
This adds most of the asynchronous functionality but does not expose it.
2020-01-30 08:53:01 -08:00
Mathias Agopian 610dca88a3 Remove everything related to the depth-prepass
depth-preass is no longer supported.
2020-01-29 13:32:45 -08:00
Philip Rideout ff66e980eb Add ResourceLoader::hasResourceData. 2020-01-28 14:51:02 -08:00
Mathias Agopian 3105a8330e remove unneeded includes in public headers
Replace with forward declarations if needed and includes in .cpp that
now need them.
The idea here is to have our headers have the least amount of impact as
possible on our clients (e.g. compilation time).
2020-01-24 12:13:48 -08:00
Philip Rideout 51cef3b5ca WebGL: unify the PNG and JPEG codepaths.
Fixes #2055.
2020-01-21 12:58:46 -08:00
Philip Rideout e752b6fb6f Factor STB config into a header. 2020-01-21 12:58:46 -08:00
Philip Rideout 69d36b0226 WebGL: fix usage of direction estimator. 2019-12-13 12:46:11 -08:00
Philip Rideout 28f0536b31 Repair JavaScript bindings for IndirectLight. 2019-12-10 18:19:38 -08:00
Mathias Agopian c1bd438d89 temporary workaround for build break 2019-12-10 12:26:52 -08:00
Philip Rideout eee7154c33 wasm: add support for DEBUG builds by disabling RTTI.
Unfortunately we require RTTI to be disabled for web builds
due to the way in which we handle array buffers. This may change
in the future but for now I think it's an acceptable constraint,
especially given the fact that RTTI adds bloat anyway.
2019-11-22 14:33:03 -08:00
Philip Rideout 853b2205dd Upgrade emsdk for improved wasm generation.
This uses clang's wasm backend rather than fastcomp.
2019-10-31 16:41:29 -07:00
Philip Rideout 2f8bc9239b Add JS binding to unary Camera::setExposure. 2019-10-01 12:39:40 -07: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
Philip Rideout 1bda37776b Rename KtxUtility namespace to image::ktx. 2019-09-23 12:08:57 -04:00
Philip Rideout 8fc94f127b Add language bindings for setCullingMode. 2019-09-18 18:12:02 -07:00
Philip Rideout c67266833a gltfio: rename getResourceUrl => getResourceUri 2019-09-06 16:43:53 -07:00
Philip Rideout d6b0b6ff52 gltfio: expose all resource URI strings.
Some buffers (like animation data) do not contain any vertex data
but web-based clients still need to know about this.

This interface is much simpler than the bindings lists, and in fact
we might remove the binding lists in the future to simplify the API.

Fixes #1593.
2019-09-06 16:43:53 -07:00
Philip Rideout 7393d5d98c WebGL: add LightManager getter methods to fix #1599. 2019-09-06 14:12:33 -07:00
Philip Rideout c11a61aa15 Web: add setBoolParameter, fixes #1499. 2019-08-14 13:05:17 -07:00
Philip Rideout 0fe8035309 gltfio: allow names to be queried.
Fixes #1425.
2019-08-06 12:54:29 -07:00
Philip Rideout ec623e7c1b Add IndirectLight queries to JavaScript / TypeScript. 2019-08-06 09:14:28 -07:00
Philip Rideout 90c17ccbad Filament now supports GPU vertex morphing.
This works by aliasing CUSTOM0 - CUSTOM7 to morphing attributes, and by
extending our existing skinning variant.

This PR was tested against some upcoming changes to gltfio.

Issue #1149, #1417
2019-07-26 17:53:46 -04:00
Philip Rideout 793198f96a Expose setSampleCount to JavaScript. 2019-07-11 12:18:32 -07:00
Philip Rideout ca5b52b2ce Add JavaScript / TypeScript support for RenderTarget. 2019-07-02 13:26:56 -07:00
Philip Rideout b4d6583901 Fix up WebGL bindings after RGBM removal. 2019-06-24 13:22:34 -07:00
Mathias Agopian 9bce361b3e Remove RGBM support entirely from filament.
⚠️ this break c++ and java source compatibility
2019-06-20 16:17:27 -07:00
Ben Doherty 89c4647c3c Expose gltfio library so it can be used by third_parties (#1230) 2019-05-28 14:50:38 -07:00
Philip Rideout fdefa16cae jsbindings: add setColor4Parameter and rename setColorParam.
JavaScript does not have overloading so we generally use a numeric
suffix to distinguish overloads.

Fixes #1202
2019-05-20 10:43:38 -07:00
Gareth Morgan 45636e5afe Correct JS bindings for (#1137)
* Correct bindings for TransformManager::create and VertexBuffer::Builder::attribute

* Correct types
2019-05-01 17:09:32 -07:00
Philip Rideout c6e2086e67 gltfio: add JavaScript bindings. (#1092) 2019-04-11 20:05:32 -07:00
Philip Rideout bd20d005ce gltfio: split out a core library for WebGL and Android (#1080) 2019-04-08 12:43:30 -07:00
Philip Rideout dcc17b9b7e Allow dynamic doubleSided and materialThreshold. (#1072)
* MaterialInstance now has setMaskThreshold for convenience.

* Materials now support dynamic doubleSided property.

This does not change the format of material packages because they
already have both getDoubleSided() and getDoubleSidedSet().

The only way in which this change could impact existing applications is
that materials that explicity set doubleSided to "false" will now
respect the material's culling mode, rather than forcing it to NONE.

Fixes gltf_viewer with littlest_tokyo in ubershader mode.

Fixes #963.

* JNI for dynamic material properties.

* Add underscore prefix to internal material params.

* Remove un-needed mat info field.
2019-04-08 11:43:01 -07:00
Philip Rideout 230f0e1b2b Fix setCustomProjection JS binding.
Fixes #1073.
2019-04-05 08:37:45 -07:00
Philip Rideout feb7d968b6 Fix web build break. 2019-03-28 08:09:24 -07:00
Jack Diver 5366105ed2 Removing STL headers from filameshio (#1050)
* Removed STL headers from filameshio/MeshReader.h modified the samples to work the same, and made an effort to remedy the jsbindings although I'm not experienced with them.

* Fixed assignment operators for MaterialRegistry

* Fixed formating for MeshReader Material Registry

* Forgot one format

* Forgot another format
2019-03-28 07:30:22 -07:00
Mathias Agopian 0b8acb451d attempt to fix filament-js 2019-03-26 11:47:47 -07:00
Philip Rideout 3b827da834 geometry: add JS bindings for SurfaceOrientation
These bindings are not user friendly because clients need to
manually allocate / deallocate memory. However it gets the job done.

Fixes #959.
2019-03-12 14:31:09 -07:00
Philip Rideout f1f9fde3a4 Various JavaScript updates.
Add shadows to the FlightHelmet demo, add a link to it on the site,
and add recently-introduced entry points to the JS bindings.
2019-03-08 12:56:48 -08:00
prideout 5ee359cf40 Move math namespace to fix #746. 2019-02-07 09:23:07 -08:00
prideout 72a987057e Move MeshReader into filamesh namespace.
This class will not extend well to glTF so this cordons it off into the
filamesh namespace, which is an already-existing namespace that we use
for the things related to the filamesh file format.

For glTF we might create a new library with its own MeshReader so
this will mitigate confusion.
2019-02-06 12:59:48 -08:00
Philip Rideout 9fd69ec7a9 Add skinning demo.
Motivated by #764.
2019-02-02 09:02:32 -08:00