Announcement

Collapse
No announcement yet.

SpeedTree terrible FrameRate and bugged shadows!

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

    SpeedTree terrible FrameRate and bugged shadows!

    I have been trying to get a level with a decent ammount of trees in it to run properly for a week now. However no matter what settings I tweaked I could only get minor improvements. To pin down the issue I have created the simplest prototype I could think of:
    A blank level with a dominant directional light, a small terrain mesh and 100 SpeedTrees with 3000 Triangles. The SpeedTrees have precomputed lighting turned off as they won't cast shadows otherwise. I turned off smoothframerate off in the SystemSettings to get the true framerate. Other than that everything else is at its default in July or November UDK doesn't matter. This prototype has lightmass lighting built, but fully dynamic lighting makes no difference.
    This is the ugly result I get walking towards the Trees:


    This is the somewhat acceptable result when I turn arround and approach the group of trees from the other side:



    Notice how both views make the framerate drop down to 30. o,0 If the trees are set to do precomupted lighting and cast no shadow I get 90FPS in that view!!!
    I have made countless tweaks including:
    1: Setting up distance culling to prevent the distant trees from being rendered.
    2: Setting up the LODs for the trees correctly to -1
    3: Tweaking the dominant directional light settings to cascaded shadows which only appear in a 3500 radius.
    With acceptable settings I can get the framerate up to a meager 35 but even if I make everything look ****ty with visible shadow drawing and objects popping in I only get 40ish FPS.

    My system is:
    Intel i7 2630QM
    560M with latest Nvidia driver
    6GB RAM
    Win 7 64Bit

    So before I go insane tweaking settings...
    How do I get 100 shadow casting Trees into my Map without killing the FrameRate?!?
    And is there any way to make the leaves cast shadows all the time and not just when you look at them in the right angle?


    PS: Sorry if this post isn't very clear.... but I've been working on this for waaaaay too many hours.

    #2
    Those leaf alphas are a framerate killer. Try doing some tests without the leaves and just having a bare tree to see if it improves.

    I've done a few tests on both Staticmesh trees and Speedtrees and the framerate drops whenever light hits those leaf alphas or causes shadows.

    In order to get the leaves to cast shadows properly and not just whenever they are looked at in a certain angle, the leaves have to be actual meshes and not billboard leaves (leaves that rotate and always face the camera)

    http://udn.epicgames.com/Three/SpeedTree.html

    Comment


      #3
      Originally posted by Chicken+Ribs Combo View Post
      Those leaf alphas are a framerate killer. Try doing some tests without the leaves and just having a bare tree to see if it improves.

      I've done a few tests on both Staticmesh trees and Speedtrees and the framerate drops whenever light hits those leaf alphas or causes shadows.

      In order to get the leaves to cast shadows properly and not just whenever they are looked at in a certain angle, the leaves have to be actual meshes and not billboard leaves (leaves that rotate and always face the camera)

      http://udn.epicgames.com/Three/SpeedTree.html
      Well if the alphas are the problem the actual meshes instead of billboards should fix the FrameRate too right? So how do I export the leaves as actual meshes as opposed to billboards? In the documentation it says: "Speedtrees support using billboards as leaves but this isn't very effective, it looks much better to define a mesh as a group of leaves or a branch." However there is no hint at how to do that in an efficient way...

      Comment


        #4
        I made a test with the leafes disabled. This gave me back 15 FPS so it was at 45 out of the original 80. Not exactly what I was hoping to achieve but well it's a start I guess. Next up I created custom mesh based leafes following this tutorial: http://www.youtube.com/watch?v=KxcsDMauhJM I used the same tree but applied these instead of leaf billboards. The FrameRate was 30FPS again but the shadows and even the trees themselfes look much better now:

        So as these still use alphas for the leafes the shadows still kill the FrameRate. However the leafes look a lot more dense now therefore it should be possible to reduce the number of leafmeshes which might improve the framerate some. All things considered this will make my game look prettier but I think it still won't make it run any better. So I am still looking for ways to improve performance of the SpeedTrees.

        Comment


          #5
          are your leaf alpha Translucent or Masked? that causes some big differences I believe

          in any case, you should try tweaking the LOD distances for trees. if you have that many trees, the front line will already be blocking the view of the ones behind so they don't really need to be using the highest LOD

          Comment


            #6
            Originally posted by Chosker View Post
            are your leaf alpha Translucent or Masked? that causes some big differences I believe

            in any case, you should try tweaking the LOD distances for trees. if you have that many trees, the front line will already be blocking the view of the ones behind so they don't really need to be using the highest LOD
            To get the textures looking good they need to be in masked mode afaik.
            Now here is my problem with LOD I can get 2 options to work:
            a) Keep LODs in SpeedTree software deactivated and import to UDK. Activate LODs there with the -1 setting. -> The model transitions ONLY from ONE standart mesh to billboard. This is to be expected.
            b) Activate the LODs in SpeedTree software and import to UDK. Activate LODs there with the -1 setting. -> The model transitions ONLY from the standart mesh to lower resolution meshes but NEVER to a billboard. This is just soo wrong as it's one tree...
            In wireframe mode I can clearly see that the billboard card is never even rendered so the mesh just dissapears after its lowest resolution setting faded out. How things work in UDK is sometimes so random that it's pretty frustrating tbf. -.,-
            So is there a way to have the trees transition through their 3+ LOD sets and then go to a billboard after their last distance for a mesh is reached?? That would be amazing as the LODs improve framerate significantly and the transitions actually look cool.

            EDIT: sorry for making this thread image heavy but here are b) trees on the left in their low LODs but all their friends have just dissapeared becaues they don't render billboards. The Tree on the rigth is type a) and just about to transition completely into a billboard directly from its highest detail level...

            Comment


              #7
              I thought I could maybe fix this by making the leafs billboards again. However it turns out that this wasn't the problem. So I am still looking for a solution to have both different steps of LODs AND the billboard at the end.

              Comment


                #8
                After waaaay too much time and choclate consumed I kinda managed to figure this out. I was able to make a tree transition from highest LOD all the way through billboard. The problem is I can't even explain anymore what I did. However if you value your sanity here are the two most important parts:
                1. Follow along with this http://www.youtube.com/watch?v=sKRNH-j_Xk0 tutorial. Leave NO step out as many of them are crucial to getting LODs to work. Ironicaly this included settings with seemignly no connection to UDK LODs whatsoever...
                2. After you imported your tree properly and restarted UDK go to WireFrame Mode. Now position the camera close to the tree and set the LOD settings in the tree properties to 0 one by one. This will allow you to preview quickly if your LODs work and how they look like. Once that is done you can set the values to something that makes the tree look pretty at all times.

                EDIT: As the name suggests those billboard tree LODs are always facing the camera as well.... -.,- So is there a way to turn those into cardboard meshes as well? I couldn't see an option in the SpeedTree modeler.

                Comment


                  #9
                  Making the billboard material two sided seems to improve the lighting on the billboard trees somewhat but the distant ones still look so bright and fake that you might as well have no tree there:




                  It seems so hard to get a forest into an UE3 game in 2012. That is kinda weird when you consider Gothic 3 was released in 2006 with such a forest: I mean ok ok that game wasn't really playable untill late 2007 but still that is 5 **** years ago!! Just feels pathetic not even being able to recreate that without any gameplay or anything affecting performance. lol Oh and I better go to bed now.

                  Comment


                    #10
                    Gothic 3 Speedtrees are more low poly and not dynamically lit, but I get your point of course.

                    I'm afraid that Speedtrees are just way too performance hungry to create a whole forest with dynamic lighting (probably not only in UE3, see Risen 2 e.g.). You can use the console command show dynamicshadows in game to check the actual performance impact of all dynamic shadows. Also what is your Speedtree Bone setup? This can cause performance issues too, espacially with that much trees.

                    In the end you better create your own (low poly) static mesh trees.

                    Comment

                    Working...
                    X