Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Blender to Unity - cracked shadows

Discussion in 'Asset Importing & Exporting' started by chillicheese, Jul 1, 2015.

  1. chillicheese

    chillicheese

    Joined:
    Feb 22, 2015
    Posts:
    8
    I got a problem exporting my Blender objects to Unity. The objects itself are looking fine, but the shadows got many cracks in it.

    If I choosing smoth faces shader in blender and then export it to Unity the shadows also looking fine, but I prefer the flat faces shader to get the low poly style.

    I tried using fbx export and also using the blender file directly. Please see the attachted screenshot. Help are really appreciate, because after hours of googling and don't find anything about it - this post is my last hope ;)

    thanks
     

    Attached Files:

    Ignacii likes this.
  2. JacksonML

    JacksonML

    Joined:
    Jun 3, 2015
    Posts:
    2
    Would you mind sharing your .blend file? I'll happily take a look at it and see if I can fix it! :)
     
  3. chillicheese

    chillicheese

    Joined:
    Feb 22, 2015
    Posts:
    8
    sure, attachted you'll find a zip file containing the .blend file and also a sample of a .fbx export .. tnx
     

    Attached Files:

  4. JacksonML

    JacksonML

    Joined:
    Jun 3, 2015
    Posts:
    2
    I was able to get rid of the strange shadow in unity by switching the shadow casting type from "On" to "Two Sided", however this probably isn't the optimal solution as meshes shouldn't normally do this. I'll continue to look, but here is a temporary solution.
     
  5. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    I just had a look at your model and had no issue to get stable results.

    There are a few things you need to consider regarding shadows. The camera's near and far clip planes have a huge impact on the shadow quality. If you make the near clip very small or the far clip plane extremely high, you get weaker results and more artifacts.
    Besides that, the directional light's shadow settings certainly have an effect. You have to consider both, the bias and normal bias. I have set the normal bias to 0.0 and the bias to 0.1 and got stable results for the shadows like that.
     
    Ignacii likes this.
  6. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    'Cracked' shadows are the normal bias setting on the light. Setting it to 0 would resolve the problem. Part of the problem is that the shader for rendering shadows with normal bias only has vertex information to work with, so when you pass it a model with split verts, they can move away from each other along their normals, which causes the issue you can see. To solve it, weld your model and retain hard edges via normal maps.

    The reason for having a normal bias to begin with is so that you can reduce artefacts with shadow rendering. In this case, you're best off fixing the geometry or lowering the bias.
     
    kalibcrone and Circool like this.
  7. chillicheese

    chillicheese

    Joined:
    Feb 22, 2015
    Posts:
    8
    I'll give it a try, thank you all