Pages: 1
  Print  
Author Topic: GL3 matrices  (Read 925 times)
Offline (Unknown gender) TheExDeus
Posted on: October 18, 2013, 03:02:24 PM

Developer
Joined: Apr 2008
Posts: 1872

View Profile
What would be the best matrix library to use for GL3 matrices (view matrix, model matrix and so on)? I see that there is glm.g-truc.net, but it's 1.6mb. Then there is VS*L http://www.lighthouse3d.com/very-simple-libs/vsml/ and it is smaller, but I think it has a lot more dependencies. GLM is a header only library on the other hand, so it is easier to include. Any other ideas? Technically we can write our own (have done this) or just use the code included here: http://www.lighthouse3d.com/cg-topics/code-samples/opengl-3-3-glsl-1-5-sample/ . Graphics really don't need all the fancy matrix math. It needs addition, multiplication and inversion and all of those functions can be optimized, because graphics only use 4x4 matrices.
This is a topic I actually mentioned earlier (when I actually wanted to remove all deprecated stuff from GL3). Now the idea is back and we need to start with a decision.

edit: Also found CML, http://cmldev.net/. Also seems to be include only, ~690kb.
« Last Edit: October 18, 2013, 03:22:05 PM by TheExDeus » Logged
Offline (Male) Goombert
Reply #1 Posted on: October 18, 2013, 04:24:00 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3110

View Profile
Harri, our new developer CoolBreeze/Rexhunter is already doing that, she sent a commit last night that actually fixed our client so the deprecated functions are no longer usable. I am writing device manager interfaces for the fixed function pipeline, as I committed earlier today for Direct3D9 as directed by the DX SDK manual because render states such as fog are not memorized between Begin/End scene calls and internal state blocks are shitty as fuck and a part of the ffp, I have to do the one for OpenGL before we can rewrite the ffp with GLSL. Basically this interface handles global batching, state management to minize not only bindings but other interference with the GPU such as shader and sampler changes, and of course, makes it real easy to replace the whole ffp.

So just hold off a bit on that Harri until I write OpenGL's device manager. Also, I am going to throw a similar system to your global 2D batcher into OpenGL 1 and it will use vertex arrays, everything will in OpenGL 1, that is why I changed it to 1.1, it makes it a lot easier to manage the data and have the graphics systems pretty similar, people with really old hardware always have at least Direct3D 9 support even back on XP anyways. But at any rate my device manager got unnecessary state changes to Direct3D 9.0 down to absolutely 0 in a few games I tested.

Also Harri if you could run that cubes demo from Studio I compiled and got fully working exactly the same now and tell me your performance in RAM and CPU usage as well as framerate, that would be awesome, so far people have been reporting the ENIGMA compiled versions running up to 100fps faster with anti-aliasing.
https://www.dropbox.com/s/1l32ipnapkvlene/CubesDemo.zip
« Last Edit: October 18, 2013, 04:28:38 PM by Robert B Colton » Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Unknown gender) TheExDeus
Reply #2 Posted on: October 18, 2013, 05:53:28 PM

Developer
Joined: Apr 2008
Posts: 1872

View Profile
Alright then. Just wanted to create a water reflection demo, but noticed that I cannot use new GLSL because of lacking matrices. Will try to use GLSL1.1 anyway. And you say deprecated functions are not usable, but that means GL3 is broken now? Because we do use many deprecated functions there...

yoyocompiler.exe - 800-1300FPS, 13% CPU and 173mb ram.
opengl3.exe - It's vsynced to 60fps, 25% CPU and 80mb ram.
opengl1.exe - It's vsycned to 60fps, 25% CPU and 150mb ram.
direct3d9.exe - 930-1600FPS, 8% CPU and 89mb ram.

To turn off vsync in ENIGMA you must explicitly call set_synchronization(false). If you didn't do that, then it will cap to vsync.
Logged
Offline (Male) Goombert
Reply #3 Posted on: October 18, 2013, 08:48:16 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3110

View Profile
Harri, there is supposed to be a matrix constant in Studio, I don't remember what it is called.

http://docs.yoyogames.com/

Feel free to add it.

But yes thanks for running the demo, I will have them even higher performance when we rewrite the device managers I code to get rid of the FFP. And thanks for telling me about synch, I will be moving that into bridges to implement display_reset(aa, vsync); for OpenGL, but that should be off by default unless it is ticked in Global Game Settings. I think you have your graphics card forcing it on.
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Unknown gender) TheExDeus
Reply #4 Posted on: October 19, 2013, 04:24:10 AM

Developer
Joined: Apr 2008
Posts: 1872

View Profile
It's gm_Matrices, and  I cannot add it until we actually use matrices for all the math.

Quote
but that should be off by default unless it is ticked in Global Game Settings. I think you have your graphics card forcing it on.
If you want vsync to be off by default, you should actually call that when the game starts. Maybe in graphics_init() or something.
Logged
Offline (Unknown gender) The 11th plague of Egypt
Reply #5 Posted on: October 19, 2013, 02:33:40 PM
Member
Joined: Dec 2009
Posts: 276

View Profile
Don't know if it can help.

Here's some fancy stuff for matrices in 3D graphics
http://lolengine.net/blog
Logged
Pages: 1
  Print