Skip to content

Commit

Permalink
script to selectively disable fog
Browse files Browse the repository at this point in the history
but this may be better handled via a custom shader
  • Loading branch information
tyson-kubota committed Feb 7, 2013
1 parent e7feb39 commit 6012fd2
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions FogLayerDisable.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* http://www.unifycommunity.com/wiki/index.php?title=Fog_Layer
/*
This script lets you enable and disable per camera.
By enabling or disabling the script in the title of the inspector, you can turn fog on or off per camera.
*/

private var revertFogState = true;

function OnPreRender () {
revertFogState = RenderSettings.fog;
RenderSettings.fog = false;
}

function OnPostRender () {
RenderSettings.fog = revertFogState;
}

@script AddComponentMenu ("Rendering/Fog Layer")
@script RequireComponent (Camera)

0 comments on commit 6012fd2

Please sign in to comment.