Page MenuHome

Confusion in Blender BRDFs: "CookTorr" is really Blinn-Phong, "Blinn" is really Cook-Torrance
Closed, InvalidPublicTO DO

Description

Relates to: T6752

--- Operating System, Graphics card ---
All.

--- Blender version with error, and version that worked ---
At least 2.4 to 2.65.

--- Short description of error ---
Blender's "CookTorr" lighting model is not Cook-Torrance. Cook-Torrance has material parameters roughness (in Beckmann distribution part), and index of refraction (in Fresnel term), and of course intensity as a multiplier. IOR is not present in Blender's CookTorr implementation nor menus.

Blender's "Blinn" lighting model is not Blinn-Phong. Blinn-Phong does not use index of refraction, but it is available in Blender's menus for it, and affects rendering.

The problem exist also in Blender's documentation:
"Blinn is a more 'physical' specular shader, often used with the Oren-Nayar diffuse shader. It can be more controllable because it adds a fourth option, an index of refraction (IOR), to the aforementioned three."

"CookTorr (Cook-Torrance) is a basic specular shader that is most useful for creating shiny plastic surfaces. It is a slightly optimized version of Phong."

I'm sorry, these are both wrong. Cook-Torrance is a physically based microfacet model. Blinn-Phong is an empiric approximation, very similar to Phong but not exactly. Also it is sometimes a little bit faster.

This seems to be an ages old problem that hasn't been fixed.
- 2007: http://www.blender.org/forum/viewtopic.php?p=62044&sid=b08c38bfa7283f0487a871ee1ebfbfbd

I propose renaming "CookTorr" to "Blinn-Phong" and "Blinn" to "Cook-Torrance" and leaving a compatibility mapping from the old names to the new matches.

P.S. This is not a question about being physically completely accurate or not like #6572 says. The models have their names and parameters totally mixed up, and it's as far as in documentation and the Python interface.

P.P.S. See http://en.wikipedia.org/wiki/Specular_highlight#Cook.E2.80.93Torrance_model -- write down the Beckman distribution part, the Fresnel term (e.g. with Schlick's approximation) and the rest. The three-line-spanning formula hardly is an optimization for Blinn-Phong's one pow call. (see http://en.wikipedia.org/wiki/Blinn%E2%80%93Phong_shading_model).

P.P.P.S. Really, please, do check the shaders. If this form of confusion is possible, there might be remains of other confusions and mixups in the shaders too.

--- Steps for others to reproduce the error (preferably based on attached .blend file) ---
See Blender documentation for Blinn and CookTorr. Compare them to either the corresponding Wikipedia articles, any sources on the Internet or the original research articles. Also see Blender's menus and the Python interface (e.g. bpy.data.materials['Material'].specular_shader).

Event Timeline

In the text I spoke about #6572. I meant the "relates to" #6752.

You are talking about code that has a history of 15 years. In those days simplified versions of the shaders were used. The shaders were updated in the very chaotic period just after Blender became open source, with a patch for new shader code being merged having errors and wrongly added even. I tracked back the discussion on this in 2003, and it was suggested to fix the code... which then it never happened :/

For our new render system (Cycles) this has been done correctly from the ground up. For the old render engine I prefer to stick the conventions there. Just changing the names will confuse even more people. I also don't have time to verify your proposal if that's actually accurate.

In practice we could accept changes as you propose, but only in case a developer (or team) is committed to actively maintain the old render system and further improve it. For as now it's a stalled project which we only keep working.

For our documentation I'll add a reference to this report. Might come in handy for future development. I will also point possible developers who want to work on our render system to your report.

Ton Roosendaal (ton) changed the task status from Unknown Status to Unknown Status.Mar 8 2013, 12:05 PM

Oops: forgot to paste the link to our todo list, where I refer to this report:
http://wiki.blender.org/index.php/Dev:2.5/Source/Development/Todo/Render#Render_Engine