Skip to content
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

Tweak SpatialMaterial's default metallic and roughness texture channels #26205

Merged

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Feb 23, 2019

To follow the glTF 2.0 specification in all cases (including outside of imported glTF scenes), the blue channel is now used for metallic and the green channel is now used for roughness. This way, less clicks are required when setting up new materials using ORM-packed textures (occlusion, roughness, metallic). This should have no effect on materials using grayscale maps, as the R/G/B channels are identical.

This also removes the need to set channels specifically in the glTF scene importer code.

To follow the glTF 2.0 specification in all cases (including outside
of imported glTF scenes), the blue channel is now used for metallic
and the green channel is now used for roughness.
@fracteed
Copy link

Good idea. I always use an ORM texture, so this saves a few extra clicks!

@kaadmy
Copy link
Contributor

kaadmy commented Feb 26, 2019

To add to this, should this be a project-wide setting for newly created materials? (And maybe for GLTF import etc.)

Edit: Offtopic, but maybe a default SpatialMaterial much like the default environment would be helpful.

@Calinou
Copy link
Member Author

Calinou commented Feb 26, 2019

To add to this, should this be a project-wide setting for newly created materials? (And maybe for GLTF import etc.)

Since the glTF 2.0 specification mandates this format, is there any significant usage of a different packing model? I'd rather not add more project settings than we need.

That said, the ability to define a custom default SpatialMaterial sounds good to me, but that's for later 🙂

@reduz
Copy link
Member

reduz commented Apr 4, 2019

I am planning to make an ORM mode for the material in 4.0..

@akien-mga
Copy link
Member

I am planning to make an ORM mode for the material in 4.0..

So what should we do until then?

@akien-mga
Copy link
Member

Let's merge for 3.2. If reduz wants to make a difference system for 4.0, that can be done later on.

@akien-mga akien-mga merged commit b9f8e07 into godotengine:master Jun 20, 2019
@akien-mga
Copy link
Member

Thanks!

@akien-mga
Copy link
Member

On second thought, does this break compat with 3.1? I thought it only impacted glTF import, but re-reading I see that it's the other way around, it makes SpatialMaterial use the same channels as glTF import.

@Calinou
Copy link
Member Author

Calinou commented Jun 20, 2019

@akien-mga I suppose it can be considered a breaking change in theory, but in practice, most people I know currently use grayscale textures for roughness/metallic/ambient occlusion. In these textures, the RGB channels are equal, so there's no visual difference.

Therefore, it shouldn't be cherrypicked to 3.1.x, but making it available in 3.2 sounds fine to me (as long as the change is documented in the changelog).

@reduz
Copy link
Member

reduz commented Jul 21, 2019

@akien-mga This is a significant breaking change by the way and many projects will break. It's also not done good enough because they are multiplied by roughness and metalness which are not 1.0 by default, so the intended effect will not be achieved anyway.

I suggest reverting this and doing it properly in Godot 4.0. In there, I plan to introduce a proper dedicated ORM material, that only does one texture tap (opposed to now 3 taps).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants