CuteAlien wrote: ↑Mon Mar 18, 2024 10:57 am
@Noiecity: Yeah - it's about Windows timer in general which are used for example in Windows sleep(). Irrlicht uses those for it's device->sleep(). Which I don't recommend using anymore therefore. Up to (including) Irrlicht 1.8 we also used sleep(1) for device->yield(), so that was just as bad. But that is now using sleep(0) in Irrlicht svn trunk (aka Irrlicht 1.9), so that can be used again as it now only gives up the thread (reason it used sleep(1) in the past was some Windows 98 behavior where using sleep(0) wasn't guarenteed to give up threads, but Microsoft changed that behavior afterwards).
@n00bc0de: Are you on Irrlicht 1.8 or svn trunk? Could be something changed. Also if you show me your main-loop I might have more ideas.
I recent watch this:
https://learn.microsoft.com/en-us/windo ... dfrom=MSDN
It's interesting, I wonder if something like that could be implemented in Irricht
Although it depends on the processor, the range of precision is low to be in such a low time scaling, if I understood correctly, in a 2.7ghz processor would take approximately 300 picosecond with an access time of 27 nanosecond, something like that varies between 0.0000000...0000....3ms to 0.000027ms well, 100,000 Picoseconds to Milliseconds = 0. 0001, but the access time is 27 nanosecond, which would be the range to consider, that is, between 0.00001ms to 0.000027ms, a timer of these characteristics would be useful for very low latency timers, such as calculating the movement and frames of an animation, it is much less precise, but can work well in low interval times, values that do not require a highly accurate precision, it would come in handy.
Ironically, RTCs do indeed have 15.625 milliseconds of clock resolution, just as you had understood, and as I read, it is much, much more accurate, as opposed to RDTSC where the clock resolution is much faster.
Here is more information:
https://learn.microsoft.com/en-us/windo ... dfrom=MSDN
Besides, many of the associated problems are solved by using a single thread, i.e. irrlicht is fine with it, and anyway, for low end games probably the error time, which would be highly unlikely in a low end game that is not susceptible to sudden changes in the cpu, you would have to be using the entire cpu in running other programs with drastic changes in temperatures for there to be a continuous error, and if it were to arise in a low-end game without abrupt cpu changes, the drop would be so minimal that it would be unnoticeable.
I wouldn't use it in my games, but it would be useful to have it added to show examples haha, I prefer the current irrlicht stability, most games crash because of this kind of events, it's the same with bilinear and trilinear filter, I'm developing a game with the trilinear filter and with 256 pixel jpg images as it offers 800 fps on an old laptop, and the graphics are not bad, they automatically become retro graphics haha