Task gpu014: Pool simulation (C++/C#)

The task is to implement small water pool using fragment shader only. Various bonus tasks are defined: dynamic wave simulation, more complex geometry, water color simulation..

vinyl

C#: Template for the task is prepared in the grcis repository. You can use the 086shader project, there is reasonable GLSL shader setup prepared for you extension and you can find sample texturing code as well. In case you will be using input texture, please load a raster image from disk file.

C++: You can use template sample09 from the ogl repository. GLSL shaders are initialized in the initGLSL() function, for texture loaded from file, see sample08, function prepareTextures().

Details

Drawn shape: use single rectangle (square) or two rectangles (first one for the floor around the pool and second one for the pool itself).

Texture coordinates: use simple 2D coordinates passed in custom vertex varying quantities.

Shaders

C#: In the InitShaderRepository() you can define custom sets of shaders assembled into shader programs. Don't forget to define all handles to uniform variables and assemble all the shader pipelines corectly. Look into the log.txt file for eventual error messages. Current uniform values are set in the RenderScene() just before rendering code (if ( useShaders ) ..).

C++: Definition of the shader set is in the initGLSL() function. You must define all handles to uniform variables and assemble all the shader pipelines corectly. Look into the log.txt file for eventual error messages. Current uniform values are set in the drawGLScene() just before rendering code (if ( shaders ) ..).

Your solution

Send all your modifications in complete Visual Studio project, including shader files and perhaps larger data files (textures). Write a brief document about your method. Especially you have to define which parts of the task you were trying to solve (see below).

Deadline

Hand in before: 2. 7. 2017

Points

Basis: 8 points for basic pool with light refraction but no further effects
8 points for static waves on the water surface (static = not moving waves) simulated by a normal map
2 points for "infinite" normal map (can be tileable), animated (moved) in time.

Bonuses: up to 4 additional points for water color dependent on pool depth
up to 8 points for advanced water-surface simulation (cellular automata, sinus/Gerstner waves..)
up to 4 points for pool size parametrization (position, size, depth, color..)
up to 8 points for nice generated textures and/or more interesting scene (two pools in one picture..)
up to 8 points for more complicated pool geometry (round pool, underwater steps, ..).

Project

Recommended starting point: Visual Studio project 086shader from the grcis repository (C#) or sample09 from the ogl repository (C++).


Copyright (C) 2012-2017 J. Pelikán, last change: 2017-04-27 04:24:03 +0200 (Thu, 27 Apr 2017)