
Cím:
Energy Balanced Materials  Interactive 3D Graphics

Leírás:

The BlinnPhong reflection model has been around for more than 30 years. It

used to be hardcoded into older GPUs from the early 2000s. It's easy to

evaluate and somewhat intuitive to control. One technique worth mentioning with

this reflection model is that you can get the specular highlight a different

color than the diffuse components. For example, if the specular component is

given a white color, the object looks more like a shiny plastic. If both the

specular and diffused components are multiplied by the same color the material

looks more metallic. However this classic reflection model is not energy

balanced, you'll notice as I change the shininess, the material looks smoother,

but overall the amount of light reflected becomes greater. If you think about

it, this makes a lot of sense. Here's the BlinnPhong equation again. You take

N dot H, and take the maximum between that and 0, and raise that to the power

of shininess. The graph of the angle between N and H, versus the specular

intensity, is like this. Clearly the area under the graph for cosine squared is

smaller than for cosine, so the amount of energy coming from the surface will

be less as you increase the shininess. Cosine cubed has even less overall

energy. As the shininess goes up, the area under the curve goes down. Two

changes give a better result, one that's both more plausible and easier to

control. One idea is to attenuate the specular term by the lumbersian fall off.

In other words, just like diffuse, make the specular term drop off as the angle

of the light to the surface becomes less straight. N dot L. The other idea is

to make these narrower curves be higher, giving them roughly the same volume at

3D. This idea is captured in the last term. As shininess increases this last

term also increases, when combined with the Lambertian term this new equation

gives a reasonablybalance result. Here is the original BlinnâPhong equation.

You can see with the shininess of three it's overall much brighter than a

shininess of 100. By energybalanced I mean that changing the shininess does

not noticeable change the amount of energy reflected from the surface, You can

see the effect by running the demo that follows. By the way, this demo puts all

its shaders inside the JavaScript program itself, if you want to look at an

example of how that's done. Using the Lambertian N dot L term also eliminates a

serious problem with specular falloff. You may have noticed it yourself with

the basic BlinnPhong model. Here's a view of the model with the low shininess

and the light coming up from behind it. The diffuse term drops off smoothly,

but the specular suddenly drops to zero, giving a pretty bad result. By using

the Lambertian dropoff, the specular term now fades properly.