PDA

View Full Version : Cook-Torance and BRDF lighting models



Arath
04-24-2003, 09:11 AM
I have read many papers on such lighting model and I wonder if one might use a texture lookup with float precision or calculate in the fragment program. I'm talking when decomposing a BRDF into two 2d functions. I haven't got yet a DX9 3d card class so I can only suppose that the texture method is faster dued to less instructions used in the fragment program, but it's just a guess. The other benefit of using texture lookup is that older card version will be easy (just less precision in the texture and may be more passes). Any suggestions on this subject, I want to hear your advice, and may be someone had already done a similar lighting model in his engine.

Cheers,
Arath

Gob
04-25-2003, 02:28 AM
AFAIK, a BRDF model has never been implemented using direct computation of the BRDF in a FP, but only using BRDF separation and texture lookup. Precomputation of BRDF and separation takes a while, and I don't think it can be implemented in realtime for now.

I've coded such renderer, and it works quite well. No need for a D3D9 compliant board. I works well (decent frame rates) on GF3.

g0b

Arath
04-25-2003, 03:29 AM
Hum may be I'm wrong but there are some model that can be calculated in a fragment program. I found a source of a Cook-Torance lighting model on this site http://www.dimension3.host.sk/web/project.php?pid=Project7&page=0&PFriend=1 . And also I know that some models (like Neumann-Neumann or Minaert) can be decomposed analytically, so it will be easier to do the BRDF equation in a fragment program.

Arath

Gob
04-25-2003, 05:09 AM
Didn't now this URL... quite interesting...
I thought you were talking about "real world" BRDFs ... Of course, Phong lighting can be seen as a non physical BRDF... that can be renderered in realtime on a TNT... That does not mean you can do BRDF lighting on a TNT ;-)

In latest nVidia cg Effect browser, you can find interesting BRDF models lighting examples done in FP (blin, blin sheen, and even kindof BSSRDF model !). I just got my NV30, so didn't go any deeper in source code.
But you may find this interesting...

IMHO, CT, ON, or Minnaert BRDF models are a bit limited. Schlick's approach is interesting but still unsatisfactory for complex materials. I guess Schlick BRDF could be implemented in FP.

g0b