Hi!
I got this example where three samples with x and y positions is moving three balls painted in GLSL over the screen.
Shader1 example works fine. Im using a loop to iterate over the positions:
for(int i = 0; i < numSamples; i++) {
drawCircle += circle(aPos[i], st, 0.01, 0.03, aspect);
}
In Shader2 im trying to avoid the for loop by sampling a texture with the positions but I guess there is something I dont fully understand.
[code]
vec2 position = texture(sTD2DInputs[0], vUV.st).rg;
drawCircle += circle(position, st, 0.01, 0.03, aspect);[/code]
Is there a way to avoid the for loop? Im just experimenting but I dont fully understand whats going on I guess.
Can anyone help me explain a bit! Thanks!
glslExample.3.toe (4.61 KB)