GLSL - Talking heads

This project deals with applying various  effects on a given 3D model  using GLSL i.e Fragment and Vertex shaders. The project tries to portray emotions of a lonely person through his lifetime. All Demos were made interactive 


Shaders : cubemap and chromatic aberration (refraction) shaders 

This phase features the model with cubemap shader and chromatic aberration (refraction) applied to it.

The texture used for the cube map is a 6 piece earth texture found in the source code.  

The important feature of this implementation is the dynamic change in the aberration.  All 3 color frequencies (Red, Green and Blue) are set to different refraction parameters resulting in chormatic aberration. To add value, I alter the Eta value for Green ( EtaG)  to vary with time.

EtaG = fabs(.5*sin(currentTime)+ .2) ;   // where currentTime is retrieved

 Additionally, the fresnel power of the material is also incremented slowly

FresnelPower += .01;

 This Asynchronous update of values, produces a dynamic effect and produces colors similar to when glass is melted.

 Effect produced only with cube mapping.

 Effect produced by combining dynamic chromatic aberration with cubemap.

Talking Heads 1 from arun rakesh yoganandan on Vimeo.


Shaders used: Bump map and refraction

Phase 2 again involves cubemap and  procedural bumpmapping.  The screen shot of a bump map is applied as a cubic texture in addition to refraction shader applied on to a cubic texture. This produces 

the effect of a facial model made purely from glass. 

 The head model with cubemapping and refraction.

 The cube map that looks like a refraction and flattened

This implementation features a vertex shader that scales down the object along its z axis in relation to its Eta value. Therefore a material with higher Eta would look less flattened than the one with lower Eta.

const float extra = (1.0-Eta*Eta)/(1.0+Eta*Eta);

p.xy = gl_Vertex.xy;
p.z  = gl_Vertex.z/2*extra; 


Shaders used: spotlight and procedural textures (polka dot)

For phase3, I wanted to experiment with a lighting shader and picked on spot light. Additionally, a procedural texture shader which produces polka dots is added to the facial model. The results are very 

dynamic and spooky, adding value to the application. The polka dots change according to a  smooth step function and 

This is done by providing two variables for checking insidesphere and insidesphere2

             insidesphere = smoothstep(scaledpointlength, 0.8*scaledpointlength, DotSize);
             insidesphere2 = smoothstep(0.8*scaledpointlength, scaledpointlength, DotSize);

Then the color of that particular location in the polka dot is determined.

             finalcolor = vec3(mix(ModelColor, PolkaDotColor, insidesphere));            

This in turn, is mixed with final_color, the contribution from the specular and diffusive terms

             finalcolor = mix(  finalcolor, vec3(final_color), 

                                          (current_time*insidesphere2 + (1-current_time)*insidesphere)  );

This above function flips the colors from inside to outside making the dots and the model switch color with time. Also some displacement is provided to the dots

  scaledpoint = scaledpoint - Spacing/2.0 + vec3(.001*current_time, -.005*current_time, .002*current_time);

due to which they appear moving.

Untitled from arun rakesh yoganandan on Vimeo.

Spotlight shader being applied to the model.

The model with just the polka dots.

Untitled from arun rakesh yoganandan on Vimeo.