Unity 3d demo

An interactive graphics demo built in unity 3d. No unity primitives were used. All the objects, lighting and textures were computed in the script using HL/SL.

4 / 4
Gameplay

    Phong Interpolation

  • Two lighting models were created to illuminate the scene calculated with Phong's interpolation.
    1. The two lighting models created were the headlights and the world light. The overall lighting was computed by returning the summation of the headlight and world light in the fragment shader.
    2. The headlight value was determined by calculating the dot product of the world object normal and headlight vector. World object normal is the normalized value of the object relative to the world and the normal to the vertex. This is calclutated in the vertex shader. Headlight vector is the vector from the position of the headlight to the world position of the object.
    3. World Light was calculated in a similar fashion.
  • Models and textures were defined in the CPU and manipulated algorithmically.
    1. The warped surface was generated by using a SIn function and manipulating the x and y UVs of the plane mesh per frame. This creared a wave that ripples across the entire surface.
  • HL/SL Programming

  • Applied shaders to many objects in the scene through the vertex and fragment shader.
    1. The grid shader was created by alternatively lighting the UVs of the object.