- Home /
How to read/interpret Renderer.LightmapScaleOffset in Unity 5
I am using baked lightmapping in Unity 5. The Renderer has a Vector4 field called LightmapScaleOffset and realtimeLightmapScaleOffset. According the the docs the x,y is supposed to hold the scale and the z,w is supposed to hold the offset. However the "w" value always reads zero regardes of how the contents of the lightmap is arranged and the other values don't match sensible positions in the lightmap. Can anyone shed any light on how to interpret the values in Renderer.LightmapScaleOffset and Renderer.RealtimeLightmapScaleOffset.
Example:
I have 8 static cubes and one static plane sharing a lightmap.
Here is the lightmap and a screenshot of the editor showing the values I am reading for the cubes from "MeshRenderer.LightmapScaleOffset" and one of the values for the cubes being displayed in the lighting panel. The values being read by the script make no sense.
Did you ever get this sorted? I want to read pixel data for meshrenders in the lightmap
Your answer
