[ODE] Mismatching results / non-deterministic behaviour

Hauser Dietmar D.Hauser at dion-software.com
Mon Sep 18 09:19:08 MST 2006


> Well there's also something else: different machines have different
> floating-point precisions, and this will also effect determinism. It's
> especially a problem if you're trying to run ODE in a networked
> situation (online game). The solution is to have complete control over
> the precision of your processor's FPU*, which can be problematic if
> you're using DirectX
> (http://opende.sourceforge.net/wiki/index.php/FAQ#I_use_Direct
> X.2C_and_it_seems_like_ODE_has_switched_to_single-precision.21)


That's correct, but luckily in my particular situation, I know that all
the computers involved are exactly the same. :)


> On a side note, is this last bit about DirectX switching to
> single-precision still true with the latest versions? I'm an OpenGL
> guy, so I wouldn't know...

It's still true. If you're using "pure" DirectX, you can tell it to
leave the FPU settings alone.
However, some engine wrap DirectX and don't give you that options, so
you need to resort to setting the FPU config back, after the engine has
set it.

That being said, there are some situations, where the engine (or some
other library) _needs_ a certain FPU setting. In this case, you need to
tweak those setting all the time when "switching" between the nasty
library and the "normal" code and libraries.
 
> *easier said than done, I know, hopefully Google can help you :)

This sets the FPU to the default settings:

_controlfp(_CW_DEFAULT ,0xfffff);


hth,
dIdl



More information about the ODE mailing list