First time user - need advice on UV maps and custom assets

Hello fellas, I’m completely new to creating assets for game engines, and after some consideration I ended up getting Unreal Engine 4. I’ve been lurking around YouTube for some time, looking for and at tutorials.

Earlier I’ve modeled some cabins, houses, some airport terminals and hangars. And as a lecture to myself, I’d like to try to get these into UE4, and find a (or understand an existing) good workflow that makes sense to me.
So far, a building have been made as a complete object that consists of several UV maps. However, I’m not sure I understand how UV maps in UE4 works. And please correct me.

One object can have

  • one UV Map for textures
  • one UV Map for light maps

Correct? I cannot have multiple UV maps per object?

So let’s say I have a huge hangar with 4-6 different materials, ranging from brick and concrete to glass and different metals in air ducts, doors etc.
I’ve made some tests with one of the buildings, and a couple of simple boxes with and without cut out holes. But I cannot seem to get my head around this.

I model in centimeters and meters in LightWave, and assign different surfaces different names so they are separated from each other in UE4. I generate a UV Maps and import the object to UE4.

When I apply a material to the object, the material is HUGE.

Here’s the UV Map.

So I went out to investigate a little. And out of curiosity, I scaled the polygons on the UV map so they are way to big to the bounds of the UV map. See the image attached - you can barely see the black lines indicating the lower values of the UV map in the center of the image.
77d57a854b.png

What happened then was this…

Is this the way to go, or am I doing something really wrong? If so, where do I go wrong, and how to I deal with that?

Later on, I’d like to learn about modular building blocks so I can create buildings with the flexibility of making them in the editor.

I wouldn’t recommend scaling your UVs outside of the 0,1 bounding box. If you want to increase your texture tiliing, you should add a TextureCoordinate node before your texture swatch and set the tiling in there.

Thank you!

In other words, I’ll probably end up making copies of materials, in order to make sure the size of the texture tiling is consistent throughout all the buildings?
How does that affect performance? Or doesn’t that matter that much since the base texture files are used in the different materials ?

Well, the best method would be to ensure your UV shells have the same density - if you put a checkerboard material on your object in your DCC, you should see all the squares of the checker texture are uniform and equally sized. So larger pieces of geo occupy more UV space, and vice-versa. If you get into the habit of doing this, you shouldn’t need to have multiple copies of what is essentially the same material over multiple meshes.

Hi OlaHaldor,

There are multiple ways you could do this.

Crow is mostly right, in that it’s better to stay in the 0,1 UV space. However, if you were using a model that had different materials assigned to different polygons (in Max this is a Multi-Sub-Object, not sure what it’s called in Lightwave) you could use tiling textures, having multiple textures assigned to one object for different parts of the model.

If you were to open a lot of the different models included with the Marketplace projects you would find that it’s a common method to use. A lot of times it’s better to place it safe in the 0,1 space though until you are more familiar with different ways to achieve different looks. for your design.

Modular design would ultimately be the best route to take for something like the hanger you have a above. Rather than using the flat-mapping and having everything separated out in your UV the way it is now, you could overlay some of the geometry that are going to be textured the same to take better advantage of the UV space you have.

For instance, The hanger supports on the side wall. Those triangle pieces could be overlaid on top of one another since they would be textured the same. Thus increasing the space they could use in the 0,1 space to get a better resolution.

There are a few different ways to approach setting up materials and UVs for something like this. Modular design workflows and tiling textures (for some of the objects) would really be a good route to get the most resolution for an object of this size. Using the texturecoordinate node in the material is a good way to tile the texture without having to increase the size of your mesh outside the 0,1 space.

Considering breaking the object into separate pieces that you put together in UE4 would be another route. This will definitely help when it comes to the lightmap layout and resolution.
For example, having these as separate objects: The roof, walls, and supports.

Using your layout as it currently is, you’ll probably find that you have to get a good resolution on the smaller parts you’ll have to have a significantly larger texture size (2048 or 4096) to really see the detail and not have pixelation.

Using the multi-sub-object style with multiple textures that only use specific polygons, since these would more than likely be better used as tiling textures you could have a much lower resolution and achieve the same effect by using the texturecoordinate node for tiling it in the material editor. Although this would require multiple draw calls for each material assigned, but it wouldn’t necessarily be as big a hit as one 4096 texture.

If you are confused or need more detail on some of the methods above let me know and I’ll put some more information together such as links for tutorials and images for demonstration. :slight_smile:

Thanks!

Tim

Thanks a lot Tim!

New things need more time to dig into and digest. Coming from a “model-texture-animate-hit-render-DONE” workflow for video production is quite different than interactive game engines - and is a bit dizzying to be honest. :slight_smile:

That’s understandable. It can be quite different than other media. We have a lot of users who come from an Architectural Vizualization background have trouble wrapping their head around UVs and lightmaps in general. Arch Viz programs like Revit and Sketchup do not use these, at least not in an editable sense.

We’re certainly here to help if you need it. :slight_smile:

Tim

Thanks again. I’ve imported a couple of buildings, but I have to create different materials for each of them, and adjust the TextureCoordinate node individually since the size of the buildings are a bit different. Say I create a material for red bricks. The big hangar building you’ve seen needs a different TextureCoordinate setting than a smaller house.

Does numbers of materials (referring to the same brick texture) bog the engine down? Or would it be worse if I had different texture files in different materials?

Now in the beginning, I think I’ll be using the engine mostly to test arch viz stuff. Who knows that happens next. I do own World Machine, so it’s tempting to create something with landscapes. :slight_smile:

Each material will cause another draw call so there is a performance issue with using too many, but you don’t need to worry about that, it’s not a big deal in this case.

You might want to take a look at material instances though, if you haven’t already.
When you create a material you can right click a lot of the nodes and set them to be parameters instead, this exposes the node to be editable by instances of the material. After you compile you can right click a material and choose “create material instance constant” which gives you an instance of the same material. If you double click this one you’ll see the parameters you have exposed on the right and you can edit them in the instance alone which doesn’t affect the original. For example you could use this to change tiling, texture or anything else you might want and it is a lot cheaper than having tons of materials that are more or less the same except they have different tiling or something. They will still cause another draw call when you have more than one on a mesh but it’s a lot cheaper than having lots of “normal” materials.

Oh wow! That sounds like a great solution for me. Thanks!

Our YouTube channel is a good place to start with some simple material videos to get you started if you’ve not already seen them.

Here is the one referring to Material Instancing.

If you have any questions feel free to ask!

Tim

That’s a great tutotiral. Just what I’m looking for.

I was actually getting started with material instancing before you posted this video. I’ve imported some assets I’ve made a long time ago for figuring out the best possible setup with the current floor plan I had at the office back then.

I’ve made the control surface I currently use, the JLCooper Eclipse, and a mockup of the big DaVinci Resolve panels as well (which is the big wet dream of any Resolve colorist), all though the latter have not been imported to UE4 yet.

Two questions:

  1. Is there any way to tell which UV channel is used for textures and which one is used for lightmaps? As far as I know, I can’t create “channels” in the same matter you can in 3D Max or Maya. I can give the UV maps names, but I cannot see which one is which channel.
  2. How can I adjust the pivot of a group? I found it in the wiki/manual, ALT+RMB, but the pivot was sent a crazy distance away. I was hoping I could get that door (and graphics in the same group) to swing open when I get close to it. But since it’s a group, the pivot is centered.

It might not be pretty, but it’s a fun challenge.

7354d8a5972804636933d62070f4078cceac697e.jpeg

For each mesh you can open this in the mesh viewer/editor and in the details panel to the right you can set the Lightmap Coordinate index to the channel you would like.

You can use have multiple UVs but this is not something I’ve practiced or done in the past. I typically use a multi-sub-object and have the materials assigned to those specific parts of the mesh. Even though the UVs will overlay on each other I have a material that only recognizes the parts of the mesh I want.

The pivots of meshes that are imported are going to be from the world origin of the modeling software. The individual meshes will not retain their pivots. There is a feature request in for this to be implemented but there is no timeline for if/when this will be added.

A workaround that some users have used is by having large groups of things in a blueprint as a component and placing objects in there. The pivot will now be the BP instead of the mesh.

That’s a numeric value where it defaults to ‘0’, and then I can type ‘1’ to select the next channel, correct?

Perfect! :slight_smile:

I’ll give it a spin. :slight_smile:

That would be correct. :slight_smile:

Just to show some progress…

I know the assets aren’t super, but that’s pretty easy to replace when new assets are made.
Gotta learn how to handle the camera and matine tools. :wink:

And I’d want to give the three monitors live video so it looks more… fresh… :slight_smile:

I loaded the “Realistic Rendering” example from the marketplace, to see if I could learn something about matinee. I noticed that a lot of the models actually have UVs going way beyond the 0,1 bounds.

So what’s the reason for that? What makes it OK for that example vs. if I did it on my assets?

That would really depend on the assets and the look you’re going for.

I picked four objects in the realistic rendering to see how they set them up. The four objects (Door, Bookshelf, TV, and Couch) all have UVs that adhere to the 0,1 space. The wall on the other hand does not, which is fine for what it’s trying to achieve with the texture. The biggest thing to remember is to keep the second UVs in the 0,1 space.

For my explanation I’m Going to reference the Couch and the Bookshelf mostly.

For the couch I would recommend keeping the texture UVs in the 0,1 space for the simple fact that if you’re going to use a normal map that is unique to each UV island you would want to do have it setup this way. This will preserve the creases and folds that you’ve modeled that way.

For something like the bookshelf you can have something like that outside the 0,1 texture space. The reason being is, if you look at the material setup, that you will see that the diffuse is a tiling wood texture that has a texture coordinate node plugged in with some values for the tiling plugged in. (although this object does have a unique normal map to get some smooth detailing around the panel edges so it doesn’t look so hard edged and flat)

The main thing is to consider what you’re going to model and consider how you will setup the material before hand.

The walls are a good example of the tiling texture. There is no unique normal that has to be applied. It’s just a base color and a tiled normal.

I hope this helps! :slight_smile:

Tim

That sorts out a whole lot. Thanks!

Here’s another question for you.

When I import an object with several surfaces, just like you do from Max with the multi-sub object feature I guess, is there any flags or anything I can use in order to get better describing names than just “Element 1, 2, 3…” ?
It’s sort of a guessing game which surface is which when I apply materials.