[PD] gl stack underflow

Matteo Sisti Sette matteosistisette at gmail.com
Fri Jan 1 16:05:00 CET 2010


Hi,

I know the question is pretty generic, but hopefully there's some common 
cause of this kind of error or something:

Basically the short version is, what can cause a GL stack UNDERflow error???

I have written a simple fragment shader in glsl for blending two texture 
in different classic blending modes (add, multiply, difference...); I 
have a few (16) instances of the same shader (an abstraction containing 
a [glsl_fragment], a [glsl_vertex] and a [glsl_program], the abstraction 
being repeated 16 times) rendering at the same time.
I am using uniform variables to tell each "instance" what texture to use 
and I use the message [texunit ...( to [pix_texture] objects in order to 
"name" the textures with some numbers.

Now, I am getting some unexpected results like: the texture being used 
is not the one I expect, so I am trying to debug my own work since 
there's certainly some stupid error, but
I have realized that the console shows this error message:

GL: subdesbordamiento de pila

which is in spanish and I guess it is a bad translation of "stack 
underflow".
While I can easily think about errors I may make that may produce stack 
OVERflows, I really can't figure out what the hell I may have done wrong 
that may cause a stack UNDERflow. I don't know what kind of anomaly to 
look for.

At the moment I can't attach the patch, however it wouldn't be of great 
use: I would need to isolate the problem but I don't know where to start 
from. I attach the fragment shader in case it is of any help though I 
doubt it.

My hope is that there is something very "typical" to take care of which 
"usually" cause stack underflows.

For example is it a problem that I sometimes "cut off" a piece of 
rendering chain in order to not display some objects?? i.e.

[gemhead]
|
(....)
|
|     |
[spigot]
|
(...)

I do this very often but this is the first time I use shaders. Is there 
something I should do (e.g. some message to send to the [glsl_program]) 
when  it starts/stops receiving the gemlist????


Any help will be greatly appreciated

Thanks in advance
m.



-- 
Matteo Sisti Sette
matteosistisette at gmail.com
http://www.matteosistisette.com
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: blendncrop.frag
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20100101/18078e95/attachment.asc>


More information about the Pd-list mailing list