Best Workflow to Get Baked Light Maps from 3ds Max into Unity?

Hi,

I’m currently trying to find a proper workflow to bring in baked diffuse maps from 3ds Max into Unity . To be more clear, these maps contain GI + direct lighting multiplied by the surface color/texture. So technically, these don’t qualify as Lightmaps I guess, since the lighting is not separate from the surface color and textures.
The reason I prefer to bake with highend renderers like VRay or mental ray is because they give me more options in lighting my scene as compared to Enlighten.

Now I am wondering which shader should be best used to plug these maps into. Using the Unlit shaders isn’t an option, because I want to add layers of specular reflections on top of the baked maps using Reflection Probes.
Right now I am using the Standard shader. I plugged the maps into the Albedo, set the “Ambient Source” to a solid white and the Ambient Intensity to 1.0. While this sort of does the job, the white Ambient Source is not working well with non-static/dynamic geometry for which I haven’t baked any maps. They turn way too bright.
Putting the maps into the Emission slot might work better as I don’t have to use any Ambient Source, but I still feel like it is be problematic elsewhere. For one thing, such an emissive surface isn’t reponsive to dynamic lights any longer. So, for instance, if I decide that a Unity spotlight is needed to enhance the scene, this won’t affect the materials with the baked maps.
For another thing, my Emission slot is now occupied, so I can’t add any emissive textures anymore.

Which workflow do you guys suggest to get my baked maps into Unity without the aforementioned problems?

Any help is very appreciated!

Sean

Anyone? I guess other people here use 3ds Max and have managed to get their light maps successfully over to Unity?

You’r not alone on this one. I would like to know this as well. Rendering out the lightmaps with V-ray would be much much easier.

The only solution is to write your own Surface shader with an additional texture slot for your custom lightmap. Then you can use both an emissive texture and lightmap texture and apply them both to the emissive output of the shader.

Here’s a very basic example surface shader with a custom lightmap using the second UV set.

Shader "Custom/CustomLightmap" {
    Properties {
        _Color ("Color", Color) = (1,1,1,1)
        _MainTex ("Albedo (RGB)", 2D) = "white" {}
        _Glossiness ("Smoothness", Range(0,1)) = 0.5
        [Gamma] _Metallic ("Metallic", Range(0,1)) = 0.0
        _Lightmap ("Lightmap", 2D) = "white"
    }
    SubShader {
        Tags { "RenderType"="Opaque" }
        LOD 200
      
        CGPROGRAM
        // disable ambient and built in lightmap support
        #pragma surface surf Standard fullforwardshadows noambient nolightmap
        #pragma target 3.0

        sampler2D _MainTex;
        sampler2D _Lightmap;

        struct Input {
            float2 uv_MainTex;
            float2 uv2_Lightmap;
        };

        half _Glossiness;
        half _Metallic;
        fixed4 _Color;

        void surf (Input IN, inout SurfaceOutputStandard o) {
            // Albedo comes from a texture tinted by color
            fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color;
            o.Albedo = c.rgb;
            // Metallic and smoothness come from slider variables
            o.Metallic = _Metallic;
            o.Smoothness = _Glossiness;
            o.Alpha = c.a;
            o.Emission = tex2D (_Lightmap, IN.uv2_Lightmap);
        }
        ENDCG
    }
    FallBack "Diffuse"
}

Have you tried using Flat Iron?

http://www.texturebaking.com/features/