Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Skeevitch |
I’m a novice to coding and I’m watching a youtube video on how to make a shader in Godot, but along the process I received a text message error stating, “expected one return statement from a non void value.” Can someone please help?
shader_type canvas_item; uniform vec3 color = vec3(0.33,0.15,0.82); float rand(vec2 coord){ return fract(sin(dot(coord, vec2(56,78)) * 1000.0) * 1000.0); } float noise(vec2 coord){ vec2 i = floor(coord); vec2 f = fract(coord); float a = rand(i); float b = rand(i + vec2(1.0, 0.0)); float c = rand(i); + vec2(1.0, 0.0); float d = rand(i); + vec2(1.0, 0.0); }
it’s in this section where I am receiving the error.
void fragment(){
COLOR = vec4(color, rand(UV));
}