fix: Remove signed blend indices due to dropping OpenGL ES 2 support #2323
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Details
Primary aim is to fix
TransformationSkinning.sdsl
shader where skinning wasn't working on Android, due to mismatched data type being passed from app to shader. Due to dropping OpenGL ES 2, blend indices can now just behave like non-ES 2 versions (ie. just useuint
data type, instead of usingfloat
).Related Issue
Fixes #2284 where the background info/problem arose from.
Here's my understanding of the original intention/code:
OpenGL ES 2 did not support passing
int
/uint
data types, so needed a workaround to usefloat
instead.stride/sources/engine/Stride.Rendering/Rendering/Skinning/TransformationSkinning.sdsl
Lines 28 to 33 in 1fc0d51
As seen in this code (and the comments I removed from the
TransformationSkinning.sdsl
file), the workaround for ES 2 was supposed to be to usefloat4
.However, it turns out the importer only passed signed or unsigned integer types:
stride/sources/tools/Stride.Importer.3D/MeshConverter.cs
Lines 724 to 753 in 1fc0d51
This was still incorrect and should have been passing a float type.
Side note: even though this file is the new importer, this bug goes all the way back to the original importer.
Anyway, OpenGL ES3+ now supports
int
/uint
data types, so the above no longer needs a workaround.I have tested this on an Android project and the model is skinned properly now.
Types of changes
Checklist