Download

Noob Question about Laying out UV's for light mapping

Hi All,

I am new to Unreal Engine and I am trying to design a house. All of my walls are simple blocks of static mesh (each of them is different length). My question is about UV’s and light mapping.

Let’s say we have a cube. We know some faces of cube will never be visible to player (e.g. Bottom face will never be visible if cube is on floor). So I give very little UV space to bottom face. In case of a wall, only two faces (front and back) will be visible. Other faces will hide behind other walls, roof and floor. This leaves me with a lot of UV space for front and back faces. To fill up UV space as much as possible, I have to stretch UV’s unevenly. See attached image.

Two larger UV polygons are the front and back faces. I have stretched UV’s horizontally to fill up space.
Smaller UV’s on right side are for hidden faces.

I have some questions:

for larger faces, is this a good idea? or UV’s should not be stretched? (only talking about light mapping purpose, not texturing)

For smaller faces, is this good?

Also, overall is this a good layout?

Thanks

In that situation it is OK. The problem that can happen is when you have a seam and the pixels on either side are different sizes, then you can notice it. In your case, the edges are in a corner and you wouldn’t notice a change.
As far as the surfaces that aren’t visible, you can actually delete it, if it’s not going to be seen and it’s not going to effect lighting then you can delete it.

Also, you’d want to try and combine things when possible, so that room you could have all of the interior walls as one mesh, and then you would only need seams in like 2 corners. When you reduce the seams you end up using the space more effectively. The only issue is when you might have a really long wall and it doesn’t fit well, in those cases you might split it so you can add another seam.

Thanks a lot. One more question. Is it OK to have simple plane meshes instead of blocks?

I mean, in my example above if I delete all the faces which will be hidden and then I am left with a mesh having two disconnected separate front and back faces. I am getting some major light leaking this way.

You can actually delete those top, bottom and side faces so they take up no UV space at all. That way you can get the most out of your UV space for lightmaps and texture UV’s. I wouldn’t recommend using planes because there needs to be a certain thickness to your walls so you don’t get any issues with lighting.

Keep in mind if you are going modular with your walls, texel density :slight_smile:

But deleting those faces will turn my wall into a plane, right? Actually two individual planes. But then again I will have light leaks due to having planes. I couldn’t find a way to delete those faces in UV editor while keeping them on mesh.

I’m Stuck.

In your case I would delete the top and the bottom faces, they won’t contribute anything so it’s OK to remove them.

As a perspective I’m into functionality of design over and above the need to optimize at least during the first pass of a new environment design. Nickle and diming optimization at the start you can land up losing the ability to reuse the same asset over and over again as a variation and waste far to much time dealing with what you think is best practice.

My process is to get it in good or bad to define the space as to layout and scale and once what I have in may head begins to materialize I have a much better idea of how to reuse what is already done and focus a bit more on optimizing what I “know” I’ll be using.

My advice leave the wall, lightmap it in full, as you never know where you can make use of an instanced copy of a block of wood and then worry about doing it the right way later.

The last pass is the polish pass as by then I know what needs attention over and above some twitch fix that makes no difference as to performance one way or another.