So I don’t know whether this is a bug or whether this is something I am personally doing wrong. I use 3D - Coat to UV my models. When I mirror the UV’s in 3D - Coat and export my model to bring into UE4, I do a build for lighting and UE4 thinks my UV’s are overlapping.
In order to mirror UV’s in 3D - Coat you simply select the UV island you want to mirror and hit CTRL + C then select the UV island your mirroring to with CTRL + V. This lays the two UV islands on top of each other. I have tested with the same model and UV’s without any mirroring in 3D - Coat and when I do a build I get no errors. I don’t know whether this is a bug or whether 3D - Coat’s way of mirroring UV’s isn’t agreeing well with UE4. I’ve checked the AnswerHub but had no luck there
I am happy to provide the model or screenshots, whatever is easier
I have no clue lol, I wouldn’t think so only cos this is the way 3D - Coat mirrors UV’s. It will lay the UV islands on top of each other, unless I’m missing something? If you know what’s going wrong please let me know
ok from sounds of things your importing a static mesh, so this means you need 2 uv channels, channel 1 which can have overlapping uv’s eg diffuse/normal … , the channel 2 needs to have unique uv’s as this is used for the light map, you can find more info here
Geodave thank you very much man! I have one more question for you guys. I am trying to get custom collision for one of the models im in the static mesh window and I am click on collision and pressing ‘Copy collision from selected mesh in content browser’ but I keep getting an error saying ‘Invalid asset to copy collision from. Select valid StaticMesh from content browser’.
Yeah I still haven’t figured this one out. I suppose in regards to the UV’s I’m just gonna have to be careful about placement and UV space. I still haven’t tried what Geodave mentioned and making 2 UV channels for my models (one for texture, one for lightmaps.) After laying out my UV’s careful I don’t get errors now when doing a build
I managed to get my models in the engine though and textured so I’m happy with that, just need to work out a few more kinks till everything starts to go smooth
To add a little bit more there are some good tutorials on Lightmapping on World of Level Design that will give you a well rounded understanding of lightmaps and how to properly set them up.
It is possible to not use the second UV channel by having a good layout with your primary UV channel. If you have UVs that will be overlapping for using tiling textures and whatnot it is definitely recommended to use a second UV for the lightmap to avoid this issue.
Cheers Tim, I will check the link out. In regards to my problem with UV’s do you think this is just the way UE4 handles overlapping UV’s? 3D - Coat mirrors the UV’s by laying them on top of each other, I don’t think there is any other way to mirror them in 3D - Coat. It would be handy to be able to do this so I can utilize as much texture space as possible, if not though I guess I’ll just have to be careful on the layout of the UV sets.
This is where Lightmaps come in handy. As others have pointed out above, using the Texture UV channel, you can have overlapping UV islands here which is extremely helpful for getting a good texture resolution with tiling textures. Having a second UV is key to getting good shadows. Since your UV 1 will have overlapping faces you cannot use this as a lightmap because shadows will bake on top of each other. It may seem cumbersome to setup and an extra step but if you get a good lightmap you can see a difference and get good shadows that give you optimum performance because there is no overhead for performance at run-time.
My recommendation would be to setup your UV channel 1 for texture however you can to get the best resolution for your textures and the style you want, but make sure to use a second UV specifically for lightmapping. This is standard workflow for nearly everything that is static in UDK/UE4 for baking shadow information.
Edit: adding more
I’ve not used 3D Coat before so I’m not sure how their UV process works. If you have access to making custom UVs within 3D coat just make sure to make a second UV channel for lightmaps and layout that one as needed. If 3D Coat does not allow you to change the UV island layout there are some free tools like UV Roadkill.
Ahh this is quality advice as always. Cheers Tim. Yeah 3D - Coat allows to edit the UV’s layout. I’ve been using auto - seams which cuts the model everywhere which isn’t very efficient so I guess I’ll go back to them and re do the seams and layout. I know how to add UV sets in 3D - Coat for multiple UV channels so this shouldn’t be an issue. One more question though. With the extra channel for lightmaps, as long as the layout for the UV’s are good, in UE4 when I start adding my lights, when I build it will use the lightmap channel to calculate the shadows over the model? This may sound a stupid question but I am constantly learning and my game is my first and only project I am working on right now
I just want to make sure I don’t need to setup the lighting in my 3D application to how I want it in UE4. Again that might be stupid but I just want to make sure I know everything about this before I dive in and do it
EDIT: Another Stupid Question.
With lightmaps on the second UV channel if I mirror my UV’s in 3D - Coat now then I won’t get any errors for overlapping UV’s?
With a second UV set on my model, UE4 will automatically think that second UV set is for the lightmaps?
If the layout is good you can use the first UV channel as the lightmap channel. This requires that the UV islands have enough spacing between them, no flipped faces, no overlapping, and I’m sure some other caveats as well. This is why it’s best to use a second UV. You can have the most control over your mesh lighting/shadows this way.
No stupid questions here.
Lightmapping can be a beast to wrap your head around especially for those new to game development.
if you mirror you UVs on channel 1 it will not affect the lightmap channel 2. You will just want to make sure that the UVs on the second channel are not mirrored or flipped. This will cause your shadows to be mirrored or flipped as well.
Below is an example of how to do a sphere. Having channel 1 setup with a flat mapping that just breaks the faces apart and the second UV is a contiguous model. The World of Level Design’s tutorial series will cover a lot of the info needed for getting great lightmaps.
Yup, if you import your model with two UV sets it’ll assign the second UV as the lightmap. When you look at this in the mesh viewer/editor you will see the first UV listed as 0 and the second as 1 (this is a zero based list so no worries. it’s still the second UV being used for lightmaps)
One last question sorry Tim haha. Say for instance I have a model with more than one UV set (I have a model with texture UV’s for walls and floors then in another UV set I have UV’s for a metal grate.) I am just wondering how I would work around that if UE4 picks the second UV set all the time for it’s lightmaps would I just simply need to make sure that the second UV set always has the lightmaps on it and the other UV set’s have the textures? If this doesn’t make sense let me know lol.
I will try and supply screenshots when I am home from work (or maby a quick video).
This is a great discussion, guys and it has me thinking about my models - I’ve never used more than 1 UV set before, and normally I do prefer to overlap UV islands since when an object has the same textures mirrored across its middle, it gives you way more texture space to work with when you can lay similar UVs islands on top of each other. I’m glad to see there is an option in UE4 using the methods described above which lets you overlay islands!
The question I have is for the 2nd UV set, does it need to be the same UV size as the first? Or can I for example, have a 2048x2048 uv for ch-0 and say 512x512 or even 256x256 for the lightmapping UVs in ch-1?
I can see myself using basic auto unwrapping tools for the lightmapping UV, which generates a lot of separate islands but at least everything will be separate and not overlapping, and it would be less work for me to generate them!
My only concern at that point would be the quality of the shadows for the object? With say a 256x256 lightmap UV (extreme reduction case) of an object, would I start seeing jagged shadows etc?
Of course then I would just bump up to 512, or 1024, but I’m just wondering if there’s any downsides to doing something like that with the 2nd UV channel?
This would essentially be a mult-material object. Again, I’m not sure how 3D coat handles this as I use 3Ds Max. In Max if I assign a material to specific polygons then those polygons are not affected by any other materials. This means that I can scale and have those UV islands however I want in the same UV as the other parts of the mesh. The mesh will still occupy the UV1 space along with all the different pieces. They do not matter if they overlap because only the materials assigned to those UV islands will be represented for that particular material ID. The second UV will still be the lightmap in this instance. If there is a problem and you have multiple UV sets you can always manually assign the lightmap. It doesn’t have to be the second UV. This is default. You can change this in the Mesh viewer/editor by finding the lightmap coordinate index and changing it to the one it should be. Just remember that it is a zero based list. In UE4 you’re UV 1 will be UV 0.
Awesome Tim. Thanks for the clarification I completely understand now
I use Silo 2 for box modelling simple geometry (like the layout of the levels). You can assign different materials in there to, it took me about 3 days to figure out how to do it but I managed to get the problem solved. Very excited to try out the lightmaps though, from all the help I have received I think I’ve finally managed to nail down my workflow
@WillBellJr, in regards to the resolution of your UV set it’s best to keep the lightmaps between 8 - 128 for resolution, that seems standard anyway. Higher resolution will look nicer but impact memory more. You can have multiple UV set’s at different resolutions as well and this will cause no problem. Each UV set is it’s own unique UV set/channel
The simple answer here is no. The default size in UE4 is 32 for the resolution (ie. 32x32 resolution size). This can be overridden in either the mesh viewer/editor or for individual objects placed in the scene via the details panel. I personally don’t recommend going over 512 for most objects though. Most objects in your scene shouldn’t need a huge lightmap resolution and if you find that you have to keep bumping it up I would look at the objects UVs. They may need to be redone or it may just be a particular part of the mesh that needs to be adjusted for better shadowing. Using the information above from WoLD is, again, a great resource for lightmapping!
My answer from above sorta carries over into this one as well. Using the Flat mapping (3ds Max) or whatever auto-unwrapping process other software may use can be problematic with lightmaps. The goal would be to keep your lightmap resolution as low as possible while having the best light/shadow bake as possible. When using the auto-unwrap it doesn’t take any of this into account and make not have scale pieces or connect pieces that should be in a manner that would produce a good lightmap.
The benefits of having a good lightmap are that you get nice shadows without having to calculate this at run-time. I’ve not done any tests on how much different resolution lightmaps would affect your performance but if the key here is optimization then having a good layout that gets great shadows at a resolution of 128 vs having a bad layout that has to be bumped up to 512 or 1024. If efficiency is the goal this is a good place to start practicing with your workflow!
For the jagged issues. It’s always a good idea to keep straight edges straight for your lightmap UV, otherwise, lower resolutions may show this more prominently depending on UV layout.
Feel free to ask questions. There aren’t any “stupid” questions here as it’s a workflow process and may not be one that everyone is used to!
@WillBellJr. What I have read from the material Tim supplied. The World of Level Designs lightmap tutorial says that it is best to keep your UV islands intact and not cut them where shadows will be in the same direction. If you have a corner or a face of your model that changes direction then it’s good to mark your seams for your UV’s at these points, to separate those UV islands.
By the sounds of it general rule of thumb is, if parts of your models faces don’t change direction don’t mark any seams there. If you have parts of your model that has faces that change direction, then mark your seams at those points.
Another thing here is for good quality shadows and to prevent any ‘jaggies’ then you will want to apply some padding to your UV’s, anything between 2 - 4 px works well. If you are using 3D - Coat for UV’ing then you can change your padding width in the ‘Edit’ toolbar menu and then in ‘Preferences’.
Okay thanks guys, so my take from this is I also have to “care” about the quality of my lightmap UVs, maybe not as much as with UV0, but I can’t just auto-unwrap and forget about them, I sorta need clean layouts and watch my edges as suggested above - drats, double UV work LOL…
As far as jaggies, I was referring to if my UV0 was 2048 and I used 256 for UV1, would I see “blocky” edges in the resultant shadows on the ground due to the smaller size of UV1, but from what I’m reading here, which is actually surprising, is that my UV1 should actually be a max of 128x128, and perhaps even less - wow?
I have 3D-Coat as well, but I’ve been doing most of my modeling in MODO (and I also can’t wait for Blender to come online with better compatibility with UE4), so my UV questions were more about the differences between the UV maps more than the app that generates them.
All this will be theory for me until I get home (at work atm), and actually try (for the 1st time), generating that 2nd map and see how it looks in UE4 - and reading those aforementioned articles as well.
I believe MODO’s Atlas unwrap is based on “angle” so perhaps this will still generate quality UVs for me, without the additional drudgery - will have to experiment…
My models are mostly spaceships and mechanical stuff (so far), so I’m fearful that I’ll may be marking a lot of edges and seams moving forward!
Thanks for the tips and responses to my question - I’m loving UE4, and is especially looking forward to the progress with UMG and Paper 2D!
I’m in the same position as you right now haha. I’m currently stuck at work and cannot wait to get home to try this out also. The lightmaps sound a bit complicated and they need more TLC over your texture maps. I’ve been sloppy with my UV’s for my models so this is an excuse for extra practice and to go back to them and clean them up again
Brofist to Tim though for all his help, really appreciate it. Sometimes the simple things need to be ‘dumbed’ down for us newbies. Knowing how it all works now though after reading up about it, it’s actually really simple! XD