Download

Do I need to maintain aspect ratio when creating lightmaps?

Hello,

I’m not referring to breaking the 64x64, 128x128 ratio and so on, but instead about the faces in the UV space. I’m modeling modular walls and am making the lightmaps out to be 64x64 with the 1/64 division rule for the grid size. (as I’ve read that that is a good number that allows the engine to upscale automatically without needing to manually go back and create higher lightmap resolutions). I just do a quick automatic mapping to get all the faces laid out, and then I sew together faces that share the same direction, and resize the more important pieces and snap the edges to the grid with 2-pixel padding (including edge padding). Usually this process creates the faces as rectangular pieces, of which I can only uniformly scale up to a certain amount before I run out of space. What I wanted to know is, what will happen if I non-uniformly scale the UV’d face from its rectangular projection, and widen it to look closer to a square? Would it cause any shadow/seam issues or inconsistencies when aligned to other objects, or would it actually be better than leaving it in limited space as a rectangular face?

It wouldn’t cause seam issues, but you might get some shadows that don’t look as good in one direction, most likely you won’t notice a difference. Rarely does anything end up perfectly proportional in UV’s.

a tip though for modular workflow, depending on what it is you’re making, it could cause lighting issues due to how the lighting system processes meshes on different threads, settings like lightmap smoothing will cause the lighting to be slightly different from mesh to mesh which shows most on interiors and flat surfaces. If your mesh is a simple box shape, then it’s better to build the entire wall section/floor/ceiling as a unique mesh that’s sized exactly the way you want, since that will reduce the number of draw calls and won’t have the lighting issue. Otherwise, your mesh needs something that will hide the seams between meshes.

Thanks for the tips. I had to re-write this many times because it felt like I was just blurting out questions, so maybe I’ll section it off so it’ll be easier to read. So, what I’m making is a system to build houses. I’ve modeled walls varying from 100cm, 200cm, 300cm…up to 1000cm in length inside Maya (and am still modeling). Also, each size comes with varying edges, so that I can create any kind of corner that I want. I plan to only use the size I need for the length of one wall, and if I ever have to combine multiple walls together where a seam is created, I’ll cunningly place a mesh in between, such as a pillar or something simple like that. After I realized, I do plan to make the floors and ceilings out of BSP>Convert to Static, because having one square floor block repeated dozens of times not will fail to create the angled floors I would require, but it would be annoying to place it inside a specifically sized room.

What I’ll do is create the exterior shell of the house, which includes an interior, and then I’ll also model interior-specific walls to make up the interior walls, and once I’m finished, I’ll create a bsp floor and subtract it in areas until I get it the correct size, then turn all of it into one mesh. SO, as you may can guess, any given house may contain many unique meshes, but in the whole neighborhood, the same walls are bound to be used over and over again… Even though it’s many different meshes, can this still be considered effective modularity? If I were to create LODs for each wall so that they would only be an exterior mesh and no exterior until you reached a certain distance, would that still be good for performance/draw calls?

That sounds correct. If you have a single mesh for a section of wall then it will look fine since the seam would be at a corner where you wouldn’t be able to tell the difference.

Any meshes you can hide that aren’t going to be visible will help, technically should already hide things that aren’t visible, though that could be complicated with a building that has an interior.

Ok, so going back to the lightmaps, would you recommend non-uni scaling the UVs, or just leave them as close to their default projection as possible, even if it means that there will be a whole lot of empty space on the UV grid?