Can a SpatialMaterial use vertex alpha for transparency?
Asked Answered
M

4

0

I'm using vertex alpha to make some regions in my model blend together. Is there a way to make Godot's SpatialShader use vertex alpha for transparency?

Modesta answered 10/2, 2022 at 2:44 Comment(0)
B
0

You mean SpatialMaterial or ShaderMaterial? If later, then I see no reason why not.

Blastopore answered 10/2, 2022 at 6:0 Comment(0)
M
0

Sorry - I meant to say SpatialMaterial. Since I'm using this for an imported scene, it would be much easier for me to tweak the existing SpatialMaterial than to replace it with a custom shader for all the objects in my scene.

Modesta answered 10/2, 2022 at 6:20 Comment(0)
W
0

Setup the spatial material, convert it to shader material and just add line ALPHA *= COLOR.a at the end of fragment function.

Windham answered 10/2, 2022 at 14:31 Comment(0)
C
0

In SpatialMaterial, it would be interesting to have Vertex Color > Use As Albedo do this automatically, but only if the object is marked to be transparent. (If ALPHA is written to at any time, then the material will be considered transparent automatically. This reduces performance and can cause sorting issues if transparency is not needed.)

However, I thought this was being done already… it's how particle color ramps can affect transparency after all.

Childlike answered 10/2, 2022 at 22:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.