It's common knowledge that college only teaches you 10% of what you need to know in a professional setting. For my college experience, lightmapping fell into that 90% that wasn't discussed.
Unfortunately, it's also a topic that was cited as a weakness of mine when I had my portfolio reviewed at GDC. So I'm wondering if someone would be so kind as to answer some questions about lightmapping for me.
regardless of the modeling package it's done in, I'm noticing that part of the method of setting up a lightmap is creating a second UV set, unwrapping the scene in Atlas mode, and exporting in a format that can handle multiple UV sets.
Why is this a necessity? Is it just to get around problems caused by surfaces that share UV space?
What filetypes will handle exporting multiple UVs?
Is a lightmap of any use inside the modeling package, or is its function limited strictly to game engines?
A lot of the lightmap tutorials I've read are old - old enough to refer to Quake and Doom as current-gen games - and refer to reducing your lightmap per object to 32 pixels. I can understand using a smaller lightmap, given its only function is influencing light, but what's a more realistic size to work with for current-gen game consoles and computers?
This is my first post, so I apologize if this is in the wrong place.
Thanks for your time!
Replies
You can start here :
http://wiki.polycount.com/LightMap
and read the threads linked. Then if you still have questions, come back !
even if you are not using max you should still watch it because he talks about things you should keep in mind while creating a uv channel for one.
http://www.3dmotive.com/product-udk-lightmaps
http://www.3dmotive.com/product-udk-lightmaps
To awnser some of your questions:
You need a 2nd UV channel because in order to bake lightmaps you have to have everything unwrapped uniquely.
32x32 lightmap may seem a little low but you will find it still gives nice shadows. Remember that every instance of an object gets an unique lightmap. Still you can go higher than 32x32 now a days.
EDIT:
lol posted while I was writing my post... still 3dmotive is really good.
http://stephenjameson.com/tutorials/lightmap-uvs-tutorial/
32 x 32 pixels can be fine depending on the size of your object and the amount of instances there are and how detailed the shadow information needs to be.
Light maps do add up after a while even at such small resolutions.
Lightmaps are great inside the modelling package aswell if you want to showcase your models in the viewport for whatever reason. I dont know how to do it in max but in maya you need to create a layered texture and link one UV set to the diffuse of the object and one UV set to the lightmap of the scene.
I will admit that when I recorded that tutorial I didn't go into nearly enough specifics of "best practices" and all the nuances of what makes a good lightmap.
Here's some additional things to consider:
Hide, hide, hide those seams! Just like a good texture map, hiding your lightmap seams is just as important. Nothing will make your object look off than a giant shadow seam right at the corner.
Straighten your UVs! Don't go completely overboard, but do your absolute best to straighten out your UV edges whenever feasible. In Max or Maya, take full advantage of those alignment tools to avoid artifacts along your lightmap.
Just as important as straightening them, make sure your UVs aren't bent at any odd angles. Perfectly straight up-and-down or left-to-right. Don't have a flat surface bent at some weird angle just because it will pack better. The lighting will almost always be better when the UVs are straight!
Using the "Auto-Pack" tools is a good start in 3dsMax, just make sure you don't turn "Rotate Clusters" on. Keep those UVs straight up and down!
Always consider padding between resolution. In the video, I probably pack them a bit too tight for such a small asset that would likely get a very small lightmap, so consider the scale of the object, the possible final scale of the lightmap, and pack accordingly.
Hope that helps!
Some general advice on avoiding seams:
-Obey the 3pixel padding rule between islands.
-Place the UV seams where there are sharp edges on the mesh, and connect islands where the surface is flat (so if you have a wall you want the whole thing to be connected if possible).
-Snap edges to the grid (to the pixels) whenever possible, and try to make them straight (horizontal or vertical). So if you are planning to use a 64pixel lightmap then plan the UV coordinates accordingly (integer values between 0 and 64).
-Make sure none of the islands are flipped or overlapping on the lightmap.
-On your normal map if you are flipping(mirroring) islands, flip horizontally across the y axis (so the seam is running vertically).
-Turn the Normal Boost Influence in the World Properties down to 0, specifically if you are mirroring your textures.
If things still don't work out and you still get seams, try turning the lightmass res to 0 which I believe will make the mesh use vertex lighting. If that still doesn't work out or if you prefer not to take that route, then you can hide your seems by obscure placement or by covering them with another mesh.
I also believe that the skeletal meshes use vertex lighting, which I believe would make lightmass UVs negligible (someone clarify if the lightmass UVs are used in any way on skeletal meshes?). If they aren't then that means you are dealing with lightmass UVs for mostly static environment/architectural assets (not so bad, unlike an organic character which could be a nightmare). I'm fuzzy on this since I don't do udk skeletal work as of now, so if anyone has some clearer info that'd be great!
I don't understand why so many engines lack Lightmap bleeding/padding, not everyone has access to ingame code.
Not wanting to high jack this thread, but I've been searching around and this is my question, "What about skeletal meshes and lightmaps?"
I've got several skeletal mesh objects in a scene and I'd like to increase the resolution for those specific objects. Is there an attribute for resolution on those specific assets? Or do you have to do something different for those skeletal meshes?
I keep drilling through menus and Google searching but haven't found anything yet.
Skeletal meshes can't use lightmaps.
They use depth buffer shadows and/or stencil shadows depending on the types of lights affecting the mesh.
I'll have to check all my lighting attributes.
Apparently you can only use one UV channel too for Skeletal Meshs, which is a big pain.
Hope that makes sense.