Quote:
Regarding math and vector / matrix calculation. Actually sometimes it is even better and faster to setup your own routines.
While this is very rarely useful, it still does have its circumstances where it is, and if you don't mind I thought I'd bring up a relatively recent example:

A while ago in the future forums I requested bones animation to be performed on the GPU instead of the CPU. I demonstrated, with models of ~50 000 polys each, each rigged and animated for bones animation, that while no animation let me have about 110 of these entities on-screen at once before going below 60fps, if they were animated I'd drop to about 30fps as soon as the 4th entity was created. I threw together a (fairly rough) bunch of functions and a shader that let me perform the animation on the GPU (this required calculating matrices for each of the bones, hence the relevance of this example), and I had around 96 on-screen before dropping below 60 fps.

That's 4.8 million bones-animated polygons at once.

Now, we'll probably have features that will let us do this in a much less "hacky" way soon (jcl expressed in that thread that a flag for GPU animation could be useful, and then if you look at the files in the latest MMO test there's an example using a shader to do bones animation, and it appears to use some new built-in variables and matrices that aren't available in the latest public beta grin ), but for a short while my plan was to bust out a 1v1 fighting game, bones animated, with each character having up to 100 000 polys (it seems we could handle even more than that, considering there'll only be two characters on screen and the environment won't need a significant amount, but 100 000 in combination with a normal map should be plenty to ensure there are no jagged edges on the whole thing).

As another example, for a while I planned to skip Quaternion->Euler angle conversion altogether by building a Quaternion matrix and doing the rotation in a shader (collision detection wouldn't be an issue because it was intended for situations with very round objects [or at least entities that can get away with a spherical hull], and then later on to be handled by my own physics). Now A7 has a nice function for converting a Quaternion to an Euler angle anyway.

I know I re-invent the wheel a lot, but one thing I like about A7 is how easy it is to re-invent little bits at a time grin

That's not to say I wouldn't prefer a more OO-approach to vector and matrix calculations, a la Unity.

Jibb


Formerly known as JulzMighty.
I made KarBOOM!