Download

Why do I have hard edges/shadows on my model?

Hey guys,

Quick question. Why am I getting weird shading errors on my model when I have a normal map applied?

Check your smoothing groups inside of your 3d package. You’ll need to rebake your normal map once you fix them.

c576bd514c5b6cb3354c1b49b6dbb27e271fde17.jpeg

be65e08e9e1b4b16bd28923ce4a54e2bd91839a2.jpeg

Smoothing groups are applied. That area you’ve indicated actually looks good in UE4 it’s just the hard edge look the outer edge has. This is the far left UV island on the Normal map which is smooth :confused:

Model in 3DS Max

This looks like a shadow bias problem to me. 6.1 - Shadow Bias | Unreal Engine Documentation

Where would I change the shadow bios for the model? Im using the model viewer currently so I don’t have any custom lights

Note that the issue is barely visible when viewing the model in the level

Well if the smoothing groups are correct, then the problem lies in your normal map projection. You will probably need to rebake your normal map and play around with the distance settings on it until you get rid of those hard creases that I highlighted in the picture. Even when looking at the normal map, you shouldn’t see hard pinches like that; for a rounded surface.

this isn’t a shadow bias (aka. shadow acne) issue.
it’s plain to see because the artifacts match the mesh topology 1:1, as opposed to how shadow acne behaves (which causes lines perpendicular to the light direction, along a surface independently of its topology).
I would describe the symptoms as “the shadowmap pass seems to render objects with faceted polygons”, or maybe more technically as “the shadowmap seems to produce decimal values in relation to the angle of incidence, instead of producing hard values”. I would suspect some soft-shadow smoothing logic to be responsible but that’s just a gut feeling. in any case this is something not present in other engines

in fact some cases show both issues combined together (i.e. in this sphere you can see the faceted-polygon shadows 1:1 with the mesh topology, and then the shadow acne lines in a circular pattern emanating from the bottom left of the sphere)

in your case the problem shows up in the model viewer because that viewer uses dynamic lights and shadows. as soon as you bake your lights in the level the problem is gone because you’re not using dynamic lights and shadows anymore.

AFAIK the issue isn’t properly acknowledged by Epic yet (the one place where I saw an answer by someone from Epic seemed to treat it as a shadow bias problem)
more info here: Dynamic shadows artifacts - Feedback for Unreal Engine team - Unreal Engine Forums

Good to know. Thanks Chosker!

I’m going to have to disagree with you still. Again, look at the normal map texture… It’s a HUGE giveaway. You can very clearly see the faceting inside of the normal map. This means that they projected their normal map wrong; in whatever 3d package they use. I’m sure many other people do the same thing as well. They take a low and a high res models, click “make normal map” and don’t bother checking the settings for it. If the low poly model is too big or too small vs the high poly, you can get get clipping issues JUST like this. Do some research on the math behind how normal maps are made.

http://www.chrisalbeluhn.com/Normal_Map_Tutorial.html
Hit ctrl+F and look for the word cage. It will show one of the ways people can screw up normal maps.

thanks but no need for the basic introduction, I know how normalmaps are baked and the common mistakes done
you found one UV island where the normalmap is actually looking incorrect and base your conclusions after that. if you see the rest of the model’s normalmap looks fine (never mind any seams in the UV islands, just focus on the smooth surfaces), and the fact that baked lighting and dynamic lighting give so different results regarding the issue is quite a big tell don’t you think?
if you cared to read the thread I linked you’d see that the problem goes beyond a simple normalmap baking issue. this happens to meshes without any normalmap and also landscapes
maybe I’m wrong and the problem in that other thread isn’t the same as here (would need to see this mesh without normalmap), but I wouldn’t be so quick to dismiss it

THis is not (!!!) a normal map or Smoothing Group issue! This is a problem of the Renderer!
The Screenshot of the facetted Sphere is made by me and it is taken from the Material Editor (i.e it’s the default Material Preview Mesh)

If it’s such a problem with the renderer, then why have I never had problems with it and why have only a FEW people made mention of it? In a little bit, I will make a quick model with a curve like that, make a normal map, import it into ue4 and snap some shots of it.

Like I said, it’s something you’re doing wrong because it’s working just fine for me…

1f88d5be4968c206f14bf315214ec5d4f5e3a722.jpeg
73a750d5254e1130e0dbdb9679972b0f44501b5d.jpeg



cd4268567ff4a41ef45f7f2873748a8f9b71e637.jpeg
f7d58d8a4bdfcb7b0deed8d23f1f10caf6cc8c27.jpeg

Using your logic:

Why is the shadow problem occuring on a mesh made by epic? more precisely in the Material Editor itself?

Edit:
Ultimate proof it’s not a Material/Normal Problem:

Well regardless of that, the normal map still looked bad. You shouldn’t see that banding on it like I highlighted in red (Unless those are intentionally hard creased surfaces).

What video card and video card driver version are you using? Because if that is still happening, there is a 99% chance it’s related to those and not UE4.

Post the files (high poly too) and we could find out for sure.

It’s not normal map related, it’s based on the mesh topology with dynamic shadows. If you’re baking lighting or using WholeSceneDynamicShadows it shouldn’t be visible(until you start reducing shadow bias, which then you’d introduce shadow acne/banding and notice the geo in some cases). But with Cascaded Shadow Maps, it’s more prominent. You can alleviate it by tweaking the standard bias and sharpness settings for the shadows, adjusting the cascaded shadow map distribution depending on where it occurs, or if performance doesn’t matter, you can reduce the issue by enabling a per-object shadow map for the mesh by checking the “Dynamic Inset Shadow” on the mesh. You can also increase the subdivisions in your modeling package or with PN Triangles and tessellation in the material. :wink:

@IronicParadox in your last shot the mesh is placed in a level, right? what kind of light does it have? try with a dominant directional light (movable) with 3 cascades. or maybe post the mesh and we can find what it is that makes it break

I’m with Radilex_ here, I get the problem with meshes that don’t even have a normalmap (like the default sphere), and also with Landscapes (where of course you can’t make a high-poly bake)

I had this issue when using wings3d to create my models. The issue that I found was smoothing groups. how i fixed it was the top edge looks like you didn’t set the edge to (hard) since you have an edge meeting against the rounded side you should select ANY edge that is not curved such as this edge and make the edge (hard) in smoothing groups BEFORE you render the textures.

as you can see in my image how the rendered texture seems to get all funky when a hard edge dont have a smooting group added to make that edge (hard)…
But dont confuse it with the smoothe tool. TOTALLY DIFFERENT TINGS lol.

how to add hardness to edges in wings3d:

6dcfdc4848a5c20aeeec209a32eff3d5bab06891.png

an example without hard edges on the left side and hard edges on the right side of my house model:

5f8cb57f6938c916fcf51f2f26f9ca1a63e1ede0.jpeg

set these hard edges and try again. and any hard 90 degree angle EDGE needs set as hard also.

Also It looks like your projection method is not good.
Is this the inside of your bowl?

if it is then you need to use a different projection method when unwraping uvs. these edges should be flattened out in your texture/normal maps or it is going to look bad.

Tip: make sure if you are working in quads(4 sided polygons that they are not skewed.

Screenshot_28.png

A plane(quad) that is not flat will cause bad shading:
selected in red you can see its not flat. however sometimes a plane looks flat but had 1 or more vertices not flat…
to fix these types of issues i recommend doing your modeling with quads then converting to tris to test if the shading is improved.

first image shows the (quad) that is not flat
second image shows how i made a (cut) from vertices to vertices so now the top is made of 2 tris not just 1 quad.
hope you find this helpful!


Screenshot_30.png