- Home /
Changing NoiseAndGrain in runtime
I need to change the variables of the NoiseAndGrain image effect but am not sure how. I have the NoiseAndGrain component as a component but don't know how to change its variables. Thank you in advance.
private var imgEffect : NoiseAndGrain;
function Start () {
player = GameObject.Find("Player").transform;
imgEffect = GameObject.Find("Camera").GetComponent(NoiseAndGrain);
}
function Update () {
imgEffect.//what do I put here???
}
Answer by Fattie · Oct 15, 2013 at 08:51 AM
http://docs.unity3d.com/Documentation/Components/script-NoiseAndGrain.html
it would appear you have available to you the properties there.
So for example you should be able to say
Debug.Log(" imgEffect.monochrome is ... " + imgEffect.monochrome );
If you just type "noise" in to your PROJECT panel, you will immediately find the script noiseandgrain
If you look in it, you will see the variables ..
public var intensityMultiplier : float = 0.25f;
public var generalIntensity : float = 0.5f;
public var blackIntensity : float = 1.0f;
public var whiteIntensity : float = 1.0f;
public var midGrey : float = 0.2f;
public var dx11Grain : boolean = false;
public var softness : float = 0.0f;
public var monochrome : boolean = false;
public var intensities : Vector3 = Vector3(1.0f, 1.0f, 1.0f);
public var tiling : Vector3 = Vector3(64.0f, 64.0f, 64.0f);
public var monochromeTiling : float = 64.0f;
public var filterMode : FilterMode = FilterMode.Bilinear;
public var noiseTexture : Texture2D;
public var noiseShader : Shader;
So, now you know what you can type there! :) hope it helps
It works! Thank you so much! This really cleared up a lot of confusion for me :D
magnificent, please TIC$$anonymous$$ (ROUND SY$$anonymous$$BOL) any answer that helped - everyone here is very anal :) Only you can close out questions. See you next question!
Your answer
Follow this Question
Related Questions
Export objects to a .3DS file at runtime 1 Answer
Some strategies to load huge models at runtime? 0 Answers
Saving Runtime Generated GameObjects to Prefabs 2 Answers
runtime: script variable not processed as demanded 1 Answer
How can record the total amount of prefabs that are spawned during runtime? 0 Answers