Commit Graph

26 Commits

Author SHA1 Message Date
Sungun Park
4fe852e88a Ensure correct resource cleanup sequence to avoid crashes upon app closing (#8408)
The commit 1747ae8f5a enfoces a correct
order for releasing resource. Fix the order to avoid crashes.

Make some samples to use the DEPTH32F format for better compatibility.
Some manufacturers don't fully support DEPTH24 on Vulkan. E.g., AMD
Radeon PRO W6400
2025-02-03 21:23:53 +00:00
Philip Rideout
d52a24b6e9 Incorporate feedback from code review. 2022-04-15 10:48:48 -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
b60518caa5 Add libs/ktxreader, rename some things to prep for KTX2.
Changes:

- Remove the strange header-only variant of libs/image
- Rename KtxBundle => Ktx1Bundle
- Move image/KtxUtility => ktxreader/Ktx1Reader
- Add unit test for Ktx1Reader and test stub for KTX2.

Notes:

- Ktx1Bundle does not depend on Filament and is used by cmgen
  and mipgen to generate KTX files.

- Ktx1Reader has a dependency on Filament and should therefore live in
  a separate library, which it now does.
2022-04-06 10:56:37 -07:00
Romain Guy
a5dbddfd12 Fix release distribution (#4713)
Statically link SDL2 to make our samples (glTF Viewer, etc.) completely
standalone, and include missing resources (fonts and default environment
map for the IBL).
2021-10-07 10:11:27 -07:00
Ben Doherty
0a0588aec8 Add Metal and Vulkan backend support to Suzanne sample (#3736) 2021-04-01 12:22:15 -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
a55b75a739 Remove monkey mesh dependency from samples.
The only apps that need this filamesh are suzanne and hellopbr. This
change allows us to modify + test Filament without re-invoking resgen.
2020-04-20 18:25:43 -07:00
Philip Rideout
854fcc7eac Desktop samples now use default backend.
There is nothing specific to Vulkan in these tests, I meant to remove
the backend override when I removed the `vk_` prefix last week.
2020-04-13 13:55:32 -07:00
Philip Rideout
d8ac60009c FilamentApp: use angle bracket syntax for includes. 2020-04-03 16:28:38 -07:00
Philip Rideout
37e2f46e10 Move FilamentApp into libs/filamentapp.
This will make it easier to migrate gltf_viewer into tools.

This is not a rewrite of FilamentApp, just a baby step.
2020-04-03 16:28:38 -07: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
Ben Doherty
e8641ce257 Additional fixes for MSVC (#1765) 2019-10-10 16:45:06 -07:00
Mathias Agopian
20c3d45b9c Engine.flushAndWait() is not needed in most places 2019-10-03 16:04:22 -07:00
Gregory Popovitch
d5c0d11404 Final changes for building with msvc 2019 on Windows (#1681) 2019-09-30 14:18:06 -07:00
Philip Rideout
1bda37776b Rename KtxUtility namespace to image::ktx. 2019-09-23 12:08:57 -04:00
Philip Rideout
95ef8d85db Minor fixup to suzanne Vulkan demo. 2019-08-16 17:04:32 -07:00
Philip Rideout
ae88536f0c Fix GL_INVALID_OPERATION in the default IBL.
In commit d955e73 we changed the default IBL from RGBM to RGB, but we
kept its internal format of RGBA8. Since the internal format is not
compatible with the data format, we see GL_INVALID_OPERATION during the
texture upload.

This is a single-pixel black texture, so the format does not really
matter, but this clears up a GL error seen on some platforms.
2019-06-24 13:22:34 -07:00
Mathias Agopian
b26684deed rename namespace filament::driver -> filament::backend 2019-03-26 11:47:47 -07:00
Mathias Agopian
7b3475f1da API change: rename matrix factory functions
scale() -> scaling()
translate() -> translation()
rotate() -> rotation()

These static functions create a matrix, they don't modify it.
Fixes #826
2019-03-04 14:34:02 -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
f690d5e69c Suzanne now tests generateMipmaps. 2019-01-30 11:03:54 -08:00
prideout
1bbe203a15 Add RGB support to VulkanDriver. 2019-01-22 09:56:27 -08:00
Ben Doherty
d113af8afb Add return 0 to main functions to avoid crashes on Windows (#674) 2019-01-03 16:59:34 -08:00
Philip Rideout
40298f3cc0 Add C++ sample for compressed textures.
This is similar to its WebGL and Android counterparts, we simply did not
have a version for desktop. This uses resgen to package the model's
textures (albedo, normal, roughness, metallic, ao) into a library that
is linked only to this sample.

This is a good test because it applies multiple textures to the model.
Moreover Aaron was asking me for a C++ example that uses compressed
textures.

For now this selects the OpenGL backend. We can change it to use Vulkan
after we add support for 3-band formats to VulkanDriver.
2018-12-11 11:23:33 -08:00