Sunset Lake Software - Comments for "Socialcam video effect" http://www.sunsetlakesoftware.com/forum/socialcam-video-effect Comments for "Socialcam video effect" en Off the top of my head by http://www.sunsetlakesoftware.com/forum/socialcam-video-effect#comment-1545 <p>Off the top of my head by looking at it briefly I would recommend that you need to create 4-5 overlays of color with transparency. Black around the edges that creates the black border and white stripes/flakes that are semi transparent. Each frame should be slightly different than the previous (or more depending on how much change you want per frame). Save these as PNG so you can load them in with the standard [UIImage imageNamed:@"Overlay 1.png"].</p> <p>Then you will need to load them into your fragment shader as textures and randomly choose texture2-7 for a frame that you can set as a uniform.</p> <p>I am new to GPUImage framework a bit but I believe you could set up multiple GPUImagePictures to handle it (I would load the textures myself in the past but this seems so much easier) </p> <p><div class="geshifilter"><pre class="geshifilter-cocoa">UIImage *inputImage1 = [UIImage imageNamed:@&quot;Overlay1.png&quot;]; GPUImagePicture * sourceOverlay1 = [[GPUImagePicture alloc] initWithImage:inputImage1 smoothlyScaleOutput:NO]; &nbsp; &nbsp; [sourceOverlay1 addTarget:filter]; .... [sourceOverlay5 addTarget:filter];</pre></div></p> <p>Then use them in your fragment shader 1 per frame and randomly choose which one. Use them by doing a simple Merge compositing mode onto your original pixel.</p> <p><div class="geshifilter"><pre class="geshifilter-cocoa">vec4 t0 = texture2D(inputImageTexture, textureCoordinate); vec4 t1 = texture2D(overlay1, overlay1TextureCoordinate); gl_FragColor = mix(t0, t1, t1.a);</pre></div></p> <p>Keep in mind that overlay will probably be a different size than your source but in this case as long as you draw your overlays with a relatively close aspect ratio a little stretching shouldn't be noticeable.</p> pubDate Tue, 07 Aug 2012 02:39:00 +0000 dc:creator vipersnake guid false comment 1545 at http://www.sunsetlakesoftware.com