Haunted Town
Hamburger Catering

Haunted Town

About picture

About


The Haunted Town

My 471 final project is to make an scene where our protagonist is lost in a haunted town; there's fog everywhere and empty houses. On the sky, there are "meteoriods" falling down. After certain amount of time passed, the meteoriods are going to explode to small pieces, and our protagonist is unharmed.

This project shows things that I have learned from this class and more. Although creatively, it doesn't look the best. I went into this project trying to implement all the technologies that I thought were cool and achieve realism in a graphics project. There are multiple textured objects in the world (e.g. houses, ground, trees). I modeled the ground myself with blender and applied different textures to it. The trees and two house models were from TurboSquid. I implemented my application to be able to apply normal map and specular map to the mesh (if they are available). Other than that, I also have hierarchical model animation, explosion effect, fog effect, collision detection and resolution, and shadow.


Features


Hierarchical Modeling

Our protagonist is animated to be running away. I had to look through the labels of dummy model parts to identify each index of model parts. Each object of the model is animated individually. Without hierarchical modeling, it would be a nightmare.


Exploding Mesh with Geometry Shader

Geometry shader can manipulate and change the triangle primitives. We can use geometry shader to move each individual triangle face along a set path. Of course each face has randomly assigned initial velocity to simulate the breaking apart feeling; else you would see the entire mesh moving as a whole as if nothing has happened. Another common exploding animation from geometry shader is having each face moving along its own face normal.


Fog Effect

This was implemented in the fragment shaders. Based on the depth of the view space (i.e. how far away the camera is to the fragment in world space), the color of the material/texture will drop down toward black, and the color of the fog ({r, g, b} = {0.5, 0.5, 0.5}) will become more prominent. Similarly, if the position of the camera is higher up (+y direction) compare to the ground, the fog effect also will be more prominent.


Shadow Mapping

This is my attempt at shadow mapping for directional light. Overall, the result is not too bad. However it doesn't look really realistic; as seen in the picture, you can't really tell where the light is coming from, i.e. is it in front of the house or behind it. Also the edge of the shadow is really jagged. Nonetheless, the technique to achieve this result is we draw all the meshes from the point of view of the light source (since we are using directional lighting, the light source is theoretically infinitely far away; we can just pick a point high up in the world, with its look at vector in the same direction as the light direction from the source to the scene). Any mesh that was drawn in the view of the light source would be the shadow, and this information is recorded as a texture map that our fragment shader can read in and draw any pixel that's in this shadow space with black color or darker color of the materials/textures.


Prototype Physics Engine

A simple physics engine is implemented in the project. This was use to detect collision between the meteoriods and the ground (each physics object, the meteoriods and the ground, is bounded by a bounding box). Although my scene is not doing the engine justice here.

running
meshExplosion
shadowAndFog
meshExplosionWCollision

References


Contact


Quan Bui

California Polytechnic State University, San Luis Obispo

qbui@calpoly.edu