Share openRNDR window as Texture - Syphon Bridge

Hello Girls and Boys, I do VJing in Vienna, mainly with audioreative patches to live input. I use VDMX, MadMapper and Processing as my basic setup. These components work together with Syphon. http://syphon.v002.info/

I like openRNDR and want to replace Processing, but don’t find implementation for Syphon which is the core of the live VJing concept to get Processing into VDMX or MadMapper and mix around with in- and outputs using different softwares.

Is there a way to follow a similar approach with openRNDR?

There is a JavaLibrary which should work as: https://github.com/Syphon/Java/blob/master/JSyphon/src/jsyphon/test/ServerTest.java
I’ve just tried to copy & paste the gl functions into the animation-001 Example after draw.circle
The server is open in my client but GL throws:
tracking verteBuffer org.openrndr.internal.gl3.VertexBufferGL3
org.openrndr.internal.gl3.GL3Exception: GL ERROR: GL_INVALID_ENUM null

loses target? glGenVertexArray? GL_VERTEX_ARRAY / BUFFER ???
I have no clue about openGL, I try to get into it, but … it’s hard :slight_smile: and there must be a proper way to do this with your API, I am on it and learned a lot about your concept … don’t see myself yet to get this thing done.

Please help!

best, Tom

1 Like

Seems like a great candidate for orx module. I would be interested in using it as well. These classes look like a good starting point:


Maybe something like this will work?

fun main() = application {
  configure {

  }
  program {
    val byteBuffer = BufferUtils.createByteBuffer(width * height * 4)
    val rt = renderTarget(width, height) {
        colorBuffer()
    }
    val buffer= rt.colorBuffer(0) as ColorBufferGL3
    extend {
      // draw on rt
      byteBuffer.rewind()
      byteBuffer.order(ByteOrder.nativeOrder())
      rt.colorBuffer(0).read(byteBuffer)
      byteBuffer.rewind()
      val intBuffer = byteBuffer.asIntBuffer()
      server.publishFrameTexture(intBuffer.get(0), buffer.texture, 0, 0, width, height, width, height, false);
    }
  }
}

You meen:
extend {
movingCircle.updateAnimation()
rt.bind()
drawer.background(ColorRGBa.WHITE)
drawer.fill = ColorRGBa.PINK
drawer.stroke = null
drawer.circle(Vector2(movingCircle.x, movingCircle.y), movingCircle.radius)
rt.unbind()
drawer.image(rt.colorBuffer(0))
byteBuffer.rewind()
byteBuffer.order(ByteOrder.nativeOrder())
rt.colorBuffer(0).read(byteBuffer)
byteBuffer.rewind()
val intBuffer = byteBuffer.asIntBuffer()
server.publishFrameTexture(intBuffer.get(0), buffer.texture, 0, 0, width, height, width, height, false);
}

Still a black screen on https://github.com/Syphon/Simple


The resolution should be displayed under “Simple Client” [–]

Honestly i was an this trace with no success, the GL3 things were missing in my chase. (gradle compile gl3) I hoped that this would work out, do you tested it?

Holidays are over, let’s have a look at this Array textures - OPENRNDR GUIDE next days… keep you uptodate.

Good to have Magic Friends

       byteBuffer.rewind()
       byteBuffer.order(ByteOrder.nativeOrder())
        rt.colorBuffer(0).read(byteBuffer)
        byteBuffer.rewind()
        glBuffer.read(byteBuffer)

        server.publishFrameTexture(glBuffer.texture, glBuffer.target , 0, 0, width, height, width, height, false)

glBuffer is a ColorBufferGL

Thx @seclorum

We have (somewhat) recently added orx-syphon which should make it super easy to both send and receive Syphon surfaces. orx/orx-jvm/orx-syphon at master · openrndr/orx · GitHub

WOW, thats great!

Thanx!

Bring this topic back to life. Has anyone been able to get multiple Syphon Servers running? I would like to run multiple OpenRNDR projects and pull them all into Touch Designer. If I run a second project I get this:

TemplateProgramKt
Warning: Running on macOS without -XstartOnFirstThread JVM argument. Restarting JVM with -XstartOnFirstThread.
INFO [main] o.o.i.g.ApplicationGLFWGL3 :arrow_lower_right: 3.4.0 Cocoa NSGL Null EGL OSMesa monotonic dynamic
INFO [main] o.o.Application :arrow_lower_right: no preload class found ‘org.openrndr.Preload’
INFO [main] o.o.i.g.ApplicationGLFWGL3 :arrow_lower_right: OpenGL vendor: Apple
INFO [main] o.o.i.g.ApplicationGLFWGL3 :arrow_lower_right: OpenGL renderer: Apple M1 Max
INFO [main] o.o.i.g.ApplicationGLFWGL3 :arrow_lower_right: OpenGL version: 4.1 Metal - 83

Hi! There is no error in your log message. What is the behavior you are seeing? Is the first texture transmitted but the second one not? Do any of the programs crash?

Here a screenshot showing how to fix that warning (the VM options part):