Commit Graph

210 Commits

Author SHA1 Message Date
Philip Rideout
4bf0d0c0a8 Web: Remove broken webpack example.
This example has fallen out of date, I tried to resurrect it but it
turned out to be non-trivial, given the special nature of emscripten's
generated JavaScript wrappers.

It might be better to provide an example that uses rollup, since that's
the bundler that model-viewer uses, or a simple TypeScript example.

For now, I think our simple HTML + raw JS samples are sufficient.
2020-08-05 11:19:08 -07:00
Romain Guy
a120e0a4bb Filament 1.8.1 2020-07-30 12:25:53 -07:00
Philip Rideout
b4623c9afc Add lightroom IBL, enable ColorGrading by default in gltf_viewer.
The non-legacy ACES is now default, it looks much better.

I also tested this IBL with WebGL and Android.
2020-07-30 11:39:36 -07:00
Philip Rideout
440687e05a Add JavaScript bindings for Fog and Vignette. 2020-07-29 15:01:05 -07:00
Philip Rideout
7584a7bebe Merge pull request #2885 from google/pr/jscolorgrading
WebGL: use color grading in demo, expose destroy.
2020-07-29 12:22:11 -07:00
Philip Rideout
664e7b8a8d ColorGrading: add JavaScript and TypeScript bindings.
This is not tested but seems fairly straightforward.
2020-07-28 14:45:51 -07:00
Philip Rideout
cd168148d8 gltfio for web: add and use destroyAsset.
Fixes #2839.
2020-07-22 13:40:08 -07:00
Philip Rideout
0da20cccdc Introduce removeEntities API / fix leak in ModelViewer (!)
For testing purposes, sample-gltf-viewer reloads the model when the
user double-taps the screen. This operation was causing a buildup of
blank entities in the Scene, because we were merely destroying the
components, not removing them from the Scene.
2020-07-22 13:38:38 -07:00
Mingwei Samuel
36b3cc7bf0 Filament.d.ts: add Vector<T> interface, vectorToArray<T> fn, fix getResourceUris() return vec 2020-07-18 10:50:44 -07:00
Mingwei Samuel
a2e5cacee0 Filament.d.ts: Add BufferReference type alias, update to accept typed arrays
- buffers processed by getBufferDescriptor can be an asset string or JS typed array.
  - 185ed0cc68/web/filament-js/extensions.js (L17-L27)
2020-07-13 20:56:12 -07:00
Philip Rideout
6eac638fd2 Remove old method for JS doc generation.
The new way is to follow the instructions at the top of
`web/docs/build.py`.

The option in build.sh has been unused for a while. Invoking Python from
CMake was pointless, especially since I don't want to force other
developers to install a specific version of Python etc.
2020-07-13 16:07:49 -07:00
Philip Rideout
4fa987c698 WebGL: Upgrade emsdk and refactor initialization.
Since postRun can no longer be set from within the extern post JS, we
now use the promise rather than postRun.

This upgrades emsdk to 1.39.19 (see note in #2800).
2020-07-13 13:02:26 -07:00
Philip Rideout
ec533e6047 DriverEnums: add usage flag for SUBPASS_INPUT 2020-07-11 09:22:28 -07:00
Philip Rideout
38d2509aaf Web tutorials now use a CDN for the npm package.
This makes the tutorials more consistent with the live demos and lets us
more easily ensure that the tutorials are kept up to date without
errors. In fact it caught an error in the Suzanne tutorial.

Since this affects source rather than served files, this PR is intended
for main.  The master branch will be updated in a subsequent PR.
2020-07-09 14:56:05 -07:00
Romain Guy
77aec40a56 Prepare Filament v.1.8.0 (#2787) 2020-07-09 11:44:15 -07:00
Philip Rideout
07e4d1c148 Fix TypeScript error for the Render Fidelity folks. 2020-07-09 07:49:22 -07:00
Mingwei Samuel
e03c663bc3 filament.d.ts make init, fetch callbacks optional 2020-07-04 09:20:51 -07:00
Ben Doherty
a6872c840c Silence more deprecation warnings (#2750) 2020-06-30 10:14:57 -07:00
Philip Rideout
c0452b5e9d JS: Update API for Camera construction / destruction. 2020-06-29 18:35:24 -07:00
Philip Rideout
b136b4aca5 JS: Temp workaround for bloom binding error. 2020-06-29 18:35:24 -07:00
Philip Rideout
59cf9e3b75 JS: Fix typo in bindings for bloom options. 2020-06-29 18:35:24 -07:00
Mingwei Samuel
0be094cd4f Update TypeScipt declarations
- Add missing LightManager$Builder methods.
- Fix IcoSphere.tangents type to be unsigned.
- Add missing IcoSphere.suvdivide() method.
2020-06-24 15:37:15 -07:00
Philip Rideout
8f4ffbc782 gltfio: various improvements to skinning normalization.
- Allow JavaScript and Java / Kotlin clients to configure this setting.
- Opt in by default (this was disabled in #2621)
- Optimize large assets like Bistro by iterating through prims only when
  the asset actually has skins.

Fixes #2714.
2020-06-23 13:30:45 -07:00
Mingwei Samuel
455bed917b Fix typescript missing options parameter for createTextureFromX 2020-06-23 09:25:44 -07:00
Philip Rideout
a5c49cc1b6 Improve JS API for Scene::addEntities.
This repairs the `animation.html` sample. Using a JS array is more
natural for web developers and more consistent with the latest
JavaScript bindings in gltfio.
2020-06-18 12:16:01 -07:00
Philip Rideout
ce995d021a Improve JS API for SurfaceOrientation helper. (#2706)
* Improve JS API for SurfaceOrientation helper.

Web developers should not be expected to call malloc on the emscripten
heap. This new API is better aligned with how we handle vertex buffers.

Fixes #2702.

* Update web/filament-js/extensions.js

Co-authored-by: Wojciech Czerniak <wojciech.czerniak@gmail.com>

Co-authored-by: Wojciech Czerniak <wojciech.czerniak@gmail.com>
2020-06-18 12:02:02 -07:00
Romain Guy
8c9cc988a6 Update references to master with references to main 2020-06-16 13:35:57 -07:00
Philip Rideout
242e8d1b56 Update live JS demos and tutorials.
At some point I should probably change the tutorials to use a versioned
NPM package rather than a checked-in prebuilt Filament WASM file.

Fixes #2686.
2020-06-15 11:34:59 -07:00
Ben Doherty
de3f757013 Add JS bindings to gltfio camera funcs (#2681) 2020-06-15 11:04:16 -07:00
Mingwei Samuel
ca6b1860be Fix typescript View set/getAmbientOcclusion wrong type 2020-06-02 16:40:50 -07:00
Philip Rideout
6c173489d7 gltfio: Add get-by-name and get-by-prefix methods.
Java bindings will be forthcoming in a separate commit.
2020-06-02 10:17:12 -07:00
Philip Rideout
a3e336921e gltfio: improve performance by assuming assets are well-formed.
glTF assets are required to provide min/max attributes for POSITION,
so in theory we never need to compute the AABB. However the option is
still there.

This PR also makes it so that Java clients can choose this option,
previously it was hardcoded for all non-native clients.
2020-06-01 10:30:09 -07:00
Philip Rideout
ede09e28e3 gltfio: add JavaScript bindings for instancing. 2020-05-29 09:22:17 -07:00
Philip Rideout
92c017bdd3 Simplify WebGL context creation. 2020-05-29 09:09:49 -07:00
Philip Rideout
c087eb6825 gltfio: Add Java / JavaScript bindings for lights. 2020-05-28 11:51:35 -07:00
Philip Rideout
58bb1f61e6 Add JS bindings for DoF.
Adding this for completeness, although the feature triggers a known
issue with Chrome's WebGL implementation that emits an error when
source and destination textures of a draw call are the same.
2020-05-26 10:06:40 -07:00
Philip Rideout
b4d16ab3b5 Tweak WebGL build settings. 2020-05-18 10:02:21 -07:00
Philip Rideout
d49d0f1762 Add JavaScript bindings for setVisibleLayers. 2020-05-15 12:53:02 -07:00
Ben Doherty
8780d7aae5 Bump version to 1.7.0 (#2541) 2020-05-15 10:41:51 -07:00
Philip Rideout
823f5c9c1f WebGL: upgrade and accommodate EMSDK.
Fixes #2515.
2020-05-11 13:58:07 -07:00
Philip Rideout
474fe9c5ed Change behavior of MaterialInstance::getName. 2020-05-08 09:44:49 -07:00
Philip Rideout
c3c8293862 MaterialInstance now has an optional name.
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.
2020-05-08 09:44:49 -07:00
Philip Rideout
fb643eb422 Update web site and JS tutorials.
This updates the tutorial markdown, fixes up the literate programming
Python script, and updates the web site itself.

The doc build script now uses a Pipfile instead of "requirements.txt",
which I find less frustrating since it does not interfere with other
Python projects on your machine.

Fixes #2483.
2020-05-05 12:39:25 -07:00
Ben Doherty
3e67f628ee Bump version to 1.6.0 (#2474) 2020-05-01 15:58:56 -07:00
Philip Rideout
167493b85c Update Skybox / Clear API for web. 2020-04-10 17:06:47 -07:00
Mathias Agopian
1b36f82c1e API BREAKAGE: this change aims to fix multi-view support (#2376)
* 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
2020-04-10 15:54:14 -07:00
Logan Lawrence
d99f9cffb2 GEOSP-97 Added javascript binding 2020-04-07 13:09:48 -07:00
Logan Lawrence
33cbc6bba3 GEOSP-97 Added comments 2020-04-07 13:09:48 -07:00
Logan Lawrence
7794cd4c65 GEOSP-97 Removed some unnecessary changes 2020-04-07 13:09:48 -07:00
Logan Lawrence
574058e81e Added and updated javascript bindings 2020-04-07 13:09:48 -07:00