Refraction using opengl es1.1

Member
Posts: 45
Joined: 2008.04
Post: #1
I wish to do a basic water effect (doesn't everyone?), and currently I'm rendering to a FBO, then drawing the bound texture to the screen via a mesh with displaced texture coordinates to achieve refraction, and in addition using texture combine to draw an additional texture over the top for the highlights.

This works rather well except that:
1/ when the mesh is too fine then I start to choke the renderer.
2/ the fbo and drawing of it's bound texture seems to be a considerable performance hit.

Currently I get about 25fps with the renderer spending rather large amounts of its time in the glFlush (which I suppose is a good point to be using multithreading to do other things) but.. the main question of my post is: given the capabilities of this (the you-know-what) platform, is there another better way of achieving refraction effects??

Note: without refraction I can easily get 50+ fps.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
Why are you calling glFlush? That's *very* seldom required, and always a performance penalty.
Quote this message in a reply
Member
Posts: 45
Joined: 2008.04
Post: #3
sorry - I ment glFlush as in the flushing shown by instruments within the heart of [context presentRenderbuffer:GL_RENDERBUFFER_OES]
Quote this message in a reply
Post Reply