How do I get a les flare like in EVE?

Started by
5 comments, last by DirectXFreak 18 years, 9 months ago
Greetings, I recently tested out EVE Online to see how they implemented the graphics. I noticed that the lens flare is beautifully done. The main part that makes it so cool is that when a ship blocks it, it gradually gets smaller, it doesn't cut out immediately. So my question is, how do I work the ray testing to find out how deep the intersection with an object goes, to see how small the solor flare should be. Here's an example of what I'm talking about.
--m_nPostCount++
Advertisement
Humus did a demo called "Soft Coronas" which uses occlusion queries.

http://www.humus.ca/index.php?page=3D&ID=27

It's a start, at least.
gluProject gives really nice results even through alpha tested tree leaves\brances, etc. It looks like that is what they are doing here. Look at Nehe's lens flare tutorial for a full rundown.

J
There's a few things you can do... The easiest is to make the lens flare fade over several frames instead of just "turning off" when it gets hidden. Basically each light source would keep track of its lens flare brightness.. If occluded, reduce brightness by some amount each frame. This alone can look pretty good.

Another, slightly more expensive way is to use more than one ray from the camera to the light source. Spread the "samples" over the image of the sun, and base the brightness of the flare on how many rays reach the light. Something like a sun isn't a single point so this is more realistic and looks good even if the motion is slow (like a sunrise).
Occlusion queries save you the raycasting.
Don't have much experience with occlusion tests, but casting a ray through your object set to the source and finding the nearest object to the ray and reducing the radius of the light-source with that should be quite effective.

(OT)
Isn't EVE gorgeous? I've played it for 2.5 years now, and it never ceases to impress me.
Geordi
George D. Filiotis
Thanks for the replies,

I'm really liking the occlusion method, I checked out the tutorial here on doing it in DirectX.

Thanks again!
--m_nPostCount++

This topic is closed to new replies.

Advertisement