Hi Guys, is it possible to apply light map to object dynamically by loading it from a hard drive during runtime?
2 Answers
2Yes indeed you can, I don’t really want to know if it’s this. But a solution is describe here :
hey guys, I found the answer…
see this
Gameobject xyz; //Assign this in the inspector
WWW wclass = new WWW(“file:///c:/abc.png”);
yield return wclass;
Texture2D img = wcalss.texture;
xyz.rendered.material.SetTexture(“_LightMap”,img);
//Done…This will work. Actually I am accessing the properties of the shader used…
I have tried it. when I bake my scene with the objects marked as static...the light map appears wierd...
– ravi_gohil999do you have a screen ? And if you don't load them from your HDD but let Unity do it, does it work ?
– lisztoTry this plugin...you can change properties of a shader on runtime like...Maintexture, Lightmap, Normalmap.... https://www.assetstore.unity3d.com/#/content/6617
– ravi_gohil999