CPE 471 Project

Fall Quarter 2020 - Marine Cossoul

About

This project was focused on the realistic representation of a dark and rainy street. The main technologies implemented in its development were particle systems, lighting strategies, camera movement/view, and object manipulation.

The following actions control movement through the scene:

Technologies

Particle System

In order to create the visual of falling rain, I implemented a single particle system with 1000 particles that originate above the center of the scene. The particles are ejected out from the starting point along the length of the street and fall while observing the physics of gravity. The lifespan of the particles is varied slightly, so as to give a random 'fall time', and the particles respawn at the origin point after crossing the ground level. The particle system also implements alpha coloring, and the particles therefore fade as they fall, creating a more realistic translucent quality to the rain particles.

Lighting

Because the scene is set to take place at night, there is no single large light source to represent daylight. Instead, the scene is lit by the lamps that line the street. This was implemented with an array of 20 light position vertices (with the coordinates of each lamp) that were passed to the shaders. In the shaders, the diffuse, specular, and ambient lights were calculated in a loop, and the color of each point was determined by the sum of the effects of each light on that point. In addition to this, I decided to implement distance attenuation to the lighting to demonstrate the reach of the light from each lamp. This is shown in the included videos, as the points closer to each lamp are illuminated much more than points that are farther.

Camera Movement / View

The movement of the camera (i.e. the user's view of and movement through the street) was determined by pitch/yaw movements as well as dolly/strafe calculations. This allows the user to change the angle of their view with the movement of the mouse, as well as control their position in the scene with the AWSD keys. The user will move along the angle of their 'View', creating a very intuitive position control interface. Additionally, I implemented collision detection with the street and buildings, so the user cannot pass through them.

Object Manipulation

One challenge of this project was to manipulate object files in order to shade components separately. Originally, the obj mesh that I used included the street, lamps, and buildings in one file. Some data manipulation allowed me to separate these into distinct objects in order to shade/texture them indiviudally. Additionally, half of the street had inverted normals in the original mesh, causing significant issues with the lighting. Again, this was fixed with object manipulation.

References

Helpful OpenGl tutorials

Simple Street Obj Mesh

SkyBox