Commit Graph
43 Commits
Author SHA1 Message Date
Mathias Agopian a878d1f39c improve sample_full_pbr
- -m option now works with "directory_*.png" or just "*.png"
- "color" replaced by "albedo" to mach other places in the source tree
- fixed warnings
- clear the background when IBL is not used
2023-02-01 10:04:02 -08:00
Philip Rideout a81b9a0f09 CMake: fix wasm build on windows machines
Noticed this while trying to help with #5859.
2022-08-22 11:44:36 -07:00
Philip Rideout bfe8a8aa18 WASM: Allow clients to enable pthreads.
Filament does not yet fully support threads with WASM, but this is a
baby step in that direction.

To enable experimental pthreads support, enable the WEBGL_PTHREADS CMake
option. This will enable pthreads support in `gltfio` and `utils`, which
is known to work, but not when served with GitHub Pages.

The web server must emit COOP, COEP and CORP headers, so our build
instructions now recommend the use of `emrun` for local testing.

This also changes our demos so that they do not use unpkg, which
does not work when using `emrun`, due to cross-origin restrictions.
2022-08-12 15:43:00 -07:00
Philip Rideout 9aeec3a759 Add Ktx2Reader and BasisEncoder and use them in samples.
mipgen can now emit basis-encoded KTX2 files. Both the desktop and
web "suzanne" samples use this as a test for compressed textures.

This PR does not add KTX2 support to glTF, but it's on the way.

`BasisEncoder` has a builder style API that calls the basis encoder to
create KTX2 files. This hides some low-level BasisU features that we are
not using, like file I/O and mipmap generation.

`Ktx2Reader` is an easy-to-use API for creating Filament textures from
KTX2 files. Its API primarily consists of these two methods:

    bool requestFormat(Texture::InternalFormat format);
    Filament::Texture* load(const uint8_t* data, size_t size);

The first method is used to build an ordered list of formats that are
supported by your hardware. The second method consumes the contents of a
basis-encoded KTX2 file and attempts to produce a Filament texture with
a preferred format.

IMPORTANT: Our tools still let you use KTX1 for non-compressed images
because it is useful for HDR, but you can no longer use KTX1 for
block-compressed data.

Partial fix for #4771.
2022-04-15 10:48:48 -07:00
Philip Rideout 57040ebb22 Fix and refactor support for S3TC + SRGB. 2021-06-16 14:08:51 -07:00
Romain Guy c66915209e Update our build to the latest and greatest (#3902)
The new requirements are as follow:
- CMake 3.19
- Ninja 1.10
- Android Studio 4.2
- Android NDK 22.1
- Gradle 7.0
- Kotlin 1.5
2021-05-06 10:13:10 -07:00
Philip Rideout 037a783e07 Add web component demo.
Just for fun, this is an example of a web component that allows you to
embed a Filament viewer with a single HTML element. It does not have
many features, but is much easier to use than our raw JavaScript API.
2021-04-05 11:42:27 -07:00
Philip Rideout 24583332a2 Add filagui and SimpleViewer to the WASM build. 2021-03-08 10:32:06 -08: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 4891bb6157 Fix SameSite warning for locally run web samples. 2020-03-30 15:58:24 -07:00
Philip Rideout 3fd9c49fb9 Update WebGL docs and website. 2020-02-25 13:50:34 -08:00
Romain Guy 8eaa1f5e88 Add options to skip samples (#2163)
-DFILAMENT_SKIP_SAMPLES=ON with CMake
-Pfilament_skip_samples with gradle

This change also renames CMake options specific to Filament
to avoid clashes with subprojects.
2020-02-24 18:15:33 -08:00
John Davis a4b879227d fix case sensitivity problem for linux 2020-01-26 19:17:57 -08:00
Philip Rideout 491d16a4e5 Exercise JPG decoding in web samples. 2020-01-21 12:58:46 -08:00
Philip Rideout e09f0bb99f Repair gradle IBL path for gltf_bloom.
I broke this when I changed the cmgen KTX behavior.
2020-01-07 14:05:40 -08:00
Philip Rideout 25c4efd2db cmgen: do not create useless folder for KTX files
With KTX, we should simply create the specified output folder and put
the KTX file(s) in there. There is no need to create a subfolder of the
output folder.

This change also allows users to pick a custom name for their KTX file,
because we only use the "deployment" name when generating filenames.
2019-12-18 13:03:02 -08:00
Philip Rideout 87db1aaa57 WebGL: remove old broken test. 2019-12-13 12:46:11 -08:00
Philip Rideout 1fa2fd9b7f WebGL: add morphing demo. 2019-10-31 11:57:43 -07:00
Ben Doherty fca71813d4 Use CMAKE_COMMAND variable in place of cmake (#1783) 2019-10-16 10:50:55 -07:00
Ben Doherty d849231caf Remove old post-process shader pipeline (#1631) 2019-09-13 09:29:28 -07:00
Philip Rideout 72644f1416 mipgen: add --quiet argument.
Note that some encodings like astc will still be noisy due to
third-party code but this works fine for the s3tc encoder.
2019-09-10 08:01:49 -07:00
Philip Rideout 0e81207758 WebGL: add demo for glTF animation.
Fixes #1583.
2019-09-06 16:44:03 -07:00
Philip Rideout a5284af2b8 Use original glTF filename for FlightHelmet. 2019-09-06 10:47:47 -07:00
Philip Rideout 4989c3dc48 Remove unused material. 2019-09-06 10:47:47 -07:00
Philip Rideout 046809cee0 Use --quiet when invoking cmgen in build. 2019-08-12 14:59:46 -07:00
Philip Rideout 91ff1d87eb Replace prebuilt KTX with a build step.
This removes the samples/envs folder and replaces these KTX files with a
build step that is driven by CMake / gradle / bash, depending on
platform.

This makes it easier to use IBL files that are generated by the latest
and greatest version of cmake.
2019-08-08 10:41:13 -07:00
Philip Rideout 34ef2a871f Stop using compressed IBL's in more places.
We use R11F_G11F_B10F for HDR so we should stop checking for compressed
IBL files.

Also, make the glTF sample on web more consistent with the default
settings used by gltf_viewer on native and use venetian_crossroads
instead of syferfontein.
2019-08-06 16:18:51 -07:00
Philip Rideout 19d7a3d21f Stop using DXT5 in web samples for the IBL.
Filament no longer decodes RGBM, so it's better to use a
floating-point format such as R11F_G11F_B10F.
2019-07-09 14:23:14 -07:00
Romain GuyandBen Doherty b1242163f7 Make CMake 3.10 the minimum version, add LTO option (#1316)
* Make CMake 3.10 the minimum version, add LTO option

* Install a newer CMake on Linux CI builds

* Update LLVM and Cmake on Windows CI

* Update build/windows/ci-common.bat

Co-Authored-By: Ben Doherty <benjdoherty15@gmail.com>

* Update formatting

* Apply suggestions from code review

* Update build/windows/ci-common.bat

* Update CMake

* Switch Android projects back to CMake 3.6
2019-06-19 12:53:03 -07:00
Philip Rideout 7b05d4fdeb Convert web helmet demo to use gltfio. (#1094)
This also adds an overlay element to show progress since this model
can take a while to load.
2019-04-12 09:41:04 -07:00
Philip Rideout c97e812056 Update FlightHelmet path. 2019-03-13 16:21:58 -07:00
Philip Rideout 960d1321e6 Repair web builds. 2019-03-11 18:36:29 -07:00
Philip Rideout 031ff260f7 Repair web builds. 2019-03-11 17:44:12 -07:00
Romain Guy 41397e1b82 Move 3p models to models/ directory 2019-03-11 14:21:51 -07:00
Philip Rideout 9fd69ec7a9 Add skinning demo.
Motivated by #764.
2019-02-02 09:02:32 -08:00
Philip Rideout 8228deb209 Add a multi-material model and JS demo.
This is a more complex test than suzanne because it has multiple
materials and exercises the named materials functionality in
loadFilamesh.

This also exercises our glTF-to-Filamesh pipeline at build time.

See issue #663
2019-01-11 09:18:41 +05:30
Romain Guy a38c40cf11 Turn on shaders optimization by default (#614)
* Turn on shaders optimization by default

Release builds of Filament only work well with optimize shaders,
turning optimizations on by default will help avoid mismatches.

This change also adds -g to disable all optimizations, for debug
builds.

* Use -g on debug builds

* Use -g on debug builds

* Update tutorial_redball.md to remove matc's -O

* Update tutorial_suzanne.md to remove matc's -O

* Use -g in debug builds
2018-12-11 09:36:37 -08:00
Philip Rideout 6c55b3b989 filamesh: Add support for COMPRESSION.
Note that the WebGL build uses filameshio, but Android does not. Our
Android samples therefore do not yet understand the compressed format.
For web, I measured the before / after:

```
BEFORE: filament.wasm = 505796, suzanne.filamesh = 521476
 AFTER: filament.wasm = 510915, suzanne.filamesh = 333489
```

Issue #558
2018-12-05 13:20:55 -08:00
Philip Rideout ffff8437ba Add tutorial that describes compression and async loading. 2018-11-16 14:09:41 -08:00
Philip Rideout 5fb0696fb7 Resurrect the JS memory leak test (#429) 2018-11-08 11:16:41 -08:00
Philip Rideout bb0c21b8ea Rename filamentjs to filament-js to follow convention. 2018-11-01 17:05:30 -07:00
Philip Rideout c46ecc6e05 Port the Suzanne demo to JavaScript. 2018-11-01 17:05:30 -07:00
Philip Rideout fffb2c8c97 Add samples to the new web directory. 2018-11-01 17:05:30 -07:00