Interaction & Meshes

cybero's picture

This is based upon, although it's pretty different in a lot of ways from, Snow, the Developer Code Sample Apple made available after Snow Leopard came out.

SL patches Interaction, Instructions & Circle used

When you drag the transparent circle around it affects the rendering of the particles surrounding.

Uses the Snow Particle OpenCL routine.

Thanks to Apple for that one.

This is a pretty useless thing, but it's a nice bit of nonsense to end a headache of a day upon.


cybero 2009 Nov 16th

10.6.2 is out so lets rant about it

SteveElbows's picture

The post I hoped I wouldnt have to make but Apple messed up in a way I find hard to excuse.

Trying to choose a mesh template from the wizard causes QC to crash, even on machine with suitable GPU.

Some existing compositions that use meshes dont work anymore, no crash but rather an empty space where the mesh should be.

Some mesh compositions may still work (eg apple example that is called Mesh Filters.qtz).

I havent narrowed down the exact nature of which mesh stuff still works as Im too tired today, maybe I made a mistake about these latter problems but the Mesh Filter template crash is a cert.

Only positive thing I have to say is that some other uses of CL in QC now seem to be working on CPU (on machines with unsuitable GPU) without having to tick that hidden preference.

Quartz Composer Snow Leopard - New Patches and Features

gtoledo3's picture

There are some pretty cool things in the new edition of QC Snow Leopard, notwithstanding any glitches. Leopard had those too (well, some never DID get fixed).

Here are some things I've noted:

-The Shadow feature on the lighting patch, is a way of doing some dynamic shadows with your lighting. The default color value seems a little heavy to me for most purposes. Backing the alpha value off to taste is a good way of taming this.

There's also a quality control! A setting of "1" will give a nice smooth edge, and decreasing that value will seem to cause the edge to get jagged, like there's an increasing amount of aliasing going on.

When I decrease the quality on the Intel X3100, I see decent gain in fps. On the NVIDIA 9600, not at all.

The shadow patch doesn't work with iterators, and toggling it back and forth can do something to "lock" the state of the Lighting environment, which can affect flat/smooth shading. While this is one of my TOP Quartz Composer feature requests, it's also to be used cautiously.

-DAE/Collada loading. The thing that's fairly handy about this is the way that all of the associated textures get loaded.

Instead of manipulating parts of the DAE with structure patches, we have "Get Mesh Texture" and "Get Mesh Component" as well as "Set Mesh Texture" and "Set Mesh Component". The texture patches are for manipulating the associated texture/image files... allowing you to "break off" the textures, do what you will, and re"set" the texture, or the component. A "component" is one part of the structure or a complex 3D object; this is familiar to anyone who has used Kineme3D.

The DAE models can be dragged onto the editor, which is slick, and familiar to Kineme3D users.

The 3D dae/collada models need to be rendered with a "mesh renderer". So the chain needed is something like mesh->mesh renderer, or mesh->mesh filter ->mesh renderer.

The mesh filters live in the patch list as repository compositions/ "qtz" patches, so each actually has an extensive underbelly that can be investigated, which aren't exposed by looking at the patch right off the bat.

Some of them are colored like providers (assuming that green=black), but some are actually externally driven by default, and hence, are purple (old blue=purple now)! To wit, look at Mesh Jiggle and see the way it interplays with the mouse.

It's worth noting now that when you make a macro, you can control+click, and get an option for "explode macro". THIS is awesome. I would love to see this type of feature become available with these type of virtual qtz patches that are leaned on very heavily in this OS.

-Other mesh stuff: To create meshes you use the... ta da(!)... Mesh Creator! It needs vertices... and you can also pipe it normals, colors, textures, texture coordinates, and colors.

You can feed it with Javascript or OpenCL. THAT is actually pretty cool.. and the mesh utilities actually make use of it as well.

For a good take on powering it with javascript, "Mouse Trails.qtz" is a good one, and it's linked to inside the actual patch list under mesh creator. That one might look familiar to anyone that's paid attention to the travails of tobyspark.

For a less obvious one that uses OpenCL to generate the mesh, go to the Developer folder and look in Library/Quartz Composer/Examples/Patches, and take a gander at "Grid.qtz" and "Quad.qtz". "N-body.qtz" is a more intense, but similar setup in some ways, that shows how to derive a particle system, and how to use a mesh creator/queue with iteration.

-Feedback patch. This is an interesting one. All of the qtz's that have "Inertia" in the title and that are in the same Patches folder, are really good examples of this one in action, as well as the 2D Fluid Simulation, which is in the System/Library/Graphics/Quartz Composer Patches (qtz's that Quartz Composer hinges upon are now loosely strung throughout the OS, so think wisely before editing or accidentally saving over one that QC needs).

Now, don't confuse this with "video feedback"... which is just a classic video/accumulator qtz setup hiding in the patch list, and which doesn't incorporate any new patches (this one actually reminded me of smokris's GL Spline example with a video input plugged in, instead of splines).

-The Interaction patch, and it's weird "outie" port and blue noodle. The Iteration Counter and Iterator Selection qtz's show this one in action.

-This brings up one of the BIG changes in QC. Now we don't have "just" enable ports on Render patches. We have "interaction" ports up above them!

This one strikes me as odd, and the ramifications of it aren't totally obvious yet, as far as how it affects the scene graph.

-Deleting or Cutting a renderer patch doesn't "kill" it in the Viewer. It stays active until you restart the viewer, or do something else. This may be a "feature" to help performance. I find it to be a bug, because it necessitates that one do an extra step to get the Viewer to reflect the ACTUAL state of the editor. This feels like it may be considered a feature (though I think it's a horrible idea).

-Multisampling in the Viewer. This one is cool, and looks like it works on the GPU. Option+Preferences, and there it is in the Editor settings. Check it "ON", do a restart of QC, and there you are... jagged edges somewhat mitigated, if it's on supported on your GPU. It doesn't smooth things out 100% but it's better than nothing, and adds a more professional look to the real-time visual output.

-The opening Template.

This one is actually amazing.... look inside of QC and take a gander at the qtz that powers it. This is a really well done qtz. At the same time, it removes the dynamic template loading, so as much as the engineering of it is beautiful and well done, it reduces function in some ways, while providing some good documentation that wasn't formerly included in the Template choice screen. It's as if this has been made a kind of qtz based brochure of function and documentation.

-... and if you unhide patches, our old friend CISmallGaussianBlur, the dead patch entry is still there! We would have missed you buddy!

-The "mystery" qtz's that wouldn't restore in the old system and that were leveraged in some apps, appear to now be in the System/Library/Compositions in some cases.

-Apple is using the Skanky SDK...maybe :) They are now loading (this pertains to the mystery qtz's working) the Backdrops.plugin and ImageDifferPatch.plugin... from the Quartz Composer Patches folder. So, now we are given GFPlugin(s) from Apple, officially. One thing that's of note is the "GFPluginExclusiveHosts", which is used in the Backdrops.plugin

So, those are some of my thoughts at the moment, and looking towards the silver linings. I've noted a decent amount of other features and/or issues, but this is about all I have in me for this post :)