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

Fix crash on smooth shading for meshes with no index buffers on Babylon Native. #12781

Merged
merged 1 commit into from
Jul 21, 2022
Merged

Fix crash on smooth shading for meshes with no index buffers on Babylon Native. #12781

merged 1 commit into from
Jul 21, 2022

Conversation

SergioRZMasson
Copy link
Contributor

Overview

When forceSharedVertices is called on a mesh that does not have an index buffer, the forceSharedVertices will create empty arrays for its positions and normals vertex attributes. This will result in a NativeEngine::RecordVertexBuffer been called with undefined arguments been passed as VertexBuffer* argument on Native engine.

This problem does not happen on the web engine because it creates vertex attribute arrays of size zero when an empty array is provided, which results in no rendering for those meshes.

Issues

@azure-pipelines
Copy link

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.

@azure-pipelines
Copy link

@sebavan sebavan merged commit 2579b8f into BabylonJS:master Jul 21, 2022
RaananW pushed a commit that referenced this pull request Dec 9, 2022
…ative

Fix crash on smooth shading for meshes with no index buffers on Babylon Native.

Former-commit-id: 68d476a0ccacaeaf4e6139e9f657ab2df983e0b6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants