Question by
nico_rawitscher · Dec 26, 2018 at 02:25 PM ·
c#lightingrealtimeemissive
Dynamic Emmisive Material Affecting Scene
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)); //Mathf.Cos(base.currentScalarValuePackingProximity * Mathf.PI + scale));
(base.currentScalarValueHumanData * Mathf.PI + scale));
gameObject.GetComponent<MeshRenderer>().material.color = c;
emissiveMaterial.SetColor("_Emission", c);
DynamicGI.SetEmissive(gameObject.GetComponent<MeshRenderer>(), c);
Comment