Allow for usage of GLTF primitives that have no texcoords #1010
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.
I purchased a model from cgtrader.com where the gltf file describes the model using just base colors (no textures and no texcoords on primitives, which is valid gltf), and it panics when bevy tries to load the gltf and compile the pipeline.
Bevy GLTF loader creates the mesh with no UV attributes, as expected. When it attempts to compile the pipeline we get an error saying that it expected a Vertex_Uv attribute but it's not supplied by the mesh.
thread 'Compute Task Pool (5)' panicked at 'Attribute Vertex_Uv is required by shader, but not supplied by mesh. Either remove the attribute from the shader or supply the attribute (Vertex_Uv) to the mesh. ', crates\bevy_render\src\pipeline\pipeline_compiler.rs:223:17
This changes makes it so that the forward shader uv attributes get enabled with STANDARDMATERIAL_ALBEDO_TEXTURE since the gltf loader uses PbrBundle/StandardMaterial. The uv attribute today is only used when STANDARDMATERIAL_ALBEDO_TEXTURE is enabled in the fragment shader.
Tested FlightHelmet and my gltf which has no texcoords, both work now.