The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates. | Twitter

+1 vote

Hi, is there a way to use a separate texture for the alpha value in a StandardMaterial3D?

It sounds like you can use the 4th channel of the albedo texture but the asset I have provides a separate texture and I don't see a way to specify that in the Albedo or Transparency (or any other) properties.

I can workaround this by making a custom shader but this seems like a relatively common practice when using third party assets so it would be great if it didn't require resorting to manually writing shaders.

Godot version 4.0.beta8
in Engine by (15 points)

2 Answers

0 votes

It seems like a pretty basic shader to write?

As far as I know Godot doesn't have this built in, but you can create a standardMaterial and then right click on it, and convertToShaderMaterial which will give you the code for that, and then you can just add another texture parameter.

Realistically, you shouldn't be using separate textures for alpha because it's wasteful in terms of resources... if it were me I would use some image editing software to combine your albedos with your alpha texture, so that you're not loading 2 textures into memory for each material.

by (1,346 points)

Thanks for the info. Indeed it isn't hard to write especially with the convert to shader material option, however this approach doesn't scale well. And I agree it's not ideal to have a separate texture for alpha, like I said these are third party assets.

Sounds like I'll just have to deal with it or figure out a way to automate it

0 votes

Can't exactly remember but it has something to do with the Detail property.
Maybe it was the mask or Blend mode or Albedo that needs to be change/set.

Apologies for my fuzzy memory but it's something to do with that

by (6,942 points)

Hmm I tried playing with the options and it almost worked. In the detail property I tried setting the mask as the opacity texture, the albedo as my base color texture, and then removed the base color texture from the regular albedo texture slot. It applies the color to the correct part of the mesh but unfortunately it just applies the albedo, not the transparency.

I might have to keep playing with it though, thanks!

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.