Results 1 to 10 of 10
  1. #1
    Join Date
    Jul 2006
    Location
    San Diego, CA, USA
    Posts
    896

    Lost normal mapping with Unity lightmapping

    When creating a lightmap in Unity 3 the normal mapping goes away. I've provided two images, one with lightmapping turned on and the other with it off. The image with lightmapping turned off shows the sun reflecting off the ground and the specular highlights on the ground and two models.




    The ground and tall cube are just a Unity Plane and cube. I created a checker pattern and let Unity create normal maps from it. I then created a material and set the shader to Bump Specular and set the two textures (diffuse and normal) for it.
    Everything was looking really good up until I generated a lightmap.

    The crate is an FBX with custom normal map. Its material was also Bump Specular.

    I tweaked parameters for the lightmapper but I could never get the normal mapping to show back up. So how can I get the shadows along with normal mapping? Caution: Unity newbie here, so if the solution is simple please be easy on me. Notice that I do get the shadows in the bottom shadow mapped image but the sun (directional) light and normal mapping disappear.

  2. #2
    Join Date
    Dec 2005
    Location
    Connecticut
    Posts
    626
    They explain it a bit in this tutorial here. Skip to ~30:30

    http://www.3dbuzz.com/vbforum/sv_showvideo.php?v=4871

    Short answer, I think you'll need to change your rendering path.

  3. #3
    Join Date
    Jul 2006
    Location
    San Diego, CA, USA
    Posts
    896
    Quote Originally Posted by Krynn72 View Post
    They explain it a bit in this tutorial here. Skip to ~30:30

    http://www.3dbuzz.com/vbforum/sv_showvideo.php?v=4871

    Short answer, I think you'll need to change your rendering path.
    Thanks but I did change to Deferred Lighting rendering path from Forward. Lee did directly say you would lose normal mapping with Forward rendering but again I did change mine.

  4. #4
    Join Date
    Feb 2003
    Location
    Trondheim, Sør-Trøndelag, Norway
    Posts
    176
    Are you using Unity3D Free? If so, Deferred Lighting is a Unity3D Pro feature only, you can set it but nothing really happens and you are basically just using Forward rendering still, as far as I know at least - correct me if I am wrong

  5. #5
    Join Date
    Jul 2006
    Location
    San Diego, CA, USA
    Posts
    896
    Quote Originally Posted by timespin View Post
    Are you using Unity3D Free? If so, Deferred Lighting is a Unity3D Pro feature only, you can set it but nothing really happens and you are basically just using Forward rendering still, as far as I know at least - correct me if I am wrong
    Ah, that could be it. I AM using the free version. So even though the Deferred lighting option is available it may be unavailable. If that is the case then it is misleading that the choice is available and there are no warnings.

    Thanks.

  6. #6
    Join Date
    Feb 2003
    Location
    Trondheim, Sør-Trøndelag, Norway
    Posts
    176
    The shadowing choices are available on lights also, but at least they give you a warning that it is a pro-only feature, so yeah, it's definitly misleading :/

  7. #7
    Join Date
    Sep 2008
    Location
    Bradford, UK
    Posts
    38
    Yes this caught me out also. I knew the advanced rendering features that deferred rendering brings were not in the free version but I thought they had left it in just to get round this problem.
    I guess we have a choice of shadows or normal maps. Personally I'd choose shadows.
    There is a third option! Baking the shadows into the textures via a 3d app before importing them. This does mean your entire level will have to be built in the 3d app I guess, plus it would need separate textures where they would otherwise just be instanced.

    It is slightly gutting because I have recently bought the pro version Filter Forge 2 specifically because the pro version creates normal maps!
    Last edited by DanMarionette; 02-12-2011 at 07:43 AM.

  8. #8
    Join Date
    Jul 2006
    Location
    San Diego, CA, USA
    Posts
    896
    Thanks for all the responses. I'm seeing more and more that the Pro version of Unity is a very good thing.

    I guess we have a choice of shadows or normal maps. Personally I'd choose shadows.
    Absolutely what I was thinking too. But my modeler may have a different view. Its his call.

    For our game a little team of mine is developing we will look into shadow blobs using a Projection thingy. We don't really need accurate shadows for the main player, only a general reference to depth and position.

  9. #9
    Join Date
    Apr 2012
    Posts
    1

    Another Option

    I was having the exact same problem, every time I used Beast I would loose my Specular and Normal maps. I did accidentally discover something that worked for me.
    First off i'll mention that I'm using the Legacy Lightmapped shaders (Don't know if that REALLY makes a difference as it did not before)
    But anyways After my bake what I did was create a new Directional Light and position it in the exact same place as my directional light I used for my bake, adjust the intensity down a little, set the color to match my original Direction light and tell it to be "Real Time" and Viola! Not only did I still have my baked shadows but I got my Specular and normal maps back.
    I hope this helps as this was a particularily frustrating problem for me... took weeks of searching and no real answers, discovered this by just trial and error

  10. #10
    Join Date
    Apr 2010
    Posts
    2
    The shader for your material isn't getting all the information it needs from Unity to produce the effects you want when you're baking lightmaps. For your object, Unity will pass information about each light to the object's materials (position, intensity, etc.), when your object isn't lightmapped. When it is lightmapped, Unity skips those steps because all the lighting information is now a quick lookup in a texture which is much faster.

    I thought I had seen a solution that they included in 3.5 (I haven't upgraded yet), but there's a radiosity normal map solution that might be useful to you here. http://forum.unity3d.com/threads/716...-Now-released!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •