![]() |
| | #1 |
| Registered User Join Date: Sep 2009
Posts: 37
| opengl Light rays |
| punkywow is offline | |
| | #2 |
| Amazingly beautiful user. Join Date: Jul 2005 Location: If you knew I'd have to kill you
Posts: 251
| What you're looking for is called volumetric light. I've never attempted it before, but there's lots of info on google. Looks like you might need some complex math with shaders.
__________________ Programming Your Mom. http://www.dandongs.com/ |
| CrazyNorman is offline | |
| | #3 |
| Registered User Join Date: Apr 2009 Location: Greece
Posts: 29
| Of course volumetric light is much more realistic, but you could just add fog and blending and with a few calculations you'll have a basic light ray! Simple and easily-rendered, but not very realistic. It's up to you. |
| Sipher is offline | |
| | #4 |
| Registered User Join Date: Apr 2009 Location: Greece
Posts: 29
| Those i described are also known as static light rays because it's too much to recalculate them every frame, so you let them fixed at the position you want to appear as heavily lit or/and misty. |
| Sipher is offline | |
| | #5 |
| Super Moderator Join Date: Aug 2001
Posts: 7,472
| Light rays can be done via world-oriented primitives. The rays will need a density and some spacial information to render correctly. Trying to do light rays in a shader is probably not going to yield the results you want. Post processing will probably not work b/c the image would have to be filtered many times to get a bright area to streak out enough to become a light ray. It is much easier to cast rays from the object in question to the light source creating the rays. If a certain percentage of the rays reach the light source you can then create a primitive along this ray and use colors to color the primitive to look like the color of the light source. Blending can be used to gradually blend out and/or alpha out the light ray primitive. Then post-processing can be applied to the final render which will create the bloom and glow you are looking for. I highly recommend you read Real Time Rendering as it explains the concept very well. It is a great book if not the single greatest book about rendering ever published. It is now in it's third edition and is worth every penny. You will be hard pressed to find graphics docs on the internet that do not in some way reference material either in the book or by the authors of the book.
__________________ If you aim at everything you will hit something but you won't know what it is. |
| Bubba is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Critique my lighting model. | psychopath | Game Programming | 4 | 08-12-2006 06:23 PM |
| OpenGL Window | Morgul | Game Programming | 1 | 05-15-2005 12:34 PM |
| geometry won't display!? | psychopath | Game Programming | 17 | 09-21-2004 10:10 AM |
| OpenGL .dll vs video card dll | Silvercord | Game Programming | 14 | 02-12-2003 07:57 PM |
| MISC questions about OpenGL | Silvercord | Game Programming | 12 | 01-25-2003 04:20 PM |