Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

decrease the quality when the player isn't near to the models

Discussion in 'Editor & General Support' started by skullred, Aug 14, 2014.

  1. skullred

    skullred

    Joined:
    Dec 24, 2012
    Posts:
    49
    I'm creating maps larger and start to have performance issues and this problem may also arise in a variety of users who will be playing my game.
    I would like to be that when the player is far from a 3D model (or an entire zone) then the model loses quality (texture) or it disappears and does not load as long as the player does not come close again to that model.
    A bit the same method that is kept here in modern video games.
    How can I accomplish this? there is already a script pre-filled?
     
  2. Graham-Dunnett

    Graham-Dunnett

    Unity Technologies

    Joined:
    Jun 2, 2009
    Posts:
    4,287
  3. skullred

    skullred

    Joined:
    Dec 24, 2012
    Posts:
    49
  4. Graham-Dunnett

    Graham-Dunnett

    Unity Technologies

    Joined:
    Jun 2, 2009
    Posts:
    4,287
  5. skullred

    skullred

    Joined:
    Dec 24, 2012
    Posts:
    49
    instead as regards the textures?
    I wish that when the model is far away, it remains the same (already in low poly) but the texture quality decreases.
    Is possible to achieve this with the same method?
     
  6. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,398
    That already happens automatically because of mipmapping.

    --Eric
     
  7. skullred

    skullred

    Joined:
    Dec 24, 2012
    Posts:
    49
    I do not think I fully understand the operation ....
    If active "generate Mip map - In line space and border Mip Map" does not change anything.
    The texture changes of quality only if active "fadeout mip map" but in this case the texture becomes completely gray and not very aesthetic ....
    I something wrong?
     
  8. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,398
    All you need is to have mipmaps active for the texture. Then it automatically uses progressively lower quality versions of the texture as the object gets farther away from the camera. It shouldn't be particularly noticeable in most cases, though it's more obvious with some textures than others. If you use trilinear filtering then it blends between mipmap levels, which makes the mipmap transitions much smoother, though trilinear is naturally more expensive than bilinear.

    --Eric