Collada DAE to GL Tools Structure via OpenCL (Composition by gtoledo3)

Author: gtoledo3
License: (unknown)
Date: 2009.12.20
Compatibility: 10.6
Categories:
Required plugins:
(none)

This is a composition that shows the simplest way to turn a loaded dae/collada object into a structure that can be rendered by GL Tools 1.4 structure render patches.

I'm including a sphere for testing. Sooo, have both files on your desktop, or say, in downloads... the same folder, or replace with the model of your choice.

Below, are some clips of a little more fleshed out (though less universal) version, with some extra mesh filtering going on...

cybero's picture
Re: Collada DAE to GL Tools Structure via OpenCL ...

Cheers for this working example, GT.

That Beatles visualization is wicked :-)

I love what happens when one switches from Vertices to Normals - transforms the whole presentation in a surprising fashion. [interesting possibilities here]

cybero's picture
Re: Collada DAE to GL Tools Structure via OpenCL ...

Tee Hee, you've inadvertently managed to jog me in the direction of a Mesh patch I'd quite forgotten about and it's one that richly deserves a mention - Mesh Jiggle.

This exploitation of .dae files is without a doubt one of the highlights of GL Tools 1.4 - opening up all of those Mesh patches for GL Structure Objects - options for shading and so on - immense - absolutely immense - congratulations to the Kineme team on this release - a new range of possibilities.

Mesh Jiggle really opens up a lot of animative and deformative things.

Beautiful.

Did you get the car thing going in part by mixing vertices and normals render objects?

BTW _ I think it's demonstrative of how badly I've been doing with OpenCL [crashes / leaks / clumsy routines] that I had as yet to fully exploit OpenCL meshes with Mesh Jiggle - not even static .dae - so focussed upon dynamic mesh generation have I been, OpenCL wise.

gtoledo3's picture
Re: Collada DAE to GL Tools Structure via OpenCL ...

I added another qtz to the front page to show how that look of the growing hair happens. It's the "input" control, right after "mesh location". I just hooked it up to an interpolation for that case.

BTW, I didn't use mesh jiggle for that warping, I started with the mesh twist example. I think the jiggle has some kind of built in mouse tracking, or interaction, to my memory. That jiggle patch is sort of neat though...

I'm pretty non-plussed that the warps are breaking across updates.

cybero's picture
Re: Collada DAE to GL Tools Structure via OpenCL ...

Managed to get audio generated dynamic mesh rendering into four different GL structures - smoother work than that appropriated via OpenCL as per the Aurora code example, got structure reversing done for the Quad structures that otherwise are just a triangle on the co-ordinate data their being fed that suits the cube, point and line structure patches so well. Make that five structure patches - include the triangles.

I am so pleased that the dynamically generated structures are now available to GL Tools.

cybero's picture
Re: Collada DAE to GL Tools Structure via OpenCL ...

Here's the rough and ready redraft of your GL Tools example being fed dynamic meshes [plus some more structures].

I was almost half tempted to post this up to the Compositions , but it is just basically a combo of Apple's code hooked in as the mesh.

Got to admit - this has opened up a lot of possibilities. Pretty nice fps for dynamically generated graphics I think and way more stable than OpenCL to .dae mesh has been.

Given that the OpenCL code is working so sweetly in the patch does that mean that its the relation between the mesh file list and the renderer that's going awry for OpenCL?

I merely ask because I'm still on 10.6.2 and this is the same routine I'm using that was originally distributed by Apple. Testing the kit out, it works , is OpenCL, generates its structure and within GL Tools structure patches works AOK, but within Mesh patches it causes problems a plenty.

Now where does that problem lie ?

PreviewAttachmentSize
AuroraCLGL44.85 KB

cybero's picture
Re: Collada DAE to GL Tools Structure via OpenCL ...

Quote:

I'm pretty non-plussed that the warps are breaking across updates.

I'm tickled pink that I'm rediscovering GL Tools and the possibilities of using OpenCL output with some reliability and degree of personal satisfaction.

I'm underwhelmed by the current OpenCL failures, vexing though they are - it's the festive season so I just can't be feeling too gloomy [Forbidden in Happy Valley] :-)

Besides, I'm certain that they are matters being addressed as effectively as is possible. Not as though they don't need to be, but this funnily enough - and in an ironic year its a delicious irony that we can better enjoy Mesh Jiggle with dynamically generated OpenCL mesh structures by transferring that delicious data to GL Tools - how totally droll and jolly.

gtoledo3's picture
Re: Collada DAE to GL Tools Structure via OpenCL ...

Interesting.... reversing structure doesn't do anything for the quads, for me. Triangles and Quads (which I guess is really a triangle patch anyway), don't work with this kind of setup on my computer. Do they actually render for you?

Also, when you think about it, dynamically generated structures with GL Tools, have been available for a long time via javascript. I'm not too sold on feeling like OpenCL is a better approach for generating structures to feed a patch like this (as far as performance/speed goes), save for some handy utility things that are immediately available because of the patch implementations.

On the note of stability of the GL Tools vs. the stock Apple renderers, one thing that I see going on is that hooking certain OpenCL structures to the stock mesh render "live", while in render mode, will cause it to crash... but these are things that "shouldn't" crash it. Basically, intense data, complicated models or structures. QC chokes, and stuff crashes. The same qtz, you can re-open, hit "play", and it works... it just the "noodling" that kills it. However, with the GL Tools renderers, this hasn't happened so far.

That said, I'm pretty sure rendering all of those little points and lines saps fps more than the stock mesh render (depending on the complexity of what is rendered, of course).

cybero's picture
Re: Collada DAE to GL Tools Structure via OpenCL ...

On my setup both Triangles and Quads do work and reversing the structure produces renderable meshes that don't add up to a total Quad :-).

See attached screen shots - is the problem your setup or that I'd left that visualizer redraft connected up via the audio spectrum input which works aok in QC but does not in iTunes although one can work around that.

PreviewAttachmentSize
justtheopenclgltoolsquads.png
justtheopenclgltoolsquads.png113.03 KB
dynamicmeshitunes.png
dynamicmeshitunes.png276.37 KB

gtoledo3's picture
Re: Collada DAE to GL Tools Structure via OpenCL ...

It's working ok now (quads and triangles).

When I was initially putting this together, either in my qtz's, or your posted composition as well, I could see that the structure was evaluating, but it wasn't making any actual quads or triangles render... at all. Every other type of structure patch was fine. I took out the clear to make sure I wasn't getting confused by colors, but no, it wasn't rendering. I could feed the patches javascript, and they would render, but if I attached OpenCL, either a kernel, or something like the dae->get mesh it wouldn't work.

I manually closed QC and restarted... now those patches are rendering ok.

The only think abnormal I can think of is that I had crashed QC a few times prior, and was letting the OS "restart" QC (via the "would you like to restart" prompt) instead of manually restarting... I had just updated OS version too. Hmm. Weird. I guess I'll wait and see if it happens again.

The problem definitely wasn't with my setup (which is producing visual output now), and it wasn't with yours either (I don't look at qtz's in iTunes, so that's kind of lost on me...I checked it out in QC).

cybero's picture
Re: Collada DAE to GL Tools Structure via OpenCL ...

This need to be clearing OpenCL kludge is definitely one of the causes of abrupt crashes in iTunes and also in QC too, incidentally, relying on QC for what iTunes does with a visualizer isn't 100% reliable.

Are you a sans visualizer iTunes listener?

[would seem ironic if you were given your talent with visuals :-)]