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

switch to new morphing API #7911

Merged
merged 1 commit into from
Jun 28, 2024
Merged

switch to new morphing API #7911

merged 1 commit into from
Jun 28, 2024

Conversation

pixelflinger
Copy link
Collaborator

  • remove deprecated morphing APIs
  • repair gltfio, samples and tests

The new API doesn't allow a MorphTargetBuffer per RenderPrimitive, instead the MorphTargetBuffer is specified per Renderable.

gltfio separates RenderPrimitives from Renderables, in particular all RenderPrimitives are created before their Renderable; this was problematic for this change because all primitives must share a single MorphTargetBuffer living in the Renderable.

To fix this, we're no longer initializing the morphing paramters at RenderPrimitive creation, instead we store a reference to the BufferSlot in the Primtive structure, so that later, when the Renderable is created we can finally retrieve the BufferSlot and initialize its morphing paramters, which are not available. The "morphing parameters" are now expanded to contain the MorphTargetBuffer as before (except now it's always the same for all the primitives of a Rendrable), as well as the offset within the buffer and the vertex count.

caveat: this PR breaks the "extended" AssetLoader

@pixelflinger pixelflinger added the internal Issue/PR does not affect clients label Jun 7, 2024
Copy link
Contributor

@poweifeng poweifeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

filament/src/components/RenderableManager.cpp Show resolved Hide resolved
filament/src/components/RenderableManager.cpp Show resolved Hide resolved
filament/src/components/RenderableManager.cpp Outdated Show resolved Hide resolved
- remove deprecated morphing APIs
- repair gltfio, samples and tests

The new API doesn't allow a MorphTargetBuffer per RenderPrimitive,
instead the MorphTargetBuffer is specified per Renderable.

gltfio separates RenderPrimitives from Renderables, in particular all
RenderPrimitives are created before their Renderable; this was
problematic for this change because all primitives must share
a single MorphTargetBuffer living in the Renderable.

To fix this, we're no longer initializing the morphing paramters
at RenderPrimitive creation, instead we store a reference to the
BufferSlot in the Primtive structure, so that later, when the Renderable
is created we can finally retrieve the BufferSlot and initialize its
morphing paramters, which are not available. The "morphing parameters"
are now expanded to contain the MorphTargetBuffer as before (except now
it's always the same for all the primitives of a Rendrable), as well
as the offset within the buffer and the vertex count.
@pixelflinger pixelflinger marked this pull request as ready for review June 28, 2024 17:10
@pixelflinger pixelflinger requested a review from bejado June 28, 2024 17:10
@pixelflinger pixelflinger merged commit f7a5111 into main Jun 28, 2024
11 checks passed
@pixelflinger pixelflinger deleted the ma/morphing branch June 28, 2024 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Issue/PR does not affect clients
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants