Re: [Algorithms] Huge world, little precision From: John Ratcliff - 2007-03-01 14:44:31 ```Dude, you do not have to transform the vertices! You only have to transform the translation component of the transform (not the rotation component)! When you build the matrix to send to the shader, just modify the translation component to be relative to the camera position. Also, I don't quite understand this conversation about high precision rotations. Rotations are always in object space, often represented as quaternion's which are normalized rotation values and, with these, normal float precision is just fine. The only issue is the giant translation component which, with a minor joggle to your object-to-world transform can be easily corrected. John -----Original Message----- From: gdalgorithms-list-bounces@... [mailto:gdalgorithms-list-bounces@...] On Behalf Of George van Venrooij Sent: Thursday, March 01, 2007 6:51 AM To: Game Development Algorithms Subject: Re: [Algorithms] Huge world, little precision It seems the best overall solution (and with the least impact to my existing code) is to use a number format of sufficiently high precision in the engine code and then transform the vertices into view space before sending them to the GPU. I am a bit worried that transforming (potentially) 200K vertices every frame might result in a performance penalty. I wrote a small console app to test this, and substracting a value from 600.000 doubles and storing the result into a float takes approx 0.005 seconds... (on a 2 GHz Turion) which is quite a lot of time if you have to do this every frame. So I might need to take a different approach in order to do away with this overhead. Perhaps carving up the mesh as Jim suggested would do the trick, although it would complicate things in the engine itself. Regards, George van Venrooij george@... http://www.organicvectory.com ----- Original Message ----- From: "Simon Fenney" To: "Game Development Algorithms" Sent: Thursday, March 01, 2007 11:01 Subject: Re: [Algorithms] Huge world, little precision > Alex Walters wrote: > >> I came across this a while back, a simple, highly accurate >> approximation for sin/cos. I expect this might be >> 'fixed-point'able. Might be more effective than a look up table. >> >> http://www.devmaster.net/forums/showthread.php?t=5784 >> >> Regards, >> Alex >> > > Interesting, but I'm surprised the poster didn't use Horner's rule to > further reduce the number of operations by ~25%. > > Simon ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ GDAlgorithms-list mailing list GDAlgorithms-list@... https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=6188 ```