[fluxus] shader texture commit

Dave Griffiths dave at pawfal.org
Fri Jun 9 08:42:56 PDT 2006


hi all,

I've enabled int parameters to glsl shaders, which means you can now pass
textures through, it works like this:

(texture (load-texture "mytexturefile.png"))
(shader-set! (list "mytexture" 0))

0 is the texture unit to use - and is the unit fluxus loads to when you
call (texture), if multitexturing is turned on:

(multitexture 0 (load-texture "mytexturefile.png"))  ; load to texture unit 0
(multitexture 1 (load-texture "mytexturefile2.png")) ; load to texture unit 1
(shader-set! (list "mytexture" 0 "mysecondtexture" 1))

in your shader it will be availible as:

uniform sampler2D mytexture;
uniform sampler2D mysecondtexture;

cheers,

dave




More information about the Fluxus mailing list