Allow for usage of GLTF primitives that have no texcoords#1010
Closed
4-rodrigo-salazar wants to merge 1 commit intobevyengine:mainfrom
Closed
Allow for usage of GLTF primitives that have no texcoords#10104-rodrigo-salazar wants to merge 1 commit intobevyengine:mainfrom
4-rodrigo-salazar wants to merge 1 commit intobevyengine:mainfrom
Conversation
Member
|
Hmm I think the problem shouldn't be resolved in shaders. That puts to much burden on the shader author to support every potential input mesh. Instead I think this should either be fixed by:
Post processing your mesh with (1) in app code should be a decent workaround. (2) is the solution I want to shoot for. |
Contributor
Author
|
Cool, i'll try to take a look at implementing what you described as 2. Thanks for thinking about this! |
Member
|
Closing this as it will require a different implementation (as discussed above) |
This was referenced Apr 1, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:17This 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.