PDA

View Full Version : Confused about BRDFs


M-J
01-12-2004, 04:04 PM
Hello everyone,

I've read alot about BRDFs for realistic image synthesis recently and I don't really understand what they are and what data they provide and how one would actually IMPLEMENT a particular BRDF in a e.g. Mental Ray or RenderMan shader.

Can anybody give me some hints or point me to some ressources?

thanks alot
MJ

ngrava
01-13-2004, 12:16 AM
BRDF stands for Bi-directional Reflection Distribution Function. From what I understand, it just refers to the method used to calculate the fall off of specularity across a surface. so it basically takes a surface color and specular setting and interpolates from the angle of one normal to the next. Blinn, Phong, and anisotropic are all examples. There's a ton of resources and turotials out on the net. just do a search for BRDF. The only one I have any interest in currently is this one: http://www.graphics.cornell.edu/online/measurements/reflectance/index.html

-=GB=-

ngrava
01-13-2004, 12:19 AM
Oops. This is a bit more spacific:

http://www.graphics.cornell.edu/pubs/1997/LFTG97.html

M-J
01-15-2004, 09:54 AM
thanks for the link ngrava
and you're right: actually there ARE tons of resources out there. I really don't know why I haven't found them in the first place :-(

Array
01-18-2004, 03:01 AM
http://www.amazon.com/exec/obidos/tg/detail/-/1568811470/qid=1074394154//ref=sr_8_xs_ap_i0_xgl14/103-5640797-4720618?v=glance&s=books&n=507846

that is the best book on the subject that I have seen to this day.

playmesumch00ns
01-22-2004, 01:46 PM
it's all phooey. all you need is a Blinn!

M-J
01-22-2004, 02:12 PM
@array: thanks, I'm gonna check that out. Actually I heard alot of good things about that book. I might be a good start...

@playmesumch00ns: :) what do you mean?

stew
01-22-2004, 03:28 PM
Jenen's book sure is good, and it outlines the Photon Mapping approach really well, but I'm not sure if it's a good introduction to BRDFs. I'm reading it right now, and I think I'd be lost if I hadn't prior experience in rendering and shading - I would not have understood Jensen's explanation of radiosity if I hadn't read about it before.

I think the "traditional" books like Watts' "Advanced Animation and Rendering Techniques" are probably better suited as an introduction.

rendermaniac
01-22-2004, 11:01 PM
I think they used a bit of Lafortune pretty effectively for Gollum (along with some Blinn). The maths is a little crazy though getting equations to approximate a sampled real illumination.

You can probably get away with standard RenderMan spec (based off Cook-Torrance - I think Maya's is kinda based off this too).

Most of the time a bit of displacement, environment maps and plenty of motion blur/grain disguises most of it from what I've seen.

Simon

playmesumch00ns
01-23-2004, 09:46 AM
I looked into that LaFortune stuff a bit after it came up in relation to a post on c.g.r.renderman I think.... looked interesting, but kinda like one of things where you've got some guy at Stanford solving it all with a 100-term differential equation, but some other bloke gets just the same result by calling specular() 3 times with different parameters...

Do you have any good references for LaFortune, Simon?

M-J: What I mean is 9 times out of 10, just using a lambert with a blinn specular highlight will get you perfectly good results. On some occasions you need to use something different for anisotropic highlights, for example. Good textures and good lighting negate the need for a complex BRDF in most cases, imo.

If you're still having trouble with what BRDF actually is, it works like this. For a given point on the surface, the BRDF basically tells you how much of the light from a given light source is reflected off the surface towards the viewer.

The simplest example is Lambert's diffuse model. This states that the intensity of the reflected light is proportional to the cosine of the angle between the light's direction vector and the surface normal.

rendermaniac
01-23-2004, 10:34 AM
No I don't really have any more information. There is a lafortune RenderMan shader by Stephen Westin here. http://www.graphics.cornell.edu/~westin/lafortune/lafortune.html
The velvet shader that comes with RenderMan is based off of his work.

Also they did some crazy real world based BRDF stuff on the Matrix triology - slight overkill from what I've seen here - http://www.virtualcinematography.org/

Very impressive, but you can have a real headache if you don't get the data you need.

I definitely agree about good texturing and lighting. Shader writing tends to be more about providing an architecture for it all to work in.

Getting good wrapping spec still isn't too easy though which is what a lot of the complex BRDF's do nicely.

Of course you could just move your lights a bit ;)

Simon

playmesumch00ns
01-23-2004, 11:24 AM
Cheers Simon, I'll have to pick that apart together with the paper. From a cursory examination seems like a lot of experimentally-determined results?

Have to agree about the overkill on the Matrix, though I thought it did work well in some cases, in others it just looked wrong (thinking particularly of the cloth shaders).

As a shader writer myself, I'd have to say there's a lot more goes into the mroe interesting shaders than just doing the texture calls... but a lot of the grunt work is little more than that.

rendermaniac
01-23-2004, 10:28 PM
No problem. If you find anything useful that you can divulge then please do let me know (if not here by email).

Simon

playmesumch00ns
01-24-2004, 12:24 AM
Looking into it now... I like this whole idea of having a bunch of coefficients to play around with. I'll knock up an interface in slim so as to control wavelength triplets all at the same time and do some experimentation... let you know what I dig up...

First few results indicate that the "blue paint" coefficients provided in that web page are quite similar to an oren-nayar with a roughness coefficient of about 0.3-0.5, but nicer looking... could be promising.

rendermaniac
01-24-2004, 03:04 AM
I think that is the biggest problem with something like this - making an interface that is understandeable with meaningful knobs. Most artists aren't going to understand these coefficients - heck I only vaguely know what they mean.

This means either connecting them up cleverly, having a list of presets (easiest approach), or having some very clever interactive GUI.

Although looking at it I guess he has just done the scientist thing and compressed it into once huge array which could be split up. And the colour matrix is pretty unnecessary.

To be honest you might be able to get away with removing the wavelength dependent stuff (although of course I haven't read the original paper yet ;) )

Simon

playmesumch00ns
01-26-2004, 10:03 AM
I was thinking about this interface stuff more for my use. If I was actually going to use it in production I'd probably hard-code the coefficients, or just have a preset-loading button or somesuch... now if only I had the time to play with this a little more. damn films keep getting in the way:)

[EDIT]

Ok... some initial tests in deadtime waiting for renders suggests that uniformly decreasing the coefficients for each wavelength increases the power of that wavelength in the result.

Lobes 2 and 3 do this with a sortof cutout negative specular effect... quite strange.

Basically I reckon you could do this in a much more controllable way by just combining 3 blinn highlights (that's what the shape looks like) with slightly different colour and parameters...

sept94
01-29-2004, 03:43 PM
I also have some questions about BRDF and rendering equations.
Many rendering equations mention "Ohm" is the hemisphere of incoming direction at position x, is that mean I have to evaulate the equation with every single light if any light is visible over "this" hemisphere? then sum up (integrate) each results to get the final value?

playmesumch00ns
01-29-2004, 10:01 PM
Yup. technically speaking you should be integrating the total irradiance from the entire sphere around your shading point, but that's going to take forever.

The simplest optimization you can make is to disregard irradiance from geometry (i.e. bounce light) and just consider the light coming from light sources.

Then we can ignore subsurface irradiance and just consider light coming from the "visible hemisphere". i.e. take the dot product of your normal, N, and you light vector, L (the vector pointing from your point P to your lightsource). If the result is negative, discount that light.

So your integration breaks down to something like this:

totalillumination = 0
for each light in visible hemisphere do
totalillumination += dotproduct( N, L )

obviously that's just going to give you the lambertian term... you'll probably want to do something a little more complicated.

sept94
01-30-2004, 02:12 PM
thanks,playmesumch00ns

I also have other questions:
1. how come some euqation is evaluated with sphere rather than hemisphere? Is the sphere only used for subsurface scattering?

2. If I only consider the light coming from the "visible hemisphere", the equation should be Summation(the big sigma) rather than integrataion(the graceful S), right? What is the difference of Summation and Integration? aren't they both relate to the light in the "visble hemisphere"?

Originally posted by playmesumch00ns


The simplest optimization you can make is to disregard irradiance from geometry (i.e. bounce light) and just consider the light coming from light sources.

Then we can ignore subsurface irradiance and just consider light coming from the "visible hemisphere". i.e. take the dot product of your normal, N, and you light vector, L (the vector pointing from your point P to your lightsource). If the result is negative, discount that light.

So your integration breaks down to something like this:

totalillumination = 0
for each light in visible hemisphere do
totalillumination += dotproduct( N, L )

obviously that's just going to give you the lambertian term... you'll probably want to do something a little more complicated.

CGTalk Moderation
01-17-2006, 04:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.