-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Add support for gltf::Material::unlit #1341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
crates/bevy_gltf/src/loader.rs
Outdated
@@ -298,6 +298,7 @@ fn load_material(material: &Material, load_context: &mut LoadContext) -> Handle< | |||
LoadedAsset::new(StandardMaterial { | |||
albedo: Color::rgba(color[0], color[1], color[2], color[3]), | |||
albedo_texture: texture_handle, | |||
shaded: !material.unlit(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is shaded
the standard name here? It feels like lit
is a more direct version of !unlit
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably not, I just used shaded
because that was already in the engine. I can rename the symbol though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
godot uses "shadeless" in its materials (which inspired this), unity uses "unlit", unreal uses "unlit", and gltf uses "unlit".
I generally don't like "negative bools", as that can result in double negatives. But given that we're calling this StandardMaterial
, we should probably align with the crowd here and rename this to "unlit" (and adjust the forward.frag shader to use # ifndef STANDARDMATERIAL_UNLIT
instead of # ifdef STANDARDMATERIAL_SHADED
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I've changed the name in 3241fb8.
This PR enables materials loaded from a gLTF file to use the "KHR_materials_unlit" extension to disable lighting via the
Material::unlit
method.