Friday, April 13, 2012

Part 10 : Bump Mapping with CrazyBump


In this post, I'm going to use normal mapping to "fake" details on the cube. I will also add specularity which will make those details pop out. There's a few software products out there that generate normal maps automatically by analyzing a texture.

As it turns out, CrazyBump is pretty neat one, and as of this writing, the mac version is in public beta. When it's no longer in beta, well, you can either find another software, or, ahem... do what you have to do.

As usual, here's a link to what I've done so far: Project

I've taken the time to add a few more comments and fix some things here and there.

Wednesday, April 4, 2012

Part 9: Texturing and Compression


For this post, I'm going to show you how to use texturetool, which comes bundled with the iOS SDK. This tool is used to compress textures so that they take less space in memory using the PVR texture compression format. You can compress your texture to use 2 bits per pixel without completely destroying the image, which is pretty amazing. Of course, there's different levels of compression, but I'll be using this one.

Also, this tool allows you to generate mipmaps offline, and GLKTextureLoader will automatically detect them. After having created the compressed textures, I will load them inside our application. I will then add a texture coordinate for each vertex in our vertex array and use them to sample the texture in our fragment shader.