GL Ortho

usefuldesign.au's picture

I am playing around with the GL ortho patch for the first time. It's just what I was looking for (i think). I am not sure if I am missing the intended use for this patch but when I put more than one primitive and/or clear patch inside it, it only seems to render the Renderer patch assigned to layer 1.

Going through the notes it seems GL ortho has been in since v0.4 of GL Tools so I'm assuming it's stable and I am miss-using it. I can't imagine I need to put every renderer in a separate Ortho patch though do I?

Incidentally, I noticed the lowest primitive in the stack (layer 1 or 2 if clear patch is used) isn't transparent when blend mode is alpha. Nothing to do with GL Ortho patch happens any way. In attached comp sphere is at bottom of primitive layers.

PreviewAttachmentSize
GL Ortho.qtz15.89 KB

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

gtoledo3's picture
Re: GL Ortho

Your left and right clip planes are both 1- that's going to make a composition error out, because it's sorta "impossible". You also set your far clip to 20... which is a greater value than your near clip- again- an impossible value. Make it something less than your near clip of 10... something like -10. It is going to "compress" everything within the coordinates you pick into the viewfield... look at it that way.

... change your left clip plane to -1 or something less than 1.... you will see it start getting into the render area as you get to zero... checkout what it looks like at -2 through - 10 to get a feel for it...

...leave your left clip at -10, your right at 1, and then change your top clip to 6 for the heck of it....

... thus is the POWER of the GL Ortho!

PreviewAttachmentSize
GL_Ortho rejiggered.qtz15.88 KB

usefuldesign.au's picture
Re: GL Ortho

Zthanks so much G. I'm on my way out the door. will study on return. thanks again.

cwright's picture
Re: GL Ortho

yeah, George's explanation is spot-on -- if near/far are equal, or left/right are equal, (or top/bottom, which you have properly configured) you get annoying clipping.

Typically, the defaults when you create the ortho patch are fine, so you don't need to fiddle with them.

regarding transparency/Alpha:

The sphere is transparent. Unfortunately, you're rendering it first (after the clear), so it's just transparent over an empty canvas. All other objects are rendered after it. Stuff placed behind the sphere won't get rendered at all due to depth buffer checks. There is no way to render "behind" already-rendered objects in opengl (Even if they're transparent). Try the ame setup without GLTools, and with a blend mode of Over, and you'll get identical results.

usefuldesign.au's picture
Re: GL Ortho

ahhh, yes i fiddled too much or not enough. thanks both for the clear explanation.

On the transparency, I keep forgetting this aspect to rendering. If you recall, cwright, I sent you a comp of tilting/rotating words I was trying to render in QCr that had a clipping problem to which you provided the same point. thanks again :)

There isn't any way to change the layers programmatically (inside the comp with input) is there? If the objects change there positions in space, the render order may to change sometimes no?

cwright's picture
Re: GL Ortho

There is no way to change layers programatically. Changing orientation in space does nothing to the layer order. (you're thinking of depth-sorting; QC doesn't do any of that.)