Project-Summer-Island icon indicating copy to clipboard operation
Project-Summer-Island copied to clipboard

Performance/optimization

Open sunkper opened this issue 5 years ago • 9 comments

Looks like over 3,000 draw calls for this scene is too much. This probably is one of the factors causing the startup freeze.

I can think of these to decrease draw calls:

  • For Qodot map, group brushes as entities like func_group and func_details as much as possible. But don't make big, sprawling groups, to avoid lighting limitation that can cause flickering.
  • Combine meshes of objects. For models made with Blender, do it in Blender. (Maybe make a duplicate and make use of -noimp suffix, so I can fix it later.) For objects made with Godot's primitive meshes, join them with CSG node, and then use CSG exporter to make it one mesh.
  • Join terrain objects.
  • Join paper quads to objects. Menu items and scribble on fridge, GoDoIceCream logo should be joined to its bodies.

Also:

  • Reuse materials.
  • Consider reducing transparent materials as possible, especially for small objects. Probably just faking it.
  • Consider baked lightmap.

Look at: https://docs.godotengine.org/en/3.2/tutorials/3d/3d_performance_and_limitations.html https://answers.unity.com/questions/14578/whats-the-best-way-to-reduce-draw-calls.html

sunkper avatar Feb 16 '20 11:02 sunkper

Consider reducing transparent materials as possible, especially for small objects. Probably just faking it.

Thinking about faking this in bottle. Use depth?

sunkper avatar Feb 29 '20 07:02 sunkper

Consider baked lightmap instead of GI

sunkper avatar Feb 29 '20 08:02 sunkper

If it helps, I can give your geometry scenes as a gltf. I had a hard time merging things because uvs were not in 0 - 1 range.

Performance is horrific because the draw calls are 4000 - 6000.

fire avatar Apr 22 '20 18:04 fire

If it helps, I can give your geometry scenes as a gltf. I had a hard time merging things because uvs were not in 0 - 1 range.

Honestly I have no clue how it will help, but I'm interested to see it if it's not troublesome to you.

One thing prevented me from merging the house into one or maybe few objects was how I abused GIProbes and ReflectionProbes. Merging them made multiple probes interacting with one object at the same time, and caused flickering and such. I just chose to roll with multiple probes and their little visual gains, but I won't abuse them like here in the actual game project.

On a related note, I see the objects inside the house also contribute to draw calls a lot. Especially ice cream and beverage refrigerators having four OminLights combined takes up more than 1,000 draw calls. They take much fewer calls without the lights. To my limited understanding and upon casual investigations it's to do with the lights interacting with surroundings (especially casting shadows)?

sunkper avatar Apr 23 '20 00:04 sunkper

Here is an example of something that is suboptimal.

The draw calls in the game are 40 which expand to 300, but the multimesh is for thousands of meshes.

image

This is a glb of the scene.

Stand.zip

fire avatar Apr 23 '20 02:04 fire

Thanks.

But I'm not sure I understand it right. Do you mean multimesh is not suitable for this kind of object? I'm not sure about this glb version too, because I see it takes much more draw calls than the original version, even I join all the objects into one.

sunkper avatar Apr 23 '20 05:04 sunkper

  1. multimesh is for 1000s of the same mesh. Imagine blades of grass. You have groups of like 4-8 per type.
  2. This glb is when I decompose the multimesh.
  3. I have a sample where I try to merge the meshes.
  4. I'm stuck on merging transparent things. I had to remove that property from your jars.
  5. I duplicated texture sheets that are exactly the same into a new texture sheet.

image

https://send.firefox.com/download/d8355a493b93eadf/#zcgI-qW1m7-EfTGXtnbsMg

fire avatar Apr 23 '20 17:04 fire

Ah, I see. That makes me wonder it would have been better compose that inside Blender from the beginning, joining meshes and textures for the final result. Because it's not like they meant to be interactable or something (I used MultiMesh for because of that after all. Though curious how should I approach it if I want all them to be interactable, but this goes off-topic.) Same for other objects, I guess.

Maybe I should revisit the scene for solving optimization issues.

(Also I was looking into ways of sharing original .blend files. Many of them are messy because I made them as I learn the basics, but will upload them in a day or two.)

Thank you.

sunkper avatar Apr 23 '20 18:04 sunkper

I asked around for advice. My friend has a special tool for blender, but he said a tool to re-uv materials is not common.

He said my implementation is fairly rare, so I'll see if I can improve it for characters too.

fire avatar Apr 23 '20 20:04 fire