generate a serious of random points in a picture, try to create many circles that are centered at those random points
for given circle centers, i can handle like:
if (distance(UV,vec2(circlecenter.x,circlecenter.y))<radius) {COLOR=colorRed;}
now the problem is , what if the circle centres are random?
i can now only locate only 1 UV at those circle center points because they have different colors from all other colors in back grounds,like:
vec4 PixelColor=texture(Image,UV);
if (PixelColor==colorGreen) {//can only locate 1 pixel}
like the effect below:(first consider all have same radius, let alone each circle has different radius)
If you dont know where the points are you will need to do a uv sweep from your current fragment location until it hits a pixel in the texture. Wont be very efficient. You would want a fixed circle radius to do the sweep.
If you knew the number of points and locations it would make things easier.
So how are you placing these points into the texture? If you are doing that, you should be able to save that position in another way as x,y in the image plane and then get it later to attempt to draw the circles?
If you still need to use the image to find the dots and then do the circle thing and need to find all of the circle centers via the pixel color in an image sweep, I’d utilize the A (alpha) channel of the image you are generating, and store a value in there you can use in any ways. In this case just making the center pixels white with the color black otherwise (0 or 1 for Color, or 0 and 255 for Color8), and you can even store a lot more data in that data like an index number if you use Color8, etc.