-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SDFGI: Massive slowdown when the camera speed is too fast (even on empty scenes) #41154
Comments
Does it improve if you go to the Project Settings, decrease the number of SDFGI rays to 5 (the lowest) and increase the number of frames to converge to 30 (the slowest)? These are the settings I used in #39965. Also, make sure to decrease the number of SDFGI cascades to 4 in the Environment resource. It's significantly faster than the current default (6). |
In such scenarios I would imagine SDFGI should blend towards a much lower resolution, larger-scale area to adjust for a higher-speed motion scenario (or be turned off?), which is typically matching what happens with a spaceship. It goes faster, but further away from the map than a human character would be, and eventually sees further away. So we'd just need to change reference frame? There are cascades but maybe they could be dynamic themselves? i.e if the game uses 4 cascades at once, upon scripted decision it could fade to 4 higher cascades (rather than being more than 4 all the time to sort of support them all, if you see what I mean)
This above is use-case based, it would work really well with flying scenarios. For characters that can dash or go super-fast while remaining very close to the environment, there isnt much choice but to turn off the closest cascades because trying to keep them up to date at all times will demand too much work at once to the computer in a limited time (hence the limit I describe in my next post) |
my framerate shouldn't drop into the 20s when i have an empty scene, all i did was, i increased the camera's speed and it all went downhill from there |
In the current state of things, it will drop at least because it tries to relocate SDF volumes at a much faster rate, since the reference frame in terms of distances is not changing. Something in there is probably not dependent on scene complexity so performance just linearly decreases until it goes above frametime. If you think it should not happen specifically within an empty scene, then it's easily fixed by having SDFGI not run when the scene is empty, but that's probably not the fix you are expecting. |
??? it should never do this in the first place, like, you have a scene with 3D models, the framerate drops, you have an empty scene, the framerate drops there's clearly a problem in here, saying that, i should just never use sdfgi, seems like nonsense to me, i mean, to me it just makes the whole technique pointless, if it's not usable in 99% of most games i mean immagine a racing game where you framerate drops this badly, do you just make all the cars, go really slowly? that's ridiculous if someone were to make a wipeout styled game, they wouldn't be able to ever take advantage of the lighting system i guess you can make a walking simulator with this system, but i don't know, i just find it odd how nobody ever brought this up, seems really strange to me |
@RaTcHeT302 The Zylann proposed a viable workaround that could be integrated into the engine in the future. |
yes i know, but i still felt like this was very important to bring up, this seems like a pretty critical problem to me, and i'm surprised that nobody pointed it out yet, seems very odd to me so i'd rather point it out as soon as possible, while everything can be fixed in time before a proper release |
but see the fact that this happens with a scene that's just plain empty confuses me the most, i mean there are no lights in there, it was literally pitch black darkness, so what's going on here? technically my framerate should still be in the thousands right? i mean there were no lights to update, just seems really odd to me i still believe that there's a huge flaw deep in there, i don't think that an empty scene should suffer such an insanely large frame drop please stop fixating on the flying thing, and understand that my framerate DROPPED when there was NOTHING IN THE SCENE |
okay i'll update the title, maybe that'll clear things up, just in case |
This is expected, cascades need to re-voxel when you move, if you make a game that will move fast, you will need to use a larger cell size so revoxeling happens lest often. That said there is a good amount of optimization pending for SDFGI that will happen when everything else is more or less done, so will see this again later. |
Oh also, the cmvalley scene you are testing with specifically sucks for SDFGI if you move fast, because it consists of very few extremely complex objects (in the million of polygons), so even if you want to revoxel a small bit of the scene when you move, its going to send millions of polygons to the vertex shader. A Properly made game scene that has the map split into more sections and objects will work way better. |
Maybe something very specific that's useful to bring up here: an empty scene has as much volume as a complex scene, it just happens to be empty. Since SDFGI (with my limited understanding) maintains a decent amount of volume-based data, I would expect it to have some framerate impact even on an empty scene. (On the flipside, if there are optimizations that help a lot with empty space specifically, then I imagine they should help with the empty space in complex scenes too--so on first glance I'm not sure empty scene perf needs special attention. (Edit: Although it might be a reasonable benchmark to have, to be fair.)) |
Also as a note, jump flood after revoxel will run anyway even if your scene is completely empty, this will drop framerate a bit if it happens to often, so make sure to use a larger cell size. All these things will be present in the documentation by the time its written, so for the time being understand that you are testing a work in progress, undocumented feature. |
Godot version:
no commit hash, as it was compiled by hand, but it's probably the one starting from here
f2149fe
OS/device including version:
windows 10 1709 16299.431
vulkan
r9 380 4 gb ggdr 5 1425 mhz
AMD stuff
2020.0729.1547.28422
20.20.01.13-200729a-357776E-RadeonSoftwareAdrenalin2020
Issue description:
if you increase your camera speed, to a very high value, the framerate drops into the 20s
this is bad if you were to make, a space game with a space ship, which needs to fly VERY FAST
this makes using the editor impossible, the framerate is too low and it's barely usable at all times
Steps to reproduce:
Minimal reproduction project:
even an empty project will do
if you move slowly, the framerate is fine
if you move quickly, it all goes to hell
disabling SDFGI fixes the framerate
The text was updated successfully, but these errors were encountered: