Lens Flare

Started by
14 comments, last by greg2 21 years, 10 months ago
Reading the depth buffer is a very slow operation, especially on cards that haven''t got an explicit Z-buffer (the Kyro range of chipset, for instance). The better way to solve this problem is to use your collision detection routines to cast a ray from the camera to the sun and see whether it hits anything. Writing collision detection just for this is a bit overkill, but I think you''d need it anyway.

Kippesoep
Advertisement
I don''t use any collision detection routines. I write a demo, not a game.

Hi..

Like Kippesoep said.. I would really recommend using a ray to detect a possible collision..

There are some very good tutorials at this site: http://www.gametutorials.com/Tutorials/OpenGL/OpenGL_Pg3.htm

You are going to need collision detection at some point.. whether you are writing a demo or a game..

Cya

Halloko
Reading the depth-buffer back to memory is a big no-no; it''ll bring your poly through-put to it''s knees.

If you''re not too worried about your Collision Detection, represent the geometry as OOBBs, or AABBs. Test the collision with a simple ray-cast.

One trick to make lens-flares, and halos, (not just from suns, but from other lightsource) look cool is to slowly fade it in (alpha 0 -> 1 upon first viewable) and out as it comes into and out of view.

Allan
------------------------------ BOOMZAPTry our latest game, Jewels of Cleopatra
reading back buffer is the slowest but also the simplest solution. you can minimize stall by doing it as the last thing before buffer swap but it will still caouse a bubble in gl pipeline. you can get some (%5) decrease even on slow cards like TNT while this can be bigger on new ones, specialy when using VAR

You should never let your fears become the boundaries of your dreams.
You should never let your fears become the boundaries of your dreams.
I will have a lots of work

This topic is closed to new replies.

Advertisement