﻿[Script Info] Title: [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text Dialogue: 0,0:00:00.23,0:00:04.79,Default,,0000,0000,0000,,There are quite a few materials that are nearly diffuse reflectors such as rough Dialogue: 0,0:00:04.79,0:00:09.19,Default,,0000,0000,0000,,wood, newspaper, concrete, and mouse pad. However, a considerable number of Dialogue: 0,0:00:09.19,0:00:13.76,Default,,0000,0000,0000,,surfaces are shiny or glossy. We call these specular materials. Examples include Dialogue: 0,0:00:13.76,0:00:18.26,Default,,0000,0000,0000,,polish metals, plastics, polish wood, glass, glazed ceramics, and enamel paint. Dialogue: 0,0:00:18.26,0:00:23.02,Default,,0000,0000,0000,,These materials look different when you view them different angles, so we need Dialogue: 0,0:00:23.02,0:00:27.75,Default,,0000,0000,0000,,to take into account the direction from the surface to the eye. One standard way Dialogue: 0,0:00:27.75,0:00:31.78,Default,,0000,0000,0000,,of simulating specular materials is called the Blinn-Phong Reflection Model Dialogue: 0,0:00:31.78,0:00:35.66,Default,,0000,0000,0000,,named after its inventors, Jim Blinn and Bui Tuong Phong. The full model has a Dialogue: 0,0:00:35.66,0:00:38.97,Default,,0000,0000,0000,,number of terms in it for self-shadowing and for a shininess factor called the Dialogue: 0,0:00:38.97,0:00:43.76,Default,,0000,0000,0000,,Fresnel coefficent. But the simplest and most common form is this. Specular Dialogue: 0,0:00:43.76,0:00:50.16,Default,,0000,0000,0000,,equals the maximum of N dot H or 0, whichever is larger, raised to a power. N is Dialogue: 0,0:00:50.16,0:00:55.28,Default,,0000,0000,0000,,the surface normal, same as with diffuse material. H is called the half angle Dialogue: 0,0:00:55.28,0:00:59.45,Default,,0000,0000,0000,,vector. Say, you're given a surface, a light source direction, and a viewer Dialogue: 0,0:00:59.45,0:01:04.100,Default,,0000,0000,0000,,direction. How would you point a mirror so that the light reflected directly Dialogue: 0,0:01:04.100,0:01:09.40,Default,,0000,0000,0000,,toward the viewer? The answer is the half angle vector, which is the vector Dialogue: 0,0:01:09.40,0:01:13.92,Default,,0000,0000,0000,,halfway between these two directions, so that these two angles are equal. If the Dialogue: 0,0:01:13.92,0:01:17.62,Default,,0000,0000,0000,,surface normal and the half angle are identical, then the surface is perfectly Dialogue: 0,0:01:17.62,0:01:21.67,Default,,0000,0000,0000,,aligned to reflect light to the eye. So, N dot H would be 1, and all light is Dialogue: 0,0:01:21.67,0:01:27.08,Default,,0000,0000,0000,,reflective. As the normal and the half angle diversion direction, N dot H Dialogue: 0,0:01:27.08,0:01:32.27,Default,,0000,0000,0000,,becomes smaller. Once the angle between these vectors is 90 degrees, the Dialogue: 0,0:01:32.27,0:01:37.47,Default,,0000,0000,0000,,contribution goes to 0. The maximum function here limits the inputs so that this Dialogue: 0,0:01:37.47,0:01:41.08,Default,,0000,0000,0000,,value is never negative. We want to avoid it being negative because we're about Dialogue: 0,0:01:41.08,0:01:45.13,Default,,0000,0000,0000,,to raise it to a power. The S factor here is the shininess or specular power, Dialogue: 0,0:01:45.13,0:01:49.09,Default,,0000,0000,0000,,and has a range from 1 to infinity, though anything above 100 is not too much Dialogue: 0,0:01:49.09,0:01:53.96,Default,,0000,0000,0000,,different. When you raise a fraction to a power, the result is smaller, and Dialogue: 0,0:01:53.96,0:02:00.10,Default,,0000,0000,0000,,smaller still the higher the power. For example, 0.5 squared is 0.25, cubed, is Dialogue: 0,0:02:00.10,0:02:04.98,Default,,0000,0000,0000,,0.125, and so on. By raising this term to a higher power, the object appears Dialogue: 0,0:02:04.98,0:02:09.25,Default,,0000,0000,0000,,shinier. We can see this in the graph of N dot H versus the specular intensity. Dialogue: 0,0:02:09.25,0:02:13.41,Default,,0000,0000,0000,,As the cosine power rises, the slope becomes tighter and tighter and gets Dialogue: 0,0:02:13.41,0:02:17.44,Default,,0000,0000,0000,,sharper. What the half angle represents is the distribution of microfacets on a Dialogue: 0,0:02:17.44,0:02:21.84,Default,,0000,0000,0000,,surface. A microfacet is a way of thinking how a material reflects light. For Dialogue: 0,0:02:21.84,0:02:26.23,Default,,0000,0000,0000,,example, a fairly smooth surface may look like this. Light coming in from one Dialogue: 0,0:02:26.23,0:02:30.04,Default,,0000,0000,0000,,direction will bounce off the surface mostly in the reflection direction. A Dialogue: 0,0:02:30.04,0:02:34.07,Default,,0000,0000,0000,,rougher surface will a lower shininess has a distribution of facets more like Dialogue: 0,0:02:34.07,0:02:37.97,Default,,0000,0000,0000,,this and the light will still go in the reflection direction, but with a much Dialogue: 0,0:02:37.97,0:02:41.85,Default,,0000,0000,0000,,wider dispersal. At this point, it's best for you to try out the specular power Dialogue: 0,0:02:41.85,0:02:45.69,Default,,0000,0000,0000,,function and see how it responds. An example program that follows, you control Dialogue: 0,0:02:45.69,0:02:49.76,Default,,0000,0000,0000,,the ambient, diffuse, and specular contributions. Try playing with the shininess Dialogue: 0,0:02:49.76,0:02:51.84,Default,,0000,0000,0000,,and other controls to see their effects.