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,125
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 Compression ajrs84 9 496 May 7, 2013 03:36 PM
Last Post: ajrs84
  OpenGL ES Texture Masking airfire 5 11,467 Nov 14, 2012 09:36 AM
Last Post: toanNguyen
  SOIL_load_OGL_texture - failing to load texture kropcke 3 3,679 Sep 5, 2012 10:08 AM
Last Post: kropcke
  OpenGL ES Texture Masking dalasjoe sin 0 3,148 Apr 13, 2012 12:17 AM
Last Post: dalasjoe sin
  Discrad black parts in texture bonanza 7 4,945 Oct 27, 2011 01:05 AM
Last Post: bonanza