Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
MichaelSchenck's avatar
MichaelSchenck
Honored Guest
12 years ago

Unity terrain and tree billboards

While working with terrains in Unity I have run into the issue where trees are switched between meshes and billboards differently for each eye sometimes. It is brief but is very noticeable and is worse as you reduce the allowed mesh trees and billboard start distance giving it more opportunity to occur at closer distances.

I have not figured out a way to deal with this other than reducing trees in the scene and increasing mesh trees to keep it from happening. It is much less noticeable at further distances and ratio of eye camera separation and distance probably impacts this. This is of course hard to balance trying to maintain a high frame rate on lower end systems.

Has anyone else out there had this issue and figured out any other ways to fix it. I can imagine that if the rendering part of the terrain system were accessible from code then there may be a way to keep which trees are billboards vs meshes in sync between the two camera views. Perhaps Unity is just not open enough to access things like this or is there some shader magic that can happen?

This is also likely an issue with any other system that uses billboarding like this. Any thoughts out there?

6 Replies

Replies have been turned off for this discussion
  • Don't have my rift yet, but could you avoid using the tree painter and use trees with different LODs instead? - I want my rift now! :?
  • drash's avatar
    drash
    Heroic Explorer
    I know this will seem unrelated, but I had the same sort of problem with the Contrast Stretch image effect - the contrast for the scene would adjust differently for each eye since each eye is not seeing exactly the same thing. Probably not the optimal solution, but I fixed that by simply having the effect in one eye control the contrast of the effect of the other eye.

    Anyway, maybe there is some code you can dig into so you can control the threshold for LOD changes and keep them in sync for both eyes?
  • Just bumping this issue again and wondering if anyone had a solution to Rift + Unity terrain tree billboard issues. The two main issues I see are synced switching between meshes and billboards (perhaps testing from one location) and only doing horizontal billboard orientation (orienting billboards vertically with camera orientation is really wacky in stereo).

    I have started experimenting with the terrain billboard tree shader but it is beyond my basic shader knowledge. I was hoping that someone had solved or at least improved these issues. Spent some time Googling to no avail. Was hoping after a year maybe someone at Unity or a knowledgeable soul could throw us a bone on this. Or I could also be missing something basic here?
  • I have had good success so far with advanced foliage shader

    https://www.assetstore.unity3d.com/#/content/3253

    Im not sure if its going to solve your problem completely, but it does have a smooth transition between billboard and mesh.
    Also a nice plus, the billboard trees will remain vertical and perspectively correct, this will stop the billboards from waving around when you look up and down.

    setup can be tricky as it requires conversion of tree materials etc. but worth it imho
  • Ahh, I did look at AFS but didn't try it yet since it is a big project to go with a whole new system of shaders.

    Since you have had luck with it and the Rift, I will dive in and try it. It also has a number of other features that will be worth the effort to get it setup. Are you working with AFS and the Rift using Unity 4.3.x or 4.2.x?

    BTW, Ambient Flight is a really great project - I have a background in GIS and build digital mapping software as a day job so that kind of a project really intrigues me, keep up the good work!

    Also, if you have not already, check out Nathaniel Doldersum's work at http://www.terraincomposer.com/ He does a lot of work that could be helpful with your project (World Composer).
  • "MichaelSchenck" wrote:
    Ahh, I did look at AFS but didn't try it yet since it is a big project to go with a whole new system of shaders.


    You can bypass the material conversion by replacing the default tree materials with the AFS one, might work in some cases, but if you have done a lot of work on your project already, it would pay to make a copy of it and test it first.

    "MichaelSchenck" wrote:

    Since you have had luck with it and the Rift, I will dive in and try it. It also has a number of other features that will be worth the effort to get it setup. Are you working with AFS and the Rift using Unity 4.3.x or 4.2.x?


    latest unity version, it also has a nice feature of bendable plants, great if you are doing walking games. Doing a test with some dinos, and its nice to see them crashing through ferns.

    "MichaelSchenck" wrote:

    BTW, Ambient Flight is a really great project - I have a background in GIS and build digital mapping software as a day job so that kind of a project really intrigues me, keep up the good work!

    Also, if you have not already, check out Nathaniel Doldersum's work at http://www.terraincomposer.com/ He does a lot of work that could be helpful with your project (World Composer).


    Thanks, yes i have both, and use them here and there, but i had a lot of limitations and have rolled my own solutions to go with these plugins.