Ability to set layer order

Hi is there anyway we could set the layer order manually, so one could avoid depth sort?

PreviewAttachmentSize
set_layer_order.png
set_layer_order.png496.79 KB

dust's picture
Re: Ability to set layer order

not sure i understand the question ? you can set the layer order manually by setting the layers index number ? not sure how one would programmatically change the layering indexes.

if your having depth sort issues try setting your layer to back face culling that should work for most shapes. theres probably a nifty kineme patch to do what you want.

PreviewAttachmentSize
Screen Shot 2011-07-23 at 10.48.59 AM.png
Screen Shot 2011-07-23 at 10.48.59 AM.png96.91 KB

sorenknud's picture
Re: Ability to set layer order

Sorry, what i mean is to set it programmatically, becaurse i want to set it manually from a DMX console, and i am currently adjusting z position inside a depthsort env. but it is annoying that the "scale" changes when you move in Z, and since i have started to mess with the GL matrix its not enough with 0.00001 difference in Z pos– sometimes it has to be 0.6 wich changes the size very much.

So it would be much better to be able to choose the layering manually but, trough artnet for remotecontrol.

gtoledo3's picture
Re: Ability to set layer order

sorenknud wrote:
Sorry, what i mean is to set it programmatically, becaurse i want to set it manually from a DMX console, and i am currently adjusting z position inside a depthsort env. but it is annoying that the "scale" changes when you move in Z, and since i have started to mess with the GL matrix its not enough with 0.00001 difference in Z pos– sometimes it has to be 0.6 wich changes the size very much.

So it would be much better to be able to choose the layering manually but, trough artnet for remotecontrol.

Do it all in an iterator and control which set of params/texture goes to which iteration.

hyprctv.farbraum's picture
Re: Ability to set layer order

If you put your sprites in the Kineme GL Ortho Patch, so they wont change their sizes and you can set the order by setting the z value.

cwright's picture
Re: Ability to set layer order

No, the layer order is fixed - it cannot be changed from within the graph (doing so would have non-trivial implications in the engine).

sorenknud's picture
Re: Ability to set layer order

I just don't understand why its O.K. to depthsort but not ok to choose layering?

What I want is basicly to do "manual" depthsort without changing the Z-pos...

Is there no way to "cheat" the depthsort into thinking that one object is closer than another?

yanomano's picture
Re: Ability to set layer order

As George said, in Quartz Composer, you have to render in an iterator to have the ability to change the rendering order programmatically.

Here is a very basic composition (no it's not yet Photoshop :-) where you can assemble your layers and their properties as javascript objects. The "Order" parameter set a value for each layer.

A Structure Sort Patch revamp the Layer structure according to the "Order" values of each layer. It's a sorting but without changing Z positions...

PreviewAttachmentSize
Layer Order.qtz13.71 KB

gtoledo3's picture
Re: Ability to set layer order

That's a great example, Yanomano, and is exactly what I meant.

I think QC is really flexible when one starts thinking in this way. If one uses virtual inputs on something like the javascript you show in your Layer Order.qtz, one can also transmit various types of objects. For example, one could connect a Spherical Mesh, and a Grid Mesh, whether it be K3D, or OpenCL, and control which object gets rendered at which layer, by controlling the geometry on the front end and rendering all to a common renderer inside of the iterator.

Also, this may sound nutty, but you can generate all of your textures, and then do all of your compositing, transforms, and layering effects using core image, potentially. There are certain times when that's not a bad fit, but it's a totally different way of thinking about it.

gtoledo3's picture
Re: Ability to set layer order

cwright wrote:
No, the layer order is fixed - it cannot be changed from within the graph (doing so would have non-trivial implications in the engine).

I want to make sure that I'm conveying that I'm not challenging the statement above in any way whatsoever!

When you look at a qtz file, all of the nodes are in an array, and shifting the order of the dictionary entries for patches effects how the graph lays out. When a patch that isn't a renderer/consumer gets flipped to a lower item count, it will draw under a patch with a higher item count. This is why patches one creates later can be pulled "over" others on the QC Editor.

Similarly, layer order is strongly indicated, if not completely dictated by the item number of the consumer's corresponding dictionary entry in the QC file. One can cut and paste and shift around layer order reliably by changing the order of the dictionary entries.

Couldn't something load the o.g array, take new input data, write a new array based upon that data, and load it?

usefuldesign.au's picture
Re: Ability to set layer order

Layer order also effects patch evaluation order not just rendering order. I know lots of us know this I just had this patch handy so thought I would post it.

This has implications for interaction and hit-tests using logic states that crossover or feedback, usually these are flip/flops in their variations which UIs are often made up off.

PreviewAttachmentSize
Evaluation Order (by Layer).qtz17.58 KB