[PD] shaders + erosion filter

Claude Heiland-Allen claude at mathr.co.uk
Fri Jul 7 13:06:53 CEST 2017


On 07/07/17 12:00, hi via Pd-list wrote:
[...]
>     step_w = 1.0 / 640.0;
>     step_h = 1.0 / 480.0;
[...]
>             tmp = texture2DRect(sourceTexture, vec2 ( pos.s + float(i)*step_w, pos.t + float(j)*step_h ) ).rgb;

texture2DRect() expects integer-per-texel coordinates in the range
[0..size), so your step_w and step_h should be 1.0 to get neighbouring
texels.

See Matias Valdenegro's comment here:
https://stackoverflow.com/questions/6736531/where-can-i-find-documentation-on-the-opengl-shader-function-texture2drect#6737327


Claude
-- 
https://mathr.co.uk



More information about the Pd-list mailing list