good news for performances

Everything related to the code /
Tout ce qui touche au code
Post Reply
User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

good news for performances

Post by zuzuf » Fri Dec 05, 2008 10:52 pm

all math functions TA3D called were double precision functions whereas we only use single precision (type float). So even a call to fabs was slow because it has to convert its parameter into a double then do the fabs and convert the result back to float.

I've replaced all those double precision function calls with their single precision equivalent :). You can find those functions almost everywhere in the code so the speed up should be noticeable :D
=>;-D Penguin Powered

milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

Post by milipili » Sat Dec 06, 2008 2:20 pm

Would it not be better to only use double instead of float ? I always have problems with float.
Damien Gerard
Ta3d & Yuni Developer

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Post by zuzuf » Sat Dec 06, 2008 2:36 pm

what problem do you have with floats ?

here we mainly use those math functions on small vectors. Remember TA uses fixed precision numbers (32 bits int with 16 bits used for decimal precision) and it's enough for the needs of the game :) . We would do some heavy math operations I would agree using double but here it would only slow things down : if we use double then we must send more data to OpenGL which will convert them back to float on most systems ...
=>;-D Penguin Powered

Post Reply

Who is online

Users browsing this forum: No registered users and 34 guests