does anyone know about the “cull 3d scene” item on the profiler?
I mean, i have a project, with about 60 or so meshes on screen that starts with 144fps and it dwindles to about 11 in 2 to 3 minutes. I’ve checked the profiler to try and catch what was funneling fps and the source seems to be the “cull 3d scene” increasing ms number
But I don’t even have 3d culling enabled! (although I’ve tried enabling it and baking occluders on an occluder instance, but the situation stays the same…), don’t know where to look now and haven’t found any info on what this might be anywhere else
A scene where the amount of visible triangles doesn’t change should not have that much difference in FPS, much less culling. You are not telling the entire story. Is your object count growing? Is the scene animated? Is there anything else going on?
Indeed it has more going on, theres this houses that animate when they spawn, and thos tiny dudes that have a walking animation with a particle emitter
Can you get a polygon count for that whole render?
I’ve looked into the monitor tab (I’m new to this profiler thing don’t know what measures what, thus the question), an theres this “total primitives drawn” under raster category, it stays around 32k, draw calls are at a steady 77, is that too much? I’m aiming for mobile, but my assets are already low poly. Under objects it says 2474 objects, 198 orphan nodes. My only transparent texture in the scene is that quad mesh that has a shader with two 128² pixels noise textures scrolling. No shadows cast
That is definitely something weird happening. You may have to disable things one by one until you find the source. If you could post your project as a git (or zip) I could take a look, but I can’t imagine what’s going on from the data given.
Well thank you for your kindness, if want to take a look I’ve uploaded to this gdrive folder (i dont really know how to use git) Sorry for the size, but most of it is in the .godot folder didnt knew what i could get rid of. Theres a lot of stuff written in portuguese there but I think all of the logic will be understandable
Ok, after looking at this for a bit I have found one memory leak causing a major performance drop.
You “Utilidades.gd” script has
var debugmesh : MeshInstance3D = MeshInstance3D.new() as a local binding, but this was not being freed automatically (it’s not Refcounted). Just adding
debugmesh.queue_free() to the end fixed this.
Now, there is for sure another memory leak. The easy way to see this is in the Monitors tab.
Objects, Nodes and Primitives stay flat, while Memory and Process time grows steadily making FPS dip.
I haven’t looked into it more, but somewhere you are making an instance of something that is not RefCounted and not freeing it when you don’t need it. I’m gonna have to leave it to you to find it, tho. Good luck! <3
Whaaat?? Memory leaks! Will have to learn so much stuff to debug this!! Thanks for showing me a way!
Will add the queue_free thing there and then move on to study what refcounted is etc. Thanks Efi!!
Will update this topic whenever i get around solving these leaks, in case anyone suffers from the same obscure thing that i do