Open esperanc opened 4 months ago
texture color pick is using an asynchronous method to read the pixel values, so it can not used in a repeat, it is executed when the gpu/driver decides it is a good moment without much delay
texture color pick is using an asynchronous method to read the pixel values, so it can not used in a repeat, it is executed when the gpu/driver decides it is a good moment without much delay
Ok, but this is super counter-intuitive. At least, I think there should be something in the documentation to this effect - I spent a long time to figure this out! Perhaps if there was another op that would gather colors from a bunch of points in an array, this would be implied.
Link to simple, reproducible example patch The following patch shows the error. It has two almost identical branches, one, marked "incorrect" uses the standard textureColorPick op, while the other, marked "correct" uses a modified op which works error demo patch
Describe the bug The op fails in reading several pixels for coordinates stored in an array using a repeat op. To make it easier to reproduce, the patch reads two pixels from an array set manually with stringToArray. After reading the pixel for the first point, it does not update the result for the second point. The modified op uses readpixels directly, which does work. In the attached screenshot we should see two red circles and two blue circles, but we see 3 red circles and only one blue circle, which was produced by the modified op.
How To Reproduce
Platform
Dev Tools No useful hint there