Announcement

Collapse
No announcement yet.

Optimising My First Environment

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

    Optimising My First Environment

    Hi all,

    This is my first real environment that I'm working on for an assignment at University, though I'm struggling to optimize the environment.

    Computer Specs
    Intel i5 3570 (3.5Ghz * 4)
    Radeon HD 7950
    8GB RAM

    I can get a Framerate of about 40 average on Crysis 3 Ultra settings - so it's frustrating that I can't hit 60 on this environment.

    Environment screenshots:
    http://puu.sh/5z833/3f35e02f18.png
    http://puu.sh/5z861/1092513ca1.png

    Play on PC http://puu.sh/5z8bc/aef54b285f.png
    Play in Editor http://puu.sh/5z8fF/bd60026bfe.png

    The package size is about 323MB - I'm not sure if this is causing the performance issues though UDK warns me about package size.

    So, the first thing which is confusing me is that my framerate is significantly better when I play it in the editor; shouldn't it be better when playing it on PC? My framerate also drops as I progress through the level.

    The Speedtrees and the small Grass patches are dynamic/they move. I've tried reducing the amount of trees but this doesn't seem to be making a difference really. The ponds each have a realtime reflection (that appears to be a bit bugged/broken) and there's a few dynamic, moving platforms.

    I've also tried tampering a lot with the Dominant Directional light though it's trial and error. The Skylight in the scene does not cast shadows, nor do the two lights which illuminate the ponds/waters.

    Finally, I've removed a lot of particle effects (limiting it to just the emitters around the ponds) and simplified a lot of collisions.

    Any performance/optimisation help appreciated.

    Subzero

    #2
    Probably the lighting--if you don't have static lighting then you're spending a lot of processing power on dynamic shadows. Also, static meshes are faster than BSP, and make sure you don't have too many or too high of a poly count.

    Comment


      #3
      If you don't know what's possibly causing problems then using the stats can help you find it.

      Some stat commands I usually use...

      stat game
      stat engine
      stat memory
      stat scenerendering

      With these you can get feedback on just about every aspect of major components that could be causing you trouble.

      Comment


        #4
        Originally posted by darthviper107 View Post
        Probably the lighting--if you don't have static lighting then you're spending a lot of processing power on dynamic shadows. Also, static meshes are faster than BSP, and make sure you don't have too many or too high of a poly count.
        Thanks for the reply.

        I'm not 100% sure what this means? The only dynamic objects I have on the map are the trees/grass and the moving platforms. The rocks and buildings are all static as they don't move? I've built my lighting but this hasn't helped the framerate; only made it worse in-game.

        The two Pointlights over each pond have both Static & Dynamic lighting channels enabled (however they cast no shadows). The Skylight only has the Static channel enabled (doesn't cast shadows) and the DominantDirectional light has Static and the Dynamic channels enabled and both cast shadows.

        Comment


          #5
          Originally posted by obihb View Post
          If you don't know what's possibly causing problems then using the stats can help you find it.

          Some stat commands I usually use...

          stat game
          stat engine
          stat memory
          stat scenerendering

          With these you can get feedback on just about every aspect of major components that could be causing you trouble.
          Cheers - I've had a look at them but I can't say I understood the statistics well enough aside from knowing a few basics (E.G. what draw calls are, etc.) - I'm still new to this.

          Comment


            #6
            Oh wait, I think I understand now!

            Under the lighting settings of all my Rocks, houses, etc. the "Dynamic lighting" box is checked. I assume this needs to be unchecked on all objects which aren't moving; then if I build lighting it will bake the static shadows onto them and therefore solve the performance issues?

            Comment


              #7
              With lighting, yeah, your channels don't actually make light dynamic or static, it's only there to tell which light affects which objects. A dynamic light can affect static objects, and vice-versa. This doesn't mean if the light is dynamic and on a static channel, the light is static. It just means that light affects static channel, meaning all static meshes. A dynamic light is always dynamic and if you build lighting, a static light is always static. If you do not build lighting, then even static lights are rendered as dynamic. The fact that you disable shadows only impacts shadow rendering but it still means that light is dynamic and still expensive to render.

              On the static mesh properties, easiest thing to do is drop a new static mesh in your scene and compare the properties to your others. Basically you would want "Use Precomputed Shadows" to be checked. The "Accepts Dynamic Lights" can be checked, and really should be otherwise if you did have a dynamic light, it won't cast light to that object. Just compare to the defaults of a new static mesh and you use those settings on your current meshes.

              When it comes to lighting settings and channels and all that. I suggest you stick with what UDK defaults, unless you really know what you're doing. You can have serious negative impact if you mess with the wrong thing.

              To make it simple, if you want dynamic lighting, then use a dynamic light, and if you want static lighting then use a static light. There is no need to mess with channels or other settings, it's in fact the light type that makes it dynamic or static.

              Those other properties and the channels and things are for special case tweaks, which in your case here, I really doubt you need any.

              Comment


                #8
                I also suggest checking stat decals and see if those are taking too much time per frame to render, what helps is using "FilterMode" -> Affect and choosing the specific component it should affect, we had a big level with lot of decals and gained a 10-20ms per frame by doing this. Hope it helps!

                Comment


                  #9
                  Originally posted by obihb View Post
                  On the static mesh properties, easiest thing to do is drop a new static mesh in your scene and compare the properties to your others. Basically you would want "Use Precomputed Shadows" to be checked. The "Accepts Dynamic Lights" can be checked, and really should be otherwise if you did have a dynamic light, it won't cast light to that object. Just compare to the defaults of a new static mesh and you use those settings on your current meshes.
                  How do you know if a light is Static or Dynamic? (Sounds like a silly question but I thought a light could be either based on what channels are enabled)

                  So basically I should reset all my static mesh lighting properties to their defaults? (As I'm just dropping a new mesh to compare which would have the defaults anyway) - ensuring that PreComputed shadows are active?

                  Comment


                    #10
                    Yeah, reset all your static mesh properties to defaults.

                    A static light is the default light, it is just called the simple name of the light, like PointLight. Placed in the scene a static light has only a big "S" on it. Dynamic lights are called like PointLightMovable. Placed in the scene they have a "D/S" on the light. If you place any light and you change settings on it, making it a non default light, it has a big "U" on it.

                    So, ideally you want lights with "S" on them in your scene accept for special case, like if you use dominant light for the sun or whatever other cases or other light types. A dominant light will also have the "D/S" on it because it's also a dynamic light, even though you get a static version that will be able to cast static shadows for static objects, it's still a dynamic light. I don't wanna confuse you, but, yeah, dominant lights are all dynamic lights but doesn't always cast dynamic shadows.

                    Comment


                      #11
                      You can check out the different light types in the UDN, but a quick bit of info--Dominant Directional Light is a static light, meaning it can cast static shadows but it can also cast dynamic shadows for things that can't do static shadows (like characters). The are dynamic lights that are listed as movable or interpolating, which means they only cast dynamic shadows. That would be for cases where the light actually needs to move around. As far as static/dynamic objects, the only dynamic objects are Skeletal Meshes, or Interpolating meshes. That means they can move around. By default, UDK will manage static lighting and dynamic lighting based on the type of light and what type of mesh. You don't need to change any settings for the static mesh unless you're forcing something that isn't normally done.

                      Comment


                        #12
                        Okay, starting to get really confused here.

                        Here are the properties of one of my custom built meshes, http://puu.sh/5zZ7V/3f21fbb906.png - I've literally just dragged and dropped this into the scene. By default it casts both static and dynamic shadows (which I assume is a resource waste causing my low framerate as it's a static object therefore should only cast static shadows.)

                        My framerate was always poor which is why I started tampering with the lighting - the only things I'd changed on them were the colour - I turned off shadows on the lighting over the ponds as I just wanted to give the pond areas an unrealistic illumination effect.

                        Comment


                          #13
                          Having the check there to cast dynamic shadows means it will cast dynamic shadows on dynamic objects, so when you build lighting, by default it will cast static shadows on static objects and dynamic shadows on dynamic objects. If you have no dynamic object around to get shadows then it won't effect anything. But since your entire scene is using dynamic shadows it's slowing down.
                          If you want to use static shadows, then also make sure the static shadow resolution isn't too high, by default it's 32 which is very low, but don't set it too high.

                          Comment


                            #14
                            Okay, I've made the following changes and I'll do a preview lighting build shortly to check the framerate:

                            1) Reset all my static meshes to their default values for lighting

                            2) Deleted all the lights and put new ones down. I have a DominantDirectional (D/S) light acting as the Sun, a Skylight to keep the darkest areas partially illuminated and two PointLights (U) over the ponds. The Pointlights have shadows disabled as this is the sort of effect I want.

                            Screenshot: http://puu.sh/5A0UG/ac5d1e8c26.png

                            I take it this means my framerate after a lighting build should be okay?

                            Thanks for replies so far, all; and sorry if I'm a bit slow/painful to cope with.

                            Comment


                              #15
                              Okay built everything and the framerate in Editor is about 50, but in-game it's still at less than 20. D;

                              Comment

                              Working...
                              X