Search Unity

[SOLVED] Shadow on scaled object is stretched along the scaled axes. Bake GI.

Discussion in 'Global Illumination' started by mat9054, Sep 5, 2018.

  1. mat9054

    mat9054

    Joined:
    Nov 14, 2015
    Posts:
    42
    I am using plane as floor and I scale the x or z axes to fit the spaces I need to fill. I noticed when plane doesn't have a x and y scale ratio of 1:1, the shadow on the plane will be stretch along the axes that is most scaled. This result in shadow being blur.

    I was thinking it had to do with asset I was using but I did a test with basic plane and unity-made material and I have the same issue.

    https://imgur.com/a/QyZpsFA

    As you can see in this picture, the plane above as a scale ratio of 1:1, shadow looks good. The plane below as a scale ratio of 10:1 and the shadow looks stretch on the x axes.

    Am I missing something?

    I am using unity 2018.1.5f1.
     
  2. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
    Hey! It is quite common to see some blurring when a camera moves far away enough to force objects into another shadow cascade.

    You might also experience issues with baked shadows when scaling meshes non-uniformly, but that is expected. However, I suspect that in this case you are using realtime shadows, correct?

    I've also tried to reproduce this issue on my end using realtime shadows, but was not able to. See the .gif below for my attempt:

    2018-09-10_14-46-20.gif
     
  3. mat9054

    mat9054

    Joined:
    Nov 14, 2015
    Posts:
    42
    Thank you for your answer, no I am using bake shadow. I had no idea this was expected behavior when using bake shadow. I have change my scene to only use uniform scale.
     
  4. Findus

    Findus

    Joined:
    Jun 23, 2012
    Posts:
    111
    My guess would be that Unity doesn't adjust the initially created lightmap UVs when scaling an object. So what you are seeing is simply lack of resolution in that direction. You could try to reimport the object with adjusted lightmap UVs if that's feasible.
     
  5. HenriSweco

    HenriSweco

    Joined:
    Aug 8, 2016
    Posts:
    28
    If you wish to use basic Unity objects(planes, cubes, spheres), I recommend you download and use the now free(and official Unity plugin) ProBuilder from either the PackageManager(on 2018) or the asset store(below 2018). It has great and simple tools to create and modify simple 3D objects. Automatic UV unwrapping(Editing the mesh will update the UVs and UV2s to match), and a UV editor if you wish to change anything manually.

    Even for just testing I highly recommend using ProBuilder(and ProGrids if you want grid snapping).
     
    mat9054 likes this.