Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Billboarding ignores fog - But ONLY in build

Discussion in 'General Graphics' started by montyjack, Aug 17, 2021.

  1. montyjack

    montyjack

    Joined:
    Jan 10, 2014
    Posts:
    43
    I have an underwater sequence with lots of seaweed "trees." In the editor, they disappear into the fog just as expected. However, once I build the game, the billboarded seaweed appears in front of the fog, appearing to glow in the dark. It looks cool, but it's not what I'm aiming for. Any idea why the billboard shader would behave differently in the build versus in the editor? It's like it's using cut-out in the editor, but translucent in the build. See below. The bottom image is as it's supposed to look.

    upload_2021-8-17_7-21-14.png
     
  2. montyjack

    montyjack

    Joined:
    Jan 10, 2014
    Posts:
    43
    Trying to fix this issue I added LODGroups to the seaweed to cull them before they billboarded. I found that my FPS drops from 80 to 3. Profiling revealed that the game was spending 300ms per frame on "culling." This only happens when LODGroups are present on the trees, and the trees do otherwise display normally. Speedtrees, which have LODGroups, are not an issue; only custom meshes.

    Any idea why this would happen? It's the opposite of what a LODgroup should do.