Garry's Mod

Garry's Mod

744 ratings
Automatic Culling - Dynamic auto-cull
2
2
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Tool
Addon Tags: Build, Fun, Roleplay
File Size
Posted
Updated
2.517 KB
28 May @ 5:58pm
28 May @ 6:44pm
2 Change Notes ( view )

Subscribe to download
Automatic Culling - Dynamic auto-cull

Description
What is this?
This script is a dynamic aggressive culling applicator for Draconic's aggressive culling system I released a few weeks back. I had a fair few people ask me to make a script that makes it "automatically apply to everything". So tl;dr, here's that request, -ish.

Not so tl;dr: If I were to apply it to everything you would end up losing more performance than you would gain. So I wrote this script which has a size & material count filtering system for spawned entities, as well as a blacklist for entities it should not bother with, to make sure this only applies to entities that will actually improve your performance by enabling aggressive culling on them. This also includes convars if you wish to try enforcing it on more things just to see yourself that trying to do so will only result in a net loss. Draconic's aggressive culling disables when the entity is within close proximity so you won't have to worry about stuff like weapons and gameplay objects becoming invisible near you, as well as whenever you are zoomed in.

So where will this actually save my FPS?
  • Entities obscured by the world from player view, but not traditionally culled (either due to a large visleaf or a poorly optimized map).
  • Entities an extreme distance away will not render at all.
  • Weapons with a ton of materials held by NPCs.
  • Custom entities with a lot of polygons and/or materials.
  • If used on a server with "custom base maps" or other perma-prop-like solutions, likely to help save a decent few frames from scripted entities with lots of materials being picked up by this script.

Convars
  • sv_autocull_enabled 0/1 -- Enable/disable this script from flagging newly-spawned entities for aggressive culling.
  • sv_autocull_dolargeculling 0/1 (Default 1) -- Enable/disable "large" entities from being aggressively culled (See image).
  • sv_autocull_domassiveculling 0/1 (Default 0) -- Enable/disable "massive" entities from being aggressively culled (See image).
  • sv_autocull_minimummaterials 3 (Default 3, max 32) -- Minimum number of materials an entity must have in order to be considered for automatic aggressive culling. Using this on a ton of entities with only one material will result in a loss of performance rather than a save.

If you are looking for a way to manually apply aggressive culling to specific entities there is a toolgun tool I made for exactly this purpose.

IMPORTANT NOTE
Do NOT mix multiple culling-method addons. All you accomplish by doing this is creating extra processing overhead which will make your game run worse than if you didn't have any at all.

Support me on Ko-fi[ko-fi.com]
If you need immediate help with any of my addons, or just want to know what I'm working on or etc, then consider joining my Discord[discord.gg] server.
146 Comments
Vuthakral  [author] 6 Aug @ 7:18am 
you can use mat_wireframe 4 to see the visual effect used in the thumbnail, anything picked up by this system will disappear when obstructed by the world even if it's in the same room as you.
Modest Bob 6 Aug @ 6:27am 
Is there a way to know if this is working aside from comparing FPS?
Cherrie_The_Shifter ΘΔ 4 Aug @ 12:06pm 
Okay so it seems it culls only stuff you spawn yk loose items so it wont help with lag as it dont cull teh map like some other game do. thats what i getting from it, it will help for if you have a shit ton of stuff spawned in, ir maybe maps with alot of entities npcs and loos stuff, Anyways Yeah
WolfBite 26 Jul @ 1:42am 
Honestly i feel dumb for still not fully understanding how this works but i havent dropped below 55 FPS since ive subscribed. I thought it was just some random "FpS bOoStEr" you see on workshop but ive subbed to you before and youve never lead me wrong. Whether or not this is for what i think it is. This mod has literally saved my Realism collection. Thank you homie. Take these multiple awards, my smile, a handshake, a thumbs-up. And finally my gratitude. Have a great day! <3
r.ionut2846 24 Jul @ 5:00am 
i have one question why when i load up i see some doctor breens
def. 13 Jul @ 8:45am 
Does this cull NPC's?
Colio 11 Jul @ 12:58pm 
Ohhh, I'm really sorry for wasting your time... I kind of forgot I needed that enabled.
Vuthakral  [author] 6 Jul @ 7:07pm 
You didn't install the required addon
Colio 6 Jul @ 6:39pm 
Hey, what's up with this error?

[Automatic Culling - Dynamic auto-cull] lua/autorun/automatic_aggressive_drc_culling.lua:3: attempt to index global 'DRC' (a nil value)
1. unknown - lua/autorun/automatic_aggressive_drc_culling.lua:3

Is it something to worry about? Is it something else conflicting?
Vuthakral  [author] 30 Jun @ 7:34am 
If those props are small enough, have 3 or more materials, and the map isn't already culling them then yes