Syphon Cinder – Get Texture

Home Forums Syphon Syphon Implementations – User Syphon Cinder – Get Texture

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #4766
    momothemonster
    Participant

    I’m working on a PixelMapping app in Cinder to control DMX lights.

    I’ve got a Syphon Client taking Textures in from VDMX, that all works great. I’m having trouble getting the Texture into a format where I can read the RGB values of each pixel, though.

    I added this function to the syphonClient class:

    ci::gl::Texture* syphonClient::getCurrentTexture()
    {
    	return mTex;
    }

    is this a reasonable way to get the texture? It seems to be working in that I can bind it, read the texture and write it to the screen, and then unbind it – but converting it to a Surface (ie dumping it to the cpu so I can read the RGB values) results in an empty object.

    Would it be better/worse to draw the syphonClient’s texture into an FBO instead of using a getter?

    #4767
    bangnoise
    Keymaster

    Unfortunately the texture is backed such that it won’t return meaningful values if you try to read it back to the CPU – you’re not doing anything wrong. Drawing Syphon’s texture into an FBO is the only way to do this .

    #4768
    momothemonster
    Participant

    Thanks, bangnoise! That’s very helpful to know. To clarify – there’s no way to get at the data within Syphon’s texture or surface (returning a char array) without drawing to FBO?

    #4769
    bangnoise
    Keymaster

    Correct.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.