danca 122 Report post Posted December 5, 2005 Hi. There are some fundamental concepts that i can't figure out... I'm working on a raytracer and the geometric part i understand but when it comes to implementing lightning i'm stuck. I've done phong but now i want to move on to more realistic rendering. From what i've understood I need to somehow approximate the value of the rendering equation by some numerical method. Part of the equation is a BRDF. But what i don't know is how the value of the equation gives me the final pixel color? And what is the BRDF returning? A float, rgb, spectrum? And is there one BRDF for every object or several? Suppose i calculate the rendering equation and it returns the radiance, how do i get the final pixel color? I feel quite comfortable with the math i just don't know how to bring it all together... Thanx / Daniel 0 Share this post Link to post Share on other sites
timw 598 Report post Posted December 5, 2005 the rendering equation is for monocromatic light. thus you evaluate it once for the red green and blue components. it is a vector integral equation. the BRDF is the bidirectional reflectivity of the surface at the wavelength you're evauluating. so it usually has 3 scaler componentsBRDFred, BRDFgreen, BRDFblue so you'd need to evaluate the rendering equation for each component. and of course the radiance has three components R,G,B in essance Lred(x,w) = INTEGRAL(BRDFred(x,w,w')*(n^w')*Lred(x,w')dw') where n is normal and w' is the incoming direction and the integration variable.it's the same for green and blue.to make complete clear,Lred(x,w) is the radiance leaving surface point x in direction wLred(x,w') is the randiance entering the surface at x from direction w'Tim 0 Share this post Link to post Share on other sites
danca 122 Report post Posted December 6, 2005 Thanks for the reply, now i understand a little more but still there are some things...Let's say i have a BRDF that i can evaluate and the surface normal at some point and the incoming/outgoing directions. How do i get the radiance entering the surface (Lred(x,w'))? Is that a light property? And suppose i calculate the radiance leaving the surface at some point how do i compute the pixelcolor at that point? 0 Share this post Link to post Share on other sites
timw 598 Report post Posted December 6, 2005 hmm lol you hit it on the nail lol. evaluating that is the heart of lighting. there are many ways. path tracing is one. Lred(x,w) can have within it light coming directly from the light, and also light bounced other surfaces. the stuff coming directly from the light is called direct lighting. and it is usually evaluated seperatly. commonly monte carlo integration techniques are used to solve it. path tracing and the like. direct light is usually evaluated seperatly using a surface area paramaterization. look up direct lighting, and accurate integration of diffuse area lights. I'd explain more, but I think if I tried the post would explode. it's probably better learned in a book. definitly look up:monte carlo integrationpath integrals, path tracingphoton mappingimportance samplingthe surface area paramaterization works kinda like thisdw' = dA*(n^-w')/r^2 you're converting an integral across the hemisphere to an integral across the surface of the light. this is commonly solved with monte carlo integration. this would give you direct lighting. but you can also integrate the thing using the original hemisphere form, but it's better to treat direct and indirect light seprate. it's more efficent.Tim 0 Share this post Link to post Share on other sites
playmesumch00ns 190 Report post Posted December 6, 2005 If you really want to learn this stuff, the best thing you can possibly do is buy this book:http://www.pbrt.org/ 0 Share this post Link to post Share on other sites
danca 122 Report post Posted December 6, 2005 And here i was thinking that this was something i could easily implement over night...The pbrt book does look really good. I'll be visiting amazon shortly.Well, thank you guys for the help. 0 Share this post Link to post Share on other sites