************************************************************************* * * * RAIN SIMULATOR * * . a precipitation renderer . * * * * Programmer : Felix Gonda (felix.e.gonda@gmail.com) * * Instructor : Dr. Hanspeter Pfister * * Teching Assistants : Moritz Baecher * * Kevin Dale * * Kalyan Sunkavalli * * Yuanchen Zhu * * Sound Design : Jeff Wilson * * Class : Introduction to computer Graphics * * (http://www.cs175.org) * ************************************************************************* PROGRAM DESCRIPTION: ************************************************************************* This program simulates a rain weather system. It implements a particle- based rain drop system that consists of four rain zones surrounding the camera. As the camera moves, the rain zones are recalibrated so newer rain drops are spawn in the appropriate zones. Furthermore, only zones within the camera frustum are rendered. To impress the effect of rain in the environment, splashes are rendered when rain drop collides with the ground or any object in the environment. As the intensity of rain increases, surfaces will gradually become wet. The wetness can be seen on the ground surface as well as on the surfaces of objects in the environment. The rain drops, splashes and objects are lit per pixel using the lights placed in the environment. For each pixel rendered, light is calculated by sampling the contribution of the ambient, diffuse, and specular components of each light based on the distance of the light from the pixel. For spotlights, falloff is taken into consideration in computing the attenuation amount. INSTALLATION ************************************************************************* - If you downloaded the executable, unzip the content of the zip file, and run the program from the exe sub-directory. To run the program, just double-click on the file rainsim.exe - If you downloaded the source code, you'll need to build the project. Please follow instructions in the "SOURCE CODE" section of this document. GRAPHICS CARD REQUIREMENTS ************************************************************************* You need NVIDIA GeForce 8800 or better graphics card to run this demo. I can not gurranttee performances on lower graphics card. Release build should run at 100 FPS. USER CONTROLS: ************************************************************************* The following controls can be used to interact with objects in the scene. Camera Keys W : move the camera forward S : move the camera backward A : move the camera to the left D : move the camera to the right Mouse : orient the camera up, down, right, left Rain Keys: R : increase intensity of rain F : decrease intensity of rain Light Control Space : toggle light attachment to camera B : toggle light blinking 1 : change light color to white 2 : change light color to red 3 : change light color to green 4 : change light color to blue SOURCE CODE: ************************************************************************* The following is the list of all source code created and included in the implementation of this project. Except where noted, all source code have been implemented by me (Felix Gonda). Some of the code has been developed during the class or as part of homework solution. External libraries are noted below as well. Rain texture is from columbia rain streak database, others are purchased from (http://www.3dtotal.com/textures/) COMPILATION: - Visual Studio 2008 is required to compile and link this project - All required libraries are already included in the rainsim_src.zip file. - You'll need to put the file "fmodex.dll" in the release or debug directy of your build if you're running directly from visual studio. main code: /src/Block.cpp /src/Block.h /src/Camera.cpp /src/Camera.h /src/Common.h /src/Debug /src/FBO.cpp /src/FBO.h /src/Frustum.cpp /src/Frustum.h /src/Ground.cpp /src/Ground.h /src/Light.cpp /src/Light.h /src/main.cpp /src/Object.cpp /src/Object.h /src/Particle.cpp /src/Particle.h /src/RainDropEffect.cpp /src/RainDropEffect.h /src/RainManager.cpp /src/RainManager.h /src/rainsim.ncb /src/rainsim.sln /src/rainsim.suo /src/rainsim.vcproj /src/RainSplashEffect.cpp /src/RainSplashEffect.h /src/Scene.cpp /src/Scene.h /src/SceneManager.cpp /src/SceneManager.h /src/SceneRain.cpp /src/SceneRain.h /src/SettingsManager.cpp /src/SettingsManager.h /src/ShaderManager.cpp /src/ShaderManager.h /src/shaders /src/Singleton.h /src/SoundManager.cpp /src/SoundManager.h /src/sounds /src/tangent.cpp (http://www.dhpoware.com) /src/tangent.h (http://www.dhpoware.com) /src/Text.cpp /src/Text.h /src/TextureManager.cpp /src/TextureManager.h /src/textures /src/Timer.cpp /src/Timer.h /src/Vector.h /src/vpmath.h shaders: /src/shaders/ground.frag /src/shaders/ground.vert /src/shaders/raindrop.frag /src/shaders/raindrop.vert /src/shaders/rainsplash.frag /src/shaders/rainsplash.vert /src/shaders/sampler.frag /src/shaders/sampler.vert /src/shaders/wet_object.frag /src/shaders/wet_object.vert textures: /src/textures/bulb.tga /src/textures/C013_color.tga /src/textures/C013_normal.tga /src/textures/cv60_v-70_h150_osc7.tga (http://www1.cs.columbia.edu/CAVE/databases/rain_streak_db/rain_streak.php) /src/textures/leather_color.tga /src/textures/leather_normal.tga /src/textures/light_particle.tga /src/textures/marble_color.tga /src/textures/marble_normal.tga /src/textures/metal_color.tga /src/textures/metal_normal.tga /src/textures/rock_color.tga /src/textures/rock_normal.tga /src/textures/stone_color_map.tga /src/textures/stone_normal_map.tga /src/textures/waterdrops.tga /src/textures/waterdrops_object.TGA /src/textures/water_bump.TGA /src/textures/water_detail.TGA /src/textures/White Oak.tga /src/textures/woodrusted_color.tga /src/textures/woodrusted_normal.tga /src/textures/wood_tile_color.tga /src/textures/wood_tile_normal.tga external libraries: /src/Libraries/fmod (sound library - http://www.fmod.org) /src/freeglut-2.6.0 (http://freeglut.sourceforge.net/) /src/glew-1.5.5 (http://glew.sourceforge.net/) /src/GLTools (obtain from class) REFERENCES: ************************************************************************* Tools and resources: - RenderMonkey for prototyping shaders - OPenGL GLUT for implementing environment - Columbia rain texture database: http://www1.cs.columbia.edu/CAVE/databases/rain_streak_db/rain_streak.php - 3D total textures http://www.3dtotal.com/textures/ Research Materials & References: - „Realistic real-time rain rendering” Pierre Rousseau, Vincent Jolivet and Djamchid Ghazanfarpour Computers & Graphics, Volume 30, Number 4, 2006 - „Creation and control of rain in virtual environments” Puig-Centelles, A., Ripolles, O. and Chover, M. The Visual Computer, Volume 25, Number 11, November 2009 - Water Flow in Portal 2 Alex Vlachos, Valve July 28, 2010 http://www.valvesoftware.com/company/publications.html