teaching machines

Feature 8 Post Mortem

March 23, 2013 by . Filed under cs455, postmortems, spring 2013.

This feature was fairly simple to implement.  Using the code supplied by Chris Johnson, I simply had to read in the .ppm image for my texture and send it off to the shaders.  One thing I had to worry about, was making sure my texture mapped to the terrain correctly.  Because I felt it would use tremendous resources to make my own texture coordinates array for the terrain, I decided to use the vertex positions to map to the image.  By specifying a texture width and height as uniforms in the vertex shader, I could then divide the position coordinates by the width and height to make the texture coordinates map into the 0 to 1 space of the image.

Here is some screenshots comparing the untextured and textured landscapes:

 

Here is a short video showing the landscape in action:
[youtube http://www.youtube.com/watch?v=XArhbtsYEls?feature=player_detailpage]