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. Dismiss Notice

Looking for a better shader for this model

Discussion in 'General Graphics' started by ODINKONG, Aug 23, 2021.

  1. ODINKONG

    ODINKONG

    Joined:
    Nov 4, 2014
    Posts:
    111
    Hi, first off I'm using Unity standard render pipeline (unity 2019.4). We have an effect we really like on this model in blender, but in unity the standard shader totally kills it. I'm wondering if anyone has suggestions that could help us achieve a similar look as the one in blender with the more defined metal ridges.

    This is the same model and there are no textures on it. The lighting is just behaving very differently in unity. This effect is achieved with weight painting.

    Blender



    Unity
     

    Attached Files:

  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,236
    Metal materials get most of its "look" from what it's reflecting. Blender appears to be reflecting some kind of clouds, where as Unity is using the default skybox. Presumably you have some kind of HDR environment texture in Blender. If you import that texture into Unity and use it as the skybox, Unity should look fairly similar.
     
    ODINKONG likes this.
  3. ODINKONG

    ODINKONG

    Joined:
    Nov 4, 2014
    Posts:
    111
    I'm not really as concerned about the color as the lack of drop shadows in the ridges.
    I've noticed that it has something to do with shadow bias, but I have it set to 0. The cannon looks better at a large scale but I need it to be 1 scale not 10 scale.

    Here is the cannon in unity at 1,1,1
    upload_2021-8-23_18-31-29.png

    Here it is at 10,10,10
    upload_2021-8-23_18-32-41.png
     
  4. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,236
    Seems like it's a combination of shadow bias and shadow resolution. You'll want to make sure your shadow resolution is set to high or very high, and play with the shadow distance and split ratios in the quality settings to focus the effective shadow resolution on the areas closer to the camera.

    Generally you don't want a shadow bias / normal bias of 0.0 as you'll get shadow acne artifacts. But you do want them as low as you can get them. The problem is how low you can set them depends on the content / scene / lighting / personal annoyance with different artifacts. There's no one perfect setting. Shadow mapping is a collection of "good enoughs" that hopefully get you something that looks like shadows.
     
    ODINKONG likes this.
  5. ODINKONG

    ODINKONG

    Joined:
    Nov 4, 2014
    Posts:
    111
    Thanks for the help I ended up with a shadow Bias of 0.034 and the shadows seem to look fine in the rest of the scene. Still doesn't look as good as it did in blender but I managed to get it to look like this at the proper scale in game.
    upload_2021-8-23_20-3-48.png
     
  6. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,355
    Do you have an ambient occlusion map? It's really easy to bake one in Blender.
     
    Tartiflette likes this.