Way to do Light Beams/Rays of Light (Non-defferred)

Started by
1 comment, last by thedigga007 13 years, 7 months ago
Basically I am looking for a good way to simulate light beams or rays of light. I say "non-deferred" because the light beams do not have to interact with the scene they just need to look like rays of light so a z-prepass seems unnecessary. People have been doing this for years not sure why I am having a hard time o.O

Anyone have a good technique for doing this?

My first approach was to do reverse rim lighting on a cone with a falloff like this:

// I assume that the local origin of the object is 0, 0, 0float transparency = 1 - saturate(length(In.localPosition) / Falloff);float3 V 	= normalize(In.eyeVec);			float3 Nn 	= normalize(In.worldNormal); 		float rim = pow(dot(Nn, V), RimPower) * transparency * RimColor.a * RimIntensity;	return float4(RimColor.rgb, rim);


This looks good only when the surface normals are facing the camera...
Advertisement
Billboard polygon with a "light ray" texture on it. Fade the polygon to invisible with distance.
Thanks for the reply.

I think I found what I am looking for using Epic's approach:

http://udn.epicgames.com/Three/VolumetricLightingGuide.html

This topic is closed to new replies.

Advertisement