Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

changing a lightmap at runtime

$
0
0
Hello! i am trying to change a lightmap at runtime. in my example i change the lightmap with index 0. i am run this code at keypress but nothing is happening... the lightmap assigned is still the same... any ideas? function bakings(){ var mapdata : LightmapData = new LightmapData(); var filename : String = "Box01_lightmap"; mapdata.lightmapFar = UnityEngine.Resources.Load(filename, Texture2D) as Texture2D; mapdata.lightmapNear = UnityEngine.Resources.Load(filename, Texture2D) as Texture2D; LightmapSettings.lightmaps[0] = mapdata; print("lightmap 0: "+LightmapSettings.lightmaps[0].lightmapFar); } thx for the help!

Viewing all articles
Browse latest Browse all 171066

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>