header2
bio projects contact
computer graphics
computer graphics
cvision
search
programming
design

 

_______________BRDF__________Raytracing__________OpenGL__________RenderMan

 

Project Overview: Bidirectional Reflectance Distribution Function

I implemented a Bi-Directional Reflectance Model, I implemented an Anisotropic Phong Model taken from a paper titledAn Anisotropic Phong BRDF Modelby Michael Ashikhmin and Peter Shirley. In their paper they discuss an anisotropic Phong-style BRDF which builds on the earlier Phong model. Also, I implemented a Blinn-Phong model to compare the two results. I noticed that my Blinn implementation looked practically identical so I decided to experiment with a control parameter and got some interesting results.

Software: Implemented in C++ in MS Visual Studio

Traditional Blinn-Phong Model:

Recall: BRDF describes how light is reflected from a surface and tries to answer the question: Assume light hits a point on a surface with the incoming angles of (θi Φi) and the outgoing angles (θo Φo), how much energy is reflected?
BRDF(θi ,Φi, θo ,Φo)

This function describes how light hits a surface at one point and leaves the surface from the same point.
BRDF Models Implemented
[1] Anisotropic Phong BRDF Model:

Anisotropic Idea: BRDFs that describes reflectance properties that do exhibit change with respect to rotation of the surface around the surface normal vector
Most real world surfaces (in contrast to isotropic which is for more smooth plastics)
- M. Ashikhmin and P. Shirley, An Anisotropic Phong BRDF Model:

anieq
Where nu and nv are control parameters:
controlParam diagram

Results
Values experimented with the Anisotropic Phong Mode: nu = nv = 200, 300, 400
aniresults
[2] Specular Reflection: Blinn-Phong (shinny surfaces)
Recall: Blinn instead calculates the so called half-vector H to replace R * V in the Phong Model
halfwayVector
Noticed results looked practically the same as Phong, so I created own experiment and used a control parameter (as in the anisotropic and got some interesting results)
Tweaked Blinn-Phong Formula: Used a control parameter as the exponent and experimented with different values:
MyBlinn = ka ia + S (kd(L*N)id + ks is max(N * H)^r)
-Where r is a control parameter

 

Shading Results:
Seem to get a smoother specular hotspot then with the standard Phong model
Experiment values: Blinn Phong: r = .75, 1.5, 2.5

myBlinn

Code Snippet written in C++


//---ambient
test += light->material->ambient * mat->ambient;

//---diffuse
incident = Unit(LightPos - hit.point) * N;

if (incident > 0.0 )

test += light->material->diffuse * diffuse * incident;

//---specular
Vec3 Pp = P + (delta * N);
Vec3 E2 = Unit( LightPos - Pp );
Vec3 R3 = Unit( ( 2.0 * ( E2 * N ) * N ) - E2 );

//Halfway vector
Vec3 H = ( LightPos + E ) /( Length(LightPos + E ) );
incidence = (E * R3);

//--BRDF
double nu = 300; double nv = 300;
double brdf_part1 = (sqrt( ( nu + 1 ) * ( nv + 1 ) )) / (8 * Pi);
double nl = N * LightPos;
Vec3 h = LightPos + E;
double nh = N * h;

if (nh > 0)

test += brdf_part1 * (light->material->specular * specular ) * (pow((nh/Length(h)),e) / nl) * incidence * incidence;

//Blinn-Phong – own recipe
double p = 1.5;
double efactor;
if (incidence > 0.0 ) {

efactor = pow((N*H), p);

test += pow(efactor,p) * pow(incidence, 2)* (light->material->specular * specular ) * r;

}

References:
[1] “Realistic Ray Tracing”, Peter Shirley, 2000
[2] “3D Computer Graphics”, Alan Watt, 1993