Forums > Jitter

Send, to Syphon?

June 15, 2011 | 9:56 am

I’m a bit confused as to the most efficient way of using sketch and text2d with syphon.

I can draw to the screen fine but how do I get the results to the Syphon Server?

If I convert to a matrix then presumably this goes from Opengl to cpu and back.

Not sure how to get a texture output which I can feed into the Syphon Server.

I’m sure its basic stuff but I cant suss it out,

Any ideas?

June 15, 2011 | 4:03 pm

Syphon Server needs a ‘texture’ to be input. So what you need to do is "render to texture" in Jitter. In Jitter land, there are two techniques to do this. One is @capture, where you specify an existing named object you own as another "OB3D" rendering objects @capture attribute.

So. mycontext @name foo mycontext @capture foo

Now, the will not show up on screen. It renders off screen into the texture named foo. Then bang and send that to Syphon Server.

The "issue" with @capture is it works only on a per object basis. How to capture an entire scene? The solution is to use @capture with, and use drawobject (If memory serves) capablity, coupled with @automatic 0 for the things you want in your scene.

So, in this case, you would have

a context and window named mycontext mycontext @name foo mycontext @capture foo mycontext @automatic 0 @name text mycontext @servername capturedemo

Now, sketch draws to the texture, the the texture goes to syphon, and you tell sketch to manually draw the text2d named "text". Search the forum for examples, I have posted some as have many others.

This is from memory, some specifics may be different.

June 15, 2011 | 7:23 pm

Thanks for the pointers – I’m still a bit confused by all of this tbh. I had a go with @capture but got confused by layers.
Then I cobbled this together from a few clippings I found.
It uses the to_texture method – is this a suitable way of achieving it?

— Pasted Max Patch, click to expand. —
Viewing 3 posts - 1 through 3 (of 3 total)

Forums > Jitter