3
\$\begingroup\$

I started developing my very first game 3 months ago using Cocos2d 2.0 for iPhone. I am now in the stage where I'd like to add some cool effects to the bullets and some special weapons (see my waveforms question here). I got a good answer in the cocos2d-iphone forum (see this one).

Unfortunately I am a bit paralized now. I don't know if I will be overdoing by learning OpengGL 2.0 or if I should just stick ot the old 1.0. There is a good intro on various tutorial's written in Steffen Itterheims blog (see this post).

I would like to add to my game:

  • a blur effect to the bullets (here is a tutorial for OpenGL 1.0)
  • a waveform (see above)
  • some realistic water ripples (here is a nice sample code)

So now, given that I don't want to overdo things but at the same time I want to achieve those effects, from where should I start? Should I discard the OpenGL 1.0 tutorials? OR should I use only OpenGL 1.0 code?

How can I avoid confusion? I mean, it seems that the compiler recognizes both, but that there are some conflictual calls in some circumnstances, I am fairly sure this has some explanation, is there some reference to this somewhere?

\$\endgroup\$

2 Answers 2

2
\$\begingroup\$

Look at the "Shader Test" in the Cocos2d samples.

https://github.com/cocos2d/cocos2d-iphone/blob/master-v2/tests/ShaderTest.m

This applies a Blur fragment shader to a CCTexture2D object from your CCSprite.

As for the other shaders you can find a bunch of running samples here:

http://www.iquilezles.org/apps/shadertoy/

This should get you started.

\$\endgroup\$
0
2
\$\begingroup\$

Have you tried looking at particle emitters?

http://particledesigner.71squared.com

Download that and check out the particle emitters on there, they do what you're after (blur effects and water ripples).

You add the files to your game like so:

http://www.cocos2d-iphone.org/forum/topic/7777

Add them to your resources folder and add them like that.

\$\endgroup\$
2
  • \$\begingroup\$ thank you, I tried 71squared and it doesn't seem to be able to achieve a waveform as I'd like. \$\endgroup\$
    – mm24
    Commented Aug 5, 2012 at 12:45
  • \$\begingroup\$ Thank you for your reply, I accepted the other one as more specific to my question but thanks anyway.. \$\endgroup\$
    – mm24
    Commented Nov 5, 2012 at 13:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .