After releasing new DirectX11 pack for vvvv and beta 30 : http://vvvv.org/contribution/directx11-nodes-alpha, Time to go back into dev.
I added new Segment Node, which allows Z extrusion. It's pretty nice playing with Phase/Cycles/Resolution you can do some nice designs, here are couple of shots below (no fancy shading yet).
So now issue with designing it, i have heap lot of shader nodes, layers and groups, so it's a big patch to maintain.
Exporting it as file would be handy, so I could just design my bits and use a file loader, fast switch, clean patch, mmmmhhh :)
So first thought was collada, but it's such a crap format, way too big for what it does.
I'd have to store vertices for every bit + transform, projected file size: 10 megs at least, bleh...
So second thought was to create module for every node, and have it output relevant data as string as well as render it, so cumbersome, bleh again...
Then last thought, oh I got dx11 source code (since I wrote it), so i should be able to traverse the graph and store data instead of render (and then serialize as any format like json, no xml please ;)
- I don't want to store vertices/indices, takes too much space. I already know what geometry I use, so it would be better to just tell how to generate it again.
- Most 3d formats suck for batching, in my case I can have the same geometry sent 10 times to shader, most 3d software would replicate geometry (come on, please start to do proper format one day), Instead it would be much easier to tell geometry-> transform list.
So for the moment once geometry is created I got no way to know how it was built.
So I simply added this in geometry provider
Then here is sphere:
That's it, instead of storing 1000 vertices i can just store 5 parameters instead, how cool is that?
When I create geometry, I just assign the descriptor to the geometry, so I can know at any time how things were created.
Now that's cool, but I need to grab geometry, so here is how it works.
Layer have RenderSettings which carry some info on how to render, so I simply added collector as render hint.
Then settings carry:
So renderer only has to set it's flag to collector (tells shader that we don't want to render but collect information).
Shader then can just retrieve descriptor, and push it with list of associated transforms (huhu, batch friendly ;)
Little snippet for shader node, if render hint is set to collect it just appends object/transform instead of render.
Object list is then serialized as Json Object, here is one part of it:
Now I can simply reload the whole scene from the file, (for example above, whole scene fits in 33kb indented, 22kb compressed, pretty nice ;)
So next was just doing a Loader node for testing, pretty simple, retrieve descriptor, create geom, associate with transform and render. Please note that could do an importer for anything, it's not only 4v related (technically I got a use case for it, top secret ;)
The obvious great thing is it's totally transparent, I only need to enable collect, and I can retrieve whole scene, no need for any fancy stuff, and works for any part I have already done as well, no mod needed.
Here are few example of it: