Fix GLES3 instanced rendering color and custom data defaults #81575
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.
In the GLES3 Compatibility renderer if a MultiMesh did not have instance colors or custom data enabled, the default instance color and data values ended up being 0.0 (or whatever value happened to be set previously) instead of 1.0 which made most meshes completely black if
vertex_color_use_as_albedo
flag was enabled on the material. This happens often with GridMap which uses internal MultiMesh objects.This PR sets default compressed values to 1.0 for color and 0.0 for custom data. Looks like this is also needed in canvas rasterizer to satisfy any buggy. strict or paranoid OpenGL implementations (especially web) that check the input attribute declared data type (uvec4) against the bound type even if the shader branch reading the value is disabled by an uniform condition (FLAGS_INSTANCING_HAS_COLORS and FLAGS_INSTANCING_HAS_CUSTOM_DATA in canvas rasterizer).