I've just finished making most of an awesome game for the iPhone, but its missing something. I would love to have ripple effects follow the bullets, or even at bare minimum have a shock wave move out with the explosions, but the docs on the new ripple effect are spotty at best. Should I even be using the ripple effect, or just particles with distortion maps? Can cocos2D even do distortion maps? Can anyone clarify (either type it out, or point me to a place that would have the information I need) how to make this work?
Ripple Effect
(17 posts) (11 voices)-
Posted 2 years ago #
-
You can't do distortion mapping with cocos, as it only supports OpenGLES 1.1 currently (the 3gs supports OpenGLES 2.0, and can do full shader effects). The Ripple effect currently in the trunk works by rendering the scene to a FBO and mapping it onto a grid of polygons; the ripple is applied by moving the verts around. Doing this is very expensive at any decent resolution, and can drop your frame rate in half. I used the full screen ripple effect in splat, and it definitely kills frame rate and doesn't look that great.
I believe it's possible to do a more efficient ripple effect on OpenGLES 1.1 hardware (like the ones in Koi Pond), but I don't know the inner working enough to point you in the right direction..
Posted 2 years ago # -
Thanks mate. Any concept of how to do this manually? Could I render the entire camera view to a texture, put it on a plane, and move the points manually to distort it? If I've already got gorgeous performance (I think I have almost 30 fps on a first gen) and really don't mind taking a performance hit, what's the best looking way to make a ripple that will follow and object as it moves around (very like koi pond, but instead following a projectile)
Posted 2 years ago # -
If you look at the ripple effect source, you'll see it basically does that. When you initialize it, you can tell it how much to tessellate the grid. If you need to write your own custom effect to move the points in some other way, you can easily follow the design pattern provided in those classes.
Posted 2 years ago # -
yes, the Effects in cocos2d are somewhat slow.
I think that slowness is due to the fact that in each frame, N nodes are rendered to the FBO.It would be faster if the FBO is not updated at all, but this would be another kind of effect. I called them "Light weight effects":
http://code.google.com/p/cocos2d-iphone/issues/detail?id=448Posted 2 years ago # -
Aynone knows how they do it in Koi pond ? I have always wondered.
Posted 2 years ago # -
We are testing our app on a 3GS, is it possible to check frame rates on older first gen models without need to own all models???
Posted 2 years ago # -
I think your best bet is to try and get a 1st gen ipod touch, as I believe thats the slowest model. So if you can get it running ok on that, it should be acceptable on the others. At least thats what I'm hoping to do.
Posted 2 years ago # -
Good idea and apologies for delay in replying
Posted 2 years ago # -
So, which part is the main slowdown of effect ?
Posted 1 year ago # -
Yup, Thx Riq. I got effects working real fast now after adapting the deformation code to a static sprite (without the use of FBO). It works nice :)
Posted 1 year ago # -
There's a cool ripple type effect that someone uploaded to Particle Designer that I just saw. It looks like a bunch of concentric rings when sitting still, but when it moves it looks like an object leaving ripples behind it in the water, pretty sweet for a particle system!
Posted 1 year ago # -
Hello fideliusx,
I am striving at adding some localized ripple effects to my game also (although nothing to do with bullets, but same principle).
Any chance you would share some guidelines as to how to achieve it?
I am not familiar with advanced graphics programming, so don't hesitate to tell me if this is out of my league.
If you can point out any tutorial that might help me understand, it would be much appreciated.Posted 1 year ago # -
Seems I need to boost my OpenGL skills before understanding most of the link you just suggested. I suppose I should not expect such effects to come free.
I will definitely check it out when I have a little more time, thanks a lot.Posted 1 year ago #
Reply
You must log in to post.