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
good news for performances
- zuzuf
- Administrateur - Site Admin
- Posts: 3281
- Joined: Mon Oct 30, 2006 8:49 pm
- Location: Toulouse, France
- Contact:
good news for performances
=>;-D Penguin Powered
- zuzuf
- Administrateur - Site Admin
- Posts: 3281
- Joined: Mon Oct 30, 2006 8:49 pm
- Location: Toulouse, France
- Contact:
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 ...
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
Who is online
Users browsing this forum: No registered users and 19 guests