Skip to main content
GameDev.net gamedev.net
🔒 Locked

Need advice for visual effect

Started by ckcornflake Jul 27, 2007 at 11:16 AM 1 replies 500+ views
Original Post
ckcornflake
ckcornflake
I want to create a shield effect similar to the spherical shield surrounding the ship in the following picture: http://www.planetdescent.com/site/screenshots/d3/visitor18.asp What techniques would you guys recommend I use to achieve an effect. I'm guessing I will have to do some texture blending and mess with the alpha values. Should I just procedurally create the sphere or use a model? Is there any other techniques that are being used that I might be missing?
Palidine
Palidine
yeah, just render a sphere with a semi-transparent texture. the sphere can be created just by getting the sphere extents of your object (i.e. iterate the model points and find the furthest from the object origin). Then just add a little multiplier so the sphere extends a little beyond that furthest point.

-me
smitty1276
smitty1276
You can get a better sphere if you render it with a shader.

Render a quad that occludes the location of the sphere. Then, for the shader, pass your camera's eye-point and the position and radius of the sphere. For each fragment, draw a ray from the eye-point to the fragment's location and test that ray for intersection with the sphere. If it hits, you know the location of the fragment on the sphere's surface and you know the surface normal (frag position - sphere center)... just apply any lighting or textures, set the transparency, and voila! A pixel-perfect, textured sphere.

It runs pretty quick in hardware, and it looks really good.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.