Search Unity

Fade meshes with camera distance

Discussion in 'General Graphics' started by jeijei, Jul 1, 2018.

  1. jeijei

    jeijei

    Joined:
    Aug 31, 2014
    Posts:
    30
    I have an open world system where adjacent scenes are loaded/unloaded, but my issue with that is that the meshes simply pop out of nowhere
    The fog in the lighting settings doesn't really help if there isn't anything behind the newly loaded scenes, since the fog just suddenly appears where the new meshes are
    The ideal option would be to have objects change their alpha to 0 if they're far enough
    However the fog color alpha does nothing
    I tried making a transparent shader that does that and it worked, but then it doesn't receive shadows, even if the alpha is at 1
    I thought a custom image effect might work, but the syntax there is even more confusing
    What other option do i have?
     
  2. Yuvii

    Yuvii

    Joined:
    May 20, 2014
    Posts:
    55
    Hey,

    Maybe you could use LODs ? So your object won't even have to disappear, they'll just lower their mesh quality when the mesh is far from the camera. It will eventually be culled (disappear) when it's to far to render.
    I think it can a good alternative solution for your issue.

    Cheers