★ TouchArcade needs your help. Click here to support us on Patreon.

Water waves Effect in OpenGL ES 2.0?

07-12-2010, 01:13 PM
#1
Joined: Sep 2009
Location: Vancouver, Canada
Posts: 977
Send a message via MSN to MindJuice Send a message via Skype™ to MindJuice
Water waves Effect in OpenGL ES 2.0?

I am looking to create a water waves type of effect in Open GL ES, probably 2.0. I imagine this is something that is easier to do in 2.0 though with the shader support, but my OpenGL experience is pretty limited.

Basically I want to render a frame, then apply the wave effect, then render the next frame, and then apply the wave. In other words, the image that has the waves is also animating.

If you have seen Sqirlz, that is the sort of effect I am looking for. The bird on the Sqirlz page is animating, and his dynamic reflection is animating and rippled.

I would need to integrate this as a layer in a Cocos2D app.

Does anyone have any links or information to this sort of thing?

Thanks,


Ken
07-13-2010, 01:42 AM
#2
cocos2d doesn't currently support OpenGL ES 2.0 and you can't just mix and match OpenGL ES versions so you are out of luck at the moment if you want to use cocos2d.
07-13-2010, 01:07 PM
#3
Joined: Sep 2009
Location: Vancouver, Canada
Posts: 977
Send a message via MSN to MindJuice Send a message via Skype™ to MindJuice
Quote:
Originally Posted by Steve Oldmeadow View Post
cocos2d doesn't currently support OpenGL ES 2.0 and you can't just mix and match OpenGL ES versions so you are out of luck at the moment if you want to use cocos2d.
Ah, I see. I hadn't looked into it that far yet. Good to know.

Is this sort of effect possible with 1.0?

Thanks Steve.

Last edited by MindJuice; 07-13-2010 at 01:12 PM.
07-13-2010, 07:46 PM
#4
Joined: Sep 2009
Location: Vancouver, Canada
Posts: 977
Send a message via MSN to MindJuice Send a message via Skype™ to MindJuice
So Cocos has CCWaves and CCWaves3D among other effects. I will take a look at those to see if I can leverage them somehow.

I can't find an example of them though, so I won't know what they look like until I try it.
07-13-2010, 10:05 PM
#5
There is a demo included with cocos2d of all the effects. You might be able to achieve something passable. Those effects are basically modifying the vertices of a grid to create a wave effect. For performance reasons the grid has to be pretty large and the quality of the effect is really determined by the grid size.

A shader would definitely be better if you are only targeting devices that support OpenGL ES 2.0.