Search Unity

[3DS Max 2009] Optimal Lightmap Settings?

Discussion in 'Formats & External Tools' started by degeneration, Apr 27, 2009.

  1. degeneration

    degeneration

    Joined:
    Apr 3, 2008
    Posts:
    115
    I've been working in 3ds max and am having major issues with my lightmaps. I've tried variations with my UVW map flattening but I'm getting a lot of darker edges around my models.



    You can see around the edge of the tables chairs and columns.
    What settings do people use for:

    UVW Map Flattening?
    Max Polys per lightmap?
    Size of a lightmap?
    Render to texture settings?
     
  2. antenna-tree

    antenna-tree

    Joined:
    Oct 30, 2005
    Posts:
    5,324
    In Maya there is a value to fill in the seams when doing a lightmap or other type of transfer. Max must have a similar setting.
     
  3. jcarpay

    jcarpay

    Joined:
    Aug 15, 2008
    Posts:
    561
    To get rid of the dark seams: In 3dsmax check the Render to Texture tool -> go to the Objects to Bake rollout and increase the padding value (default=2).
     
  4. degeneration

    degeneration

    Joined:
    Apr 3, 2008
    Posts:
    115
    Having a good look but can't find anything. I looked at some of the maps that the Render To Texture plugin creates http://www.rendertotexture.com/index.php?view=gallery and it looks like it "bleeds" the colours out to avoid the lightmap hitting any of the unrendered area.
     
  5. degeneration

    degeneration

    Joined:
    Apr 3, 2008
    Posts:
    115
    Did try that earlier, whacking it to something stupid on this go. Don't know if I'm doing this right but my method is:

    Select object
    Add UVW Unwrap Modifier (CH 2)
    Flatten Map
    Render to Texture (on channel 2)

    Here is a good example how how it is going wrong...



    I need it to bleed over the UVW Map. Padding had had no effect, unless I am doing something wrong.
     
  6. degeneration

    degeneration

    Joined:
    Apr 3, 2008
    Posts:
    115
    Nope. Set the padding to 8 and it made absolutely no difference (The map was identical to 2 padding)
     
  7. antenna-tree

    antenna-tree

    Joined:
    Oct 30, 2005
    Posts:
    5,324
  8. GameLvr

    GameLvr

    Joined:
    Mar 22, 2009
    Posts:
    115
    I noticed problems with the FBX exporter- if you export to FBX, then import it back into Max do you still see the problem?
     
  9. snicholls

    snicholls

    Joined:
    Mar 19, 2009
    Posts:
    229
    RM Ones???
     
  10. degeneration

    degeneration

    Joined:
    Apr 3, 2008
    Posts:
    115
    OK. It seems I wasn't entirely aware of what Max was doing. What I was actually using was what Max created in the render window which had no padding at all. The shadow map DID have padding but is stupidly dark.


    1. Render window, manual save, no padding.





    2. The real shadow map, with padding, too dark.



    Just to see what would happen, I applied in Photoshop two Brightness/Contrast adjustment layers on (150%brightness / -50% Contrast) and got this...



    So, how can I get image 1 to have padding?
     
  11. GameLvr

    GameLvr

    Joined:
    Mar 22, 2009
    Posts:
    115
    I'm guessing you let max make a shell texture after it baked the map so it was using that for the base texture in the second render instead of white

    I always check Render to Files Only so it doesn't muck with my materials
     
  12. subspark

    subspark

    Joined:
    Apr 28, 2009
    Posts:
    17
    I'm having a BIG issue. Edge padding doesnt seem to work with Mental Ray in 3dsmax 2009. Does anybody know why I can't get edge padding to work to remove the UV seams in my baked lightmap?

    Cheers,
    Sparky.
     
  13. degeneration

    degeneration

    Joined:
    Apr 3, 2008
    Posts:
    115
    You may have been having the same problem that I've been having. Are you using the image thats in the "render window" or are you using the automatically saved modelnameShadowMap image. The later does have padding, but I found (and it took me ages to realise) that the image that renders in the window has no padding.
     
  14. subspark

    subspark

    Joined:
    Apr 28, 2009
    Posts:
    17
    Ahh I see. However in the actual file the padding is all chewey. There are artifacts all throughout the padding. Is there a reasonable way to fix this?

    Cheers,
    Sparky.
     
  15. GameLvr

    GameLvr

    Joined:
    Mar 22, 2009
    Posts:
    115
    same goes for baking normal maps- what you see in the render window is not the normal map (though it shows problem areas)

    the real normal map (with padding and pretty colors :)) is saved out automatically

    no idea on Mental ray- I've only used V-Ray lightmaps and am still trying to figure out how to increase the quality
     
  16. subspark

    subspark

    Joined:
    Apr 28, 2009
    Posts:
    17
    Yeah I'm using the file thats saved out from Mental Ray and the padding is gross. Same has always been with normal maps too, yes.

    Ahh well I'm just trying to tweak the settings now for best performance/quality.

    Cheers,
    Sparky.
     
  17. subspark

    subspark

    Joined:
    Apr 28, 2009
    Posts:
    17
    Increasing the padding to 5 solved the padding artifacts. I now have a perfect ambient occlusion map under ideal settings for performance/quality.
    Theres no detectable noise in my maps!

    Thanks for the help, degeneration GameLvr. Too cool.

    Cheers,
    Sparky.
     
  18. degeneration

    degeneration

    Joined:
    Apr 3, 2008
    Posts:
    115
    A little unsure about these settings to be honest.
    Could you tell me exactly the setting you use as mine still was too dark? Its the white base texture that I'm not getting.
     
  19. perfectheat

    perfectheat

    Joined:
    Jan 1, 2009
    Posts:
    12
    Personally I would switch to VRay for rendering in Max. Then I would use Brute Force and VRayCompleteMaps in Render to Texture.

    Brute Force can take very long time but the quality is miles ahead with close to zero artifacts in corners. I usually go with 8 or 16 subdivs.

    Found that with using other methods of rendering I got very different results from surface to surface. I could have two walls in the same room and the lightmaps came out as if the walls were in very different light locations.

    Work example: http://tinyurl.com/dfcbsc

    I always go with 2 in padding in Render to Texture. When I flatten the UW map I usually punch in 1 but allways end up rearranging, and throwing away bits, to get the most out of the map size.

    If you render out textures in higher resolutions and end up taking them down a step in Unity you might end up getting glitches that way.

    With any method you will probably have to do some manual work in Photoshop. A small tip with walls is to turn the unused areas of your maps to the colour of the walls. That way with white walls will get you less black lines in corners when viewed from a far.

    Another tip to get more out of your lightmaps is to go for a Gamma 2.2 Linear Workflow: http://tinyurl.com/cua4pa

    Best,
    perfectheat
     
  20. holmeren

    holmeren

    Joined:
    Dec 12, 2006
    Posts:
    300
    Vray and Vray dirt 8) (especially to AO)
     
  21. GameLvr

    GameLvr

    Joined:
    Mar 22, 2009
    Posts:
    115
    Excellent V-Ray tips!

    I searched their forums for a long time but found very little on baking out for real-time

    guess that means I need to see about catching up to the latest versions for Max
     
  22. Zante

    Zante

    Joined:
    Mar 29, 2008
    Posts:
    429
    Are you rendering two passes or fitting it into one? :p

    Would be good if they were render elements you could just add. :[
     
  23. chaos1986

    chaos1986

    Joined:
    Mar 29, 2009
    Posts:
    230
    Yes sadly this is (and has been) a known bug in 3DSMax since as far back as I can remember, it has been mentioned to Autodesk more times than I've had cold drinks and still nothing has been done.

    There are 2 ways to fix the bug

    1: Save the lightmap as a .dds file format with no mip-mapping and expand the edges of the image, you may have to turn feather selection onto 1 or 2 to cover the black artifacts at the edges, then save out your lightmap again and it should be fixed


    2: If the scene is relatively small go into manually edit the UVW and make each element smaller, there is (to my knowledge) any way of making all elements smaller.


    The bug still exists in 3DSMax 2010 and it isn't going to be fixed, it only seems to affect Autodesk products.

    Even in some professional games you can spot these artifacts in corners the devs have missed.

    If anyone does have a fix for this PLEASE let us know, i know this problem affects a lot of people