Standard shader: How to add lightmap from 3dsmax on UV2?

I can’t figure out, how to add a lightmap coming from an external package (3dsmax) usually baked to UV-Channel 2.
Any ideas?

I am having the exact same problem. I had hoped I could plug it in the emission channel, but I can’t because i can’t specify the emission channel to use UV set 2.

Have you found a solution to this yet?

1 Like

No, let´s hope UT will fix this.

Modifying the Standard shader is not a way to fix it.

Lightmaps should go where they belong and that is the LightmapSettings.lightmaps array. A specific Renderer can then use a lightmap by using its index (Renderer.lightmapIndex) and then point at a specific area within it by using the scale & offset (Renderer.lightmapTilingOffset now renamed to Renderer.lightmapScaleOffset).

1 Like

Kuba could you supply more info please? For example I have 1 lightmap atlas uv baked on 3 seperate objects from another application. It’s a tga texture file. How do I apply that lightmap to uv slot 2 on the standard shader in unity? Sorry I can’t find this specific info anywhere.

Yes, please give us at least a short list of steps on how to add a lightmap coming from Max or whatever to a standard material.

1 Like

I think he means something like this. Add this script to the mesh you want to assign the lightmap to.

The process is…

  • Add your bespoke lightmap (or lightmaps) in to the lightmaps array
  • Hit ‘Set Lightmap Array’
  • Set the lightmap index and tiling/offset values you want for the mesh
  • Hit ‘Set Lightmap Values’

1941734–125556–SetLightmapsManually.cs (1.11 KB)

4 Likes

Thanks, but doesn´t work for me.
No matter, however - UT guys have to implement a workflow for this.

1 Like

Oh weird. Did you set the Lightmap Index to 0?

Actually, you might need to turn off Continuous Baking in the lighting tab, and set lightmap mode to Non Directional too.

1 Like