OpenGL texture -> CIImage -> OpenGL texture

Member
Posts: 320
Joined: 2003.06
Post: #1
I'm wanting to use core image effects on an openGL texture.

I have found that it should be pretty easy to create a CIImage from an opengl texture by using CIImage's imageWithTexture:size:flipped:colorSpace: method.

My question is, how do I then efficiently get it back into an openGL texture after having applied the effects? Do I need to create my own FBO and render the image using CIContext's drawImage:atPoint:fromRect: method? Is this as quick and easy as I can do it?

Chopper, iSight Screensavers, DuckDuckDuck: http://majicjungle.com
Quote this message in a reply
Member
Posts: 320
Joined: 2003.06
Post: #2
well I pretty much answered my own question. Using the two above methods and a couple of FBOs I've got it working, and it seems fast enough. There doesn't appear to be any VRAM->RAM->VRAM stuff happening. Would still be interested to hear if there might be a faster or better way though.

Core image is pretty cool, can't believe it's taken this long for me to get around to using it!

Now to figure out how to automatically generate UI for all of the filter options...

Chopper, iSight Screensavers, DuckDuckDuck: http://majicjungle.com
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #3
I recall looking at this in the past and concluding that an FBO was the way to go.

Look at Core Image Fun House in /Developer/Examples for autogenerated filter UI.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  OpenGL ES Texture Masking airfire 6 13,711 Mar 17, 2014 07:07 PM
Last Post: baioses
  Mapping 2D texture to multiple GL_TRIANGLES ardowz 2 501 Mar 12, 2014 08:56 AM
Last Post: ardowz
  Rendering Heightmap using texture data ardowz 3 510 Feb 25, 2014 10:25 AM
Last Post: SethWillits
  Render to Texture behaves weirdly ardowz 2 841 Feb 17, 2014 04:50 PM
Last Post: ardowz
  Preventing texture from creating transparent gaps on edges ardowz 3 816 Jan 21, 2014 11:28 AM
Last Post: SethWillits