OpenGL texture -> CIImage -> OpenGL texture

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:
Quote this message in a reply
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:
Quote this message in a reply
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
  Mapping 2D texture to multiple GL_TRIANGLES ardowz 4 8,495 Feb 27, 2017 11:09 PM
Last Post: Nicolredmay
  Rendering Heightmap using texture data ardowz 4 6,179 Nov 17, 2015 03:32 AM
Last Post: mark89
  OpenGL ES Texture Masking airfire 6 23,049 Mar 17, 2014 07:07 PM
Last Post: baioses
  Render to Texture behaves weirdly ardowz 2 4,973 Feb 17, 2014 04:50 PM
Last Post: ardowz
  Preventing texture from creating transparent gaps on edges ardowz 3 5,012 Jan 21, 2014 11:28 AM
Last Post: SethWillits