Ibex Mac Distortion Caching Performance Update

11/21/2013 - Started work on re-adding caching of the distortion shader. Currently it works but it is overlapping one of the lenses in the middle. It doesn’t add much in terms of performance, but going from 30fps to 35-39fps is still a relatively significant change on slower hardware. The biggest problem was figuring out how to do the caching.

The solution I ended up using involves setting up two different render targets on my framebuffer object (FBO) in the OpenGL GLSL shader. Once I did that I render the coordinates of each color: Red, Green and Blue to gl_FragData[0/1]. I use the value of vec2(0,0) for red to signify that we should render black in the final distortion. I used a GL_RGBA32F and I can’t tell the difference between that and the GL_RGBA16F in terms of quality, but I’ll leave it this way for now. Below is a screenshot of the overlap problem.

ibex-cached-distortion-overlap