Tablet and Shader Work

Hey Folks! Today started off with a bit more tablet parsing work. And later, more shader investigation.

I think I've finished putting all the data type and parser code together, and Steve is going to plug those into his encounter processing to see if things run normally. Depending on how that goes, there may be more stuff I can do to help shoulder the burden of the mobile port. 4 years of code is a lot to convert!

Once that was done, I turned my attention back to shaders. I'm still having trouble wrapping my head around the transforms necessary to do normal-mapping. Though, as I'm discovering, a lot of the problem lies in differences between conventions in one language vs. another, and from site to site.

For example, some sites list 4x4 transform matrices as having their translation components in the final column, while others list it in the final row (i.e. transposed). Even after looking up column-major and row-major, I'm unsure which is which. Thankfully, OpenGL documentation clears this up by explicitly stating that the translation components are indices 12-15 in the Matrix array. No confusing that!

Another example is that the initial normal map tutorial I followed created a "ModelViewMatrix" while other tutorials had "Model" and "View" matrices. I later learned that the combined ModelViewMatrix is more common, but at the time, I couldn't figure out for the life of me how I was supposed to tease these apart. (In the process, though, I learned how OpenFL's Matrix3D.Create2D() function works, which is basically a translated top-down view matrix pointed at 0,0.)

Combine the above confusion with a general rustiness (or lack of experience) with matrices, and we get a pretty wide gap between what I know and what I'm trying to do.

I still think it's worth it, though. Matrix math has haunted me for years, and this is pretty integral stuff to game dev. Maybe slightly less-so for 2D games, but as per yesterday's example shaders, it can add some really juicy visuals if used cleverly.

I think tomorrow will continue this line of work. I feel like I'm making progress, albeit slowly. Learning how the 2D view matrix is made, how translation matrices look, and now, getting a better handle on tangent and binormal calcs, I think I'll be getting there soon. Just have to hang in there, brain!