December 20, 2012 at 3:01 am #14202
Hi everyone !
Is anybody using syphon in an Ogre3D app ?
My app embeds a syphon server. And I have some troubles pushing frames to it.
Using simple client, I can connect to my embeded server, texture resolution and framerate are ok, but texture is garbage.
Here is how I create server:
Ogre::RenderWindow* videoOutput = videoOutputs[VIDEO_OUTPUT_PREVIEW];
Ogre::OSXCocoaWindow* videoOutputCocoa = static_cast<Ogre::OSXCocoaWindow*>(videoOutput);
NSOpenGLContext* mGLContext = videoOutputCocoa->nsopenGLContext();
CGLContextObj ctx = (CGLContextObj)[mGLContext CGLContextObj];
syphonServer = [[SyphonServer alloc] initWithName:@”video”
And how I push frames:
Ogre::TexturePtr texture = Ogre::TextureManager::getSingleton().getByName(renderPlanes[SOURCE_PREVIEW]->getOutputTexture());;
Ogre::GLTexture* textureGl = static_cast<Ogre::GLTexture*>(texture.get());
texId = textureGl->getGLID();
imageRegion:NSMakeRect(0, 0, texture->getWidth(), texture->getHeight())
December 21, 2012 at 7:05 am #14495
- This topic was modified 8 years, 2 months ago by tony.
Are you sure the texture is gl texture rectangle, not 2D?December 21, 2012 at 10:08 am #14511
It seems obvious 🙂
I changed textureTarget to GL_TEXTURE_2D, but same error occurs.
Still investigating …December 21, 2012 at 11:16 am #14512
Well, a few things.
1) ensure that the CGLContext you init the SyphonServer on is actually the active context used during rendering. Sometimes contexts get destroyed and re-created. Maybe lazy init in the render loop?
2) ensure that the texture you are publishing is not being deleted before you publish.
3) OpenGL Profiler, enable break on error, and ensure there are no GL errors. This is also a great place to go to Resources (when you are stopped at a break point) and verify that your textureID is valid, and matches your expectations.December 21, 2012 at 12:36 pm #14513
Thanks for your help Vade !
I checked with OpenGL profile, texture ID is OK, no GL errors.
Texture is not deleted.
About Context im not so sure. I have multiple render windows, and multiple contexts. I tried each one, same result. I quite sure my problem is here.December 21, 2012 at 2:53 pm #14514
Is the GL context active, and the same as the one you’ve initted Syphon with? Just check if the CGLCOntextObj returned from CGLGetCurrentContext() matches that you’ve initted Syphon with.January 2, 2013 at 8:31 am #16050
I must be missing something in my side
Still investigating, I do not want to give up 🙂
- You must be logged in to reply to this topic.