February 28, 2015

Trying

So I made two separate shader programs: one for the skybox and one for the rest of the scene.  Took a while in doing so because I'm an idiot sometimes and made some dumb mistakes.

Things for Grace to remember next time:
- Before calling glUniform[...] you need to make sure the appropriate shader program is loaded first (uniforms won't get passed through otherwise)
- If you don't bind the correct vao's right before drawing (if you have multiple shaders) then weird stuff happens where attributes of one shader affect the attributes of another.  Left pic below, the weird shape in the bottom is supposed to be my skybox but it was affected by the Gulpin's geometry.  Right pic is correct version.  Hi Gulpin!
- You need to match up the names you're giving variables in the shaders with the names you call in glGetUniformLocation or glGetAttribLocation!  Errors will result if not!

Many more.  These are the ones I remember off the top of my head.

Trying a crack at procedural geometry, I eventually want to use Perlin noise but right now I'm just using a random number generator in the vertex shader to affect the height of the ground


SUCH a hack right now but it's a start.

February 20, 2015

When you get seams on your skybox, don't just assume it's OpenGL's fault.  Maybe you just suck at cutting images evenly.

It looks good now tho :)
Outside the skybox

Inside the skybox

I've never tried procedural terrain generation before but imma give that a try

February 19, 2015

Updates

I haven't been neglecting my graphics study.. I just had a small issue where both of my laptops stopped working within 2 weeks of each other, and I'm dumb and didn't use Github for any of them so I've had to rewrite all of them from scratch, twice.  Plus side is that it's gotten quicker and easier each time.

Anyways, I've been trying to recreate this scene in OpenGL:


It's kinda an inside joke between me and a few school friends so I thought it'd be fun to make a project out of it (Assignment 2 on Stanford's calendar).  Modeled the Gulpins in Maya and loaded them into OpenGL through an obj loader script I found online.  I was gonna model Charizard but first laptop broke and for sake of time I just modeled an angry face.

Then second laptop broke and instead of going back to this project, I'm gonna start a new one that I had considered before.  I'll post updates once I get enough of it working to show off.

Discovered SOIL as a way to load images into OpenGL which makes it a lot easier than last time I tried, once I got SOIL working.  I'm starting to understand linkers and include directories better in Visual Studio but I definitely did not understand it before.  And for SOIL you have to open up the directory in a separate Visual Studio project, build it, then copy the project over to your current project in order for it to work, which took me a long time to figure out.  Once you get through the initial frustration of hooking of SOIL though, it seems to be a lot simpler than what I used last time for image loading.

I really wish I still had the code for my Harry Potter wand.. it was cool, especially since I've really been in a Harry Potter mood lately.