Tuesday, December 31, 2013

Looking to 2014

This time last year, I decided I was going to try a year-long resolution: I wanted to try a new recipe or new cooking technique every week of 2013. There were some periods where I fell off, like during conference season, so I didn't manage 52 new recipes but I did learn quite a few new things. Since I don't have kids to satisfy, and my significant other can cook perfectly well on his own (and far better than I can), this once a week experiment wasn't too much of a burden for anyone involved. My cooking resolution also led to lots of conversations with my fellow blogger here, which may have contributed to this blog's birth.

Monday, December 30, 2013

Adding shaders to your program

We've got some code that draws a pair of triangles using vertex buffer objects (VBOs).  They can only be seen on some video cards, and if you do see them they are plain white.  Adding a shader will get them drawn everywhere and let us apply some colors.

The first step will be adding some code so that our program can load shaders and get them to be applied when drawing polygons.  So lets start there.

Friday, December 27, 2013

Triangles drawn by VBO's

It took me a while to figure out Vertex Buffer Objects, they get pretty involved and throw you into some complicated stuff.  I'm not sure I fully understand all the stuff I had to do to make them work, but the program does what I want it to do and that has to count as some kind of success.

There's a lot of stuff to cover on this one, and with the hopes of keeping the posts at reasonable sizes I'm going to break them up into a few posts.  In this one I'm going to cover how to use VBO's to get your polygons on the screen.

Thursday, December 26, 2013

Quiche Florentinesca

I've wanted to try my hand at quiche for some time. Today is quiet, and if it turns out poorly I'm the only one stuck with it, so it seemed like an excellent day to try! Rather than the standard ham or bacon in quiche florentine, I opted to use some of my leftover frozen turkey from Thanksgiving.

After the prepping and the eating, I think I'd go with a more traditional pâte brisée crust, next time. This crust was serviceable and quick, making it great for a quick throw-together meal, but lacked flakiness and buttery richness.

Monday, December 23, 2013

Shapes and colors in GL

Previously I went through how to create a Windows form with an GLControl in it.  Nothing was drawn in that control, and really whats the point of having OpenGL accessible in your program if you don't actually draw anything?

There are several ways you can tell OpenGL to draw polygons.
  • Immediate mode is the oldest and probably the slowest method of drawing.  They are not included in OpenGL ES, which is what Android and iOS devices use.
  • Vertex Arrays was introduced in version 1.1.  This allows you to pass chunks of data to OpenGL in a single function.  All the data is stored in program memory which means that it needs passed through to video memory in order to render anything, this hampers performance quite a bit.
  • Vertex Buffer Objects were released with version 1.5.  This moved the information needed for rendering into video memory which boosted performance.  I believe this is the preferred method of rendering objects currently.
When I was first working with OpenGL my machine had an integrated Intel video card in it.  The drivers only provided OpenGL version 1.4 which blocked all of my efforts to figure out vertex buffer objects.  Fortunately, that video card has been replaced with something better and I can play with modern methods.  I'm still going to take some time and go over the old methods just for completeness.

Friday, December 20, 2013

Character Process, second attempt

I know I just did one on these posts, but it bothered me that it ended with "and I crumpled the drawing up and threw it out".  It just seems like poor form to describe a process that ended with a garbage result.  I doubt anyone suspects me of lying about how I make the drawings, it just bugs me that I ended up with a failed result.  This is probably my coder mentality coming through.  With anything on the computer if you follow the instructions correctly then you ought to get the same result every time.  So if your process is good it shouldn't generate garbage.  This is not true with drawing, but I've been drawing for far less time than I've been coding so I don't have the best habits.

Tuesday, December 17, 2013

Lemon Chicken with Spaghetti Squash

Lemon Chicken with Spaghetti Squash

This is based on a simpler dish my Mom used to make, always one of my favorites growing up. Here I've added a few extra touches to the basic dish. This was usually served with egg noodles, but hey, I like spaghetti squash. This will serve two hungry adults with leftovers for tomorrow.

Monday, December 16, 2013

Tinkering in GL again

A long while ago I had puttered with drawing in OpenGL via .Net.  It was an interesting diversion for a while, but I ended up quitting that since I couldn't envision it really being viable.  Since .Net is an interpreted language you've got the run time environment causing some delays in executing your code.  For games you need to be rendering the screen 30 times a second, I had a hard time believing that this would be possible within the .Net environment.

I should have known better since this has been done in Java, which is essentially the same sort of setup.  Sure enough I was proved wrong.  I got into the Hex: Shards of Fate alpha from being a Kickstarter backer and soon discovered not only was this game written in .Net but it used the Mono framework as well.  The graphics appear to be going through the Unity graphics library as well.  All of the .Net parts they are using can be used on mobile devices as well, presumably this is how Hex will be getting onto those platforms as well.  From a technical standpoint I'm very curious how this game will end up.

From a more personal standpoint its rekindled my interest in using OpenGL within a .Net application.  With that in mind let me dust off that old code and see if I can't figure out how to make it work again.

Friday, December 13, 2013

Character process

As I continue to muddle my way through learning to draw one of the things I'd like to keep track of is how my method for drawing people changes.  I've read about a few different approaches, but the one I like the most is the construction method from Andrew Loomis.

I like the concept of building up from a basic skeleton to the final image.  I don't follow it exactly as it's laid out in that book though.  Some of the steps seem to require a lot of work and don't seem to help me a lot so I pare them down quite a bit.  Essentially I've slowly been building my own process using the Loomis method as a base.

Monday, December 9, 2013

Reviving the Nook tablet

My kids have been tracing letters on my wife's phone for a while, this runs into trouble when both of them want to do letters and she's only got the one phone.  I've got this Nook Tablet lying around, it's been rooted to get access to full Google play store so putting the app on there should be a quick fix for this.

Had I known this would take me almost a week I might not have agreed so readily.

Friday, December 6, 2013

Coloring!

My kids love playing with sidewalk chalk and constantly request that I draw things for them.  Too often I'd look down at my chalk scribbles and be unable to recognize what I set about making.  This left the boys disappointed, and that clearly wouldn't do.  So for about six months now I've been making an effort to learn to draw.

It's been an interesting thing to figure out and I'd really like to write a bunch on the various techniques and processes I use when drawing stuff.  I've already changed my approach a few times and I'd like some way to track this better.

My most recent experiment is trying to color my drawings.  I got a box of cheap colored pencils to try out on a few pencil sketches to try and come up with something more interesting than gray scale shading.

Monday, December 2, 2013

C# and COM Interop

I recently came to a situation where I needed to perform some task in a VBScript that exceeded what the language permitted.  I could add a new DLL that includes the needed functionality which the script could make use of.  Ideally you'd probably want to use some form of Visual Basic to create the DLL, since at would allow all your data types to match what the script was using.  I didn't really want to use Visual Basic, so decided that if it was possible in C# then that's how I'll create my library.