Is it possible to create a volumetric cone of light coming out of a spotlight using Sun Shafts? If so how?
Is this efficient?
In my game, as I am navigating through a tunnel, I want to emulate a liquid environment using this volumetric lighting effect. However Have not been uble to make sun shafts to work.
From what I could find before making this post, it was either beta related stuff or some general issues with sun shafts. My problem is, AFAIK, very specific and I do not even know if it is at all possible to be done in this way, hence my need for assistance.
Thanks a million everyone for all the comments and suggestions.
In a nutshell here is what I have tried so far:
the fugly way of having a semi-transparent cone (as in many games, including BIG titles) - simply doesn’t work and won’t use it at all;
particles from both elipsoid and mesh emiters - not that “realistic” and looks strange when you pay a little bit more of attention to it;
godrays - as you Jimmy pointed out they are in fact quite expensive and considering the weight of the effect in the game I’m not very keen on sacrificing computation cyles solely for the sake of it.
Which leads me to the fact that, unless there is any other way or clever idea that I am simply not having, this effect will be set aside from this part of the game.
Other from that, I would really like to know if in Unity one can have sun shafts emited from a light source other than a directional light.
If those are not the way for you, then there is no way.
1 and 3 are the only reasonable ways, 1 for those who don’t want to sacrifice performance from lower end hardware and thus take the “looks similar if you don’t stand in” workaround, 3 for those aiming at DX10 class hw upwards
You are right. Since in my game players would have to cross the “volumetric light” 1 is definitely not IMHO the way to go, and since we are not aiming at high end machines 3 is also off.
You could attempt to use whats often used in older engines (like TGE) and games, which used planes for the lightrays instead of cones, then you at least don’t have the fishy “intersection” issue especially if you add some code to ensure that such rays are disabled when you would get too close / have them intersecting