2D Toolkit Forum

2D Toolkit => Support => Topic started by: csotomon on December 05, 2012, 02:26:12 am

Title: Fog and Spot Light
Post by: csotomon on December 05, 2012, 02:26:12 am
How can I make that my sprite become afected by the unity fog and a spot Light?

Title: Re: Fog and Spot Light
Post by: unikronsoftware on December 05, 2012, 08:24:36 am
You can use one of the lit shaders. Also be sure to change this http://unikronsoftware.com/2dtoolkit/doc/reference/sprite_collection.html Normal Generation -> Normals only.
Title: Re: Fog and Spot Light
Post by: csotomon on December 06, 2012, 03:47:02 am
Hi, with this changes, the sprite is affected by the spot light, but no for the fog, how can i solve this?
Title: Re: Fog and Spot Light
Post by: unikronsoftware on December 06, 2012, 09:39:23 am
You'll have to change the shaders, or copy them and then modify the copy, whichever you prefer. The shaders have fog turned off explicitly to save performance - in a vast majority of cases there isn't much use to fogging sprites.

In the shader, you will find a line like this:
Fog { Mode Off }

You will need to switch it to something more appropriate based on this:
http://docs.unity3d.com/Documentation/Components/SL-Fog.html
Title: Re: Fog and Spot Light
Post by: csotomon on December 06, 2012, 04:33:11 pm
Thank you for U help
Title: Re: Fog and Spot Light
Post by: Tochas on December 06, 2012, 06:52:08 pm
Have someone used the "2D Volumetric Lighting system" available on the asset store? http://reverieinteractive.com/2dvls

I am thinking to give it a try