Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Sub Materials with Max

Discussion in 'External Tools' started by Vimalakirti, Jan 18, 2010.

  1. Vimalakirti

    Vimalakirti

    Joined:
    Oct 12, 2009
    Posts:
    755
    Hi all,

    I'm at a point where I need to use sub materials with 3ds Max, which I don't have a lot of experience with, and I'm wondering about which tools to use for good import into Unity with .fbx.

    The basic question:
    Do I use Unwrap UVW or UVW Map?

    Also, is there anything I need to be aware of that could take me by surprise?
     
  2. holmeren

    holmeren

    Joined:
    Dec 12, 2006
    Posts:
    300
    Hi

    Why do yo you need to use Sub Mats?
    Split up your mesh in IDs.
    UV map or Unwrap use what you like.
    I always use the Unwrap modifier.
     
  3. Vimalakirti

    Vimalakirti

    Joined:
    Oct 12, 2009
    Posts:
    755
    Thanks,

    I'm learning about the ID's from video tutorials and i think I have that part. I'm a little confused about the mapping, though. The ID part happens when you're still working with Editable Polys before adding anything else into the modifier stack I think (before Unwrap UVW and before skinning).

    I'm trying to make a book that can be opened. I want it to be one object, and I need to load textures with scripts. To this end, these each need to be separate maps:
    Front Cover
    Inside Left Page
    Inside Right Page
    Back Cover

    So... after I break it down into Sub materials, how do I map each part?

    There may be tutorials on this, but unfortunately, I may not be able to work on this again for a few days, so have patience if it takes me a while to respond.

    And thank you for your help.
     
  4. holmeren

    holmeren

    Joined:
    Dec 12, 2006
    Posts:
    300
    Select your Front Cover use "Detach" in "Editable Poly"
    and name it front cover.
    Do the same with:
    Inside Left Page
    Inside Right Page
    Back Cover

    Unwrap them

    Export them all as one FBX as multiple FBX files.
    Dont use multisub mat.
     
  5. Vimalakirti

    Vimalakirti

    Joined:
    Oct 12, 2009
    Posts:
    755
    And just rig them to the same bone system so they'll all move together seamlessly?
     
  6. holmeren

    holmeren

    Joined:
    Dec 12, 2006
    Posts:
    300
    ahhh
    I get it...

    One book, one mesh, one material, one ID, one mesh, one texture.
    Rig the book.
    Animate it
    Export it.

    Better?
     
  7. Filto

    Filto

    Joined:
    Mar 15, 2009
    Posts:
    699
    From my experience it works fine with unity. Just apply the different materials on the appropriate faces in 3dsmax and save. For mapping use select by id apply an unwrap while in submode in editable poly and map them the way you want and collapse the modifier stack when you are done.
     
  8. holmeren

    holmeren

    Joined:
    Dec 12, 2006
    Posts:
    300
    Why the extra drawcalls....?
    Should be one texture one mesh.
    IMO ;)
     
  9. chaos1986

    chaos1986

    Joined:
    Mar 29, 2009
    Posts:
    230
    rule no.1 ALWAYS keep your texture count as low as possible. Try to add "elements" to your book, you can use multiple materials for your book then 'bake' them into one material
     
  10. Vimalakirti

    Vimalakirti

    Joined:
    Oct 12, 2009
    Posts:
    755
    It's a book, so it needs front cover, inside left page and inside right page. These need to be loaded procedurally, because you can put down one book and pick up another. The left and right pages need to change because you can turn the pages as you read it. Multiple textures, loaded procedurally.
     
  11. perversonality

    perversonality

    Joined:
    Jan 8, 2010
    Posts:
    57
    As a thought, you could create a single texture map which contains all of the covers (front and back) and all of the required pages. When the player has a specific book in their hand then you can move the texture offset to place the UV coordinates on top of the image part that contains the correct content, I think using Material.mainTextureOffset, though I don't have Unity on my work PC to try it right now. To make this work you would unwrap the cover and have multiple textures for the unwrapped cover on the sheet and similarly you would unwrap the pages and have multiple page textures on the sheet. You would then need to move the UV coordinates for the cover (sub)object and the page (sub)objects to have the correct texture applied
     
  12. Vimalakirti

    Vimalakirti

    Joined:
    Oct 12, 2009
    Posts:
    755
    The thing is that each texture comes as its own individual file. One for the cover, one for each page. So they need to be loaded that way without fitting them to a complex map. That's the main challenge: how to construct (model, rig, map) a book where the pages can be loaded properly, and it can be read "in game."
     
  13. perversonality

    perversonality

    Joined:
    Jan 8, 2010
    Posts:
    57
  14. Vimalakirti

    Vimalakirti

    Joined:
    Oct 12, 2009
    Posts:
    755
    Okay, I have sub materials and mapping working thanks to all your help! It worked by creating the material sub materials, then selecting faces and choosing the sub-mat number while in Editable Poly mode, then uvw mapping to fit each selection set to the full map, rotating if necessary in the material window, then rigging. Now I'll export and continue in Unity!

    Perv, thanks for that link. Now that I've come this far, I'll look to that for the procedural loading.

    :D

    Victory is Nigh!
     

    Attached Files:

  15. holmeren

    holmeren

    Joined:
    Dec 12, 2006
    Posts:
    300
  16. perversonality

    perversonality

    Joined:
    Jan 8, 2010
    Posts:
    57
    Glad I could help :)
     
unityunity