Direct3D Timing Issue

Brad

31-01-2007 17:44:20

For some whacky reason, whenever pyOgre is running on the Direct3D renderer with floating mode set at fastest, the standard python timing functions cease to work.

time.time()

This function will produce the EXACT same result each pass in the frame loop. This is severely crippling my timing measurements overall. How setting the renderer in python is even effecting my python functions and floats is well beyond me.

The problem does not exist in OpenGL or in Direct3D when the floating mode is set on consistent.

Any suggestions or solutions?

~Brad

Game_Ender

31-01-2007 20:37:34

DirectX changes the floating point mode behind your back. To a search on the main ogre forum for floating point and Direct3D.

Brad

31-01-2007 22:38:13

http://www.ogre3d.org/phpBB2/viewtopic.php?t=23155

This was the only thread I found that bore relation. It's still a very strange thing to me, however. It isn't just rounding off the floats passed in through Ogre. It's somehow physically effecting the internal float rounding of the CPU altogether since the function call in question is simply done in pure python. Ogre is not involved in the program loop in any way aside from having been initialized.

Ahh well. I've reimplemented my engine's timer using clock instead. Thanks anyhow though!

Game_Ender

01-02-2007 04:14:42

You didn't read the thread. DirectX changes the FPU on the your CPU to use single precision. Which affects all calculations, even pure python ones. I am glad you got it sorted out.

saluk

02-02-2007 01:34:44

Thanks for this thread, I was having this problem as well. pygame.time.Clock fixed everything. Sometimes it can be hard to remember that you're not just working in python, but within a larger system :) Python is still using the same hardware and system calls that any other language uses, not to mention all of the imported libraries having c components as well.