Announcement

Collapse
No announcement yet.

Questions about SpeedTree in Unity - batching, lightmapping, SSAO artifacts, etc

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Questions about SpeedTree in Unity - batching, lightmapping, SSAO artifacts, etc

    I have searched around, looked in the Unity 5 Beta 12 docs, etc. Having troubles finding anything along the lines of a QuickStart for SpeedTree in Unity. I have a few questions about best practices, etc.

    General Tips for Usage in Unity
    • Static batching? I have noticed that when I mark a speedtree as Static, the branch intersection multitexture blending looks weird. I'm not sure if this is due to a bug in the beta, or if this is because I marked the tree as Static? Can SpeedTrees be marked as Static? I really hope so, seeing as they should have a pretty significant effect on global illumination.
    • Dynamic batching is disabled when there is Wind affecting the trees? Is this true?
    • Overall, I was hoping someone could lead me in the right direction as far as usage and optimization in Unity. What options do I have, what are the important performance decisions to make, whether trees should be Static, how wind affects batching, etc.


    Lightmapping - I read static lightmapping is currently unavailable for SpeedTrees in Unity 5, but the feature is planned - is this going to be a 5.0 feature, or 5.x?


    SRT file - I read in the documentation the SRT file is supposedly the Runtime file that you import to Unity. However the modeler exports SPMs, and unity seems to import the SPMs. Just kind of confused, it seems like the documentation is incorrect? Do I need to concern myself with the SRT file at all?

    Ambient Occlusion
    • Do the trees sold in the SpeedTree store have AO baked into them?
    • Do speedtrees generally have AO baked into them, or if you are using dynamic lighting and screen space ambient occlusion is the baked AO unnecessary?
    • I have noticed that SSAO doesn't play well with SpeedTrees... for example in this image I tweaked the SSAO a bit, but it's still got artifacts on the leaves. (EDIT - this was due to Forward rendering path, it seems to work in Deferred)


    PBR / realistic shading
    Unity 5 is using physically based shading for their new standard shader. I see speedtree models only have Diffuse, Normals, and specular for the leaves. What type of lighting model does the speedtree shader use? Are speedtrees going to look completely out of place if the rest of my game is using physically based shading?


    thanks!
    Last edited by philwinkel; 11-11-2014, 04:42 PM. Reason: update regarding the AO artifacts, it was in forward rendering mode

  • #2
    Hello,

    Unfortunately, I can't speak to all your questions. Some of the engine-specific ones should go to Unity, either on their forum or beta group. But I'll try to address the ones I can.


    General Tips for Usage in Unity
    I can speak to questions you have on optimizing an individual tree, if you have them. Also, if you're going to have a lot of trees, painting them on the terrain will give you batched billboards in the distance. So you can have many many more trees on the screen than otherwise using individual objects.

    the branch intersection multitexture blending looks weird
    I haven't seen this. I will log to look into it.


    I read static lightmapping is currently unavailable for SpeedTrees in Unity 5, but the feature is planned - is this going to be a 5.0 feature, or 5.x?
    That would be a question for Unity.


    Do I need to concern myself with the SRT file at all?
    No. the Unity-specific SpeedTree tools embed the runtime data into the SPM file. So you don't have to have a separate SRT file.


    Do the trees sold in the SpeedTree store have AO baked into them?
    Yes

    Do speedtrees generally have AO baked into them
    Yes, though you don't have to. You compute a per-vertex AO value inside the Modeler (in the tools menu, or by hitting 'O'), which is saved with the tree. This value is currently used on the SpeedTree shaders in Unity, but you could decide to not use it.


    I have noticed that SSAO doesn't play well with SpeedTrees
    SSAO doesn't work well with anything that has lots of intersecting planes, SpeedTree or otherwise. I would recommend to not use it on trees or other foliage, though it would probably work well on branches.


    PBR / realistic shading
    The SpeedTree shader is a surface shader, so it should fit into the scene's lighting fine. Unless I am wrong, it should work ok with PBR. Most of our trees come with diffuse maps that should be pretty close to albedo (we're working on getting them better suited for PBR), but you could go nuts and create roughness maps and stuff, too.

    Comment


    • #3
      Originally posted by Greg Croft View Post
      if you're going to have a lot of trees, painting them on the terrain will give you batched billboards in the distance. So you can have many many more trees on the screen than otherwise using individual objects.
      So the terrain system batches the billboards? And if you use speedtrees that are not "painted" onto a terrain object, it will not batch billboards?

      Comment


      • #4
        Here is a screenshot of the issue I am experiencing when I set a SpeedTree to static - the branch intersection multitexturing doesn't seem to work if it's static.

        Both in the editor, and in play mode.

        Attached Files
        Last edited by philwinkel; 11-11-2014, 05:13 PM. Reason: uploaded to imgur so its not blurry

        Comment


        • #5
          So the terrain system batches the billboards? And if you use speedtrees that are not "painted" onto a terrain object, it will not batch billboards?
          I checked and I was wrong about this. Both terrain and object trees batch billboards.

          Comment

          Working...
          X