Jump to content
  • Advertisement
Sign in to follow this  

Aura Effect Around an Object

This topic is 3153 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I'd like to create a visual indication that a unit is selected among others, namely in the form of an aura of some color (say light green) around the object. Units walk on the ground, so one type might be in a ring around the unit's feet on the ground as in WarCraft 3 when a hero gives surrounding units a modifier and they have a glow around them. I suppose to do this you'd have to break up the aura's plane amongst the many triangles that make up the ground, since it's hilly and varied. Another way would be to simply draw it around the object silhouetting it regardless of the ground or what angle you're looking at it. That might be simpler and indeed more desirable in case you end up having floating objects away from the ground. Either way, what's a good method to go about this? One that comes to mind would be to have a prepared sprite that's solid green in the center and fades translucent outwardly in all directions until it's transparent outside the circle. If this can be done, we'd then draw it behind the selected object before drawing the object, and also make sure it always faces toward the camera; this would either be done by: - D3DXVec3Project()'ing the object's center to screen space and drawing the sprite with DirectDraw, the size scaled according to the object's distance from the camera (requiring a sqrt()) and then draw the object normally with the fixed-function pipeline or - creating a quad with the texture, and drawing it slightly behind the object, by putting it along the line from camera to object, and placing it at a slightly greater distance than that of the object from the camera (again found with sqrt()) This will be a rigid circle, however, and the glow will not match the outline of the object unless that object happens to be a sphere or something. How else can this be done, that would be dynamic to fit the object's shape and radiate fading color out? Ideas appreciated.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!