Task gpu003: Procedural texture using noise (C++/C#)

The task is to design and implement any interesting texture effect using procedural (shader-implemented) texture and noise function. You are suggested to use GLSL shader language and try to model internal structure of a natural material (wood, marble..). Shape complexity of your displayed scene is not important, you should concentrate on the texture effect. You must implement your own noise function in a shader language and use it in your texture.

Texture samples

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 in addition to it there is sample texturing code. One texture is created procedurally (checker color texture enriched by a emboss-like effect). There is also a possibility to load any raster image from disk file and use it as a support texture. But the main part of your implementation should be in a shader language.

C++: You can use template sample09 from the ogl repository. GLSL shaders are initialized in the initGLSL() function, texture computed on CPU is shown in generateTextures() (for texture loaded from file, see sample08, function prepareTextures()). But the main part of your implementation should be in a shader language.

References

Explanations at the lecture and labs, noise function examples and 3D texture examples: see this page, theory is in this PDF presentation.
Perlin noise (Wikipedia).

Details

3D texture coordinates (recommended): you can use object space coordinates in directly. But you have to pass-through the original object coordinate in your vertex shader (without any transformation). See any Phong-shading example for inspiration (Phong shading needs the world-space coordinates so the vertex shader has to pass them unchanged to the rest of the pipeline).

2D texture coordinates: you can use classical approach definig texture coordinates at vertices. Your vertex shader then can modify this primary source and perhaps alter it in some unusual way. Fragment shader can work further with these coordinates.

Shaders

C#: You can define custom sets of shaders assembled into shader programs in the InitShaderRepository() function. 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 to the pilot Visual Studio project, including shader files. Write a brief document about your ideas, describe your noise-function implementation.

Deadline

Hand in before: 20. 5. 2018

Points

Basis: 25 points for functional nontrivial texture including your own noise function implemented in a shader.
Bonuses: for your invention, 3D scene improvement, ..

Project

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


Copyright (C) 2005-2018 J. Pelikán, last change: 2018-04-09 15:56:34 +0200 (Mon, 09 Apr 2018)