• entries
422
1540
• views
490568

# Cook-Torrance Results

553 views

Above: Identical data for all 3 spheres. Left-most is Blinn-Phong, middle is Ward and right-most is Cook-Torrance.

If you look closely at the above image I've got some pixel distortion going on. Only appeared since I've been using Nvidia hardware - guess it's that damned Directly Mapping Texels to Pixels malarky. A recent thread in DX pointed out that ATI and Nvidia handle this differently, hence it looked fine on my previous setup

EDIT: Fixed this now. click here for a 350kb image showing the difference getting texels-to-pixels correct can make. Image is a before and after shot with a difference in the middle - where you can quite clearly see the artifacts [oh]

Dropped in the Cook Torrance model this morning, wasn't too bad. My hard-coded test results were much better than the above image - but the final model must be data driven rather than hard coded. I guess another example of where my programmer-art skills get in the way [sad]

I managed to find a mistake in Advanced Lighting and Materials with Shaders (one of my 3 recommended books). On page 154, second column it has a code fragment:

float3 G1 = 2 * NdotH * NdotV / NdotH;float3 G2 = 2 * NdotH * NdotL / NdotH;

The denominators in both those lines should be VdotH. The mathematical representation on page 104 agrees with my other resources and also confirms that the code fragment is wrong.

I don't know if the sample code has the same mistake, but it did make a noticeable difference to the results once I corrected it [oh]

There are no comments to display.

## Create an account

Register a new account

×

## Important Information

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!