Enjay wrote:Performance is better, but still noticeably affected. However, (as it was last night) the effect is weird. It definitely feels slower; like a lower FPS. The thing is, it feels less like a normal lower FPS and more like a micro-pause every tic or so - like the gameplay is jerky in a very, very small faltering way. Screen updates seem normal - the delay is somewhere else.
To back this up, FPS is also weird. I run with vsync on and normally get 60fps (i.e. capped ay my monitor refresh rate). With relighting.pk3 loaded, I get 65 FPS!
With vsync off, I get a solid 200fps running around in Doom2 map01 (which I think is an internal cap). With relighting.pk3 loaded, FPS sits around 165 but the feel of the slowdowns is much more obvious - more so than it is with vsync on.
All the above was with Vulkan and the latest nVidia drivers (511.23 updated today).
All very interesting! Thanks for the update. I've noticed some of the "faltering," although I haven't seen the FPS anomalies that you describe. The light sensors only adjust color if the player is within proximity, but that means calling a CheckProximity. I wonder if that's where the problem is. I may try something else. I have been able to eliminate duplicate sensors on the same line, which was another significant performance hit. I may have to reduce those further.
Still working on it.
Update: I think the issue is just too many calls to CheckProximity. I've experimented with a few things, and it seems much better with a longer delay between polling light sources. I don't see as much micro-stuttering with weapon sway. It's subtle but noticeable. I can work on this with a direction, and it may be possible to further reduce light sensors. I discovered another anomaly with these sensors: as the player approached they would drop. I set +NOINTERACTION, which eliminated that. Little stuff like that probably doesn't help performance.
Also, sectors beyond a certain radius don't adjust at all, but that means they all do at least one distance check to the player. It seems about the same with Distance2D and CheckProximity, although I feel the former is probably faster.
Still working on it. Making some progress.
So I don't load up on screenshots, here is some progress in just reducing the number of light sensors:
https://i.postimg.cc/RCj2LKQt/Screensho ... 174030.png
https://i.postimg.cc/LXNSCXDP/Screensho ... 172756.png
So, which screenshot is vanilla Doom, and which is Relighting?
I'm seeing better performance, and while the game is somewhat darker it looks better. Reducing the number of light sensors seems to improve performance. The number of sensors vs. sources is not proportional, so it may be a matter of finding just the right ratio.
Anyway, I'll keep playing with it. I don't know how interesting this stuff is to people, but for me the idea of completely relighting a 30-year old game based on the map author's design instincts is fascinating stuff. I'm amazed it can be done at all. While I may end up abandoning this for performance reasons, I am seeing improvement and should have something to post tomorrow for the curious. Thanks Enjay!