GrizzliusMaximus
Member
Dumb question but out of laziness, I used reused the same uniform float constant for two shaders.
I initialized the shader uniform float as so:
and used it for another shader like so:
u_time in both shd_terrain and shd_tree work the same.
This works but I'm worried this is a bad way of coding. The thing is, these two won't be the only shaders that will use u_time. Is it better to declare a new variable for every shader or do this "dumb" but working technique?
I initialized the shader uniform float as so:
GML:
u_time = shader_get_uniform(shd_tree,"time");
GML:
shader_set(shd_terrain); //Not shd_tree
shader_set_uniform_f(u_time,current_time/300);
This works but I'm worried this is a bad way of coding. The thing is, these two won't be the only shaders that will use u_time. Is it better to declare a new variable for every shader or do this "dumb" but working technique?