Monday, December 31, 2012

OpenGL musiings

I finally got a cube to render.  Actually the real breakthrough was getting anything at all to render using the new GL pipeline.

I recently discovered all of my GL knowledge is apparently hopelessly out of date.  The old immediate mode rendering mechanisms and the transformation matrix stacks are all gone in GL3 and up.  My work on trying to create cool graphical effects similar to movie style stuff, as mentioned previously has branched out seemingly endlessly.  For example...

  • Simple mouse based navigation seems pretty silly since I have a 3D mouse on my desk, so I make a foray into figuring out how to access the device in Java, and then how to translate the 6 integers it gives me back into a transformation to the view matrix.  I discover that a Quaternion/Vector based camera isn't really well suited to a model where the mouse moves the Camera, as opposed to where the mouse moves the world.  Still working on a better understanding of quaternions, cameras and matrices.
  • For some reason I decided it would be in my best interest to move exclusively to Ubuntu.  This in turn led to no end of re-bootstrapping stuff and tweaking UIs and learning shortcuts.  However I think the end result is pretty nice, though I have to say in my opinion, the Gnome-Shell 3 kicks Unity's ass so hard it's not even funny.  
  • I want to have the option to do some development, or at least research on my tablet while I'm commuting, so I'm investigating AGIT, the Android Git client.  Additionally I've also got a tiny Bluetooth keyboard for my tablet(s).
  • I discover that the GL rendering pipeline should be doing all transformations in user space, or they should be pushed onto the GPU via shaders, so I buckle down and start learning GLSL.  Working with VAO and VBO's in Java is particularly grueling when you have no way of debugging the shaders themselves, at least not by having them do any debugging output.  My Amazon wishlist is now chock full of expensive OpenGL reference books.
  • I've also discovered that SWT is apparently incompatible with GL3 in JOGL.  Not sure how deep that goes.  
  • Unrelated to my main pursuits, but I also spent an inordinate amount of time this weekend attempting to move a new Laptop running Windows 8 in UEFI mode to an SSD.  Just incredibly painful.  I finally got a handle on it when I realized I could make a Windows 8 recovery USB stick from my Wife's tablet computer.  Next time, do the research before you start, or better yet, just buy the fucking laptop with the SSD.  Given the value of my time, I certainly didn't save any money there.
The more I branch out the more I have to keep in mind that while I can probably fix anything, given enough time, I can't fix everything if I want to make actual progress on the things that matter to me.  Case in point:  I didn't really need to switch to the new GL pipeline to do the basic target I currently have for myself (replicating the Perlin noise isosurfaces from the Tron visual effects blog entry I previously linked).  For several weeks it feels like I've been getting further away from actually doing that because today I'm just happy to have rendered a cube.  However, the fact is that knowing GLSL and the new GL pipeline is probably going to be useful well beyond my current task so I don't mind investing some time in it.  

On the switch to Ubuntu, I'm not sure if it was a specific need I had, or just a realization that there was no longer anything tying me to Windows.  My company has finally started moving to Ubuntu for work desktops and laptops, so I've abandoned the Macbook Air in favor of a Lenovo laptop with Ubuntu on it.  Also I now have a Macbook Air for sale.  I also moved my work desktop from the RHEL5 distribution it had been running to the new Ubuntu distribution.  This frees me from having to actually take a 'UI' machine into the office, as I'm now happy enough with the interface to use the machine directly for development  (Go-Go-Gadget Gnome-Shell 3!) .  I guess I figured 'Why bother having another OS at home when I could make them all homogeneous?'.  No more having to remember the keyboard shortcuts for several different OS's depending on where I'm typing.

P.S.  As far as I can tell all keyboards still suck.