Lecture 6: The Rasterization Pipeline (22)
kalebdawit

I read this article on shading and thought it was great.

https://www.scratchapixel.com/lessons/3d-basic-rendering/introduction-to-shading/diffuse-lambertian-shading.html

It walks through some of the math of shading and has some helpful visuals.

yauwilliam69

The diffuse coefficient is directly proportional to a value called "albedo", which is a material-dependent value defined for diffuse surfaces as the ratio of the power of reflected light to incident light. In CG, a default for this value is 0.18, since in the real world, scientists have found most surfaces on average reflect 18% of the light they receive, across different materials.

Edge7481

How would this algorithm work for multiple light sources? Since there are multiple l vectors that are not necessarily from the same direction. Perhaps it would be possible to preprocess the lighting into 1 source

cvankeuren

In terms of what happens when there are multiple light sources like @ edge said above, I think it's likely that we would have to calculate the reflected light for each light source, then look at how the different light reflections might overlap and combine them post-calculation, instead of pre-calculation. I'm curious how this might be implemented though.

ninjab3381

I was just wondering why the v vector is not taken into account in the formula as wouldn't the light just reflect at an angle of theta?

j-nn

Lambertian shading seems to be used for rendering and also ray tracing, which I've heard is very integral to computer graphics. It's very important in determining the visual appearance of the objects. I could how proportions is very important with the calcuations.

angelinelykk

The max(0, dotproduct(n,l)) term accounts for the location of the light source. We know that the dot product of 2 vectors a and b = |a||b|cos(theta). Thus, a negative value of the dot product implies a negative cos(theta). This indicates that the light source is behind the surface so the light is not being reflected off the surface towards the viewing point.

You must be enrolled in the course to comment