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?
You mean SpatialMaterial or ShaderMaterial? If later, then I see no reason why not.
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.
Setup the spatial material, convert it to shader material and just add line ALPHA *= COLOR.a
at the end of fragment function.
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.
© 2022 - 2024 — McMap. All rights reserved.