- Home /
Lighting Mapping the hard way
Hi,
I'm trying to do something a little complicated with lightmapping that perhaps someone can help with. Perhaps I should go back to using prefabs, but not quite yet. I'm trying to make a level out of an xml file format that is created dynamically. Eventually this will be locked down and a lightmap will be created for the finished level. the level is made up of tiles from mesh-renderers and any tile might be repeated.
Want I want to do is bake a lightmap for the completed level in one scene, then apply this light map to the level in a separate scene after it has been created dynamically from file. I have applied the values to do this, map index, offset and scaling factor. However the results are disappointing, the lighting is sort of showing through, but is very blotchy, with whole tiles seemingly in shadow or not.
I have gotten this to work a prefab between scenes, but this build process has alluded me. Does anyone have any ideas?
Answer by Culzean · Feb 07, 2015 at 03:35 PM
I can answer my own question. Backing out the lightmap onto dynamically created mesh at run time works just fine. The issue I was having was the offset precision. I used the Vector4.ToString() method to output the values into a file, which was a mistake. The ToString method prints a vector with 1 point of precision. Nothing like enough for UV in the range of 0-1
Whoops. Hope that helps someone. Also for anyone else having a go at something similar, this forum post proved useful. http://forum.unity3d.com/threads/reusing-beast-generated-lightmap-in-another-scene.71037/
Your answer
Follow this Question
Related Questions
How to save a lightmapped prefab in Project? 0 Answers
extended Tutorial how to setup scene for beast lightmapping 2 Answers
Blending between 2 lightmaps 0 Answers
Lightmap edges problem 0 Answers
Lightmap Baking Cross-Platform: iOS vs Mac vs Windows 1 Answer