Project 4: A (Tiny) Amusement Park and Water
Introduction

 Project4-Figure1.pngProject4-Interactive-Example.png

Water is commonly seen in our daily life. However, the interaction and rendering of water involve complex physical computation. Furthermore, interactive graphics is a program which can interact with the virtual world created by you. This project would like you to create an amusement park allowing users to have fun and interact with the program. Inside the amusement park, you must also explore a few possibility to simulate the water surface and render the surface with shader programs which become more and more important in graphics. At the end, you can use your creativity to create an interesting environment or an interactive simple game.

 

 

The Basic Task

With the advance of GPU technology, GPU becomes more and more popular in computer graphics specially in game industry. It is also noticed by general computation community. This project will provide you with experience at programming shaders with GPUs, modeling objects and creating interactive animations for computer graphics, and introduce you to many more of the features of OGRE3D. The starting point is the your work in Project 3. Your goal is to make the scene as a scene park based on the roller coaster. The overall goal of this project is to give you an opportunity to explore topics in interactive graphics: how do you make things that look interesting, and be interactive. While some of this is artistic (you need to pick interesting objects to make and good textures/... to look nice), some of it is technical: you need to pick things that can be implemented efficiently and have interesting behavior. Like project 1 and 3, this project defines a set of sub-goals with points awarded for each goal. Unlike project 1, the goals are far more loosely defined, so there is scope to try interesting things to get all the points available.

 

 

 

 

 

 

Furthermore, water surfaces are common in computer graphics, especially in games for creating fantastic effects. They are a critical element that can significantly improve the level of realism in a scene. But depicting them realistically is a hard problem, because of the high visual complexity present in the motion of water surfaces, as well as in the way light interacts with water. This project would give you the chance to explore techniques developed for rendering realistic depictions of the water surface. With these two things in mind, this project would like you to have the experience by implementing a shader program and a CUDA program to generate a water surface and then rendering it with reflection and refraction effects. In addition, ray-tracing is very important global illumination algorithm to generate realistic images in graphics community. Therefore, the project also ask you to implement a ray tracer for rendering the water and other scene objects.

In terms of your grade, effort spent on technical are more valuable because we are computer scientist. For example, it is better to spend your time making a simple "blocky" car drive around in an interesting way, or to make a simple shaped car out of parametric surfaces, or to light the car in an interesting way, then to carefully model a gorgeous model of a car. (of course, if you want to make model a gorgeous car, implement bezier patches to display its curved body, have it realistically race around a track ... - we won't complain).

Some specific things we want you to learn from this assignment (which will explain some of the requirements):

  1. To try out some of the technical topics that we've discussed in class (subdivision surfaces, culling, ...) or topics we won't discuss too much in class (particle systems, fractals, ...)
  2. To get some experience with how textures are used to make simple objects look more interesting.
  3. To get some experience with creating geometry for graphics.
  4. To gain experience working with a larger, more complex graphics application.
  5. To gain some experience creating the behavior/motion of graphics objects.
  6. To work with shaders for generating water surfaces and shading effects.
Water Surface Generation With GPU

Basically, the water surface can be simply decomposed into two geometric components: high-level surface structure and low-level surface details.

  • The surface structure represent the large scales of the wave movement and can be represented with a set of 2D grid with the y direction represent the height of the grid point. A vertex shader can be used to simulate the movement at the vertices by changing the normal and the y position of the vertex.
  • The surface detail represent the small scale perturbation in the local area and generally can be represented as a normal map. A pixel shader is created to generate a normal map for those perturbation.

Generally, there are several ways to implement the wave on the surface of water:

  • Sine waves (10) (Ref. 1): The sum of the sine waves are chosen to represent the complex water surface movement. The equation can be expressed as

  Project4-SineWave-Eq.png

  • Wavelength (L): the crest-to-crest distance between waves in world space. Wavelength L relates to frequency w as w = 2w/L.
  • Amplitude (A): the height from the water plane to the wave crest.
  • Speed (S): the distance the crest moves forward per second. It is convenient to express speed as phase-constant, phi , where phi = S x 2w/L.
  • Direction (D ): the horizontal vector perpendicular to the wave front along which the crest travels. Please refer to Ref. 1 for more direction details.
  • Height maps (10) (Ref. 3): similar to sine wave method, height map method decomposes the wave on the water surfaces into a set of different level of detail represented as a heightmap (the shape of single component and generated by artists) The following shows an example of the height map.

 Project4-Heightmap.png

The combination of the heightmap can be expressed as the following equation.

 Project4-Figure-HeightMap-Eq.png

Please refer to Ref. 3 for more heightmap details.

  • Wave equation(Ref. 4): Generally, the movement of the wave can be expressed as a wave equation as listed in the following:

 Project4-Wave-Eqn.png

Then by modeling the water surface as cubic Bspline surfaces, the right hand side of the equation can be expressed by the following:

 Project4-Wave-Right-Hand-Side.png

And then the integration can be computed with one of the following integration methods

 Project4-Integration.png

Then the equation is solved at each vertex of the 2D mesh to generate the water surface. Please refer to Ref. 4 for details.

Water Surface Rendering With GPU

Two important effects for the water surface rendering: reflection and refraction. We assume that we are looking outside the water. The reflection and refraction can be generated with the following different methods

  • Combination of refraction and reflection with an environment map for the sky and a set of texture map for the box. (Ref. 1) (10)
  • Using the refraction map and reflection map to simulate the possible viewing condition from above the water to simulate the refraction and reflection effects. (Ref. 4) (10). The following shows an example of refraction and reflection map

 Project4-RefractionAndReflection.png

In addition to the refraction and reflection, the caustics on the floor due to concentration of refraction and reflection is also visually important. Therefore, simulate the caustics effect on the floor is also important for the rendering. (5)

Project4-Caustics-Example.png

The Tasks

Fundamentally, to generate the perception of the water in an interactive application consists of two tasks: 

  1. Your program has to generate a water surface according to some physical rules which are formed for some specific phenomenon in your mind. This generated surface represents the boundary of water for a renderer to generate proper images for illustrating the water surface.
  2. Your program must render the water surface to simulate the effects of refraction and reflection. Furthermore, the caustics caused by water movement on the sea floor can be added to add more reality.

In addition, realistically rendering the water surface is also important for other graphics applications, a basic ray-tracing algorithm is required to simulate the global illumination effect in the scene. The ray tracer will generate an image according to rays through the center of all pixels to interact with the scene object and then compute the lighting effects and shadow effects.

Furthermore, each task requires modeling one or more objects using a specific technique from class. The points available for each technique varies according to the difficulty of the task. In all cases, you get a base number of points for implementing one object with a technique, then an extra 5 points for each additional, but distinct, object with the same technique. You can score points for a maximum of three objects with any one technique. For instance, if you create a texture mapped polygonal ticket booth, and a texture-mapped polygonal roller-coaster carriage, and extrude the roller-coaster tracks, then you get 20 + 5 + 25 = 50 points. If an object involves more than one thing, such as a texture mapped, swept surface, then you can score points for both texture mapping and sweep objects.

The maximum number of points is 100. As with Project 1 and 3, you can do as much as you like, and we will truncate to 100 as the final step in computing the grade. The individual tasks, point value, and example objects are:

Technique

Requirement

Points

Suggestion

 

Texture Mapping

  • You must create your own texture (at least 3) to earn the point from this score.
  • Add texture mapped polygonal objects to the environment. Each "object" for grading purposes consists of at least 5 polygons all texture mapped. Different objects require different maps.

5

Buildings, walls, roadways Hierarchical Animated Model

Hierarchical Animated Model

  • You must create your own hierachical models not import from maya or OGRE3D default.
  • Add a hierarchical, animated model. The model must combine multiple components in a transformation hierarchy. Different models need different hierarchies.

5

Ferris Wheel, any number of other fairground rides.

Paramatric Instancing

Add an object described by parameters. You must create multiple instances with different parameters, and each class of model counts for separate points, not each instance.

10

Trees (cones on sticks), buildings, even rides

Sweep Objects

Add an object created as a sweep, either an extrusion or a surface of revolution. The important thing is that it be created by moving some basic shape along a path. The overall object must use at least three different uses of the swept polygon. In other words, something like a cylinder isn't enough, but something like two cylinders joined to form an elbow is.

10

Rails for the roller-coaster, trash bins, trees

Subdivision

An object defined using the modified butterfly scheme. You must include a key press that refines the model, so that we can see the improved quality. The sphere example from class can help, somewhat, with this.

10

The roller-coaster car, organic looking roofs, ...

Really Cool Shaders

Graphics Processing Unit(GPU) has become very important aspect in graphics. We would like to explore the usage of them such as environment map, particle simulation, water simulation, and so on. Everyone has to write 3 shaders. But if the shaders do something really cool, that counts for technical challenge. Bump Mapping definitely counts as a technical challenge. A properly anti-aliased procedural shader would be a technical challenge. Phong shading would be a technical challenge except that you can get the code from just about anywhere - combine it with something more imaginative to make a technical challenge. We'll give technical challenge points for really imaginative shaders.

5 ~ 10 ( Depends on TA's decision)

Foundation, firework, ...

Hack Rendering Tricks

  • Local lights (5~10): have a light that only effects nearby objects. You can't just do this using the OpenGL falloff since that limits the number of lights you have - you'll need to switch lights on and off depending on what object is being drawn. Note: local lighting is NOT the hack "spotlight cones" that my sample program does. Consider putting a flashing (or even spinning) siren on a police car, or ...
  • Inter-object shadows and reflections (5-15): Shadows on the groundplane are easy. Shadows cast from one object onto another are much harder. Reflections of actual (dynamic) objects are really tricky - as opposed to using environment mapping with static environments. Implementing shadow mapping (or shadow volumes) is one way to do this.

5 ~ 25 (Depends on TA's decision)

...

Non-Photorealistic Rendering

Give your world an artistically styled look to the drawing. For example, make everything look like a pencil drawing by tracing object edges and making things squiggly, or use "toon shading" to make things look like a cartoon. Note: if you are really going to do an NPR world, we might be willing to remove the texture requirements - but only if you'll be doing enough NPR stuff.

5 ~ 20 (Depends on TA's decision)

Foundation, firework, ...

Very Advanced Texturing

  • Skybox (5): make a textured sky - have clouds and stars (at night). But note that a proper skybox stays fixed relative to the camera (so it doesn't have to be so huge that it causes Z-Buffer issues).
  • Billboard Object (5): model a complex shape by using a flat object that moves to face the viewer (and probably transparency). Nice trees can be done this way.
  • Projector Textures (5): make a slide projector or something that creates an unusual effect. To get full credit, it needs to be clear that you are using the texture matrix stack to get a projection.
  • Environment Map (5~10): Use environment mapping to create a reflective surface. Be sure to describe how you made the map.

5 ~ 25

...

Other Modeling Methods

  • Complex Procedural Model (5 ~ 15): Generate complex shapes using a procedure. You might make branching trees, buildings with lots of columns, fractal mountains, ...
  • Fractals (5 ~ 10): Implement fractal geometry (a random kind of subdivision) to make some complex shapes like mountains or trees.
  • L-Systems or other plant generators (5 ~ 10): These are procedural models like fractals that have specific rules for generating trees (or other plants).

5 ~ 35

Foundation, firework, ...

Performance Tricks

  • Level of Detail (5): Draw objects with different levels of detail - if they are far away, draw a simpler version. Showing this off is hard because if it works correctly, no one will notice (except that your program might be faster). Have a UI to force different levels of detail so we can see them, and see the performance difference.

5 ~ 15

Foundation, firework, ...

Animation Techniques

  • Particle Systems (5): Model a complex, moving object as a set of little particles. You can make fireworks, rain, snow, fountains, fire, ...
  • Fake Physics Effects (5): Use some kind of math techniques to make "physical" animations (like flags waving or water ripples in a pool, or flames). Rather than trying to simulate the physics, experiment with using procedural "hacks" (a waving flag can be a sine wave ...). Bonus challenge for doing fake physics using the shaders (for example, having the flag movement or water waves generated in the vertex shaders).
  • Very Complex Behaviors (5 ~ 15): Some behaviors are so complicated that they constitute a technical challenge. For example, flock simulation is a technical challenge.
  • Complicated Animations (5 ~ 15): a human walk around

5 ~ 55

Foundation, firework, ...

 

If there's something that you want to do that you think is a good task, but not listed, please ask. We may extend this list at a later date as we think of more ideas. We may not be able to help you with some of these, so doing it will require some bravery and determination.

It is important that if you do something, you are able to show it off in the demo/make a picture for your album. So if you model some nice object, make sure there's a fast way to get the camera to go there. Or, if you do subdivision, show different levels of the same object so we can tell you really did the subdivision.

Some of the challenges require something to be complicated. You might wonder "when is an animation complicated enough that it qualifies as a challenge" or something like that. Generally, if you have any doubt, then it probably isn't so complicated. But if you are in doubt, ask.

Components

Your park must have:

  1. at least a water surface with interaction
  2. water rendering effects: refraction and reflection
  3. Multiple objects moving at any time (besides the ones that I made)
  4. Multiple different types of behaviors (besides the ones that I made)
  5. Multiple different types of buildings / scenery (besides the ones that I made)
  6. Multiple new textures. Some must be hand painted. Some must not be flat (that is, it must wrap onto multiple polygons)
  7. You must attempt "enough" technical challenges (see the technical challenges page).
  8. You must have at least 3 shaders in your program (by "shader" we mean a pair of vertex/fragment programs attached to an object). At least one of these shaders must provide a procedural texture, and at least one of the shaders must be (properly) affected by the lighting. At least one of the shaders must be affected by the time of day (so you need to figure out how to pass the time of day to the shader).
  9. You program must work at a sufficient frame rate (which isn't hard since the tomputers are so fast).
  10. You must add something that is effected by the time of day (besides the one shader used to fullfill the requirement above). For example, you can have an object that changes color (the shader is sensitive to the time of day) and shape (something besides the shader is sensitive to the time of day).
  11. You must use at least one type of "advanced" texture mapping: multi-texturing, projective (slide projector) texturing, environment mapping, bump mapping, or shadow mapping. (if you want to pick something not on this list, you may want to check with us to make sure it counts) 10. An object made out of a curved surface. You can implement subdivision, or some form of parametric surfaces, or do a surface of revolution, or ... This is described more on the technical challenges page.
The Program Skeleton

Your program should build based on the roller coaster project.

Hints and Suggestions
  • Have fun and be inventive.
  • A key thing to consider is polygon count. Graphics hardware can only display so many polygons in a second, and if you try to display too many the frame rate will collapse. Texture maps also use memory, so too many textures can even more dramatically affect performance.
  • The way the train alignment is set up, it is simplest to do just a single carriage, and a short one at that. Doing lots of cars makes it harder to keep then on the track, although it is possible.
  • Make use of the OpenGL error checking mechanism. It is described in the OpenGL Programming Guide.
  • Start simple - just try to get a polygon to appear in the center of the world.
  • The way the current carriage transformations are set up, the origin for the train is assumed to be at the bottom (at track level).
  • It is OK to have multiple modeling techniques in one object. For instance, you could have a carriage made up of some texture mapped polygons with some subdivision areas. You get all the points if you do a sufficient amount of each technique.
  • It is OK to borrow code from other sources - but not other students. You will probably learn as much trying to figure out how someone else's code works as you would doing it yourself.
  • Texture images abound on the web, so feel free to use them. Or you can use a program like Photoshop to create your own. You might even find a use for the first project.
What to handin
  • As usual, you must hand in everything needed to build and run your program, including all texture files and other resources.
  • If you work with a partner, only turn in one copy of the project. In the other person's directory put a single file in your handing directory - a README.txt that says where to look.
  • In your readme, please make sure to have the following (you can break it into seperate files if you prefer):
    • Instructions on how to use your program (in case we want to use it when you're not around)
    • Descriptions of what your program does to meet all of the minimum requirements.
    • A list of the objects you modeled (if you made lots of different objects, just list the 5-10 most interesting ones). Please order the list so the most complicated/impressive one is first.
    • A list of the behaviors you made. Please order the list so the most complicated/impressive one is first.
    • A list of the shaders that you made with a brief description of each.
    • A list of the technical challenges that you attempted / completed, with a description of what you did and what you used it for.
    • If you used the sample, code, a file that describes any changes you made to the "core" of the system (e.g. other than changing main.cpp and adding new Objects and Behaviors).
    • If you did not use the example code, an explanation of why you chose not to, and a discussion of your program's features.
  • You should make a subdirectory of the project directory called "Gallery." In this directory, please put a few JPG pictures of the best scenes in your town. Please name the pictures login-X.jpg (where X is a number). Put a text file in the directory with captions for the pictures. (note: to make pictures, use the screen print and then use some program to convert them to JPG).
  • You must also make a subdirectory of the project directory called "Video" to put a 1~2 minutes of video capturing your world.
Results

詹家棋, A (Tiny) Amusement Park and Water -- 詹家棋

Detail

林德潔, A (Tiny) Amusement Park and Water -- 林德潔

Detail

莫立恆, and 陳政焬, A (Tiny) Amusement Park and Water -- 莫立恆、陳政焬

Detail

Yan-Lin Chen, and Ying-Sheng Luo, A (Tiny) Amusement Park and Water -- 羅應陞、陳彥霖

Detail