GPU Programming

Project 1 Decription


 

 

Concept:

Project 1 basically allows us to play with different variety of shaders and implement them on a head model provided by Andy. I tried to keep to theme of effects of heat/fire, but have not been able to integrate the shaders to produce the theme exactly.

 

Tools Used:

  1. Microsoft Visual Studio 8
  2. OpenGL/ GLSL package

Description:

The project consists of a head model and different shaders that I have used to implement some basic effects. Each effect has been described below.

  1. Toon Shading with Directional Lighting
  • This involves setting color of the model according to the specular intensity of the surface. It also has a directional lighting model which calculates the ambient, diffuse and specular value and applies it to the model color. It has two fragment shaders written, one for toon shading and the other for calculating light intensity consisting of all components (ambient, diffuse and specularity) and applying it to the toon shading colors.

 

  • Blur

    Index is value is calculated from the vertex positions (x,y) and passed to the fragment shader where it applies takes pixel values from 12 neighbour pixels, sums them and averages them to give the current pixel a color from the texture map.

  • Particle System

To give a Fire Effect I wrote a particle system class which sends out 300 partilces (small quads) every frame and updates their position according to the velocity and acceleration. The fragement shader uses GLSL alpha map and multitexturing feature.

Problem: This was to be used to give an effect of a burning head by trying to capture the values of colors according to the moving textures every frame and map onto the head to give a more real head burning effect. For this need to get the texture colors from the fragment shader and send it to the application again and map the texture coordinate onto a 128x128 texture.

Hence could not integrate the particle system as per the plan.

  • Noise with some turbulence

    I read an article on turbulence with perlin noise. I have tried to apply the same on the head model. The Noise3DTexture.c file has a 3D-Perlin Noise function. It lets us send three floats, alpha, a beta value (how much of the first three numbers contribute to the color intensity) and the number of iterations for which the noise level is approximated.

  • The first figure gives the combined effect of the perlin noise and some turbulence added to the noise intensities. An alpha, equivalent to inverse of the final intensity has been applied with time which gives it a 'withering away' effect.
  • The second figure shows the noise intensites returned by the perlin noise function for parameters:
                            • alpha = 1.0, beta = 0.5, number of iterations = 50
                              • x,y,z = calculated every iteration
  • The third figure gives the turbulence applied to the noise intensities.

Download:

The code can be downloaded from the following - project1