openFrameworks <3’s VVVV

YouTube Preview Image

Sharing graphics assets between openFrameworks and VVVV using shared memory.

Should also be possible to share DirectShow Video assets from VVVV back to openFrameworks using the same method.

Proof of concept code available at http://code.kimchiandchips.com as ofxSharedMemory

Tags: , ,

8 Responses to “openFrameworks <3’s VVVV”

  1. Merlin Says:

    Hi there,

    so do you think it is also possible to build a GUI inside of oF … send some information like position and rotation information to vvvv but then render the result (from vvvv) directly inside of the oF GLUT window?

    What I mean is … vvvv will be used for some 3d ribbon generation (in this case) but the user want see that there is something going on outside of the oF Window.

    This would totally solve my problem that I have got. 😀

    Merlin

  2. elliot Says:

    Hey Merlin

    That’d totally be possible.
    Chances are that you could do this via network transmission without needing to used shared memory (that depends on the number of vertices for the ribbon.

    If you’re talking <1000 vertices (360KB/s at 30fps for 3D floats) then try with OSC first (as there’s lots of support on both sides for that). If you get performance issues then try a leaner network solution or shared memory.

    This code doesn’t deal with your kind of situation yet, but should be easy enough to adapt for that kind of challenge.

    Elliot

  3. Merlin Says:

    Hey Elliot,
    thanks for the fast reply. I am pretty new to the topic of openFrameworks and vvvv.

    First a little bit more info about our project:

    For our university we have to build a little program based on Microsofts Kinect for non verbal communication. What we want to do is to realize all the GUI stuff with something similar to ofxSimpleGuiToo and the Interface to the Kinect with openNI/NITE.

    The user will use the left hand to change attributes of the ribbon over sliders, buttons etc (i.e. the color). This information than has to be sent to vvvv where a friend of mine will design the ribbons.

    The last step is to bring the stuff back to oF and draw the ribbons within the OpenGL window.

    I will definitely have a look at OSC but one last question. The 3d ribbons will be rendered within vvvv and than I am transferring the 2D information back? I just know that oF is based on OpenGL and vvvv on DirectX. will this be a problem?

    Merlin

  4. Merlin Says:

    Ok .. so far so good … with OSC I can plug all mt float/int values into vvvv. But the bigger challange is the following. How can I bring the DirectShow Video assets from the vvvv render output into my openFrameworks app. It should be drawn as a kind background so that elements like buttons etc. are still visible.

  5. elliot Says:

    The VVVV renderer can produce a DirectX Texture asset using the EX9.Texture node, but this is not the same as a DirectShow Video asset. You can use AsVideo to make this conversion, but it’s likely to be quite performance intensive (a texture is on the GPU’s ram, video on the CPU’s ram).

    You’d be much better off sending all the vertices of your ribbon to oF and draw them there. You could even transform the vertices by your camera in VVVV before sending.

    If you really want to send a video asset, then you’ll need to look into ofxSharedMemory and create a mechanism for picking up shared memory streams into an ofTexture. It shouldn’t bee too difficult but really pushed for time here so can’t help you right now.

    Elliot

  6. Merlin Says:

    So the way would be:

    1.To create a texture asset over the EX9 (per frame) and to sent this as an pixel array over OSC back to of?

    2. Writing the texture into a GLTexture and than mapping it on a Quad that is perpendicular to the orthogonal camera.

    I appreciate that you are sharing your knowledge with me! It’s a pity that your very busy right now but if you could just have a look at this thread from time to time … this would help me a lot.

    Merlin

  7. Merlin Says:

    >You’d be much better off sending all the vertices of your ribbon to oF and draw them >there. You could even transform the vertices by your camera in VVVV before sending.

    The problem is that I really want to send all the shading to oF too. Not only the geometry. Hmmm … again I played around with it a whole day. But I am just not experienced enough. No idea what I am doing. D:

  8. Merlin Says:

    OK … at least your sample is now running on my system … but there is as you said only a setData and no getData function. Don’t think that I can do that, but let me know when you find the time to extend your plugin.

Leave a Reply