Aura Effect Around an Object

Started by
-1 comments, last by bababooey 14 years, 1 month ago
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.

This topic is closed to new replies.

Advertisement