Game Development Community

Light Rays

by Tom Spilman · in Torque 3D Professional · 05/05/2009 (7:14 pm) · 26 replies

Ross got the light rays working in Torque 3D tonight and you guys deserve the first look...



farm4.static.flickr.com/3366/3506355506_ca64e79ab1.jpg

farm4.static.flickr.com/3391/3506356430_0b16c95fae.jpg

farm4.static.flickr.com/3350/3506359166_95b355023e.jpg

farm4.static.flickr.com/3393/3506359644_fcfc7f40b9.jpg


Another thing to look forward to in beta 2.

About the author

Tom is a programmer and co-owner of Sickhead Games, LLC.

Page«First 1 2 Next»
#21
05/07/2009 (1:52 pm)
Quote:
@Pete - It actually makes it run faster.

Ok... no... just kidding.

It has an impact... it has to take alot of samples for each screen pixel to get the radial effect from the sun position. This is pretty much a direct implementation of the GPU Gems 3 technique.

Like with most of these techniques the hit is gonna vary by the amount of fillrate your card can handle. I wouldn't recommend using this effect on lower end GPUs.... for sure nothing below a Geforce 8xxxx series card.

With an 8xxx GPU or above, you get steady frame rates using this technology?

With a GeForce 260, think I would get 40+ FPS constantly?
#22
05/07/2009 (3:45 pm)
@Bo
Actually you can't fake rays when the luminance source (in this case sun :)) is not visible on the screen, since these are screen space techniques as OP have mentioned. I use a similar method you mentioned for my "god rays", but instead of static tube, I extrude a "swarm" of parametrized parallelepipeds (number is configurable either manually or through screen space area error metric) from the direction of the light source, then render them into a render target with alpha. Alpha attenuation is determined through amount of luminance each pixels receives, basically a gather operation over the light ray, because the farther it gets away from the light source its energy diminishes. Finally I do a bloom pass on that and combine it into main render target. Also you need to mask out occluders. We use occlusion queries to mask out pixels, but stenciling would work also. That would be the overall technique with a couple of twists and turns depending on the given scene. I managed to implement this even on TGEA 1.7.1, it will be a breeze to port over to T3D.
#23
05/07/2009 (9:30 pm)
I gave the whole light rays a bit of a try here with Undercity (which really isn't designed properly for how the system works, but it was a fun way to spend 5 minutes while waiting for supper to cook. Here are some results:

fosters.realmwarsgame.com/undercity/ucity10_sml.jpg
For those of you who are curious, yes the animated fan blades does affect the light rays in real-time.

fosters.realmwarsgame.com/undercity/ucity15_sml.jpg
Also the HDR has been turned on for an added affect, though nothing has been touched for this particular level/environment.
#24
05/08/2009 (3:18 am)
One suggestion for your light rays, is the inclusion of Dust particles that float in the light rays. Would make it look more realistic imo.
#25
05/23/2009 (2:53 pm)
what use the light effect in Torque 3d beta2?
can I when open? where open?
#26
05/23/2009 (2:58 pm)
Szzg007, see this thread:
Click ME
#27
05/23/2009 (4:36 pm)
Thanks Hewster....(kiss) (L)
Page«First 1 2 Next»