Closed pyalot closed 13 years ago
The repeat you would want is not 512 in this case, but 51.2 (0.1 times 512), and that is not an integer period. Use even multiples, like gl_FragCoord*(1.0/8.0) and a corresponding period of 64.0, and it should work. If not, let me know. The "pnoise" functions are not that well tested yet.
using an integer even division works, please mention that in the sourcecode comments to pnoise.
Good point. I have been using pnoise in RenderMan SL for ages, and the restriction to integer periods is well known in that context, but it deserves a better explanation here. (In general, I should document all the functions better.)
If noise is rendered per fragment, and the attached texture to the FBO is 512x512 pixels, then the gl_FragCoords go from 0.5 ... 511.5, using a period of 512 does not tile properly:
float value = pnoise(gl_FragCoord.xy_0.1, vec2(512.0_0.1)); // does not work