Skip to content

[Merged by Bors] - GLTF loader: support mipmap filters#1639

Closed
inodentry wants to merge 3 commits intobevyengine:mainfrom
inodentry:gltf-mipmap-filters
Closed

[Merged by Bors] - GLTF loader: support mipmap filters#1639
inodentry wants to merge 3 commits intobevyengine:mainfrom
inodentry:gltf-mipmap-filters

Conversation

@inodentry
Copy link
Copy Markdown
Contributor

This removes the GltfError::UnsupportedMinFilter error.

I don't think this error should have existed in the first place, because it prevents users from using assets that bevy could totally render (without mipmap support as of yet).

It's much better to load the asset properly and then render it (even if it looks a little ugly), than to refuse to load the asset at all, giving users a confusing error.

@Ratysz Ratysz added A-Assets Load files from disk to use for things like images, models, and sounds A-Rendering Drawing game state to the screen C-Usability A targeted quality-of-life change that makes Bevy easier to use labels Mar 13, 2021
@Davier
Copy link
Copy Markdown
Contributor

Davier commented Mar 13, 2021

Do you think we should emit a warning when ignoring the unsupported filters? Or would that be too noisy?

@inodentry
Copy link
Copy Markdown
Contributor Author

Well, this is a stop-gap. We will have real mipmap support VerySoon™. I just pulled this commit out of my WIP mipmap work, into its own PR, because I keep seeing people struggle with this error.

Also, we aren't technically ignoring them, this code sets them correctly in the texture sampler. It's just that it doesn't make a difference when rendering yet, because the textures don't actually have the mipmaps.

No it would not be noisy, I can add a check to print a warning if one of the mipmap filters is used, I just think it's unnecessary.

@inodentry
Copy link
Copy Markdown
Contributor Author

FYI, the CI failure that happened here is unrelated to my code. It failed at an earlier step (the ubuntu base image packages), before getting to building bevy.

@cart
Copy link
Copy Markdown
Member

cart commented Mar 13, 2021

Yeah I agree that doing a best-effort load instead of failing is the better UX. This is an interesting case because Bevy warnings should be "actionable", but in many cases users can't / won't want to change this setting in their input assets. But we also don't want to give users the impression that mipmaps work when they don't. We're stuck between a rock and a hard place 😄

I think you made the right call here, given that this is a gap we will fill in soon. There are a number of other GLTF features that we don't support yet and emitting logs for all of them (by default) would be pretty nasty. Emitting debug logs might be a good middle ground, but I think we should probably just merge this.

@cart
Copy link
Copy Markdown
Member

cart commented Mar 13, 2021

bors r+

bors bot pushed a commit that referenced this pull request Mar 13, 2021
This removes the `GltfError::UnsupportedMinFilter` error.

I don't think this error should have existed in the first place, because it prevents users from using assets that bevy could totally render (without mipmap support as of yet).

It's much better to load the asset properly and then render it (even if it looks a little ugly), than to refuse to load the asset at all, giving users a confusing error.
@bors
Copy link
Copy Markdown
Contributor

bors bot commented Mar 13, 2021

@bors bors bot changed the title GLTF loader: support mipmap filters [Merged by Bors] - GLTF loader: support mipmap filters Mar 13, 2021
@bors bors bot closed this Mar 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Assets Load files from disk to use for things like images, models, and sounds A-Rendering Drawing game state to the screen C-Usability A targeted quality-of-life change that makes Bevy easier to use

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants