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

Questions about setting objects to static.

Discussion in 'Daydream' started by pfreema1, May 29, 2017.

  1. pfreema1

    pfreema1

    Joined:
    Apr 5, 2017
    Posts:
    21
    Hi everyone! I have a few questions regarding these screen shots:


    1. Why would set pass calls go up after setting the scene to static? Only one directional light in the scene, and all objects set to static are not moving. Nothing different between the two screenshots, other than setting static on.

    2. Why do the textures look all messed up in the static screenshot? I've googled around, and the problem seems common, but I wasn't able to find a concrete "do this to fix it" solution. Any suggestions?

    3. On some of my scenes, setting stationary objects to static and baking the lightmap looks like it's going to take multiple hours (days even?) to finish. This also seems common, but again, I never found a solution to it, only many people complaining about it.

    3. When researching how to make things run more efficiently, I kept reading that setting non moving objects to static is crucial for mobile VR, but it seems like it just messes things up (or rather, I'm messing things up lol). Is it necessary to have stationary objects set to static? I'm currently hitting 60fps for the most part, with the rare dip to ~50 fps if there are a ton of enemies and bullets flying around (the GvrFps counter gives me lower numbers in play mode than in the actual build).

    Thoughts?

    Screen Shot 2017-05-29 at 6.37.38 PM.png

    Screen Shot 2017-05-29 at 6.36.20 PM.png
     
  2. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    900
    The static checkbox on GameObject is a dropdown where you set several different "kinds" of static.

    One of which is lightmap static, which looks like your trouble here. It seems you're using materials that support lightmaps, but you either:

    a) have not finished baking lightmaps, so you see black splotches, etc.
    b) do not have a valid UV2 set on your models for lightmapping to use (this might mean turning on lightmap uv in the import settings for the model, or if you're generating these meshes in some other way then you can generate that uv2 set yourself from script).

    But since you went on to say you never let lightmaps finish baking, I'm betting on a) in your case. ;-)

    You can make lightmaps bake faster by using lower resolution. See, for example: https://forum.unity3d.com/threads/p...stuck-at-5-11-clustering.355398/#post-2325936. Either way, yes, baking them can take a *very* long time. You need to let it finish, and tune your parameters down to a reasonable level so that it can finish in a time that works for you.

    You can also try the new progressive lightmapper that's in 5.6 if you don't care about all of this Enlighten "indirect global illumination" tomcockery that's not usable by most of us anyway (but cost all an unimaginable sum of wasted hours baking just so we could have lightmaps).
     
  3. pfreema1

    pfreema1

    Joined:
    Apr 5, 2017
    Posts:
    21
    Thanks for your reply Claytonious!

    For the above screenshots, I did let the lightmaps finish baking, but yeah for other scenes, it looked like it was going to take too long so I stopped the process. I'll take a look at what's there for the import settings.

    Thank you for the other suggestions as well! The progressive lightmapper sounds very interesting. I'll have to look into that.