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. Let us know your feedback about the Global Illumination changes in the 2023.2 beta.
    Dismiss Notice
  3. Dismiss Notice

Weird batching of billboards on unity terrain

Discussion in 'Unity 5 Pre-order Beta' started by camel82106, Nov 12, 2014.

  1. camel82106

    camel82106

    Joined:
    Jul 2, 2013
    Posts:
    304
    Hello,
    I have created an scene with unity terrain and 10000 conifer speedtrees on it.

    I have change deleted all lods of conifer trees except billboard lod. So only billboards are drawn.
    I have disabled terrain drawing to get only clear results of drawing trees.

    I get these results if I set lod group so, that only lod0 (billboards) is drawn. And nothing is culled.
    Than I get these draw calls:
    draw calls 112
    saved by batching 4031
    That looks nice.

    But if I change lod group settings of tree and I set culling for example only to 1%. (so lod0 billboard is 99% and 1% is culled) Than I get this result:
    draw calls 3804
    saved by batching 339

    Simple conclusion is if I set some culling on lod group. Most of batching is gone. And than I get an big performance hit with bigger number of trees.

    Is it correct behaviour?

    Scene settings:
    deffered
    linear color space
    1 real time directional light
    real time sky

    Regards
    Peter
     
    Last edited: Nov 12, 2014
  2. camel82106

    camel82106

    Joined:
    Jul 2, 2013
    Posts:
    304
    I have tried an workaround will seting of camera layer culling distance.

    But it looks that unity ignores layer of tree set on it. And it works only if I set culling distance for layer that is set on terrain. So it looks like tree is geting an layer from parent terrain.

    But than it's culled of course whole terrain.
     
  3. zeroyao

    zeroyao

    Unity Technologies

    Joined:
    Mar 28, 2013
    Posts:
    169
    Hi camel82106,

    I'd guess you enabled LOD fading for the billboards (since it's on by default). Billboards with different fading value (evaluated mostly from distance to camera) will not batched. I'd suggest in this case tune down the fade "width" value for billboards.

    For the tree layer yes currently they are with terrain always. I think it makes sense to just use the layer setting on the tree prefab. Please file a bug to me.

    Cheers,
    Yao
     
  4. camel82106

    camel82106

    Joined:
    Jul 2, 2013
    Posts:
    304
    Hello,
    You are complete right. After playing with fading width or just disabling it. Batching was working nicely.
    Thanks You very much. I'm new to unity terrain so I wouldn't have it found for long time :)
    And it makes sense perfectly.

    I have reported a bug with tree layer override. If I get email about bug number I will post it here.
    Regards
    Peter
     
  5. camel82106

    camel82106

    Joined:
    Jul 2, 2013
    Posts:
    304