Skip to content
Feb 14 12

Central State Mental Hospital (Milledgeville, GA)

by admin

Traveling back from Savannah, GA we decided to swing by the Central State Hospital. Built in 1842 and peak population of 12,000 patients this place was a must see for me.  I was expecting a single large building but instead it was very large campus style layout. I was not able to find the graveyard which they used numbers instead of name markers. Here the pictures from our trip, sorry I did not go inside.

read more…

Dec 11 11

GLSL Bump Mapping

by admin

This is my last post on GLSL. To tell the truth after all these post on GLSL I do not fully understand it. Either way here is bump mapping using GLSL. To make more sense of bump mapping here is an except from my project.

Bump mapping is an alternative to normal mapping in that it uses a grayscale height map instead of an RGB map. The height map determines how high something is. However, we won’t be actually moving any vertices. Like normal mapping, we will only change the normals.

As you may recall, the normal is perpendicular to the surface underneath. Another way to put it is that the normal is perpendicular to the tangent of the surface. Hence, we need to first calculate two tangents. To calculate a tangent, we need to know the height value just above and below (or to the left and to the right) of the current position. We can offset the texture coordinates in four different ways and use these offsets in four calls to texture2D. Note, for some maps, you may need to fiddle with this offset value to get something right (….this is probably why normal mapping is more prevalent in industry….). Once you have the two tangents, simply cross them and normalize to get the new normal.

I changed the camera angle to show the bumps better.

read more…

Dec 10 11

GLSL Normal Mapping

by admin

Here is my version of GLSL Normal Mapping. A normal map is an RGB texture where the RGB value corresponds to the XYZ of the normal. Since we are only doing mapping onto a quad, we simply need to replace (not offset) the old normal with this new read normal. There is one caveat, however. RGB values range from [0,1] while normal directional values can range from [-1,1]. The same should go for green and blue.

I tried to do Blinn-Phong reflection but i am not sure if it is correct.

read more…

Dec 9 11

GLSL Desert Mirage/Heat Wave Effect

by admin

Here is another GLSL code sample from my project. This one was fairly easy after they gave us the formula to use. Here is the code and image of the results.


read more…

Dec 8 11

GLSL Edge Detection

by admin

Here is an edge detection I created for class.  I used a Laplacian stencil sums up, down, left, and right values and subtracts them by 4 times the center value.

 


read more…

Nov 20 11

GLSL Phong and Gouard Shading

by admin

I recently wrote a program for class the compared Phong and Gouard shading using the OpenGL shader language GLSL. To sum it up in a couple of sentences, Gouard shading uses per-vertex shading and Phong uses per fragment/pixel shading. Gouard will look more flat shading because the triangles (triangle mesh) will have a solid color. Phong shading colors per pixel so the triangles can vary in color inside the triangles.  In GLSL the lightening calculation will be calculated in the vertex shader for Gouard and in the fragment shader for Phong.

Nov 3 11

Find the closest point

by admin

This post is the third installment from my post (How to detect a collision between a circle and a line).  In this post I will show how to find the closest point to a point/circle. It is pretty straight forward after you know how to determine the distance between 2 points. read more…

Oct 27 11

Determine if a point/ball is above a line

by admin

This post is the second installment from my previous post (How to detect a collision between a circle and a line).  In this post I will show how to determine if a circle or point is above a line. If you know anything about a dot product of two vectors then you probably could come up with the ‘if’ statement yourself. Without going in to too deep of details about dot products, it is basically means if two vectors point the same direction then their dot product will be greater then zero.

read more…

Oct 20 11

How to detect a collision between a circle and a line.

by admin

I just now finished another computer graphic school project and want to share a few things. As you can tell there is a few bugs, but that is a different story. So far I am going to do this any many parts. I wanted to start off by talking about how to detect a collision between a circle/ball with a line. I will later talk about how to find the reflection, what to with many different lines and what else I can brew up.

Here is a visual of what I am talking about:

read more…

Sep 9 11

Curve Subdivision using Neville’s Method

by admin

Here is some code and an applet of showing how the Neville’s method affects curve subdivision.  How to use the applet is on the bottom. Check out my previous post on an applet that just uses Neville to compute a curve. Enjoy!

Subdivision with Neville’s Method