Syphon-Framework icon indicating copy to clipboard operation
Syphon-Framework copied to clipboard

Core Profile support: what am I doing wrong ?

Open jcelerier opened this issue 3 years ago • 3 comments

Hi, I'm trying to make Syphon with a core profile but am failing at it...

what works:

      m_syphon = [[SYPHON_OPENGL_SERVER_UNIQUE_CLASS_NAME alloc]
        initWithName: serverName
        context: myContext
        options: NULL
      ];

       // and then, in my render loop: 

       auto t = /* my texture */;
       [m_syphon
            publishFrameTexture:t->texture
            textureTarget:t->target
            imageRegion:NSMakeRect(0, 0, width, height)
            textureDimensions:NSMakeSize(width, height)
            flipped:false
       ];

This works fine if I create a 3.2 compatibility profile. If I change my profile to core (and, ideally, 4.1) then suddenly the receiving apps get a black screen instead - I tried with the Simple apps and VDMX (rendering to screen in my app otherwise works with any of those). I've tried looking for toggles or anything I could use to see where things go wrong but don't really manage to... if anyone has ideas it would be great, thanks !

jcelerier avatar May 04 '22 15:05 jcelerier

Also my build defines SYPHON_CORE_SHARE=1 as that looked relevant, but maybe that's the issue ?

jcelerier avatar May 04 '22 15:05 jcelerier

Not sure TBH

Are you setting state that perhaps is not being captures by the SYPHON_CORE_RESTORE macro, assuming you aren't manually resetting state for the server?

iirc SYPHON_CORE_RESTORE handles the frame buffer bindings looking at the code in https://github.com/Syphon/Syphon-Framework/blob/master/SyphonServerRendererCore.m

If you set breakpoints for OpenGL errors do you get any before (or after) you call into Syphon?

vade avatar May 06 '22 17:05 vade

oh alternatively, if you are using SHARE, it doesnt restore the FBO binding and dumps it to FBO 0. So if your app assumes specific FBOs are bound, you may need to re-bind them manually, or use RESTORE to have the framework do a glGet prior to changing FBO target, and then restoring.

it would be advantageous to not use RESTORE and if you already know the FBO target you need bound, to just set it. You would avoid a glGet and maybe gain a fraction performance increase.

vade avatar May 06 '22 17:05 vade