Skip to content

[rmodels] Enable GPU skinning for GL 3.3+, - #5902

Merged
raysan5 merged 1 commit into
raysan5:masterfrom
JeffM2501:GPU_SKINNING_FIXES
Jun 1, 2026
Merged

[rmodels] Enable GPU skinning for GL 3.3+,#5902
raysan5 merged 1 commit into
raysan5:masterfrom
JeffM2501:GPU_SKINNING_FIXES

Conversation

@JeffM2501

Copy link
Copy Markdown
Contributor

This PR enables GPU skinning for OpenGL 3.3 and 4.3.
It also ensures that we only do GPU animation if the model shader supports bones. Otherwise it defaults to CPU.
This allows someone to mix and GPU and CPU skinning if needed, and gives modern desktops use of GPU skinning without needing to change the default build.

only do GPU skinning if the shader supports bone IDs.
@raysan5 raysan5 changed the title [RMODELS] Enable GPU skinning for GL 3.3+, [rmodels] Enable GPU skinning for GL 3.3+, Jun 1, 2026
@raysan5

raysan5 commented Jun 1, 2026

Copy link
Copy Markdown
Owner

@JeffM2501 Many users, specially students, probably just want to load a model and play animation, without touching any shader. If GPU-skinning is enabled by default on OpenGL 3.3/4.3 and no shader is provided, does it fallback to CPU?

@JeffM2501

Copy link
Copy Markdown
Contributor Author

Yes, the change I made in the mesh update has it check the shader, it will now just work.

Current raylib will fail at cpu animation if you buld with the gpu flag, this change will give you the correct fallback.

@raysan5
raysan5 merged commit f1d6020 into raysan5:master Jun 1, 2026
16 checks passed
@raysan5

raysan5 commented Jun 1, 2026

Copy link
Copy Markdown
Owner

@JeffM2501 thanks for the review

@raysan5

raysan5 commented Jun 1, 2026

Copy link
Copy Markdown
Owner

@JeffM2501 I'm afraid models_animation_blending example does not work anymore...

@JeffM2501

Copy link
Copy Markdown
Contributor Author

Ok, I can take a look

@raysan5

raysan5 commented Jun 1, 2026

Copy link
Copy Markdown
Owner

@JeffM2501 I'm afraid all animation examples stop working... 😢

@raysan5

raysan5 commented Jun 1, 2026

Copy link
Copy Markdown
Owner

Actually it makes sense, it's not a fallback mechanism, CPU vs GPU skinning are exclusive, if CPU is selected, required buffers are loaded and updated, if GPU is selected those buffers are omitted and a valid shader is expected. I'm reverting this PR for now.

raysan5 added a commit that referenced this pull request Jun 1, 2026
@JeffM2501

Copy link
Copy Markdown
Contributor Author

Actually it makes sense, it's not a fallback mechanism, CPU vs GPU skinning are exclusive, if CPU is selected, required buffers are loaded and updated, if GPU is selected those buffers are omitted and a valid shader is expected. I'm reverting this PR for now.

yeah I see that now, I don't think they are conceptually mutually exclusive, just the way it's written right now is. I have some ideas that I will work on.

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.

2 participants