[1.1.x] Hidden script rendered shapes are still being checked in preparation loop
Posted: Mon May 10, 2021 2:41 pm
Not a bug, bug design oversight.
Rendering library shapes which are hidden (set_visible false) still checked in main render loop, which is pointless, because it is clear that they won't even get drawn until getting un-hidden by scripts, and to me looks like nobody bothered or even thought doing this tiny optimisation.
This raise "Script render preparation" time with my mod: https://mods.factorio.com/mod/shield-generators, despite 99% of shapes are being invisible.
If you want to test against my mod, grab version 0.1.2, because 0.1.4 destroy rendering objects (and recreate them later) instead of hiding them to workaround this issue.
Rendering library shapes which are hidden (set_visible false) still checked in main render loop, which is pointless, because it is clear that they won't even get drawn until getting un-hidden by scripts, and to me looks like nobody bothered or even thought doing this tiny optimisation.
This raise "Script render preparation" time with my mod: https://mods.factorio.com/mod/shield-generators, despite 99% of shapes are being invisible.
If you want to test against my mod, grab version 0.1.2, because 0.1.4 destroy rendering objects (and recreate them later) instead of hiding them to workaround this issue.