Repository navigation
Consistent skinning uniforms across configurations and GLES #6189
ariankordi
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I'm trying to make my raylib app as cross-platform as I can without depending on compiler macros, and in doing this I faced issues with skinning in vertex shaders.
If the user is linking raylib from a package where it's off by default, there's no way to know at runtime.
This costed me hours and hours of debugging to get my app working on the web.
The second issue is addressed in the repo by using different shaders for each OpenGL version (330 vs 100), but even if you're willing to maintain those, you still can't share the same shader with skinned and unskinned meshes.
I've addressed these issues in my project with the following snippet:
Then in the vertex shader:
Usage: Run GetSkinningMode on each mesh you want to draw (or I suppose the first mesh in a model), then set
skinningModeon the shader accordingly.(The shader does not account for vertex weights, normals, or tangents. This means it'll only work with simple skins. Should be an easy fix, though.)
I really hope these problems can be addressed in the project at some point, but for the time being, this lets me write shaders once and work across GLES 2 + GL Core 3.3.
All reactions