- Home /
How can I change the self ilumshader its emission value on a material from a script?
I want to change the value for the emission from a script, but I am not sure how I can acces that variable and I can't open the buildt in shader.
Answer by Bluestrike · Sep 07, 2011 at 03:29 PM
Got it,
var emission = 100;
renderer.material.SetFloat( "_EmissionLM", emission );
That one is only relevant for Lightmapping calculations, isn't it?
yep, my script controls a light attached on a prefab model, if the light can be switched on anf off the material should not cast light. But writing this I realize this is not going to work if there are 2 instances of the model and one is flagged to switchable and one isn't as they share the material it will use the setitngs set on the last edited moel :/
Answer by Waz · Sep 07, 2011 at 11:59 AM
The sources of all built-in shaders can be downloaded from here. From these you can find the names of all uniforms (parameters). I don't think any have a straight color for _Illum, only textures, but it's pretty easy to add if you need it (and for that, start with these sources).
Your answer
Follow this Question
Related Questions
Shader problems! GLSL Questions! 0 Answers
how to make special effects by joint or other ways ???!!!!! 0 Answers
How transfer data from shader to script? 0 Answers
What's the syntax for creating a skybox with a script? 2 Answers
Terrain Shading 1 Answer