Search Unity

Plane loses shape on Camera zoom out

Discussion in 'General Graphics' started by adrgra2001, Aug 26, 2021.

  1. adrgra2001

    adrgra2001

    Joined:
    Oct 24, 2020
    Posts:
    4
    Hey there, im creating a game where the user is able to zoom in and out by adjusting the field of view of the camera. Now I got the problem that at some point my water plane just looses its shape, when the field of view is too high. Why is that so and what is a way to work around that?
     

    Attached Files:

  2. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,639
    THe depth buffer is logarithmic. I'm guessing when you pull the camera back a large distance, the water and ground become (relatively) so close together that the camera can't reliably tell which one is in front of the other.

    What are the near/far clip distances on your camera?
     
  3. adrgra2001

    adrgra2001

    Joined:
    Oct 24, 2020
    Posts:
    4
    That would make sense. My near clip distance is 0.1 and my far clip distance is 1000
     
  4. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,639
    Since you're dealing with such a large scale, it might help to change your near clipping to something higher like 1. That will give you some more granularity. If that doesn't work, try even higher.

    If you can't find a good all-around set of values, remember that you could write a script to change the near and far values when you zoom in and out.
     
  5. adrgra2001

    adrgra2001

    Joined:
    Oct 24, 2020
    Posts:
    4
    Thank you. I notice that when I build the project its much better, so I will be able to work with that. However now there's a weird circle that moves with the camera and seems to render the tress differently. Im using the terrain tress feature to create the trees. Do you have any idea where this circle might come from?
     

    Attached Files:

  6. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,639
    I can't really tell what's going on in that screen shot.

    I don't know all of the ins and outs of Unity's terrain trees, but they have some sort of built-in LOD system to render differently at different distances, including completely replacing the tree with 2-D billboard. That could have something to do with it. I don't think the trees were designed with this type of long aerial view in mind.
     
  7. adrgra2001

    adrgra2001

    Joined:
    Oct 24, 2020
    Posts:
    4
    Youre right, it was an issue with the tree prefab not having an LOD Group. After using other trees the issue is gone. Thanks a lot for all your replies