As many of you may know we have been running into problems with the
lack of double precision in OpenSG. After many months of putting it
off I have started looking into a solution that will have a minimal
affect on current code. I have come up with a first pass at a working
solution. The concept behind the attached patch is to make the
MatrixStore in OSGRenderPartition store matrix accumulations in double
precision. This is mainly because our scene graph is set up like the
following with our camera always located at the origin of the scene.
Root
|
Navigation (Very large) - Actually the inverse of the normal
'camera' position.
/ | \
LandTile ... LandTile (Very large)
As you can see the final position of the geometry is very close to the
camera. We only need the matrix accumulation from the geometry to be
in double precision. The attached patch contains the following high
level changes:
1) Add the ability to multiply two matrices with different value
types. (Matrix4f * Matrix4d)
2) Change RenderTraversalAction::pushMatrix() and
RenderPartition::pushMatrix() to have a template that allows
accumulating matrices of different value types.
3) Store accumulated matrices in MatrixStack as double precision.
4) Convert back to floating point when creating each RenderTreeNode
What do people think about these changes? Is there a better method to
double precision without changing a *lot* of code?
Thanks,
Aron
P.S. It is worth noting that these changes are for the
fcptr_stable_jun07 branch. If we can all come to a conclusion I can
merge the changes to trunk.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Opensg-core mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-core