Final Project - Stanford Universityphysbam.stanford.edu/~patkar/final_project.pdfAmbient occlusion...

8
Final Project CS 248 Spring 2012-2013 Here’s the moment you’ve all been waiting for! Drum roll please. It’s time to announce the CS 248 Final Project! The Final Project is an opportunity for you to put all the knowledge and skills you have gained during the course to produce a stand-alone capstone project. You are free to use your code from previous asignments. Proposal due: 29th April. Milestones each week Project Due: During the finals week. 1 Requirements For this project, you are required to make an interactive, 3D computer game. You are allowed to build up on existing game engines e.g. the unreal engine or unity. You are also free to use other libraries (for example for sound, physics, etc.), as long as you clearly document their use. If you have any questions about whether a particular package will be allowed, feel free to post a question on Piazza. For this project, you may develop on any platform you like, in any language you like (although the course staff might not be able to support everything). You will be using the same machine that you develop on to demo your game, so make sure that you are able to bring it and run it in Gates. This means you’re free to create your game on a laptop/desktop, mobile device or a web-based game that can run on any of these devices. Just make sure you can bring it to Gates on the day of your demo. That means, if you’re bringing some serious hardware, please come early to your demo and allow enough time to get set up (in fact, you should arrive twice as early you think you should, in case anything goes wrong). The basic functionality your game must have is: The game must be rendered in 3D. That is, you cannot have gameplay be animated predominantly by sprites. However, you can have 2D gameplay, such as a sidescroller with 3D models for the player, etc. It must be interactive, the player’s actions should affect the course of the game (i.e. no movies). The game must run smoothly at interactive framerates (>15 fps). It must incorporate texture mapping and lighting/shading. 1

Transcript of Final Project - Stanford Universityphysbam.stanford.edu/~patkar/final_project.pdfAmbient occlusion...

Final Project

CS 248 Spring 2012-2013

Here’s the moment you’ve all been waiting for! Drum roll please. It’s time to announce the CS 248 FinalProject!

The Final Project is an opportunity for you to put all the knowledge and skills you have gained during thecourse to produce a stand-alone capstone project. You are free to use your code from previous asignments.

• Proposal due: 29th April.

• Milestones each week

• Project Due: During the finals week.

1 Requirements

For this project, you are required to make an interactive, 3D computer game. You are allowed to build upon existing game engines e.g. the unreal engine or unity. You are also free to use other libraries (forexample for sound, physics, etc.), as long as you clearly document their use. If you have any questions aboutwhether a particular package will be allowed, feel free to post a question on Piazza.

For this project, you may develop on any platform you like, in any language you like (although the coursestaff might not be able to support everything). You will be using the same machine that you develop on todemo your game, so make sure that you are able to bring it and run it in Gates. This means you’re freeto create your game on a laptop/desktop, mobile device or a web-based game that can run on any ofthese devices. Just make sure you can bring it to Gates on the day of your demo. That means, if you’rebringing some serious hardware, please come early to your demo and allow enough time to get set up (in fact,you should arrive twice as early you think you should, in case anything goes wrong).

The basic functionality your game must have is:

• The game must be rendered in 3D. That is, you cannot have gameplay be animated predominantly bysprites. However, you can have 2D gameplay, such as a sidescroller with 3D models for the player, etc.

• It must be interactive, the player’s actions should affect the course of the game (i.e. no movies).

• The game must run smoothly at interactive framerates (>15 fps).

• It must incorporate texture mapping and lighting/shading.

1

• The game must be threaded if implemented on a desktop/laptop.

Beyond these basics, we are also expecting that you implement some more advanced features. We allow youto use external libraries, but you will be graded based on the value that you add to the material you startwith. In particular, you should have some good, nuanced answers to the question, ”What algorithms or ideasdid you implement?”

That means, if you use an external library, we’re expecting you to use it in some interesting way, ratherthan as a shortcut for not having to implement things yourself. This is particularly true for things related torendering and animation, as they are relevant to the topics covered in class. For example, integrating anexisting physics library might help you make a more fun game, but will not score you any points. The way toscore big points would be to use that physics library as a stepping stone towards more advanced effects, likefluid dynamics or destructible/deformable objects. On the other hand, if you choose to start from scratch, wewill not require as much because you will have to implement more basic functionality yourself.

To make this example a bit more precise, integrating an existing rigid-body simulation engine into yourgame would be warrant few points (but could help you make a really fun game); building a rigid-bodysimulator yourself would be considered “medium to hard”; implementing advanced physics simulation yourself,such as fluid dynamics or physically-based character animation, would be considered “hard” (see next sectionfor more details).

We’re expecting larger teams to have more advanced games than smaller teams, in particular, each teammember is supposed to implement either 1 “hard” or 1 “medium” and 1 “easy” or 3 “easy” tasks.

2 Teams

You can work in groups of upto 10 (yes ten) students!! Each student needs to have a well defined area. Hereis the list of the allowed areas and maximum allowed members per area

• Animation (2 members)

• Simulation (2 members)

• Rendering (2 members)

• Geometry (2 members)

• Sound (1 member)

• Performance (1 member)

If you have a very small team you can work in multiple areas. Each game is required to have some basicrendering, geometry, animation and simulation irrespective to the team size. So we suggest that you have ateam of at least 2 people.

3 Tasks

Here is the list of tasks and their difficulty according to us. This list is definitely not exhaustive andyou are free to add your own ideas to the list. Be sure to confirm with the staff in this case to makesure that your idea is within the requirements of the project. Note that the difficulty ratings are moreof a rough estimate and are subject to change, and many of them depend on the exact feature that youimplement. Many topics below can be made as “hard” as one wishes and are active research topics. We willgive you specific feedback once your proposal is in.

2

Rendering

• Real-Time ray tracing. With the availability of fast GPUs it is possible to do ray tracing in realtime. It is still quite difficult to do since the rendering data needs to be transferred to the GPU memoryfrom the CPU memory. You would also have to write some basic GPU kernel code (CUDA/OpenCL)for the ray-tracing to work. References:Optix

• Ambient occlusion. Ambient occlusion is a rendering technique that simulates the shadows found incracks and corners of objects. It was implemented in many big-name titles, like Crysis and Batman:Arkham Asylum. Check out the the link here on Screen-Space Ambient Occlusion. Take a look atHBAO in particular. [Difficulty: easy to medium]

• Non-photorealistic rendering. Using non-photorealistic rendering can give your game a beautifulstylized appearance. A number of techniques are described in Chapter 11 of the ”Real-time Rendering”book. References: Stylized rendering techniques for scalable real-time 3D animation, Shades of Disney,Paper [Difficulty: easy to medium]

• High dynamic range rendering and optical phenomena. Human eyes adjust to the light levelssurrounding them; even with an extremely bright light source, details can still be seen in surroundingdarker areas. HDR rendering attempts to achieve greater realism by performing lighting calculationsusing more than the typical (0, 1) range of values. See Section 10.11.1 in the ”Real-time Rendering”book. [Difficulty: easy to medium]

• Camera effects. Bloom, lens flare, film grain and ”old-television” effects, etc. are often added inmovies to add more atmosphere to a scene. The same can be done now with modern graphics hardwareand is used in various video games to achieve the same effect. [Difficulty: easy to medium]

• Deferred rendering. Deferred rendering outputs data for the lighting equations into separate textures(or channels) and then combines them at the end. Using deferred rendering, a large number ofdynamic lights can be easily managed in the scene. Games using this technique include StarCraft II,S.T.A.L.K.E.R., and Halo: Reach. [Diffuculty: medium]

• Depth of field. Depth-of-field can give some extra realism to a game, and force the player to focus onimportant objects. It can be used to great dramatic effect. One can either post-process a scene usingthe depth buffer, or for more physically accurate renderings, accumulate renderings of the scene fromdifferent parts of a camera aperture. See Section 10.13 in the ”Real-time Rendering” book. [Difficulty:easy to medium]

• Motion blur. Motion blur is good for a fast-paced action game, and makes fast-moving objects lookmore realistic. We recommend implementing motion blur using the velocity buffer. Please do notimplement the ”accumulation buffer” method, as it does not produce motion blur at correct time scalesand generally does not look good. See Section 10.14 in the ”Real-time Rendering” book. [Difficulty:easy to medium]

• Screen-based anti-aliasing OpenGL provides polygon-level anti-aliasing, but that produces prob-lematic results at polygon seams, where the background bleeds through. True anti-aliasing involvesrendering the scene using a higher sampling rate, with possibly randomized pixel locations. See Section5.6.2 in the ”Real-time Rendering” book. [Difficulty: easy to medium]

• Atmospheric scattering. This involves writing a special shader. Check out this whitepaper fromNVIDIA. [Difficulty: easy to medium]

• Complex Shadows.Basic shadow mapping is a part of Assignment 3. For the final project, you cantry out some more complex shadowing techniques, such as shadow volumes and the generation of softshadows. See Section 9.1 in the ”Real-time Rendering” book. [Difficulty: easy to hard, depending ontechnique(s) used]

3

• Volumetric Effects - For flames, etc. we often simulate these volumetric particle systems with sets ofparallel planar quads texture-mapped with a translucent texture. However, when this intersects withgeometry in the scene, we get nasty edge effects. This can be ameliorated through the use of ”softparticles”, as summarized on this page. Also see this page from Nvidia. ”[Difficulty: easy]”

• Parallax/Relief Mapping Simple bump mapping can make a surface appear to have more geometry,but it only affects the lighting. What if you want to have bricks look like they were actually protrudingand occluding each other? Parallax mapping and relief mapping are approaches that address this.[Difficulty: easy to medium]

• Displacement Mapping While parallax mapping and bump mapping work great in the middle ofsurfaces, they fail at edges of polygons. For example, bricks won’t protrude past the edge of the polygonthey’re jutting out of. With displacement mapping, you actually perturb the geometry using a texture.See Section 6.7 in the ”Real-time Rendering” book. [Difficulty: easy to medium]

• Other advanced rendering effects. There are plenty of rendering effects that can enhance the visualappeal of your game or set up a stylized atmosphere that enhances the gameplay. You can experimentwith area lights and soft shadows, atmospheric effects, camera effects, ray-tracing as textures, andmuch more. The book Real-Time Rendering is a wonderful source for ideas and specific algorithms.Strive to use these advanced effects in service of the game play. Avoid using them as superfluous eyecandy. Make sure they fit the overall environment of the game. Try to immerse the player in a visuallycohesive experience. [Difficulty: easy to hard, depending on the feature]

Geometry

• Procedural geometry. You can use procedurally generated models to enrich your virtual world.You can procedurally generate terrains, plants, buildings, or even whole urban environments. Youmight even be able to do away with storage of your world all-together and generate it on the fly froma stable random seed, like MineCraft, or Elite. You could also use procedural generation to createtwo-dimensional or three-dimensional textures. [Difficulty: easy to hard] References: Texturing andModeling: A Procedural Approach, Algorithmic Botany, Procedural Modeling of Cities, ProceduralModeling of Buildings, Terrain Generation Based on Simulating Erosion, Continuous LOD TerrainMeshing Using Adaptive Quadtrees, Terrain Project, Real-time, continuous level of detail renderingof height fields, A Multiresolution Mesh Generation Approach for Procedural Denition of ComplexGeometry, Creation and rendering of realistic trees

• Implicit Surfaces/Tesselation - When Quake I came out, one problem with it compared to itspredecessor, Doom, was that its fully polygonal engine meant that monsters, etc. looked very jaggedand not smooth, due to the fact that rendering many polygons was hard. In modern graphics, we solvethis problem by either defining the surface implicitly using some sort of analytic function, or definingthe surface with a super-dense mesh. Then, when we render, we use tesselation techniques to subdividethe surface into polygonal elements whose size varies with the size of a screen pixel such that we seecurved/smooth surfaces. The movie industry takes this to an extreme, and subdivides the objects inthe scene into micropolygons the size of pixels and then assigns each polygon a single color, with nointerpolation inside a polygon. See Section 12.2 in the Real-time Rendering book. [Difficulty: easy tohard]

• Functional portals Portal, from Valve Software, while simple to play, uses many techniques for itsportals to be transparent to the user. Walking through a portal transports you instantly to anotherpart of the map with no inconsistency in the middle. In this feature, portals are more than a renderingtechnique: you can actually go through them, they actually work. Physics simulation across portalscan get quite tricky, if you choose to implement it. [Difficulty: easy to hard]

• Metaballs: wikipedia, Paul’s Projects, geisswerks, GPU gems

4

Animation

• Rigging and skinning. Driving complete characters with skeletal animation is non-trivial, especiallyif you implement skinning yourself and also try to simulate muscle under the skin. [Difficulty: easy tomedium]

• Motion capture. Motion capture data can enhance the realism of character animation. It is relativelyeasy to have a character perform pre-recorded motion clips. What is much more difficult to processand blend the motion data so that the character responds to the user interaction and can performanimations not explicitly seen in the recorded data. This is an ongoing area of research and you arewelcome to try to implement some of the published data structures and algorithms in your game to getinteresting effects. Links to motion capture data repositories can be found below. [Difficulty: easy tohard] References: Motion warping, Verbs and adverbs, Motion graphs, Interactive motion generationfrom examples, Motion synthesis from annotations.

• Physically-based character animation. Characters animated with physical simulation of thedynamics of their motion can be more adaptable to their environment and more responsive to userinput. This can be very hard to make look good! Excellent feature if you want to go to grad school.It will not gain you much, though, if it doesn’t look good when all is said and done. There are alsosome techniques that try to combine physical simulation with motion capture data to allow novel butrealistic animations.[Difficulty: hard to very hard] References: SIMBICON: Simple Biped LocomotionControl, Continuation Methods for Adapting Simulated Skills, Robust Task-based Control Policies forPhysics-based Characters.

Simulation

• Water. There are a number of techniques for simulating water (particularly large bodies of water) inreal time. References: this tutorial and this paper. [Difficulty: medium]

• Basic rigid-body physics. [Difficulty: medium] Your game might include rigid-body simulation ofobjects interacting with their environment, responding to forces, etc. References: Rigid body dynamics,Physically Based Modeling.

• Dynamics of linked structures. [Difficulty: medium to hard] You might want to physically simulatethe dynamics of connected chains of rigid objects. References: How to simulate a ponytail, Five physicssimulators for articulated bodies, Physically Based Modeling.

• Cloth simulation. [Difficulty: medium] As the linked structures become small and numerous, you startto get a cloth. There are a lot of simulation problems here, from numerical stability to avoiding artifactssuch as self-intersection. Reference: Large Steps in Cloth Simulation, Physically Based Modeling.

• Destructible objects, fracture. [Difficulty: easy to hard] Reference: Real-Time Deformation andFracture in a Game Environment, Animating Fracture, Graphical Modeling and Animation of BrittleFracture, Graphical Modeling and Animation of Ductile Fracture.

• Elastic objects, deformation. [Difficulty: medium to hard] Objects that bend, squish, or tear basedon their interaction with the environment. References: Elastically deformable models, Modeling inelasticdeformation.

• Fluids, fire, explosions, smoke, other natural phenomena. [Difficulty: easy to very hard]References: Stable Fluids, Visual Simulation of Smoke, Physically Based Modeling and Animation ofFire.

5

Sound

• Sound propagation. [Difficulty: hard] You can simulate how sound propagates through environments.Reference: Survey of Methods for Modeling Sound Propagation in Interactive Virtual EnvironmentSystems.

• Physically-based sound. [Difficulty: hard to very hard] You can synthesize sounds for events thatoccur in the world. For example, when objects collide, you can synthesize realistic sounds for thecollisions based on the material properties and geometric structure of the objects. Fluids also makesounds that you can generate by analyzing their dynamics. You can even simulate whole new musicalinstruments this way. Reference: Synthesizing Sounds from Physically Based Motion.

Performance

• Very large or very detailed environments. If your game involves a very large world with manyobjects at different scales, you might have to use advanced optimization techniques to retain real-timeperformance. Many of these involve eliminating objects as early in the pipeline as possible, so theydon’t have to be processed later on. These include techniques such as view frustum culling, occlusionculling, geometric simplification, and image-based rendering (e.g., impostors, billboarding, or depthimages). For geometric simplification and image-based rendering, the challenge is to reconcile real-timeperformance with seamless visual appearance. [Difficulty: easy to hard]

• Multithreading other tasks

4 Deliverables

Proposal

• Due by 07:40pm on Monday, April 29th

• Around 1 page

• One proposal due per team: List all team members & SUNet ID (max 10 members)

• Submit to the staff list

• List of features, both graphical and gameplay-related. Make sure that the list of features meets therequirements given in the table above.

• At least one image (e.g., sketches, concept drawings, screenshots, reference images)

The proposal should clearly state the premise of your program, describe the 3D world you plan to buildfor it, outline the gameplay and interaction and enumerate the advanced techniques you plan to implement.If you envision facing any special technical challenges (like predicting collisions between a basketball and ahoop, working on specialized hardware, etc), list them. This is also the place for us to evaluate whether ornot your project seems to have enough ”value added”. Also, if you have an idea for an advanced feature thatwe haven’t mentioned, please feel free to share it here and get some feedback. If you envision needing anyspecial tools to achieve your goals, like a laser scanner or a motion capture system, tell us how you’ll getaccess to these tools.

Finally, you must include at least one image in your proposal, to illustrate the proposed game. We don’tcare how you produce this image: a scanned pencil sketch will do, or something you whip up in your favoritedrawing tool. Carefully label the important elements in your image. Sample labels might be: ”waterfall [here]will be animated with physically-based fluid simulation”, or ”[these] missiles will emit particle system smoke”.The purpose of this requirement is to help us understand your proposal, and to help you think about howhard or easy it might be to implement what you propose. We will give feedback to every proposal duringthe demo session. Hopefully, most of these responses will be of the form, ”Cool idea! Full speed ahead!”.However, if we see you headed towards the shoals, we’ll let you know.

6

Milestone

• Due every Monday 7:40 pm from the week after the proposal is submitted.

• Revise your original proposal

• Update the status of each feature (e.g. ”Implemented well”, ”Partially implemented”, ”Scrapped dueto time constraints”)

• Include visuals of your graphics created by your own code: Take a few screenshots or a screen capture(video) of the current system or show us the code in action!

• You will get a +, = or - based on your proposal and your current progress. Though this will notaffect your grade directly this should be a good indicator of how well you are doing. If you get alot of +’s then you are probably doing well and you should get a good grade in the end. On the otherhand if you get a lot of -’s then you should not be surprised if you get a no so good grade.

The milestone allows us to measure your progress and ensure that your assignment is within reasonablescope. List the features from the original proposal and give us a short summary of the status of each one.Let us know what is working well, what is mostly working (and maybe we can give some pointers), andwhat is just not going to make it to the final project. You can add and/or remove features at this stage,but make sure you still meet the requirements given the size of your team. We look forward to seeing yourworks-in-progress!

Final Presentation

• Due during the finals week

• No late days

• Submit a report

All team members must be present at the demo. During the demo, make sure you tell us what features youhave implemented, external or third-party sources (frameworks, references, models, textures, game-enginesetc.) that you used. Functionality you don’t show us or that doesn’t work will not be given credit. Yourreport should list your team members and should explain what advanced features you implemented andhow you implemented them. You should be concise (bullet points are fine), but describe the full technicalrange of what you’ve implemented - for example, if you’ve implemented a character animation system, we’dwant to be able to distinguish between something that uses keyframes and something that uses a customdynamics engine. Also, your writeup should include references to any external sources you referred to forinspiration and/or code, and it should indicate how your 3D models and other content were obtained. If youused external content as starter code and modified it, please let us know what you modified.

5 Evaluation

The final project is worth 60% of your final grade. We will evaluate you based on three criteria

1. Individual Contribution (20 %): This will be based on the tasks you implemented and their difficultylevel.

2. Category (20 %): This will be based on how well your category (say rendering) is represented in thegame.

3. Final Result (20 %): This will be based on how good your final game is in its entirety.

7

6 Competition

The game will be judged on the overall quality and fun-ness of your game, in addition to the graphical content(don’t worry this will not affect your grade!). We know that this is subjective, but this is how game audiencesevaluate games. You should imagine being evaluated by people from outside the class, who don’t necessarilyknow (or care about) all the technical details that go into your game. We are bringing in a panel of gameexperts to judge the competition.

In order to be considered for the competition, you must produce a short (< 5 min) demo video of your gamethat can be posted on YouTube. You should put some effort into this, as you can use it as an advertisementor demo reel for your work. The video will be used in the evaluation process and in an archival recordof the competition. The audience is mainly the jury, your future employers, and the general public. Thevideo should highlight the overall game experience, interesting gameplay elements, and interesting technicalcomponents you implemented.

Videos from past year’s competitions can be found on YouTube.

7 Honor Code

Just as a precaution, we would like to reiterate the Stanford honor code. In particular, you are not allowedto take any code, library, or assets and represent it as your own work. We are allowing you to use as manyexternal sources as your heart desires, and you are free to borrow code, but please explicitly credit work doneby someone else (both in your writeup and in a comment at the top of the source files.) Note that this meansthat if you are borrowing someone’s implementation of an algorithm, you will not get credit for the algorithmitself.

8