- Home /
Loading Lightmap dynamically from hard drive
Hi Guys, is it possible to apply light map to object dynamically by loading it from a hard drive during runtime?
Answer by ravi_gohil999 · Jan 25, 2013 at 03:12 AM
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.....
please if your solution is the good one, validate your answer ;)
Answer by liszto · Jan 24, 2013 at 06:26 AM
Yes indeed you can, I don't really want to know if it's this. But a solution is describe here :
http://answers.unity3d.com/questions/359301/access-use-lightmap-property-using-script.html
I have tried it. when I bake my scene with the objects marked as static...the light map appears wierd...
do you have a screen ? And if you don't load them from your HDD but let Unity do it, does it work ?
Try this plugin...you can change properties of a shader on runtime like...$$anonymous$$aintexture, Lightmap, Normalmap....
Your answer
![](https://koobas.hobune.stream/wayback/20220613091512im_/https://answers.unity.com/themes/thub/images/avi.jpg)