[PD] getting the texunit from the texture id??

Matteo Sisti Sette matteosistisette at gmail.com
Fri Jan 1 18:54:19 CET 2010


Hi,

Given the texture "id" that comes from the second outlet of a 
[pix_texture] object,
is there a way to retrieve its texunit number that I can use inside a 
shader to access the texture?

Forcing the pix_texture object to use a given texunit is becoming 
problematic for me because I am using some [gemframebuffer] and 
[pix_snap] objects and it seems they also "use" texunits. As far as I 
understand from the tests I have done, I can't simply assign arbitrary 
numbers to my textures (for example texunit 100, 101, 110, 111...): I 
need to know exactly how many texunits are "available" and "swap" them, 
but if I miss something I mess everything up.
On the other hand, it seems like these texunits are kinda automatically 
assigned and menaged if you don't touch them - but then, I need a 
texunit number in order to access a texture from a shader...

... that's why I think I would solve my prolem if I could "retrieve" the 
texunit of a texture.....

thanks
m.

-- 
Matteo Sisti Sette
matteosistisette at gmail.com
http://www.matteosistisette.com




More information about the Pd-list mailing list