r/Unity3D • • 2d ago

Question Strange shadows on mesh when imported to Unity

I have a thin mesh that has strangely behaving shadows when imported to Unity URP 6.3, but looks fine in Blender. I thought it was ambient occlusion, but I turned it off, and it looks the same. I tried playing around with the depth and normal bias in render pipeline asset, with no improvement either. If anyone has encountered the same with a solution, I'd be more than grateful to hear, thanks!

98 Upvotes

37 comments sorted by

118

u/cyangradient 2d ago

check normals

22

u/Creaticality 2d ago

Face orientation is correct, I've recalculated normals and tried resetting vectors. Am I missing something? It's fine in Blender, which makes it harder as all solutions I've looked up has a visible issues already in blender, but very little information regarding fixes within Unity.

18

u/Steki3 2d ago

Check if your mesh has solid faces inside (likely at each edge loop).

9

u/Key_Floo 2d ago

Try marking all the edges as Sharp? In edit mode with edge selection on, select all and right click to mark as sharp. It might help!

4

u/cyangradient 2d ago

Do you write normal data into file when exporting? Do you import that normal data in Unity or do you recalculate? Is the geometry good? Maybe there are interior faces. Also, you can't know if it looks fine in Blender if you haven't enabled any lighting.

26

u/TheHuxwell 2d ago

in unity, mesh's import settings change "Normals" to Calculate from Import and tweak the Smoothing Angle as you like. That is the instant fix within Unity though not as advanced as blender fix. It easily suffices for small objects.

1

u/Creaticality 7h ago

This only let's me smooth out the shading (it does fix some of the weirdness), but I'm going for a flat shaded artstyle, so it's only a temporary fix for now.

3

u/naklow12 2d ago

I think that's the way. I do same whenever I run into this issue.

8

u/shoxicwaste 2d ago

URP lighting settings, Shadow Bias and Normal.

1

u/Creaticality 2d ago

Thought the same, but it didn't change at all. It wasn't ambient occlusion either.

2

u/shoxicwaste 2d ago

Really strange one, have you tried changing shaders/materials?

Theres def something weird up with the normals.

3

u/imlo2 2d ago

Check normals like already suggested, and also check if there's any degenerate geometry like double faces (back and front) welded together, etc. And test also different import settings to see if there's any effect on the model. That might help you to diagnose what's wrong.

2

u/Creaticality 2d ago

Yea, I thought some faces might clip through, but doesn't seem to do that. Tired playing around with the import settings for over an hour, but nothing really changed. It's quite sus. Soon I'll just make it a plane, without any thickness, if it makes it better.

1

u/imlo2 2d ago

When in doubt and I can't figure it out - and issues persist, I usually start to debug it and count the vertices, triangles etc. with code, and crack at it until I find the fault.

But check again lighting and anything that might contribute - disable absolutely everything in post-processing like that AO you mentioned, and check again all lights; load the model to an empty scene, do all the basic isolation tests so that you can see what might affect it.

1

u/Creaticality 7h ago edited 7h ago

Update: Thanks for all the replies! So far best solution has been to simply use smooth shading, that fixes most of the issues.. But it's not really a proper solution as flat shading is the art style I'm going for.

3

u/minimastudios 2d ago

Toggle AO on and off lmk if it’s the issue

2

u/eliormc 1d ago

Export as .OBJ then import into Blender and export again as .FBX

2

u/Cevius 1d ago

Select all vertices, and then weld based on range with a low value, and see if your total vertex count drops. Might have some double ups which can happen with accidental extrude or bevel tool uses. Leads to weird normals and strange lighting sometimes

2

u/destiny20991 1d ago

Looks like smooth shading

1

u/therealnothebees 2d ago

You have internal faces probably.

1

u/survivorr123_ 2d ago

upload the model ill take a look

1

u/blepshark 2d ago

try auto smooth, adjust the modifier till things are as sharp as you would like them to be (easy way of setting sharpness on multiple edges) and see what it looks like in game

1

u/Gradash 2d ago

Look if any attribute is stored. I've already gone through a lot of problems like this and been attributed to something I didn't know.

1

u/thuris4x 2d ago

Ambient occlusion

1

u/les_bloom 2d ago

The colors look inverted to me

1

u/grrrfreak 1d ago

Change "calculate on import" to something like smoothing angle on mesh inport settings.

1

u/Crunchynut007 1d ago

Ngons or normals. Shade flat then shade smooth and add vertices. It’s possible you have a second set of faces overlapping creating ngons.

1

u/Leading-Jaguar-5700 1d ago

on thin meshes from blender into urp shadow banding like this is often caused by paper thin single sided geometry self shadowing across the wall giving it a tiny bit of real thickness solidify in blender or checking normals import vs calculate in the fbx importer usually clears it right up

1

u/Deelook 1d ago

The alternating light/dark segments look like flipped normals from a negative scale. Maybe check the object's scale in the N panel and if any axis is negative, hit Ctrl+A > Apply Scale and re-export.

1

u/Heroshrine 1d ago

Could be a tangent issue

1

u/Valuable-Cap-8005 18h ago

Is your ambient occlusion cranked up in unity?

1

u/MaximilianPs 12h ago

Look like the auto smooth is enabled in mesh import, check the Fbx property

1

u/Agreeable_Emu_5146 11h ago

I had a similiar issue because thickness or in my case the Y component of scale was 0 that cause to mess up the normals calculation

1

u/plearly 2d ago

Looks like interior faces

1

u/Much_Highlight_1309 2d ago

Vertex normals are screwed up