Fade Environment Unity asset

Screenshot_3

Fade Environment package allows you to prevent geometry clipping the camera when the camera gets too close to environment objects. It fades out pixels in shader based on distance to the camera without using transparency. To increase performance fading is done through Dithering algorithm.

Can be used for foliage (Unity Tree for example) or any other kind of objects.

Version 1.1: Added 16×16 bayer matrix to reduce banding artifacts.

Asset store link

Unity Player Demo

17 thoughts on “Fade Environment Unity asset

    1. Ervin Post author

      It’s a shader include file (.cginc) that can be included in surface or in vertex shader. You need just call one method from it. This asset contain examples for both shaders, plus modified shaders for Unity tree, so you don’t need to write your own code for that.

      Reply
  1. jason

    Looks pretty good, one question tho:
    Is it feasible to use this shader for fading out models that are far way from the camera instead of too close to camera?
    If yes, does this shader pack provides parameters for both near and far fade out distances?

    Thanks a lot!

    Reply
    1. Ervin Post author

      Yes, there is ditheringFade method for near fade out and ditheringFadeInverted method for far fade out effect.

      Reply
      1. jason

        Hi Ervin,
        I bought the asset but after importing I got these two error msgs:

        Shader error in ‘Custom/DitheringUnlit’: in ps_2_0 uints can only be used with known-positive values, use int if possible at Assets/Shaders/DitheringFade.cginc(54) (on d3d9)
        Compiling Fragment program

        Shader error in ‘Custom/DitheringDiffuse’: in ps_3_0 uints can only be used with known-positive values, use int if possible at Assets/Shaders/DitheringFade.cginc(54) (on d3d9)
        Compiling Fragment program with DIRECTIONAL SHADOWS_OFF LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF

        Do you know why i’m having these issues? Thanks a lot!

        Reply
        1. Ervin Post author

          Hi Jason,

          These errors won’t breake shader functionality, so it should work as expected. But we will provide a fix to remove these error messages.

          Thanks,
          Ervin.

          Reply
  2. Rick

    Howdy! I just purchased your asset and I think it’s pretty handy! I’m using it for a VR project and I would like to know if there is a way to make it fade in from black instead of turning completely transparent? It would make it terribly simple to look through walls/doors/etc, but I would like to get the same effect (so the player knows they are clipping) but I am more interested in seeing this as a very simple “x-ray” view that doesn’t allow the player to see all the way through the object.

    How can I achieve this? Without this, I can’t really use this asset.

    Thanks!

    Reply
    1. Ervin Post author

      Hi Rick,

      Thank you for your purchase. Yes, it’s possible but it will require some changes that should be done to the package. Send us your invoice number to support@muscipula.com and we will try to provide you modified asset.

      Reply
  3. facy ben book

    can this be used with third person controller i have the issue always that camera enters the my player which shows the interior i need something that when camera is close to the player , the player dispeare

    Reply
    1. Ervin Post author

      Yes, it can be used for fading of a player character. You can take a look at the demo to see how it fades objects.

      Reply
  4. mangax

    hello, i haven’t bought your asset yet, but am eager to buy it once there is mobile version of it!

    also there is something else i want this asset to improve upon. which is to have obstruction/see-through functions.. for example.. this asset is made so objects super close to camera fades away.. but i’d like if there is an obstacle between camera and player, a circular section fades to see player through obstacle…

    Reply
    1. Ervin Post author

      Mobile version of the asset requires a lot of work that should be done, we are working on it. So stay tuned for updates.
      As for implementation of obstruction/see-through function this is something that can be made as additional functionality, we will think about it. Thanks.

      Reply
  5. Anomalous Underdog

    Hi, can this asset be used to fade objects selectively? I want to fade the player character when a conversation in the game starts, not when they clip the camera. Also, my character uses the standard shaders, plus a version of the standard shader that I edited to allow showing 2-sided faces. Will the fade effect work for that?

    Reply
    1. Ervin Post author

      Hi, the fade effect in its current state will not work in the way you have described. It will require a lot of changes to the asset.

      Reply

Leave a Reply