Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

http://vimeo.com/2461697

Hi everyone, I'm trying to create an effect like this, the underwater effect (water distortion). I've looked around and I've seen references to "water caustics" but I'm not sure how to create this in Cocos2d or if it's done with obj-c only.

Thanks.

share|improve this question
add comment

3 Answers 3

While I don't think they'll give you what you're asking for out of the box, you should definitely check out these two classes because they might be able to get you something very close.

CCShaky3D & CCRipple3D

Play around with those effects and see if you can get close. If you can't, you can always dive deeper into the engine to see how those effects are made and create your own effect.

Here's an old Youtube video showcasing these effects and others (you may want to mute the sound, though).

I hope this helps.

share|improve this answer
add comment

Even though CCShaky or CCRipple or CCLiquid are good effects for this kind of stuff, they consume quite a lot of processing. I do recommend you to use Cocos2d 2.x and give shaders a go. I have been doing it for a while and it seems to work better.

share|improve this answer
add comment

If you use Cocos2d 1.x version, take a look at Joe D answer. For fixed graphics pipeline this effect is only possible via grid distortion.

Maybe you use Cocos2d 2.x, with shaders? Then things are much better :) It's easy to do this effect in fragment shader (offset texture coordinates by some function of x, y and time). And you would have much more flexibility with shader (for example - add shading somewhere).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.