Hallo all,
i'm playing with shaders and meshinstance.
I've picked up a dissolve effects and applied it to simple mesh like spheres and cubes.
Now let's say that i want the dissolve to execute 1 time only and then controlled by the game
i want to let the primitive reappear.
Now can i interrupt flawlessly the execution of the shader, and the reapply it when i need?
Is there some sort of code control involved.
Should i implement this logic inside godot or inside the shader?
My initial idea is to disable in some way the TIME variable, and infact i'm trying to do that.
But here's another question: how can i know with precision the time taken from the shader to
execute the dissolve effect?
Thanks a lot for any hints.
this is the code of the shader
shader_type spatial;
render_mode cull_disabled, depth_draw_alpha_prepass;
uniform sampler2D noise_text;
uniform vec3 color;
uniform float velocity_factor;
void fragment () {
vec4 noise = texture(noise_text, UV);
float input = sin(1.5);
//float input = sin(TIME * 6.0 * velocity_factor);
float cut_pass = noise.r + input;
float border_pass = cut_pass - 2.115;
cut_pass = round(cut_pass);
ALPHA = cut_pass;
border_pass = round (border_pass);
border_pass = 1.0 - border_pass;
vec3 final_border = vec3(border_pass);
final_border *= color * 0.027;
EMISSION = final_border;
}