Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gltfio: support morphing for models with sparse accessors #5651

Closed
prideout opened this issue Jun 6, 2022 · 2 comments
Closed

gltfio: support morphing for models with sparse accessors #5651

prideout opened this issue Jun 6, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request gltf Specific to glTF support

Comments

@prideout
Copy link
Contributor

prideout commented Jun 6, 2022

Our recent fix for non-packed morph data would be insufficient for models that have sparse accessors. This is important but not urgent since neither the Blender exporter nor gltf-transform support sparse encoding:

donmccurdy/glTF-Transform#351

Moreover, the glTF samples repo does not have sparsely morphed models that we could test with:

KhronosGroup/glTF-Sample-Assets#61

@prideout prideout added the gltf Specific to glTF support label Jun 6, 2022
@prideout prideout self-assigned this Jun 6, 2022
@pixelflinger pixelflinger added the enhancement New feature or request label Jun 7, 2022
@rbsheth
Copy link
Contributor

rbsheth commented Jun 9, 2022

If it is helpful, you could pull a test avatar from our API and it will have sparse morph targets: https://bitmoji.api.snapchat.com/bitmoji-for-games/test_avatar?lod=0

@prideout
Copy link
Contributor Author

prideout commented Jun 9, 2022

Thanks that model indeed provokes the functionality, thank you! Yay Snap. :)

bjovanovic84 added a commit to PolyCam/filament that referenced this issue Sep 12, 2022
* Update spirv-tools to get new code folding optimization.

This change includes a fix for an issue we filed against spirv-tools:
KhronosGroup/SPIRV-Tools#4371

So, it should reduce the number of extraneous matrix copies in finalized
GLSL code.

I did quick size total of all filamat files (*) before and after this
update, it went from 11.3 MB to 11.1 MB.

(*) All backends are enabled, includes built-in Filament shaders and
gltfio ubershaders.

* Repair macOS build breakage, hopefully.

Not only did I forget to patch the spirv-heades CMake file, I also
messed up the patch file while trying to manually update it.  This
should fix it.

* #endif comment match the macro name (google#5609)

* Fix typo

* extend `blendOrder` functionality

blendOrder was used to control the draw order of blended render
primitive within a Renderable. We now have an option to make the
blend order global, in this case those primitives with a global blend
order are always sorted solely using the blend order value (i.e. the 
distance from the camera is not take into account).

* Revert "iOS: implement headleass swapchain (google#5486)"

This reverts commit 0e5ba60.

This causes issues in G3, still need to investigate the root cause.

* fix overallocation by about 17MB

In practice on most systems this would only consume address space,
since most of those pages won't be accessed.

fixes google#5608

* gltfio ubershader mode: set sheen to OPAQUE.

This makes ubershader mode more consistent with jit mode.

SheenChair and ToyCar in the samples repo both have opaque cloth.

* Fix warnings.

* Remove unnecessary binaries (google#5621)

* remove RenderManager::setGeometryAt() that only sets offset/count

This is an API breakage, but the "full" setGeometryAt() can usually be 
used instead.

* HwRenderPrimitive is now immutable

* Clean up BasisU CMake targets, add zstd target.

We were re-building various C++ files in three different targets
(basis_encoder, basis_transcoder, basisu executable), it's probably
better just to set up proper dependencies between the libraries.  Note
that I'm not sure if this actually improves build times.

More importantly, this creates a CMake target for the zstd library
because we want to use zstd in other places.

* Repair Android and iOS builds.

* Metal: fix blitting when render target is smaller than texture (google#5616)

* Remover prebuilt MoltenVK (google#5623)

* Update RELEASE_NOTES for 1.23.0

* Release Filament 1.23.0

* Update RELEASE_NOTES for 1.23.0

* Release Filament 1.23.0

* Bump version to 1.23.1

* Remove stale comment and update the debugging doc.

* Remove NSOpenGLPFANoRecovery requirement when creating the NSOpenGLContext (google#5626)

* gltfio: fix morphing for non-packed floats.

* disable user scissor while rendering the shadowmaps

fixes google#5607

* remove a bunch of <functional> includes

This forces us to use an explicit hash class in a few place, but it
is cleaner.

remove utils::lower_bound and utils::upper_bound, which were not used.

* merge identical backend RenderPrimitives together

This is done in RenderPrimitiveFactory using a bidirectional associative
container.

This is a necessary step toward auto instancing.

* GitHub Actions: verify RELEASE_NOTES is updated for each PR (google#5633)

* PrimitiveFactory: fix typo and reserve 256 entries

* Fix WGL requested context attributes

Fixes google#5611

* Add a basic stopwatch class

this can be used for basic timing.

* reserve 128 entries in ResourceAllocator

this improves performance quite a bit by reducing heap allocations.

* Remove merge conflict line from RELEASE_NOTES

* Metal: fix invalid MSL generated due to missing optimization pass (google#5640)

* Fix typo (google#5648)

* gltfio: remove poorly maintained lite flavor

* Add support for ubershader archives.

An ubershader archive is a bundle of filamat packages with some metadata
that conveys which glTF features each material supports.

This PR does three things:

1. Adds a new command line tool called `uberz` that consumes a list
   of filamat files and metadata text files and produces a single
   ubershader archive.

2. Adds a new library (also called `uberz`) that is used by `gltfio`
   to read ubershader archives, and used by the above command line
   tool to write ubershader archives.

3. Enhances `UbershaderLoader` so that it no longers uses a hardcoded
   set of materials, and instead takes an ubershader archive.

Ubershader archives have a simple binary layout that can be memcpy'd
directly into a C struct. The metadata is specified using a text file
with key-value pairs. These two file formats have formal desriptions in
the README in `libs/uberz`.

In a subsequent PR, we will remove the `gltfio_resources` target and
change the signature of `createUbershaderLoader` so that it takes
an archive.

* Revert "iOS: implement headleass swapchain (google#5486)"

This reverts commit 0e5ba60.

This causes issues in G3, still need to investigate the root cause.

* Update RELEASE_NOTES for 1.23.1

* Release Filament 1.23.1

* Bump version to 1.23.2

* configure render primitive pool so it works with msvc

a 64 bytes pool seems to work with both clang and msvc, unfortunately,
c++ doesn't let us know the allocator object size at compile time
for map containers, so we have to guess.

* disable timer queries on some version of Mali-Gxx drivers

* Revert "Workaround: partially revert "don't issue a flush..." (google#5557)"

This reverts commit c049a1 and reenables commit b2cdf9:

    "don't issue a flush systematically after framegraph's execute"

* gltfio: Rename all plugin classes to have "provider" suffix.

    UbershaderLoader  => UbershaderProvider
    MaterialGenerator => JitShaderProvider

* Rename gltfio to filament::gltfio.

* Fixup to "gltfio: remove poorly maintained lite flavor"

* Remove uberz <=> filament dependency, move ArchiveCache.

* fix typo

* Repair debug builds.

* Do not trigger UB with string_view.

* Added a new `instanced` material parameter

This boolean parameter is used with materials that need to access 
`getInstanceIndex()` (filament's equivalent to `gl_InstanceIndex`).
It is false by default, and getInstanceIndex() is not accessible.
This is intended to be used in concert with
`RenderableManager::Builder::instances()`.

* fix typo

* UbershaderProvider now takes a custom archive in its constructor.

We still use resgen for convience, but the archive is now passed in
from the client application.

This will allow us to shrink the gltfio Android library (stay tuned).

* iOS: add --quiet when running cmgen.

* Remove an 'API Change' warning from one item.

* Fix morphing with sparse accessors.

We were not leveraging `cgltf_accessor_unpack_floats` in a few spots,
this was a mistake.

Fixes google#5651.

* DEPTH commands are now instancing friendly

DEPTH commands are now sorted just like COLOR commands, that is,
they use a 10 bits z-bucket and the material id in the sorting key.
This allows instance-able primitives to be sorted next to each other.

* Allow UniformInterfaceBlock to have arrays of size 1

* Always access object uniforms via getObjectUniforms()

We no longer use the hardcoded objectUniform UBO name, instead, we 
access the object uniforms through the new getObjectUniforms().

Because it's not possible to return a "Uniform Block" from a function
in GLSL, a large part of this change, is to replace the interface block
by a structure.


Note: getObjectUniforms() is not public, but it is used by gltfio to
access the userData field, which is also not public at the moment.

* gltf_viewer: exercise picking functionality.

* Expose picking to JavaScript, use it in helmet demo. (google#5678)

* cleanup and fixes regarding skinning UBO (google#5676)

- rename PerRenderableUibBones to PerRenderableBonesUib to be more
  consistant with other interface block naming.

- make sure the C++ struct and the UBO definition match. 
  PerRenderableBonesUib is a UBO with one bones[256] field, but the
  C++ struct has a single bone and treated the UBO as an array.
  This makes things less confusing.
  We can now use sizeof(PerRenderableBonesUib) in many places which
  better expresse what we are doing.

- Fix an off-by-one assert when setting a skinning buffer to a renderable

- Asserts that no more than 256 bones are associated to a renderable

- improve documentation and fix some typos

* fix unit tests

* backend: remove STREAM buffers and add Unsynchronized buffer update API

Unsynchronized update just means that the buffer is updated regardless
if what the gpu is doing, the synchronization is the responsibility of
the caller.

Also added resetBufferObject(), which essentially destroys and reallocate
a buffer for the same handle.

* OpenGL: add WebGL support for ReadPixels. (google#5675)

* Update RELEASE_NOTES for 1.23.2

* Fix typo

* Always use homogeneous attachment sizes (google#5679)

* small optimization that helps avoid bindUniformBufferRange calls

a lot of primitive may use the same UBO slot, if they happen to be
in a sequence, we don't need to rebind the UBO.

* Update cgltf, remove a morphing constraint. (google#5688)

Fixes google#5670.

* fix getInstanceIndex()

it would be initialized after user material code was called.

* Vulkan: check for OUT_OF_DEVICE_MEMORY. (google#5690)

Related to google#5432.

* Upgrade vkmemalloc from 2.3.0 to 3.0.1 (google#5691)

* Vulkan: fix ReadPixels with 2-component formats. (google#5692)

This fixes the OOB seen with picking.

* Fix warning.

* Update BlueVK and use Python 3. (google#5698)

This will allow us to fix the validation error related to
VK_KHR_portability_enumeration.

Also, macOS comes with Python 3 nowadays so we're upgrading the script
from Python 2.

* NoopDriver: return unique handles (google#5697)

* NoopDriver: return unique handles (google#5697)

* Release Filament 1.23.2

* Update instructions for Vulkan + macOS. (google#5693)

* Fix bitrot in sample-page-curl (google#5703)

* Vk: do not raise SIGINT for validation errors. (google#5700)

This was occasionally useful for debugging specific problems, but it is
much too intrusive to enable in all debug builds.

* Vk: set ENUMERATE_PORTABILITY_BIT for MoltenVK. (google#5699)

This lets us avoid the following validation error.

    Attempting to create a VkDevice from a VkPhysicalDevice which is
    from a portability driver without the
    VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR bit in the
    VkInstanceCreateInfo flags being set...

* BlueVKDarwin: Simplify the build and loading process. (google#5701)

* BlueVKDarwin: Simplify the build and loading process.

Some of our CMake logic was not necessary because we do not staticly
link against anything for Vulkan.  All entry points are dynamically
loaded.

Some of the load-time code was also needlessly complicated. In fact the
ICD environment variable that we were setting is now deprecated.

I tested this PR with:

- macOS + June LunarG SDK
- Android on a Pixel 6

* Fix up, further simplification.

* Fix build breakage

* Vk: remove slow allocations workaround, fix scaniverse models. (google#5708)

The vkmemalloc performance workaround we implemented with google#4128 for Mali
is no longer necessary. Removing this fixes google#5432.

* smolv blobs are now 8-byte aligned in filamat. (breaks materials) (google#5705)

* configure render primitive pool so it works with msvc

a 64 bytes pool seems to work with both clang and msvc, unfortunately,
c++ doesn't let us know the allocator object size at compile time
for map containers, so we have to guess.

* Update RELEASE_GUIDE with info on re-running

* Fix typo (google#5713)

* fix the use of an uninitialized texture (google#5711)

* Add EGL support for OpenGL on Linux (google#5674)

* Metal: correctly compute viewport (google#5710)

* OpenGL: take mip level into account when checking attachment sizes (google#5709)

* Quick repair to matdbg for alignment padding. (google#5717)

This was too tricky, it highlights that we definitely need refactor this
to share code with the flattener / unflattener pipeline. I'll look at
that next.

* Vk minor code cleanup.

* vulkan: first instance should be 0 not 1

* Do not trigger UB with string_view.

* Vulkan: Support VMA_DYNAMIC_VULKAN_FUNCTIONS off

* Vulkan: Support VMA_DYNAMIC_VULKAN_FUNCTIONS off (google#5726)

* Refactor the CMake script for gltfio ubershaders. (google#5725)

* Vulkan: fix VMA-related warning in GitHub builds. (google#5729)

* Fix typo (google#5728)

* Check the font path is the file (google#5734)

If the font path is the directory then it's undefined behavior.

* Speed up debug builds. (google#5735)

* uberz tool: add --append and --template arguments. (google#5730)

* ImGuiHelper: add support for Y flip. (google#5748)

Reflects a change from Betty and should be cherry picked to v1.23.3

Users could customize the ImGuiHelper camera, but they had no control
over the scissor coordinates. This allows them to use vertically flipped
coordinates, which, unfortunately, is required for MediaPipe
integration.

* ImGuiHelper: add support for Y flip. (google#5748)

Reflects a change from Betty and should be cherry picked to v1.23.3

Users could customize the ImGuiHelper camera, but they had no control
over the scissor coordinates. This allows them to use vertically flipped
coordinates, which, unfortunately, is required for MediaPipe
integration.

* matdbg: fix 4x overallocation for SMOLV blobs

* CocoaPods: include uberz library (google#5752)

* CocoaPods: include uberz library (google#5752)

* matc: add --template option.

This makes it easier to generate ubershaders without the fancy CMake
machinery available in its `configure_file` command.

* CocoaPods: include uberz library (google#5752)

* "ShaderBuilder" does not need to exist, remove it.

We were mostly using this as a byte buffer, not a builder.
This PR removes ~200 LoC and 3 files.

* Metal: Allow Filament to disregard MTLTexture pixelFormat when importing (google#5753)

* Metal: Allow Filament to disregard MTLTexture pixelFormat when importing

* Update RELEASE_NOTES for 1.24.0

* Update version to 1.24.0

* Release Filament 1.24.0

* Bump version to 1.25.0

* Fix destroyEntity documentation (google#5760)

* Access the object uniforms relative to gl_InstanceIndex

* Basic automatic instancing.

* add API to enable/disable auto-instancing globally.

auto-instancing can have some overhead, so when it is known that the
scene doesn't have identical primitives, it is better to disable it.
(disabled by default).

Also add some missing bindings for `enableAccurateTranslations`.

* Release Filament 1.25.0

* Bump version to 1.25.1

* fix typos in Camera documentation

* Use string_view for map lookups.

We can avoid construction of std::string by using std::map with a
special comparator. For some reason, this is not supported with
unordered_map.

* matdbg: prep for removing bespoke chunk serializer

matdbg should use Flattener / Unflattener rather than imitating them,
this is phase 1.

* Metal: add support for scissor (google#5644)

This patch enables user scissor in Metal backend; There was no implementation for it.
While the absence of the feature in Metal does not incur serious problem, many rendering glitches were found in apps using ImGui due to it.

Co-authored-by: Benjamin Doherty <bendoherty@google.com>

* Add backend test for viewport and scissor (google#5767)

* filamat: remove some unused code.

* Fix swallowed errors in MaterialParser.

If `ChunkContainer::parse` failed, then `MaterialParser::parse` was
returning SUCCESS.

* Camera API and documentation improvements

- getNear() and getCullingFar() now return doubles
- updated documentation
- all setProjection() calls can now throw (when enabled) and will
  do so if preconditions are not met (instead of setting a default
  projection).
- Frustum can now be logged on debug builds

* matdbg: rewrite ShaderReplacer to remove bespoke chunk i/o.

* `Renderer::getUserTime()` now returns seconds as documented

Fixes google#5722

* filamat: remove more dead codelines.

* filamat: dictionaries now store each blob once, not twice.

BlobDictionary and LineDictionary were storing blobs as map keys to
achieve simple compression, but they also stored duplicates of
in a vector for index-based lookup.

Now, the vector is storage and the map has keys that are string_view.

* Fix Conflict with glibc 2.35+ macro. 

Fix google#5720

* Release Filament 1.25.1

* Bump version to 1.25.2

* gltfio: use openLocalTransformTransaction API.

* Add config object to engine initialization(google#5556)

This code adds a config object, "ConfigParams," to Engine creation parameters for setting memory buffer sizes for command buffers and driver handle arena sizes. It will use #define values (FILAMENT_PER_FRAME_COMMANDS_SIZE_IN_MB, etc.) as defaults (and as minimum acceptable values) if the user does not provide values. It attempts to validate the values given to prevent the user from creating a unusable state.

* code maintenance/cleanups

- try to help DataReshaper a bit
- fix some typos in comments
- address a few "todos"
- protect mActivePrograms with a lock, as it should

* Fix build

* cleanup comments/documentation and code

* fix adreno driver crash related to morph target change. (google#5754)

For some android gpu drivers, some uniform arrays should be initialized to be used in the shader, even if not used.

Co-authored-by: Mathias Agopian <mathias@google.com>

* more Engine configuration cleanup

- move all froxel configuration constants out of Engine.h, unlike
  the previous todo/comment, these shouldn't be part of Engine::Config.

- same for irradiance map

* gltfio: minor fixups to prep for g3 integration.

* gltfio: use openLocalTransformTransaction API.

* gltfio: minor fixups to prep for g3 integration.

* Release Filament 1.25.2

* Bump version to 1.25.3

* Use staging buffers to implement Metal buffer updates (google#5795)

This PR changes how Metal handles buffer updates. Previously, Metal allocated a full new buffer each time an `updateBufferObject` command was issued; however, it did not copy the previous contents of the buffer over to the new buffer, so partial updates did not work correctly.

Now, Metal allocates a single, private GPU buffer and employs temporary staging buffers whose contents get blitted to the private buffer at each update.

There's still some room for optimizations, and I need to give more thought to how I want to implement `updateBufferObjectUnsynchronized`.

* rework backend texture upload APIs

The main goal is to allow more flexibility, allow cubemap arrays in
the future and better match vk and metal apis.

Main changes:
- remove updateCubeImage
- remove update2DImage
- update3DImage is now the only texture upload backend API

cubemaps are now treated just like a 2D array of 6 layers.

For this reason, Texture::setImage(..., FaceOFfsets) is deprecated.
Additionally, the 2D versions of Texture::setImage() become inline
helpers.

A side effect of this change is that it is now possible to update only
a single face of a cubemap, but also a region of a face (or faces).

* Upgrade Kotlin, AGP, NDK (google#5804)

* fix cubemap uploading

There was a wrong assert in Texture::setImage() as well as a typo when
calling setImage() itself in the sample code.

* fix max mipmap levels calculation for 3D textures

the depth of the texture wasn't taken into account. In practice this
would restrict the number of mip levels of a 3d texture that would have
a larger dimension in depth.

* Fix config object related build failures (google#5814)

* Fix config object related build failures (google#5814)

* Release Filament 1.25.3

* Bump version to 1.25.4

* fix View::pick() callbacks

the handler parameter would be ignored for some overloads.

* Make filament and utils public headers -Wall -Wextra warning free

All warnings here where harmless unused parameters.

* Add support for cubemap arrays in the backends


This is not intended to be used yet because we're not currently
checking that cubemap array are actually supported, however, if they
are, they should work.

* Upgrade to emscripten 3.1.15 and remove workaround.

Starting with 3.1.14, embind started to support for `noexcept`
which caused multiple definition errors since we have a workaround
in place that alreadys supplies template instantiations for `noexcept`.

This change should not affect G3 since our JS bindings are not used
in G3.

The upstream fix is here:
emscripten-core/emscripten#17140

Fixes google#5789.

* fix a use-after-move

* fix all warnings in OpenGLDriver.cpp

* Prevent proguard obfuscation for KTX1Loader.

* SamplerGroup cleanup

- remove the 2 argument version of setSampler
- use a bool instead of bitfield for the dirty state
- try to avoid setting dirty bit if setting same sampler

* move SamplerGroup out of HwSamplerGroup

this is the start at making HwSamplerGroup more "real". It shouldn't
keep a reference to the filament::SamplerGroup, which is just an object
to pass the data.

for now, we move the SamplerGroup reference into the concrete classes to
keep the same implementation. But now it becomes an "implementation
detail" of the respective backends.

* take advantage of HwSamplerGroup abstraction in GL backend

we mow do most of the work of validating the sampler parameters and
resolving to an actual GL sampler, when updating a SamplerGroup,
instead of doing this each time a program is made active.

A lot of cpu work is saved when the same samplergroup is reused with
multiple programs.

* SamplerGroup now uses a FixedCapacityVector<>

SamplerGroup itself is now a more "traditional" class where copy and
move ctor do what you'd expect. This actually removes a few copy of
the internal data in some cases and uses less memory, at the cost of
doing some heap allocations, but they should be rare and outside of
the main loop.

* updateSamplerGroup() now uses a BufferDescriptor

this is more in line with other APIs of the backend. This change is
complete for the GL backend, but for the metal/vulkan backend we still
use a SamplerGroup as the internal data structure, which is just 
temporary.

Eventually, SamplerGroup should becomes a "filament" only API (not
a backend API).

* cgltf: enable validation asserts in debug builds

* Update public WebGL viewer to 1.25.3

* Metal: add initial support for stencil buffers (google#5783)

* Add IBL builder to TypeScript, fix google#5805

* rename `ShaderModel` enums

GL_ES_30   becomes MOBILE
GL_CORE_41 becomes DESKTOP

ShaderModel controls which flavor of GLSL (GL or ES) is used both when 
reading and outputting materials.

It's also used to set default quality settings and the default precision
of all fragment shaders.

Technically, Vulkan and Metal don't need this distinction, but the GL
backend does.

* better test for presence of `unpackHalf2x16`

This will actually reduce the binary size a bit on mobile.

* Fix DoF on WebGL

The issue was that WebGL2.0 doesn't support texture swizzle.


Fixes: google#5828

* Fix PlatformEGLHeadless build and add a build.sh option to build EGL

I have disabled building SDL with headless EGL, because
SDL_config_minimal.h doesn't work with EGL, and I don't know how to
implement a an SDL config that would work with EGL.

I have verified that this works in a separate project, and that it
compiles in this project.

```
$ ./build.sh -e release
$ find ./out/ -name "*EGL*"
./out/cmake-release/filament/backend/CMakeFiles/backend.dir/src/opengl/platforms/PlatformEGL.cpp.o
./out/cmake-release/filament/backend/CMakeFiles/backend.dir/src/opengl/platforms/PlatformEGLHeadless.cpp.o
./out/cmake-release/libs/bluegl/CMakeFiles/bluegl.dir/src/BlueGLLinuxEGL.cpp.o
```

* Headless EGL: Fallback to a 24-bit depth buffer

* Fix typo.

* Fix PlatformEGLHeadless build and add a build.sh option to build EGL

I have disabled building SDL with headless EGL, because
SDL_config_minimal.h doesn't work with EGL, and I don't know how to
implement a an SDL config that would work with EGL.

I have verified that this works in a separate project, and that it
compiles in this project.

```
$ ./build.sh -e release
$ find ./out/ -name "*EGL*"
./out/cmake-release/filament/backend/CMakeFiles/backend.dir/src/opengl/platforms/PlatformEGL.cpp.o
./out/cmake-release/filament/backend/CMakeFiles/backend.dir/src/opengl/platforms/PlatformEGLHeadless.cpp.o
./out/cmake-release/libs/bluegl/CMakeFiles/bluegl.dir/src/BlueGLLinuxEGL.cpp.o
```

* Headless EGL: Fallback to a 24-bit depth buffer

* Fix incorrect precision restoration when computing accurate world translations

When FTransformManager computes accurate world transforms, it adds downcasted leftover to translation part to restore precision.
However, both transltation and leftover are given as float3 - simply adding them resut float3, so addling leftover become meaningless.
one or both should be upcasted first.

* Fix incorrect shader permutations in MaterialBuilder

* Metal: implement MSAA stencil buffers (google#5834)

* Fix bluegl-gen.py

The comment about MSVC was not properly escaping backslash
sequences, eating some of the comment and generating an
interpreter error on \u.

* skip SSAO texture read if SSAO is disabled

* skip clear coat if material.clearCoat is null

This allows a material to have clear coat turned on/off dynamically
without paying too much of a price.

* Remove vestiges of old API from Stream.

* MaterialInstance public API friendly to std::string_view

Internally we use std::string_view and the public API is augmented
with APIs that take a length for strings, which makes them useable
with string_view parameters.

Also fix exception specification for all setParameter methods, which
can throw if exceptions are enabled (or exit the program otherwise).

* Vulkan: add documentation for cmd buf manager.

* get rid of `utils::StaticString`

In most places this is simply replaced by `std::string_view`.

We also change a few internal/private headers so they accept 
`std::string_view` instead of `utils::CString`.

* Fix typo in documentation

Fixes google#5848

* Fix "angle sum trig identity" typo

* Fix derivation of SH trig terms recursion

Fixes google#5866

* Release Filament 1.25.4

* Fix: OpenGL not clearing stencil buffer (google#5870)

* gltfio: fix warning in release build.

* make all public API pre-condition violation fatal

We used to have a mix of fatal and non-fatal assertions for precondtions
errors. From now on, we always throw if exceptions are enabled or 
crash with a log otherwise.

* make Camera::lookAt() take doubles instead of floats

this matches all the other Camera APIs

* Camera::getPosition() now returns a double3

* Move stencil state out of RasterState (google#5873)

* Return support for ASTC formats properly.

`Texture::isTextureFormatSupported` always returned `true` for ASTC, it
now queries the hardware as expected.


Fixes google#5872

* Fix StructureOfArray alignments

StructureOfArray always aligned each array to the same alignment as
malloc (usually 8 bytes), but that was not enough if one of its type 
has stricter alignment requirements. 

StructureOfArray now always honors at least the alignment requirement
of each array.

Also removed dependency on EntityInstance.h

Fixes google#5727

* Update docs for sampler2D arrays

* The "Prepare Shadow Pass" was never executed

It was culled by the frame-graph because it didn't have "read" from 
any of its resource, only writes. However, it does set uniforms, so need
to be called.

fix google#5874

* Add additional state to StencilState (google#5879)

Separate out stencil operations for back/front facing primitives and add read/write masks.

* Fix PrimitiveInfo size (google#5883)

* Fix PrimitiveInfo size

* Make Command 64 bytes

* Ensure UTILS_DEPRECATED is used in the public API

* improve GL backend stencil state updates

We separate stencilWrite from stencilFunc, which can lead to less
GL state changing.

* StencilState can now use designated initializers

We just remove the custom default ctor.

* Remove mStentilState from OpenGLDriver

It wasn't really needed because it's essentially a copy of the GL state.

* We don't need the union in StencilOperations anymore

* Remove mRasterState from OpenGLDriver

it was a duplicate state from the true gl state which could easily cause
problems. It only existed to optimize state updates when nothing changed
but we already have fine-grained tests for this.

* Fix a small discard issue with the stencil buffer

In GL we need to track if a buffer is written at all so that later we
can decide to honor the discard flags or not (see b514b2e).

* Stencil reference value can be separate for front and back

* gltfio: add 'detach' methods to allow ownership transfer

These new methods allow gltfio to be integrated into internal Google
libraries.

* gltfio: add 'detach' methods to allow ownership transfer

These new methods allow gltfio to be integrated into internal Google
libraries.

* gltfio: remove a memcpy via custom cgltf_file_options.

Earlier versions of cgltf did not support file reader customization.
This was fixed back in Dec 2019 but at the time I did not notice, so
we never bothered cleaning up our usage.

In the future we would like WebGL + Android builds to permit texture
downloads to occur concurrently with the texture decoder jobs. This PR
is basically a preparatory refactoring, but with the nice side effect of
removing a memcpy.

* gltfio: concurrent texture downloading and decoding.

This feature can improve load time when textures are downloaded from the
web on non-filesystem platforms like Android.

More specifically, this allows downloaded texture assets to arrive after
the user calls asyncBeginLoad(), which means that decoding and
downloading can occur concurrently.

Prior to this PR, we already used JobSystem for decoding, but we did not
kick off any jobs until after all assets were downloaded.

Still TBD: add this feature for external vertex data.

Partial fix for google#5909.

* 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.

* 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.

* Fix Texture documentation

Fixes google#5904

* gltfio Android: Fix double free error.

The custom release callback that I provided was in the wrong place; it
was only being used for a path string, not the actual buffer content.
The cgltf API is a bit awkward in this area.

No need to update RELEASE_NOTES because this will be cherry picked to
the RC branch, which is where the bug introduced.

Fixes google#5918.

* Add CONFIG_MINSPEC_UBO_SIZE and fix comment.

Fixed a comment that said "We store 64 bytes per bone.".  The actual
number is 32.

Developers who know their users have powerful devices may wish to exceed
ES3.0 minspec constraints to allow more bones and / or morph targets.

Fixes google#5785.

* Fix SamplerGroup update issue (google#5928)

* Fix SamplerGroup update issue (google#5928)

* Bump version to 1.25.5

* Release Filament 1.25.5

* Bump version to 1.25.6

* Update RELEASE_NOTES for 1.25.6

* remove filament web

Co-authored-by: Philip Rideout <philiprideout@gmail.com>
Co-authored-by: LaiJF <cihv2@163.com>
Co-authored-by: Mathias Agopian <mathias@google.com>
Co-authored-by: Benjamin Doherty <bendoherty@google.com>
Co-authored-by: Romain Guy <romainguy@curious-creature.com>
Co-authored-by: Josh Faust <1388377+jfaust@users.noreply.github.com>
Co-authored-by: Rahul Sheth <rbsheth@cs.stanford.edu>
Co-authored-by: daemyung jang <dm86.jang@gmail.com>
Co-authored-by: MasTraER <MasTraER@users.noreply.github.com>
Co-authored-by: BStringhamVRSK <bjstringham@verisk.com>
Co-authored-by: hzzengxiaoqi <97344033+hzzengxiaoqi@users.noreply.github.com>
Co-authored-by: Alan Eneev <aeneev@google.com>
Co-authored-by: MasTraER <mastraer@gmail.com>
Co-authored-by: Filip Henningsson <c18fhn@cs.umu.se>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request gltf Specific to glTF support
Projects
None yet
Development

No branches or pull requests

3 participants