[PD] [GEM-dev] gl stack underflow
Matteo Sisti Sette
matteosistisette at gmail.com
Fri Jan 1 21:27:50 CET 2010
Well it seems that:
- by avoiding texunit 0 and (probably unnecessarily) 1, I have actually
resolved the weird interactions with [pix_snap]
- I still have stack underflows and overflows printed at each frame
which I'll investigate but it's probably not causing any "visible" issue
- What was still driving me crazy is that I didn't know that I have to
take into account that the texture size is actually the next power of
two of the expected image size.
Since using [pix_texture] you don't have to worry about "padded" image
size, AND since ALL glsl examples in Gem use 512x512 images, gently
"avoiding" the problem, I naively thought that a MxN image used as a
texture would simply have its M pixels spanning the [0,1] range in the x
axis (and same for N on y).
Is there some "standard" way, some utility function or something, to
deal with non-power-of-two size textures? or have I to explicitely write
the calculations to get the correct coordinates? I think I can do that,
but if I can have the machine do it for me I prefer that :)
Thanks
m.
chris clepper escribió:
> pix_snap is probably using texunit 0 which is the default for any
> texturing call. pix_snap actually uses a function called
> glReadPixels(), and that might use texture units internally to grab the
> frame and store it before read back to main memory.
>
> Also, you cannot use any value for the texunit pix_texture uses most
> GPUs have at least 8 so texunits 0 to 7 are valid. Lots of GPUs have
> much more than 8 so you have to figure out where they end.
>
> On Fri, Jan 1, 2010 at 1:38 PM, Matteo Sisti Sette
> <matteosistisette at gmail.com <mailto:matteosistisette at gmail.com>> wrote:
>
> Thank you for pointing me to the examples, but it definitely seems
> there is some kind of interaction with [pix_snap]: even if I force
> [gemframebuffer] to use texunit 0 and my textures to use texunits
> 1,2,3 and 4, I still get under/overflows as soon as pix_snap takes a
> snap, and my shader is using a snapped picture (which does not
> correspond to any other texture) instead of the texture I expect it
> to use.......
>
> Well I will try to post a simplified patch because this explanation
> of mine is a mess, but it seems I have to figure out how to avoid
> pixsnap to mess with textures. It does not accept a texunit message
> (dunnow if it would make any sense)......
>
> cyrille henry escribió:
>
>
>
> Matteo Sisti Sette a écrit :
>
> cyrille henry escribió:
>
> there is an exemple of how to use multiple texture /
> textunit in the gem exemple folder, in directory 10.GLSL
>
>
>
> You mean 05.multitexture.pd?
>
> Yes I've seen it (it is thanks to that example that I have
> been able to do something - btw iirc it is yours, so thank you).
>
> But that doesn't show any interaction with [gemframebuffer]
> nor [pix_snap]. That's where my troubles begin (apparently)
>
> the exemple 06 show how to use gemframebuffer and multiple texture.
>
> exemple 07 is also usefull for you.
>
> c
>
>
>
>
> --
> Matteo Sisti Sette
> matteosistisette at gmail.com <mailto:matteosistisette at gmail.com>
> http://www.matteosistisette.com
>
> _______________________________________________
> Pd-list at iem.at <mailto:Pd-list at iem.at> mailing list
> UNSUBSCRIBE and account-management ->
> http://lists.puredata.info/listinfo/pd-list
>
>
--
Matteo Sisti Sette
matteosistisette at gmail.com
http://www.matteosistisette.com
More information about the Pd-list
mailing list