Question by
nico_rawitscher · Dec 26, 2018 at 02:27 PM ·
c#lightingrealtimeemission
Emissive material realtime
Hi Guys,
I am coding some emissive materials that will change their Color during run time. I am seeking for them to also affect the lighting of other objects in the scene during play mode, but currently they are not . How can this be achieved? Any insights would be great! Thank you
Here is the code I have :
scale += Mathf.Clamp(Mathf.Sin(averege),0.01f,.2f);
Color c = Utility.Lerp3(Color.white, Color.red, Color.blue, Mathf.Cos(base.currentScalarValueHumanData * Mathf.PI + scale));
gameObject.GetComponent<MeshRenderer>().material.color = c;
emissiveMaterial.SetColor("_Emission", c);
DynamicGI.SetEmissive(gameObject.GetComponent<MeshRenderer>(), c);
Comment
Your answer
Follow this Question
Related Questions
Dynamic Emmisive Material Affecting Scene 0 Answers
See Light through fog 0 Answers
Light color is equal to Object color/ script? 0 Answers
How to fix Emission maps that aren't cooperating with other maps? 0 Answers
Interior dynamic lighting HELP 0 Answers