layout(location = 0) in vec2 v_TexCoord;
layout(location = 0) out vec4 o_Target;
layout(set = 0, binding = 1) uniform texture2D t_Color;
layout(set = 0, binding = 2) uniform sampler s_Color;
void main() {
vec4 tex = texture(sampler2D(t_Color, s_Color), v_TexCoord);
float mag = length(v_TexCoord-vec2(0.5));
o_Target = vec4(mix(tex.xyz, vec3(0.0), mag*mag), 1.0);
}
I know it's not rust. But if there is someone who knows this shading lang please help. I didn't understand the first line in main function. I wanted to know what Sampler2D function is doing. And what texture function is doing. I searched in Google about Sampler2D it shows as a type rather than a function. This part confuses me.
For context, I was learning from examples of wgpu-rs and got stuck here. This code is in here
Also I'm completely new to this language. If you provide any links to tutorials or recommend any books, I'd be really happy