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 https://guide.openrndr.org/#/06_Advanced_drawing/C07_Array_textures 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. https://github.com/openrndr/orx/tree/master/orx-syphon

WOW, thats great!

Thanx!