Artifacts on certain flat faces, showing up in Unity, and (hardly) visible in blender render : r/blenderhelp Skip to main content

Get the Reddit app

Scan this QR code to download the app now
Or check it out in the app stores
r/blenderhelp icon
r/blenderhelp icon
Go to blenderhelp
r/blenderhelp

For help with Blender problems, also consider visiting https://blenderartists.org/c/support or https://blender.stackexchange.com/


Members Online

Artifacts on certain flat faces, showing up in Unity, and (hardly) visible in blender render

Solved

Hello!

I can't find where this comes from or how to solve this :

r/blenderhelp - Artifacts: In Unity, zoomed in
Artifacts: In Unity, zoomed in

This is what it looks like zoomed out, in Unity :

r/blenderhelp - Artifacts: Entire mesh shown in Unity
Artifacts: Entire mesh shown in Unity

Here is my mesh in Blender:

r/blenderhelp - Artifacts on certain flat faces,   showing up in Unity,   and (hardly) visible in blender render

In Blender, these artefacts are not showing up with the solid viewport shading nor the material preview one, but it can be seen in the rendered viewport shading when looking at a medium-shadowed side AND moving the camera.

When I'm still, it's barely visible;

r/blenderhelp - Artifacts on certain flat faces,   showing up in Unity,   and (hardly) visible in blender render

But I took a screenshot while moving the camera, and it looks like this:

r/blenderhelp - Artifacts on certain flat faces,   showing up in Unity,   and (hardly) visible in blender render

You can see more of how it reacts, with my gifs in the comments below.

What I have tried /more details about the "problematic" faces

I didn't see anything wrong with those faces:

  • Deleting one of the problematic faces, creating another one (fill) don't remove the problem (artifacts are still there), even before setting back the custom normals as I want (see section below)

  • I checked for non-manifold or broken topology, everything looks fine, no double vertices, no ngons, I tryed every [Mesh > Cleanup] menu options to learn them and see if one was adapted to solve my issue: none

  • Tryed recalculate normals

  • All my face orientations are correct

  • The mesh has
    ᅟᅟ- no smoothing group
    ᅟᅟ- no modifier

  • This is not related with the debug material or texture in the blender: the artifacts are showing up even if the cube have no material

More details if needed, about the normals of the mesh

I precise that I use split normals to have custom normals shading.
I drew this schematics if you want to better understand what's going on there (what I wanted and what I did for the mesh):

r/blenderhelp - Normals schematics
Normals schematics

(this way I can have a "hard" shading on the upper border and a "flat" sahding on the lower border, as you can see on the Unity screenshot)

Share
Sort by:
Best
Open comment sort options
u/libcrypto avatar

What does the modifier stack look like?

u/Fransouski avatar

empty:

Comment Image
u/libcrypto avatar

Are there any .blend files you can share that exhibit the problem as in the GIF below?

u/Fransouski avatar
u/libcrypto avatar

I can see the source of the issue, and it's how eevee is calculating shadows cast by the sun lights. If I go to eevee shader config -> shadows and change the cascade size to 4096, the flickering is a lot better. If I go to the properties of sun.002 under shadow -> cascaded shadow map, some of those controls make things a little better. However, there is a fundamental issue with regards to how eevee is calculating shadows from a sun source. Maybe eevee next will be better at it.

More replies
More replies
More replies
More replies
Edited

Those look like aliasing artefacts from realtime-rendering shadows to me. The faces there are small and pinched between adjacent faces so close that the shadowmap resolution doesn't play nice with them.

Turning on "Contact Shadows" might help, in Eevee render settings and/or in Unity.

Comment Image

Exact same setup and viewing angle, but with Contact Shadows on:

Comment Image
More replies
u/Fransouski avatar

Here is a gif of when I rotate physically the mesh in Unity,

u/Fransouski avatar

And one in Blender: (visible only in medium-light)

Notice that the artifacts does not exist on the 4 curved faces of mesh's edges, but only on flat surfaces

More replies
u/Fransouski avatar

Thanks u/libcrypto and u/tiogshi for helping me finding the right track!

Having artifacts in Blender wasn't such a problem as long as it was good looking in Unity, so I focused my researches more on solving shadow issues there than on the mesh itself.

Enabling contact shadows in Unity was not possible for me as I work with the Universal Render Pipeline, and contact shadows are only for High Definition Render Pipeline.
But I rapidly found the solution:

https://youtu.be/ZCpQhpt2k6s?si=fWi53IEx_BmjPVYQ

In the URP renderer asset, in the Shadows section, seting the Normal Bias parameter to 0 removed the artifacts.

u/Fransouski avatar

!solved

u/AutoModerator avatar

You typed "!solved". The flair for this submission has been changed to "Solved".

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

More replies
More replies