Some ideas on optimizing rendering of big maps

Discuss anything ZDoom-related that doesn't fall into one of the other categories.
User avatar
Darkcrafter
Posts: 571
Joined: Sat Sep 23, 2017 8:42 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support

Some ideas on optimizing rendering of big maps

Post by Darkcrafter »

Well, I know for being some PITA in a while just for asking features but I though it might worth posting some ideas so keepers tell if they're good or not.

So, rendering big maps like these (please don't treat it like an ad!) is kind of tough for the engine.
So these are some ideas that could be taken into consideration:

1) Render skybox less often, e.g. with less FPS and with less resolution (Map16 has a really tough one!);
2) Divide the main camera rendering to close and far fields, with the latter being also rendered with less FPS and smaller resolution, albeit, upscaled back via box or linear filtering;
3) Render floor/ceilings reflections with lower resolution (GTA SA does this), maybe also with less FPS;
4) Not an optimization related one - render a low res and fps version from the player position in a 360 degree panorama fashion, so this could be used as a dynamic environment map for reflections on surfaces and 3D models like PBRs, AFAIK, isn't this what GTA 5 does?
User avatar
phantombeta
Posts: 2119
Joined: Thu May 02, 2013 1:27 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: Brazil

Re: Some ideas on optimizing rendering of big maps

Post by phantombeta »

GZDoom is CPU-bound, not GPU-bound, so these ideas would generally make performance worse instead. The "rendering at lower FPS" ones would also look particularly choppy and laggy.
1) Render skybox less often, e.g. with less FPS and with less resolution (Map16 has a really tough one!);
That'd look pretty bad for not much improvement in performance. The skybox would look extremely laggy when you turn.
2) Divide the main camera rendering to close and far fields, with the latter being also rendered with less FPS and smaller resolution, albeit, upscaled back via box or linear filtering;
That wouldn't help. You'd be doubling the number of drawcalls which would put more load on the CPU and further slow the game down. (GZDoom can't just "render at less FPS", the way it works, the whole scene has to be rendered every frame)
3) Render floor/ceilings reflections with lower resolution (GTA SA does this), maybe also with less FPS;
The cost of rendering reflections is largely drawcalls, not GPU power, so this wouldn't help much outside of good CPUs being used with anemic GPUs.
4) Not an optimization related one - render a low res and fps version from the player position in a 360 degree panorama fashion, so this could be used as a dynamic environment map for reflections on surfaces and 3D models like PBRs, AFAIK, isn't this what GTA 5 does?
That'd be quite a massive performance hit, because you'd need to render 4 to 6 different views (either a tetrahedral or a cube map) and each of them would need to do the whole rendering process from the beginning. It wouldn't work particularly well for anything that isn't basically centered around the player either, because the environment map would look more and more wrong the further away from the player an object is.
GTA 5 only does this for your car's reflections, everything else uses normal, non-realtime cubemaps.
User avatar
Darkcrafter
Posts: 571
Joined: Sat Sep 23, 2017 8:42 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support

Re: Some ideas on optimizing rendering of big maps

Post by Darkcrafter »

Got it, thank you for such a thorough explanation!

Return to “General”