Search Unity

Question Getting fog shader to work correctly in combination with a cell + outline shader

Discussion in 'Shaders' started by Jointy87, Dec 15, 2020.

  1. Jointy87

    Jointy87

    Joined:
    Dec 19, 2019
    Posts:
    21
    Hiya,

    I'm working on a project using orthographic camera. Normal fog options don't seem to work with orthographic cam so I turned to using a fog shader on a plane as per this tutorial: https://www.lmhpoly.com/tutorials/unity-urp-tutorial-orthographic-fog-plane-shader

    That fog shader works fine on the model used in the example scene of that tutorial, which uses urp/lit materials. However, if I add objects from my own project to the scene, the fog plane acts as just that, a plane. See gif:

    FogShader_Error.gif

    There's no fog effect to speak of un my 'pillar'. This pillar is using a 'Stylized Surface with Outline' shader from the 'Flat Kit: Toon Shading and Water' asset pack from the Asset Store:
    https://assetstore.unity.com/packages/vfx/shaders/flat-kit-toon-shading-and-water-143368

    I'm wondering if anybody could have an idea what could be causing this problem? What are possible variables I could tweak to make it work? Because the shader on the pillar comes from a paid asset I doubt I can share that here. The fog shader is free for grabs though, so that I can share:

    upload_2020-12-15_10-46-44.png

    upload_2020-12-15_10-47-4.png

    Interestingly, the FlatKit asset pack also has a Stylized Surface Shader without outline, and somehow, if I give my pillars that shader, the fog DOES work. Unfortunately I really need to use the shader with outline though.

    If anybody has any idea on what I should be looking at to fix this that would be amazing. I'll be frank, I'm very new to shaders, so pretend I'm 5 years old when explaining anything ^^;;

    Thanks and cheers!
     
    taoleaf likes this.