Sign in to follow this  
Sagar_Indurkhya

Proposal Of standard C++ Math Library

Recommended Posts

I just wanted to know if anyone is interested in helping me create a library for higher level math. I think this is one major thing that is limiting hobbyist game developers: they don't have time to write code for a better spline, or they don't know how write code for advanced collision detection. Also, if this library can become standardized, and a lot of people use it, I think we can discuss higher level gaming more efficiently. If anyone is interested, contact me at SIndurkya@yahoo.com. Or just leave a comment or suggestion.

Share this post


Link to post
Share on other sites
The thing is do you want to specify a standard or make a specific implementation of functions the standard? I don't think either will happen, for game programming at least. Scientific computing has a various levels of BLAS functions for scientific computing which work very well for what they do. They are not very well suited to games though.

I think the first problem is people just have differnet structures for different things in their programs. You would probably have to do some serious programming witchcraft to fit everyones programming structures. Are you doting 2 3d vectors? Ok which order are the components in? Are they floats/doubles? What about pading in the structure? I need a fall back method also so if I don't have SSE I can fall back to MMX or the FPU. What if I'm doting one vector agianst 100 different vectors? Should I pull an entire cache line at a time?

Its all very up in the air and dependent on how each individual game is implemented. Maybe you can use a faster sqrt() function because you don't need the precision. I think the best thing would be for a repository of functions. Basic building blocks that you can use to build up your own library. Need an ultra snazzy cross production function that works on an opteron and can pipeline 100 products without thrashing your other thread that might use that stucture too? Well just look in a database of functions and grab it.

Actually I'm not sure how well that would work. It can take a while to fully develop a library like that and I'm sure all the major players have their own standards they start with. How would we convince people to open source something like that? Also if you want it to become a standard you can't expect anything in return.

Share this post


Link to post
Share on other sites
Boost also has some useful contributions, especially the basic linear algebra bits.

More importantly, however, what subsystems would you target this at? ODE is open to the public, so physics (at least rigid body dynamics, the common case) is already around. Most of the available open source engines seem to have similar modules available. So the question is, why not simply add your efforts to theirs, or at least consider asking to fork their dev tree?

ld

Share this post


Link to post
Share on other sites
I checked out those libraries, but none of them have splines. We should create a free public library that has functions for all the splines. We could support float, double, and long double. I think the more people we can get to use a library, the more support we can get. But I don't like that CVS system. How about I just post all the source code, and if people have suggestions or questions, they email me?

Share this post


Link to post
Share on other sites
Quote:
Original post by Fruny
As mentioned in this thread, such a project was started last year. If you want to revive it, be my guest.

Your link to "this thread" is.. well.. it's linking to this thread... was that what you intended?

John B

Share this post


Link to post
Share on other sites
First, please take a look at this thread first :
Horse Power Math Lib (2)

The central problem is that a standard math library without decent performances is close to non sense in video games but in this precise field, performances and compatibility is the worst headache you can imagine. Every element concerned adds important and tricky constraints :
- the compiler used.
- the OS.
- the various machines (FPU, SIMD chip).
- the user choices / settings

Once a compatible, speedy and expandable kernel is done, writing a spline module is a piece of cake. The formulas are known to everyone with www access. The problem is to define the functions/interface so that performance and full compatibility are both asserted.

My ambition for this library is both :

- one HAL, the GL or D3D of maths for video games. A kernel that lets one unique code find its optimal implementation in every possible context, letting any compiler perform at its best.

- one library in the common sense of the term, or rather an encyclopedia of speedy applied maths, that lets experienced users add their knowledge and work optimally, and that lets others (beginner hobbyists) benefit of it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this