Fog Layer

From Unify Community Wiki
(Difference between revisions)
Jump to: navigation, search
(Removing all content from page)
m (Reverted edits by Joseph05408 (Talk); changed back to last version by KeliHlodversson)
Line 1: Line 1:
 +
[[Category: Camera]]
 +
[[Category: MonoBehaviour]]
 +
[[Category: Javascript]]
 +
Author: Joachim Ante
 +
==Description==
 +
This script lets you enable and disable fog per camera.
  
 +
For changing more render settings, see [[CameraRenderSettings]]
 +
 +
==Usage==
 +
Attach the script to the camera you want to have fog enabled or disabled.
 +
Then click on the enabled checkbox in the title of the inspector to turn fog on or off for this camera.
 +
 +
==Javascript- FogLayer.js==
 +
<javascript>
 +
/*
 +
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 = false;
 +
 +
function OnPreRender () {
 +
revertFogState = RenderSettings.fog;
 +
RenderSettings.fog = enabled;
 +
}
 +
 +
function OnPostRender () {
 +
RenderSettings.fog = revertFogState;
 +
}
 +
 +
@script AddComponentMenu ("Rendering/Fog Layer")
 +
@script RequireComponent (Camera)
 +
</javascript>

Revision as of 19:11, 19 October 2009

Author: Joachim Ante

Description

This script lets you enable and disable fog per camera.

For changing more render settings, see CameraRenderSettings

Usage

Attach the script to the camera you want to have fog enabled or disabled. Then click on the enabled checkbox in the title of the inspector to turn fog on or off for this camera.

Javascript- FogLayer.js

<javascript> /*

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 = false;

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

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

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

Personal tools
Namespaces

Variants
Actions
Navigation
Extras
Toolbox