Download

Shading issues with Blender made static meshes

I’m trying to import a trench from a Blender made FBX.

Here in this pic you can see those weird shadows that appear on the sandbags and below the wooden planks after building the lighting.
Screenshot 2017-01-27 23.10.39.png
I’ve placed this in a blank project on the starter content level.

I stumbled upon several threads talking about light maps so I checked mine. I let UE4 generate them, and it seems pretty fine, no overlappings, nothing.
My light map UVs:
Screenshot 2017-01-27 23.13.35.png

The mesh itself is made from several objects. The sandbags are all disconnected from each other, so there’s much clipping going on here. At first I thought that might be an issue, but then I checked the models from the StrategyGame demo (specifically the Brewery, because it’s the most complex) and they didn’t care about clipping meshes either, so I don’t think that’s the problem here.

My diffuse UVs are rather messy (in terms of overlapping, I guess they are unwrapped well enough however). Might that be an issue, or does shading only care about light map UVs?

Please let me know if you have any ideas!
Thanks in advance!

Is there noone who could help?

Hey LordStuff,

Looks like you may need to bump up the lightmap resolution. Try 128 or 256 and see if that changes the look. Ideally you would want to have the sandbags as a separate mesh so you can take advantage of more lightmap uv space. But if that isn’t a possibility for your project, an increase in the resolution should resolve the issue.

I’ve tried playing with the lightmap resolution, put it up even to 512, but it only helped a little bit, it just made the shadows a bit smaller.

EDIT: here a picture with lightmap resolution set to 256 (like it is for the Brewery you see below)
Screenshot 2017-01-31 22.41.24.png

The funny thing is that it actually looks totally fine in the object preview (as you can see above in the original post) but the spots only appear when building.

Setting the shading to smooth and filling up the mesh of the ground helped a bit, but the issues still appear, mainly on the sandbags.

I also tried making them a bit more low poly, which showed that only those faces of a sandbags get dark, that actually intersect with other sandbags… Why would that be a problem when intersecting static objects work so well in the Strategy Game demo?

Screenshot 2017-01-31 21.47.06.png

Any other advice?

Also: Setting the shading to stationary completely negates the issues, but I somehow want to leave this static and find the mistake I made…

Intersections in strategy game here:

Screenshot 2017-01-31 21.33.05.png
Screenshot 2017-01-31 21.32.54.png

EDIT:
As I recognized that in the Strategy Game demo they used custom lightmaps instead of UE4 generated ones, I tried doing that too, but that only made it worse…

EDIT 2:
I stumbled across shadow bleeding, it somehow looks like that’s what’s happening, but why would it only happen to my mesh.
I also downloaded a free sandbag model, it has about the same poly count and the sandbags are, like mine, seperate objects without any holes, intersecting each other, but it doesn’t generate any weird shadows…
Screenshot 2017-01-31 23.06.13.png

Are your shadows at the highest quality(epic)?

They are, I run everything on epic.

Also that couldn’t have been the problem anyways, because in the same project, I have one mesh that has this shading issue, and another one next to it that doesn’t. I checked all settings I could think about, but maybe it’s just a problem with what I did or didn’t do within Blender…

Does it change if you choose “built in” or “import Tangengs&Normals” (if you ticked the tangents flag at export) instead of “MikkTSpace Tangent” at import?

How are the bags themselves unwrapped? It’s hard to tell from a zoomed out combined UV map.

I’m going to try it later.

EDIT:
I checked it just now, doesn’t change anything, sadly.

Each side has its own island, basically like a cube every bag is unwrapped to 6 sides… The UVs in the OP aren’t up to date anymore, I can upload an updated an clearer screenshot later.

EDIT:
Okay so in my new “low poly” version, they are split up into 4 parts. Top, bottom, left+front, right+back. There shouldn’t be much of a problem with my UVs, I think… Except that they’re a bit small, is there anything I can do in Blender that makes my textures render bigger in UE4? I don’t really want to work with texture coordinates, I’d like to somehow standardize my UV sizes…
Screenshot 2017-02-01 16.32.36.png

I’m just thinking what could I’ve possibly done wrong, is there anything I need to do except modelling it, unwrapping it, putting materials on it, exporting it, importing it and setting a higher light map resolution?

Does noone have an idea what could be wrong with this model?

The problem is that this is completely blocking me from continuing with my project, because I don’t know if I have to change how I work…

If someone suggested that you split the single mesh up they meant into their own meshes that are imported as separate objects. Each of these should have their lightmap UV repacked to use the 0,1 space efficiently. The sandbags in particular need to have their UVs pelt mapped with no split edges for the best bake results. You can find this setup as example in the Lightmapping documentation for UE4. By breaking these up into their own static meshes you get better density for an efficiently packed UV for the sandbags than you would as having them part of a larger mesh and using much less UV space. Also, by pelt mapping the sandbags you get smooth light bake vs the hard edge artifacts and shading differences.

With some better planning on how to break apart the mesh for separate static meshes and repacking the UVs I think you can fix the issues you’re running into here.

Curious, can you show the UV’s of the other sandbag model?

Thanks for answering!

So you mean I should try to import every sandbag on its own and combine them into one Unreal blueprint? Because that would mean a lot of work (there are about 30 sandbags + about 30 wooden bars) while the other meshes I mentioned (demo Brewery and other sandbag model referenced in this thread) are imported as a single mesh and do not cause any issues… :frowning:

I guess it could be a way of dealing with this problem, but I somehow think that would affect my working efficiency immensely… I mean… if I wanted to import other rather complex objects like a tank or some other machinery, I’d have to export and import every single bit seperately… is that really how people work?

I’m not familiar with pelt mapping, so I’m going to take a closer look at that first!

I’ve also heard about light map issues that occur if you don’t align your UVs to a certain grid, because the engine somehow tries to fill up unused pixels with black, and that might cause issues on the edges. Could this be what is causing my artifacts here? Then again, the videos I watched only used wooden boxes, how should I align something that is round (or at least not rectangular) to a grid?

Here’s a picture of the other sandbag model I talked about. I selected some random bags to demonstrate that they are indeed seperate meshes and also intersecting to some degree. They are all in one “object”, but seperate shapes, as are my sandbags.
Screenshot 2017-02-05 18.19.53.png
UVs:
Screenshot 2017-02-05 18.20.14.png
Not very special, I think… Maybe it’s just my inexperienced opinion, but I don’t see any real differences to my mesh :S

Well I took a closer look at how the demo meshes were made by exporting them into Blender, and while they are well done in terms of design, most of them are actually pretty messy, with many intersections, “open” volumes, and even totally unused vertices somewhere in the middle of the model (like the mannequin, which has vertices that don’t even form tris in the head and limb joints)… however, they still perform really good, nothing of that “mess” is actually visible or noticeable in Unreal, and I guess it shouldn’t really make a difference nowadays… I mean… do those few intersection still affect performance that much?

I made this mesh in about an hour, using the array modifier of blender, duplicating a prefab sandbag. After applying it, I repeatedly selected random sandbags, moved or scaled them a little bit to create variation. Then I only tweaked some of them to remove gaps between them. The wooden bars were made with arrays and mirrors too… So you can’t really say that this is a waste of artist time. I’d even say that making this of a single volume takes much more artist time, at least for my way of working… If you first work out a basic form, every detail you want to add in later is a real hassle if you want it to be connected, while it’s really easy to simply add a new volume and use intersections… many meshes I inspected had all the smaller details like nails or rivets as a seperate volume :S

The meshes would have much more tris too. If you wanted a circular tube to evenly transition into a rectangular block (like a lantern in a concrete base or a gun barrel in a weapon stock) you’d need to add one tri for every vertex of the base circle, instead of just 2 tris for the rectangular surface… And combining those volumes generates more work for the artist (me) too :S

I’m totally new to working with light maps, so I can’t really tell what I’d have to do here… Are the light maps generated by Unreal really that bad? How would I improve them if I tried to make them myself? How would a decent light map look like?

Thanks for helping though, I’m eager to improve my skills!

EDIT: last night I tried combining the meshes using the boolean modifier… it was all one mesh, but the shading didn’t improve noticeably… it had about 20% more tris and double the vertices…
proof:
Screenshot 2017-02-05 21.16.45.png
Please don’t get mad at me, but I’m rather lazy, and I don’t want to spend too much time on making secondary static meshes, I just want the shading to be… acceptable ó.0 … So if you have advice for quickly modelling out something like this, I’d be really glad. I’m just totally getting lost in details, and this is keeping me from working out the basics of my game in Unreal, because I can’t even import a simple static mesh :frowning:

Please don’t get me wrong, I don’t want to prove you wrong or anything, I just don’t think that the intersections are what’s causing the problems. And somehow I think modeling everything into one mesh is not state of the art anymore…

Here are some meshes I exported from the Shooter Game, Strategy Game and Content examples projects. There are intersections everywhere… Some vertices are plain useless, some only form planes and surfaces… The Sedan mesh that I exported from the Vehicle Demo project had 20048 double vertices! EDIT: all the selected parts are selected via ctrl+L which is “select all linked” so all those parts are seperate volumes… I marked the most obvious intersections
ee67239757a7361c7192c8482550e789746f2c47.png
Screenshot 2017-02-05 22.14.48.png
Screenshot 2017-02-05 22.15.42.png
Screenshot 2017-02-05 22.17.44.png

When reimporting said meshes as static meshes into my own project, however, after rebuilding the lighting, the shading works just fine… even without increasing their lightmap resolution!
Screenshot 2017-02-05 22.32.54.png

Sorry for the low resolution screenshots and different pic sizes, the forum wont let me upload anything larger than ~500kb…

As I said, I reimported the exported meshes the same way I imported my own meshes, as static-static meshes. Still they perform far better, even without increasing light map resolution. Also increasing the resolution for my mesh had little effect.

However, I’m going to try and remodel it to be a single mesh. I haven’t got any spare time today, but I’ll take a look at it asap…

But I guess I now understand how light map bleeding actually is causing that issue… So thanks for that at, really!

Now I only need to use my new knowledge to get it to work… :S

EDIT: Why are Chariots’ posts gone? They could’ve been helpful for others who might read this thread ._.

I can’t seem to get this to work without overcoming my laziness…

I tried using a Boolean modifier to add the bags up to one piece. Then I used a Remesh modifier to beautify it a little bit. After that, I just remodeled some weird outputs, nothing significant…

I then smart unwrapped it to get a test base. I used this new mesh as some sort of “low poly” and baked the normals of my old bags to it. The outcome looked magnificent (thinking about the time it took to make it…)

When I importing it into UE4, adding the normal and diffuse maps, setting the lightmap resolution to 256, rebuilding, boom - shading still sucks…

Though there are no intersections at all (it’s all one object now), the model consist of very regular sized squares, and the UVs are made of bigger islands rather than many small ones… it still doesn’t look much better after rebuilding…

Looks fine in Blender (I know, it’s not perfect, but I want to get it to work at least a little bit :'C )

Screenshot 2017-02-09 22.12.02.png

Again, very ugly in UE4, with shading fragments all over the place… by now, it’s not the dark parts that look weird, it’s more about the light flashy parts when it actually should be shadowed…

Screenshot 2017-02-10 21.46.04.png

UVs (smart UV project, so no custom seams or anything, I did this so I don’t end up with tons of UV islands):

Screenshot 2017-02-10 21.59.50.png

I guess I really have to do the unwrapping myself, but I really suck at this…

I also tried to inform myself about pelt mapping, but as far as I know, this doesn’t exist in Blender? My budget is rather limited… to 0.00… I’m just doing this as a hobby, so I can’t / don’t want to afford any high end products like 3DS.

So basically… if I got that right… my problem is the high number of UV islands that keep bleeding on each other? Increasing the resolution helps to some point, but doesn’t help enough here… How the hell should I unwrap this by hand in order to get the lightmap done right??