Search Unity

How to remove the white outline around objects with standard shader??

Discussion in 'Shaders' started by tmr2, Nov 15, 2019.

  1. tmr2

    tmr2

    Joined:
    Oct 27, 2019
    Posts:
    53
    Hi, I need help modifying the standard shader and would like to know what is the white outline around objects is referred to as, because there is no way to disable it within the editor. Basically ,what is left after you disable the both specular highlights and reflections on a smooth object??


     
    Last edited: Nov 15, 2019
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,342
    That's the fresnel specular reflection. It's an inherent part of the physically based shading model Unity is using. Its color is normally determined by the reflection probe being used, either the default scene probe (which is the skybox), or placed reflection probe objects. When you disable reflections it uses the ambient light color.

    If you don't want that, use a legacy diffuse shader.
     
    tmr2 likes this.
  3. tmr2

    tmr2

    Joined:
    Oct 27, 2019
    Posts:
    53
    Thanks. I tried using the legacy shaders, but then the objects have no self-shadowing at all from spotlights (directional lights work fine, which is why I wanted to use the standard shader.Are sure there's no way to disable the fresnel??



    In case you're wondering why, I'm working on a game that supposed to have a graphical style similar to ray-traced point and click adventure games from the early 1990s (like Myst).
    There's even an old renderer in Blender called "POV Ray" (which was used a lot back then, that I'm using to test render my scenes(for accuracy), before importing/recreating them in Unity. I'm hoping to use RTX in Unity when it gets animated mesh support, because I was really impressed by the Quake II RTX demo Nvidia made.


    A few pictures for reference (the kind of style I'm trying to emulate):







     
  4. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    try to set the specular color to black.
     
  5. tmr2

    tmr2

    Joined:
    Oct 27, 2019
    Posts:
    53
    I think you're misunderstanding. I would like for it to be a smooth object- with reflections and specular highlights , but no fresnel.
     
  6. jRocket

    jRocket

    Joined:
    Jul 12, 2012
    Posts:
    700
    In the Lighting Settings, you can change the reflection source to custom instead of skybox. Then you should no longer be getting any of those edge reflections. In the same settings, you can also change ambient lighting, ideally something super harsh like those old cg renders before they invented ambient lighting.
     
    TextusGames and tmr2 like this.
  7. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,342
    The built in legacy specular shader is definitely what you want to mimic that look, but yeah, the built in ones no longer support shadows from point or spot lights.

    You’ll need to make a custom shader to support that. You can make a copy of the Legacy/Specular shader and make a small modification:
    https://github.com/TwoTailsGames/Un...er/DefaultResourcesExtra/Normal-Glossy.shader
    Take that shader and add
    fullforwardshadows
    to the end of the
    #pragma surface
    line.
     
    tmr2 likes this.
  8. tmr2

    tmr2

    Joined:
    Oct 27, 2019
    Posts:
    53
    Ok, I will try this. Thanks!
     
  9. TextusGames

    TextusGames

    Joined:
    Dec 8, 2016
    Posts:
    429
    In order to remove unwanted default Fresnel effect.
    In 2020.1, URP.

    You can:
    1. Change environmental reflection intensity multiplier to 0 or something tiny in lightning(environment) settings.
    2. Change environmental reflection source to custom and not set cubemap.
    3. Disable environmental reflection in advanced settings of standard lit material (in order to possibly increase performance)

    upload_2020-8-3_13-21-18.png upload_2020-8-3_13-21-53.png
     
    Last edited: Aug 3, 2020
    MP-ul likes this.
  10. MP-ul

    MP-ul

    Joined:
    Jan 25, 2014
    Posts:
    230
    upload_2021-11-4_2-21-56.png
    Changing this works better