Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

libmymath v2.0.0


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 Yours3!f   Members   -  Reputation: 548

Like
0Likes
Like

Posted 27 June 2012 - 01:27 PM

Hi,

I've just finished libmymath v2.0.0. I switched to GLSL syntax, functions etc. So why?
Recently I did a lot of work on the GLSL side, and when I got back to libmymath I was wondering why do I need to keep in mind 2 syntaxes. Then came the idea that I should implement GLSL syntax, well, because I can't do the other way round.
Everything went fine, and because now I have way more experience with programming I believe I did quite a good job ( or you'll tell me I didn't Posted Image ). This is true for the math side of things as well. Now I could clearly see the how matrices, vectors work, and also I could get a great insight into how GLSL works while implementing the GLSL specs.
The result? Math code that is copy-pasteable between GLSL and C++. So why is this good for you? Well, because you can test your algorithms BEFORE even touching the GPU, and you can numerically verify them working. This is especially important when working with complex equations. So I encourage you to copy paste code (of course you'll have to do texturing by hand).
I implemented swizzling as well, which means that this code is valid:
vec2 a(1, 2);
vec4 b *= a.xyxy;
I didn't use neither functions or macros to achieve this, so I believe this is a one-of-a-kind implementation that *exactly* follows the syntax and style of GLSL.
Most of the functions are tested, but I need you to test them, tell your opinion about what's wrong or missing. I also need so swizzles as well, because I couldn't get them all by hand. (see the includes folder). I tried to follow the GLSL specs as much as possible, but if I missed something please tell me.

So where can you grab it? On github of course:
https://github.com/Yours3lf/libmymath

Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS