Sign in to follow this  

Making your sprite pulse

Recommended Posts

ElyasMachera    102
I would like to know how to make sprites pulse during game play..
like in this video

especially like this:
This is the reason why I want to learn games programming..
I was told about shaders..but it looks too complicated for my level and another I don't see how it will create the pulse..i have seen some shader videos and it is just grey blobs (wtf! ha)
Is there an easier way..

Note: If you can do it why not make a tutorial on YouTube, if you have the time? I think it is pretty cool how guys share their knowledge on YouTube..that's how I learnt C++ and I appreciate it.
Your guidance guys, thanks.

Share this post

Link to post
Share on other sites
haegarr    7372
Without shaders you can use texture animation. I.e. draw a couple of textures, each one with the same ship in the center but different intensities of the aura/shine around it. Use the alpha channel for fading. (It is best to pre-multiply the RGB channels of the textures with the alpha.) Then make a texture atlas from all the textures. When rendering the sprite, use the relative time and the pulse rate to determine which of the textures to use. Render a quad with that texture...

There may be a caveat. Typical sprites like ships are rendered using the so-called source alpha blending. Light effects, on the other hand, are usually rendered using additive blending. Additive blending looks more like lighting than source alpha blending does, and it allows to saturate lights into full intensity. If you follow this approach then you need to render the aura/shine first, and then render the ship on top of it.

Okay, the above solution is the "manual way"; maybe XNA gives you a better way with its sprite rendering support. (My sprite engine is based on OpenGL, and I'm not familiar with XNA.)

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this