ShadowThief wrote:I don't think that's it; my i5-6600K and NVIDIA GTX 980 should have no problem rendering the images.
Agreed. Actually, what these tests show is that the major culprit here is the startup time of the executable file. It's not the timing calculations or the rendering that's the problem but the startup time overhead of running the executable at all. It seems that after Win 7, this startup cost is much higher.
The only thing this line (
cmdgfx "" knW9) actually does is 1) Check for key presses 2) Make sure that the maximum screen refresh rate is 1000/9=111 FPS. The rendering is all done elsewhere. But what happens is that just starting the exe takes much more than 9 ms to begin with.
So atleast it has been shown that removing this line, you can get a smooth result also on Win10, when running with the server. The problem is I can no longer check for key presses and there is no control over the refresh rate (so on fast machines it might run too fast)
Possible solutions:
1. Find a way to decrease the startup cost of the executable. Not sure how, different compiler perhaps...? Or write a separate exe that does only the two things needed (would probably still be faster if written in assembler, see (2) )
2. Use Aacinis GetKey program to get the key presses. This has considerably lower startup cost than my exe, due to no linked libraries and less overhead because it's written in assembler. It's still not as fast as running without that line, but it is an improvement at least. Problem is though, that then I still cannot control the refresh rate accurately. (Aacini, can you please write a program which does both?
). I *might* be able to wing it myself, but it's been many years since I touched assembler.
3. Remove the line, and let the server do both the key reading and the time synch. This has various problems: the server needs to communicate the key read back to the script. Currently it can be done by writing to a file, but in the worst case key presses may be lost. Also, I found that with a SSD drive, writing a file every frame is pretty slow itself. But anyway, perhaps with enough tinkering, this will be the best solution, especially in this kind of program where reading keys is not important or vital
I'll get started on an entirely server-based version of this demo... this will probably add further problems, but let's see