In this project is to get introduced to the world of GLSL in two parts: fragment shading, and vertex shading. The first part of this project is the Image Processor, and the second part of this project is a Wave Vertex Shader.
Things required to be done are implement the following filters:
- Image negative
- Gaussian blur
- Edge Detection
- Toon shading
Also at least three of the following features-:
- Pixelate (http://wtomandev.blogspot.com/2010/01/pixelize-effect.html)
- CMYK conversion (http://en.wikipedia.org/wiki/CMYK_color_model)
- Gamma correction (http://en.wikipedia.org/wiki/Gamma_correction)
- Brightness (http://en.wikipedia.org/wiki/Brightness)
- Contrast (http://en.wikipedia.org/wiki/Contrast_(vision))
- Night vision (http://wtomandev.blogspot.com/2009/09/night-vision-effect.html)
- Open-ended: make up your own filter!
Lets get started !!
Some pretty early results!
SEPIA FILTER !!
NEGATIVE FILTER !
EDGE DETECTION- Using Sobel’s filter.
VERTEX SHADER MANIPULATION-:
Here i implement a GLSL vertex shader as part of a WebGL demo. Here i created a dynamic wave animation using code that runs entirely on the GPU; before vertex shading, dynamic vertex buffers could only be implemented on the CPU, and each frame would then be uploaded to the GPU.
Simple Noise function is used to find the x and y heights of the vertex and GLSL mix function is used to interpolate between the values of the colors based on the height factor.
Here, Simple Noise is averages with the Sine and Cosine function to find out the x and y heights of the vertex and GLSL mix function is used to interpolate between the values of the colors based on the height factor.