Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Generic Matrices Using OpenGL Mathematics (GLM) #1396
So this is pretty much the last of the big cleanups that needed to take place and I'm very happy to have it done. Basic idea we've been discussing is that there's no need for us to use 4 separate solutions for matrix transformations and we can just make a single generalized implementation of the matrices. That's what this pull request hopes to accomplish by making use of the OpenGL Mathematics (GLM) library. This should result in more consistent rendering across all of the graphics systems and address outstanding bugs in the transform functions.
This pull request obviously adds a new dependency on GLM. I intend to make an announcement once we decide to merge this and let everyone know about the changes.
There are several reasons for choosing GLM over the other solutions.
Fundies added two jobs to our Travis matrix to test cross compilation. The two jobs rely on a zip of deps he uploaded to GitHub. Since I am adding GLM as a dependency, I obviously had to update this zip. I uploaded it here to this issue and used that URL in the Travis yaml. Not sure what else to do or if we should move this zip somewhere safer.
Changes in this pull request
Animation Platform Example
This was provided to me by DarkAceZ and I am just using it show the consistency of the transforms at startup now.
OpenGL1 (transform fixed)
OpenGL3 (basically the same)
Direct3D9 (hidden surface removal fixed)
Direct3D11 (transform and projection fixed)
@@ Coverage Diff @@ ## master #1396 +/- ## ========================================== - Coverage 16.94% 16.74% -0.21% ========================================== Files 166 164 -2 Lines 17310 17095 -215 ========================================== - Hits 2933 2862 -71 + Misses 14377 14233 -144
Great change. I came for the lighting but stayed for the cleanup.
Oh, and regarding the half-pixel alignment: the new screenshot is superior to the old. Look at the corners of the rectangle. They're actually sharp, now (the cornermost pixel is no longer missing). I think it's fine to not worry about it. If you're feeling jumpy, check to see if the
@JoshDreamland Ok, I tested it. It seems like OpenGL is a full pixel off from where D3D is in these images. This inconsistency has been a long time issue for us, and we'll just have to come back to it again in the future. I think I am now going to proceed to merging this.
draw_rectangle(1, 1, 3, 3, true); draw_rectangle(4, 4, 6, 6, false);