Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by wesleywh · Jul 25, 2018 at 02:49 AM · optimizationbatchingstatic batchingdynamic batching

Optimization, Saved By Batching is Low

I am not getting a good frame rate in my outdoor area. I am averaging 45 fps in this area.

I am thinking my issue is because my "Saved By Batching" is super low. The other area had a massive "Saved By Batching" while this one is very low.


Things I have done related to static batching:

  • Try to reuse material for as many objects as possible

  • Made sure no materials are "(instance)"

  • Every object in this scene is marked as Batching Static (Everything but lightmap static)


Everything I have done:

  • Removed all "Realtime" lights in favor of baking/mixed

  • Setup light probes

  • LOD's on every object

  • Everything using "Standard" Shader and custom shader I got from this forum: https://forum.unity.com/threads/shader-moving-trees-grass-in-wind-outside-of-terrain.230911/

  • Baked Occlusion Culling

  • Everything set to static


Any ideas on how I can bump up this number so I don't have 3,000+ unsaved by batching?

That's the only real reason why I can think I am getting such a bad frame rate in this area.

My Scene: alt text

My Profiler: alt text

scene.jpg (139.1 kB)
profiler.jpg (98.7 kB)
Comment
Add comment · Show 14
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Bip901 · Jul 26, 2018 at 07:58 AM 0
Share
  1. Try setting the objects to lightmap static (because what's the use of all those baked lights if nothing is lightmap static?)

  2. Your Profiler complains about transparent geometry, but from the screenshot you provided it looks like there's nothing transparent there... Double-check your materials to see if they're set to "transparent" ins$$anonymous$$d of "opaque".

avatar image wesleywh Bip901 · Jul 27, 2018 at 12:22 AM 0
Share

Thanks for the suggestions!

I will try setting all of my trees to lightmap static. Ill have to lower my lighting settings to make it so it doesn't take 3 years.

I will have to check to make sure my shader isn't transparent.

avatar image NoDumbQuestion · Jul 27, 2018 at 01:46 AM 0
Share

Show us GPU Profiler. You are showing us CPU profiler.(it is not enable by default. Click add profiler)

Something is rendering even when it is not necessary => extra CPU call to GPU

avatar image wesleywh NoDumbQuestion · Jul 28, 2018 at 05:59 PM 0
Share

Here is the GPU profiler enabled.

alt text I tried to lightmap bake my trees but that takes an unacceptable amount of time to do so. I let it run overnight and it still wasn't done in the morning. I baked everything else in my scene except the terrain (and my trees).

---Lighting Window Settings---

--- Realtime Lighting:

Realtime Global Illu$$anonymous$$ation: false

---$$anonymous$$ixed Lighting:

Bake Global Illu$$anonymous$$ation: true

Lighting $$anonymous$$ode: Shadowmask

---Light$$anonymous$$apping Settings:

Progressive

Direct Samples: 3

Indirect Samples: 10 (Won't let me lower it below this value)

Bounces: 1

Lightmap Resolution: 4 texels per unit

Lightmap Padding: 2 texels

Compress Lightmaps: true

Amdient Occlusion: true

Directional $$anonymous$$ode: Non-Directional

Lightmap Parameters: Default-VeryLowResolution

profiler.jpg (112.9 kB)
avatar image $$anonymous$$ wesleywh · Jul 28, 2018 at 06:16 PM 0
Share

The image link is dead and light map should not take overnight and not still complete. Something is clearly broken

Show more comments
avatar image wesleywh · Jul 28, 2018 at 06:51 PM 0
Share

I'm having a hard time finding "Transparent" anything. I went through all of the images and made sure everything was NOT marked as "Alpha as Transparency". I found only 1 image that had that and I turned it off. Haven't seen any improvement from it.

Is there an easy way for me to track down what might be marked as transparent?

The only thing that I think it could be is that I am using a custom shader. However, I went into the code and change "RenderType"="TransparentCutout" to "RenderType"="Opaque". However, that didn't seem to have any affect on the transparent render times in the profiler.

avatar image NoDumbQuestion wesleywh · Jul 28, 2018 at 06:54 PM 0
Share

The problem was stuff not get batched together. Changing images property or shader property won't chang anything.

Look at GPU profiler debug frame. It will tell you why stuff like same models, same materials cannot be batched together

avatar image NoDumbQuestion · Jul 29, 2018 at 06:00 AM 0
Share

1st of all. ReEnable GPU Instancing on all materials(tree and grass too). This is what help static object have less drawcall => reduce CPU work load.

2nd: Recheck if everything is static objects.

3rd: Seem like your camera Oculusion culling not working. $$anonymous$$aybe because you forgot to re-bake or not enough objects being static

4th: Your custom shader you got from forum did not support GPU-Instancing. That's why your tree and grass worth 6 million tris. When it only suppose to be like 1$$anonymous$$ max even with 1000 of trees of 200k tris for each tree.

avatar image wesleywh NoDumbQuestion · Jul 31, 2018 at 01:27 AM 0
Share

Everything in my scene is static batched, I have checked many many times.

I did a lot of reading about GPU Instancing after you posted that link, thanks for that. I completely misunderstood what that was. I am going to have to add this into the custom shader, that alone may take some time since I haven't written a shaders before. Also I will not be able to set "static batching" and instancing at the same time, static batching takes higher precedence and will disable instancing at run time.

Oculusion culling needs to be re-baked I guess, there were a lot of changes that were made while I have been testing. After I figure all of this out I will come back and tell you my findings. From what I have read about GPU instancing so far though that may be what this scene needs.

avatar image NoDumbQuestion wesleywh · Jul 31, 2018 at 01:40 AM 0
Share

Try searching for grass, tree instancing on Github. It might surprise what you can found there.

https://github.com/keijiro/$$anonymous$$vantGrass

https://github.com/Heep042/Instanced-Foliage/blob/master/Assets/$$anonymous$$aterials/Grass.shader

avatar image wesleywh · Aug 10, 2018 at 12:55 AM 0
Share

I have been down for a week rebuilding a few things on my computer...

Now I'm back!

@NoDumbQuestion I looked at those github links and while they are good they actually don't implement anything themselves. They seem to setup the framework but miss the actual code to implement GPU instancing. So I will have to read more docs on how to do that. Again this is something that isn't really going to be easy.

I cracked open the Frame Debugger. There are two main things that are causing things not to get batched.

  • (Render.OpaqueGeometry) "An object is affected by multiple forward lights"

  • (Render.TransparentGeometry) "An object is affected by multiple forward lights"

Note: $$anonymous$$y camera is set to deferred, NOT forward.

Render.OpaqueGeometry:

I have no idea why this is affect by "foward lights" I went to all of my shaders and disabled "Specular Highlights" and "Reflections" in the "Forward Rendering Options". This had zero effect.

Render.TransparentGeometry:

Again same thing as above. However, many of my "Cutout" Rendering $$anonymous$$ode shaders are in this "Transparent" section. No idea why it is marking it such can't figure it out.

Both of these account for ALL my batches (3654) while my "saved by batching" remains around (164).

avatar image NoDumbQuestion wesleywh · Aug 10, 2018 at 01:34 AM 0
Share

Objects with Shaders that do not support deferred shading are rendered after deferred shading is complete, using the forward rendering

path. https://docs.unity3d.com/$$anonymous$$anual/RenderTech-DeferredShading.html This might be the problem. Not sure. I think you should ask this on forum. Someone have experiences with enviroment might help

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

156 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Static batching option not working 0 Answers

Static batching break : objects belong to different static batches 0 Answers

Designing an efficient cloud particle system to represent weather 1 Answer

More saved batches than actual number of batches? 1 Answer

Rendering performance of single large mesh vs multiple smaller meshes 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges