Skip to content

Conversation

@noname0310
Copy link
Contributor

This PR resolves the issue https://forum.babylonjs.com/t/missing-doc-for-gpupicker-in-v8-31-3/61295/8

I noticed that PrepareAttributesForBakedVertexAnimation does not function correctly in ShaderMaterial. The reason is as follows:

https://github.com/BabylonJS/Babylon.js/blob/master/packages/dev/core/src/Materials/materialHelper.functions.ts#L415

const enabled = defines["BAKED_VERTEX_ANIMATION_TEXTURE"] && defines["INSTANCES"];

if (enabled) {
    attribs.push("bakedVertexAnimationSettingsInstanced");
}

PrepareAttributesForBakedVertexAnimation checks whether BAKED_VERTEX_ANIMATION_TEXTURE and INSTANCES exist in the defines to determine whether to add the bakedVertexAnimationSettingsInstanced attribute to the list.

However, ShaderMaterial stores the define list as a sequence of “#define DEFINENAME” entries, causing it to fail this test.

image This is what it actually looks like when executed on the `ShaderMaterial` in the Edge debugger.

Therefore, I specialized this logic to suit ShaderMaterial.

This approach was chosen based on the observation that specialization had already been performed in the logic for assigning Bone's Define and Attribute within ShaderMaterial.

@bjsplat
Copy link
Collaborator

bjsplat commented Nov 15, 2025

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Collaborator

bjsplat commented Nov 15, 2025

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Collaborator

bjsplat commented Nov 15, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Nov 15, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Nov 15, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Nov 15, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Nov 15, 2025

@deltakosh deltakosh merged commit 2a414a4 into BabylonJS:master Nov 17, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants