Godot Version
Godot v.4.1.1
Question
I want to make a Sprite3D “flash” white, i.e. transition from its normal texture colour towards pure white and back. I’ve done this with Sprite2Ds before using Modulate, but it appears Modulate doesn’t allow values above 1.0 for Sprite3Ds (according to this).
I tried making a shader as suggested in the above thread, but I’ve been unable to get any shaders to work on my Sprite3D. Adding any material_override immediately removes the texture (which makes sense at first, but it still doesn’t display anything if I add the texture to the shader parameters), and I can’t seem to get a material_overlay to do anything at all to the sprite. This thread (from Godot 3.5 I think) suggests Material Overlays are the way to go, but I can’t make sense of the picture guide there - the interface I have looks completely different.
The closest I’ve got is to set the sprite’s Material_Overlay to a ShaderMaterial with this shader, which I adapted from a thread (lost the link, unfortunately) that purported to share the “basic” shader used for Sprite3Ds:
shader_type spatial;
uniform sampler2D sprite_texture : source_color, filter_nearest;
uniform float exposure = 4.0;
void vertex() {
}
void fragment() {
vec4 color = texture(sprite_texture, UV);
ALBEDO *= color.rgb * exposure;
ALPHA = color.a;
}
Still, using this shader the Sprite3D always has the base texture colour, and never modulates no matter what I set exposure to, even if I set it somewhere between 0 and 1.
So how should I go about “flashing” a Sprite3D?