Interesting. I am not using any GLSL magic within the plugin (its all fixed function pipeline and only bounces between buffers for temporary render to texture stuff), so unless QC is doing something behind my back when binding images that use shaders, I should not have to re-bind the uniforms, as I understand it.

Ahh, if you're not doing any shader stuff, then perhaps that's not the problem. (I was under the impression you were changing the GL program).

I spoke to some other "GL wizards" earlier about this exact issue and they said that if I unbind a shader, the uniforms that are already bound/set to it do not need to be reset/resubmitted when I re-bind, thus why i am not doing that. It follows the state laws of OpenGL no?

what exactly do you mean by "unbind a shader"? (just curious)

So you are saying I have to ask every frame what the uniforms are, 'download' all of them, unbind the shader, blah blah, rebind, resubmit all the uniforms and then render? Ugh. That may explain why my output is 'nothing' since no texture is bound its output gl_FragColor 0., 0., 0., 0.


If that's indeed the problem -- I don't know much about how FBOs (GLHeightField's driving technology) interact with GLSL. If it is actually losing the uniforms, that's what you might have to do.

Oh, I should note, that if I do not include the sampler, it does indeed behave like the uniforms set to the shader are indeed recalled to their last state when I rebind (else none of the shaders Ive been working with would work or animate).
Perhaps samplers are a special case?

perhaps they're clobbered?

Create a GLSL shader -- inside place 2 non-overlapping sprites. To on sprite, attach an image (I used sunbeams). leave the other un-textured.

Outside the shader, create a checkerboard -> crop (with a non-zero size), and feed it to the shader.

If GLSL Shader was safely preserving images (somehow? GL doesn't really provide a mechanism for this afaik), both sprites would look identical. Reality paints a different picture however:

<<inline: Picture 2.png>>




When I detach the Sunbeams image inside, the left sprite matches the right.

So, my current theory is that your plugin is using GL_TEXTURE0-8 (not necessarily all of them, but at least one that GLSL is also using), and that's "corrupting" texture state.

(slam dunk case of "shaders should be attached to objects, not environments" ;)

--
[ christopher wright ]
[email protected]
http://kineme.net/

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to