Home Technical Talk

Lightmap in Maya similar to Diablo 3 ?

polycounter lvl 9
Offline / Send Message
jimpaw polycounter lvl 9
Hi Everyone,

I have just finished a lowpoly level and want to create a lightmap for the entire level. I have seen tutorials that deals with one object at the time but how do you create one for a entire level at the same time? The level is built by small mesh parts ,copied over the entire level.

2. Is it possible to create ambient occlution in a lightmap ? (not baked to a specific texture but the entire level at the same time ?. The kind of look i want to achieve is like diablo 3 when colors differs drom different parts on the screen + ambient occ. ( see attachment)

also i want to know what vertex colors is. i have seen some quick example but never really understood what it does.

As you probably understand my knowledge about lightning is = 0
I would really be happy if someone could give me some help here,

thanks guys.

Replies

  • warby
    Options
    Offline / Send Message
    warby polycounter lvl 18
    if you are willing to merge your entire mesh together its very easy to bake a lightmap (at least in individual passes).

    keeping stuff as instances which is better for workflow (i would highly recommand keeping it that way) makes light-mapping in maya impossible.

    id highly urge you to do the light mapping in the engine that you will use unity/unreal etc...

    explain a bit more of what you have planned so we can suggest the right solution for you !
  • jimpaw
    Options
    Offline / Send Message
    jimpaw polycounter lvl 9
    Hi Warby and thanks for the answer. everything is stiched togheter as good as they can be. for example if i have a cylinder sticking trought the wall its not stiched but all the corners and so on are stiched. So if i understand you correct its better to do the lighmap in another program, max ?

    The level i hade made is for a iphone game. they are using their own engine and they told me that it was okay if the lightmap is 1024 X 1024 for that level. what i want to achive is one big texture texture that has all the lightning stored and then use that in the game.

    so where to start ? ,
  • warby
    Options
    Offline / Send Message
    warby polycounter lvl 18
    option 1) tell you engine guys to implement lightmap rendering/ uv mapping in their engine/tools (the right option)

    option 2) (the path of sorrrow)
    - setup all your lightsources and enable shadows everywhere if desired !
    -create a second uv set for all objects ( right click > uv sets > uv set editor > new ... call it "lightmap" or something it has to have the same name everywhere !
    -unwrap all of your objects properly by hand or use create uvs > automatic mapping if it has to be fast
    -save your scene ! <--- this is important you must keep a copy of this !
    - select everything and use use mesh >combine
    - edit > delete all by type > history on everything and clean dead transforms from the outliner
    - open your uv editor choose the uvset called "lightmap" and run polygons > layout you might have to tweak some of the settings to get the desire result none overlapping for example you will need !
    -now in the rendering bar go to lighting/shading > batch bake tweak all the settings to your desire ! here you can also choose if you want to bake to verts or texture but i asume you want texture !
    -render each colore mode out once (lighting / global illumination / ambient occlusion)
    - composite these layers in photoshop until you get the desired results
    - save your scene under a new name _baked or mabye _merged
    - give the scene and lightmap texture to your coders !

    now if you want to make a change to anything or fix a bug you must return to the unmerged scene and repeat these 10 or so steps each time which will probably take you multiple hours each time. !

    have fun starting to hate lightmaps :)
  • jimpaw
    Options
    Offline / Send Message
    jimpaw polycounter lvl 9
    Ha ha ha, that was pretty depressing ;) , thanks alot man, really nice of you, what a job. It seems that i should start with a small scene so i learn everything and then just repeat it over and over again.

    I took a look at your homepage by the way,really nice work. i love your cartoon stuff you made. what programs whould you say is the best /easiest to create a lightmap with the least effort ? , or mayby there is only the hard work you put in it ?,

    thanks again.
  • elementrix
    Options
    Offline / Send Message
    elementrix polycounter lvl 15
    jimpaw wrote: »
    Ha ha ha, that was pretty depressing ;) , thanks alot man, really nice of you, what a job. It seems that i should start with a small scene so i learn everything and then just repeat it over and over again.

    I took a look at your homepage by the way,really nice work. i love your cartoon stuff you made. what programs would you say is the best /easiest to create a lightmap with the least effort ? , or mayby there is only the hard work you put in it ?,

    thanks again.

    The stuff warby explained is actually not that much work, you just have to make sure your absolutely 100% sure you finished your geometry and everything before you are going to bake, once you have the single final mesh with the 2nd UV channel you can bake as much as you want.

    For ambient occlusion, I don't know if anyone knows a solution but baking AO for interior rooms doesn't work because it's going to be all black =), the ambient comes from a dome around the mesh and everything is facing inwards so yeh....

    For baking lightmaps I'd say modo is one of the best options if you really want to bake external but you have to be sure your mesh is done before you take the jump, fixing geometry after you've baked your lightmap is a hell lot of work if you have large scenes as warby mentioned.

    btw, vertex lighting isn't going to work for your scene, as vertex lighting gives a color to each vertex which is blended with the texture is some kind of way (multiply etc.) and you are using huge plains for the floor, now imagine baking vertex lighting on your scene, the floor that covers 4 rooms will only get lighting information from 4 points that are way outside your environment and therefor get none or much more light than the walls. So you have to make your scene very consistent and use a lot of poly's even for large flat plains, otherwise you won't get any usefull lighting information out of it.

    something more like this in terms of wireframe:
    Room_1.png

    This scene was also used in a home made engine and at that time I was trying out a lot of different packages for baking lightmaps.

    The scene basically consists out of 3 chunks of about 10k poly's and a 512x512 lightmap for each, I even tried the method of importing it into UDK, lightmapping it there, then take a screenshot of the lightmap in the generic browser, crop it 512x512 in photoshop and apply it in maya again which brings these results:

    Wip01.png
    Wip02.png

    In the end we went for modo as I already had some experience in using it for rendering and it's pretty fast. (The stuff you see in my portfolio on this scene is UDK lightmapping because that is still the better option)

    this is an example of modo baking (most of them took 3 minutes per scene part so about 10 for each room) in the custom engine we used back then:

    DC_7.jpg

    I don't really have time to explain the whole process now but I hope it helped somewhat.
  • jimpaw
    Options
    Offline / Send Message
    jimpaw polycounter lvl 9
    Thanks alot elementrix, great portfolio also ;) , really nice answers. about the vertex color it wont work becouse the floor is to lowpoly, but what about the walls ? , cant i i choose to only us it on theese walls and skip the floor ?


    about amb occ. mayby i can move the roof and the floor to get som information on the wall details at least ?

    , you have any links to good tutorials on vertex painting and lightmaps ?

    What game company do you work at now ?
  • elementrix
    Options
    Offline / Send Message
    elementrix polycounter lvl 15
    If I'm correct by looking at your lowres shot your also using very few vertices on the walls:
    example-2.jpg

    Now I don't say it'll look crap but your only going to get a very general ambient shade out of it if it works out. For example, you are never going to get any AO stuff showing up in the edges under those arches with this topology. And I don't really see vertex lighting adding a great deal to the scene as it is

    Yes you could remove the roof and floor for AO, but if you bring them back later it will look totally off, because when you get rid of that roof the light will come from above, when you put the roof back you will get a bright gradient down while there is a roof in the way that should've blocked that light.

    As my signature shows I'm currently looking for an internship so not working at any game company, but I do some freelance stuff atm and have an interview this Thursday=)

    I don't know any specific tutorials, I do have some general about lighting but I guess that's not really going to help in this case.
  • cryrid
    Options
    Offline / Send Message
    cryrid interpolator
    I think the vertex color was a side question, if he goes the texture route AO would only be limited by the resolution / density he has to work with.

    As for AO and interior rooms, is there a mental ray shader in Maya that would create the AO which you could then render to a texture? Softimage doesn't seem to have a problem creating AO in closed meshes through this method.
  • jipe
    Options
    Offline / Send Message
    jipe polycounter lvl 17
    Indoor AO usually just requires adjusting "max distance" or other equivalent attributes, depending on the render engine.
  • bugo
    Options
    Offline / Send Message
    bugo polycounter lvl 17
    turtle is ur solution! Look at what they did at killzone liberation for psp with turtle. That might help
  • jimpaw
    Options
    Offline / Send Message
    jimpaw polycounter lvl 9
    Okay elementrix i understand what you mean. but the ao shouldnt get effected by the few polys right ?

    cryrid anf jipe is it any program that bakes ambient occlution really fast and easy ? , i used Textools for Max before, really slow but gave descent results. Blenders ao kicks ass, but i dont know about the speed there ( and i have never tried to bake in Blender) , all tutorials on lightning in Maya is a huge +.

    thanks alot guys.

    bugo i will look up turtle.
  • cman2k
    Options
    Offline / Send Message
    cman2k polycounter lvl 17
    Turtle isn't free though, and I imagine the iphone-game budget isn't that huge either.

    There is already some excellent info in this thread from Warby and others, but if you are looking for more: WIKI TO THE RESCUE: http://wiki.polycount.com/LightMap

    I'm working on a similar pipeline at the moment. It is as harrowing as Warby makes it out to be, lol.
  • jimpaw
    Options
    Offline / Send Message
    jimpaw polycounter lvl 9
    thank you here comes a prototype, critics are really welcome. And sorry everyone but i will be doing the lightning in max ! , change of plans.
  • jimpaw
    Options
    Offline / Send Message
    jimpaw polycounter lvl 9
Sign In or Register to comment.