![Page 1: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/1.jpg)
Visual AppearanceVisual Appearance(Shading & Texture mapping)(Shading & Texture mapping)
Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun (USC) and prof. H.-W. Shen (OSU) and others.
![Page 2: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/2.jpg)
ShadingShading(Local illumination)(Local illumination)
![Page 3: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/3.jpg)
Photorealism in Computer GraphicsPhotorealism in Computer Graphics
Photorealism in computer graphics involves Accurate representations of surface properties, and Good physical descriptions of the lighting effects
Modeling the lighting effects that we see on an object is a complex process, involving principles of both physics and psychology
Physical illumination models involve Material properties, object position relative to light sources and
other objects, the features of the light sources, and so on
![Page 4: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/4.jpg)
Illumination and RenderingIllumination and Rendering
An illumination model in computer graphics also called a lighting model or a shading model used to calculate the color of an illuminated position
on the surface of an object Approximations of the physical laws
A surface-rendering method determine the pixel colors for all projected positions in a scene
![Page 5: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/5.jpg)
Light SourcesLight Sources
Point light sources Emitting radiant energy at a single point Specified with its position and the color of the emitted light
Infinitely distant light sources A large light source, such as sun, that is very far from a scene Little variation in its directional effects Specified with its color value and a fixed direction for the light
rays
![Page 6: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/6.jpg)
Light SourcesLight Sources
Directional light sources Produces a directional beam of light Spotlight effects
Area light sources
![Page 7: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/7.jpg)
Light SourcesLight Sources Radial intensity attenuation
As radiant energy travels, its amplitude is attenuated by the factor
Sometimes, more realistic attenuation effects can be obtained with an inverse quadratic function of distance
The intensity attenuation is not applied to light sources at infinity because all points in the scene are at a nearly equal distance from a far-off source
2/1 d
local is source if
1infinityat is source if0.1
2210 dadaa
f
![Page 8: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/8.jpg)
Light SourcesLight Sources
Angular intensity attenuation For a directional light, we can attenuate the light
intensity angularly as well as radially
nf cos)(
![Page 9: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/9.jpg)
Surface Lighting EffectsSurface Lighting Effects
An illumination model computes the lighting effects for a surface using the various optical properties Degree of transparency, color reflectance, surface texture
The reflection (phong illumination) model describes the way incident light reflects from an opaque surface Diffuse, ambient, specular reflections Simple approximation of actual physical models
![Page 10: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/10.jpg)
Diffuse ReflectionDiffuse Reflection
Incident light is scattered with equal intensity in all directions
Such surfaces are called ideal diffuse reflectors (also referred to as Lambertian reflectors)
![Page 11: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/11.jpg)
Lambert’s Cosine LawLambert’s Cosine Law
The reflected luminous intensity in any direction from a perfectly diffusing surface varies as the cosine of the angle between the direction of incident light and the normal vector of the surface.
Intuitively: cross-sectional area of the “beam” intersecting an elementof surface area is smaller for greater angles with the normal.
![Page 12: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/12.jpg)
Diffuse ReflectionDiffuse Reflection
: the intensity of the light source
: diffuse reflection coefficient,
: the surface normal (unit vector)
: the direction of light source,(unit vector)
)(cos LNIkIkI ldld
lI
dk
N
L
Ideally diffuse surfaces obey cosine law.
Often called Lambertian surfaces.
![Page 13: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/13.jpg)
Ambient LightAmbient Light Multiple reflection of nearby (light-reflecting)
objects yields a uniform illumination
A form of diffuse reflection independent of the viewing direction and the spatial orientation of a surface
Ambient illumination is constant for an object
: the incident ambient intensity: ambient reflection coefficient, the proportion reflected away
from the surface
aIak
aaIkI
![Page 14: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/14.jpg)
Ambient + DiffuseAmbient + Diffuse
0 if
0 if)(
LNIk
LNLNIkIkI
aa
ldaa
![Page 15: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/15.jpg)
Specular ReflectionSpecular Reflection
Perfect reflector (mirror) reflects all lights to the direction where angle of reflection is identical to the angle of incidence
It accounts for the highlight
![Page 16: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/16.jpg)
Specular ReflectionSpecular Reflection
Phong specular-reflection model Note that N, L, and R are coplanar, but V may not be
coplanar to the others
nls
nls VRIkIkI )(cos
: intensity of the incident light
: color-independent specular coefficient
: the gloss of the surface
lI
sk
n
![Page 17: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/17.jpg)
Specular ReflectionSpecular Reflection Glossiness of surfaces
![Page 18: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/18.jpg)
Specular ReflectionSpecular Reflection
Specular-reflection coefficient ks is a material property For some material, ks varies depending on ks =1 if =90°
Calcularing the reflection vector R
NNLLR )2(
LNNLR )2(
![Page 19: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/19.jpg)
Specular ReflectionSpecular Reflection
Simplified Phong model using halfway vector H is constant if both viewer and the light source are
sufficiently far from the surface
|| LV
LVH
nsp
nsp
nsp
nsp
HNkIkI
VRkIkII
)(cos
)(cos
![Page 20: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/20.jpg)
Ambient+Diffuse+Specular ReflectionsAmbient+Diffuse+Specular Reflections
Single light source
Multiple light source
nlsldaa VRIkLNIkIkI )()(
l
nlsldaa VRIkLNIkIkI )()(
![Page 21: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/21.jpg)
Parameter Choosing TipsParameter Choosing Tips For a RGB color description, each intensity and
reflectance specification is a three-element vector
The sum of reflectance coefficients is usually smaller than one
Try n in the range [0, 100]
Use a small ka (~0.1)
Example Metal: n=90, ka=0.1, kd=0.2, ks=0.5
1 sda kkk
![Page 22: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/22.jpg)
![Page 23: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/23.jpg)
Atmospheric EffectsAtmospheric Effects A hazy atmosphere makes colors fade and
objects appear dimmer
Hazy-atmosphere effect is often simulated with an exponential attenuation function such as
Higher values for produce a denser atmosphere
2)()(
)(d
hazy
dhazy
edf
edf
hazehazyobjhazy IdfIdfI )](1[)(
![Page 24: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/24.jpg)
Polygon Rendering MethodsPolygon Rendering Methods We could use an illumination model to determine the surface
intensity at every projected pixel position
Or, we could apply the illumination model to a few selected points and approximate the intensity at the other surface positions
Curved surfaces are often approximated by polygonal surfaces
So, polygonal (piecewise planar) surfaces often need to be rendered as if they are smooth
![Page 25: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/25.jpg)
Constant-Intensity Surface RenderingConstant-Intensity Surface Rendering
Constant (flat) shading Each polygon is one face of a polyhedron and is not a
section of a curved-surface approximation mesh
![Page 26: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/26.jpg)
Intensity-Interpolation Surface RenderingIntensity-Interpolation Surface Rendering
Gouraud shading Rendering a curved surface that is approximated
with a polygon mesh Interpolate intensities at polygon vertices
Procedure
1. Determine the average unit normal vector at each vertex
2. Apply an illumination model at each polygon vertex to obtain the light intensity at that position
3. Linearly interpolate the vertex intensities over the projected area of the polygon
![Page 27: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/27.jpg)
Intensity-Interpolation Surface RenderingIntensity-Interpolation Surface Rendering
Normal vectors at vertices Averaging the normal vectors for each polygon
sharing that vertex
1N
2N
3N
4N
vN
4321
4321 )(
NNNN
NNNNNv
![Page 28: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/28.jpg)
Intensity-Interpolation Surface RenderingIntensity-Interpolation Surface Rendering
Intensity interpolation along scan lines I4 and I5 are interpolated along y-axis, and then Ip is interpolated along x-axis
Incremental calculation is also possibley
x
1
2
3
4 5
p scan line
545
44
45
25
323
252
23
535
221
411
21
244
Ixx
xxI
xx
xxI
Iyy
yyI
yy
yyI
Iyy
yyI
yy
yyI
pp
![Page 29: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/29.jpg)
Intensity-Interpolation Surface RenderingIntensity-Interpolation Surface Rendering
![Page 30: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/30.jpg)
Gouraud Shading ProblemsGouraud Shading Problems
Lighting in the polygon interior is inaccurate
Mach band effect Optical illusion
![Page 31: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/31.jpg)
Mach Band EffectMach Band Effect
These “Mach Bands” are not physically there. Instead, they are illusions due to excitation and inhibition in our neural processing
The bright bands at 45
degrees (and 135 degrees) are illusory.
The intensity of each square
is the same.
![Page 32: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/32.jpg)
Mach Band artifact Mach Band artifact (Gouraud Shading)(Gouraud Shading)
Mach bands: Caused by interaction of
neighboring retinal neurons. Acts as a sort of high-pass
filter, accentuating discontinuities in first derivative.
Linear interpolation causes first deriv. Discontinuities at polygon edges.
![Page 33: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/33.jpg)
Normal-Vector Interpolation for Surface RenderingNormal-Vector Interpolation for Surface Rendering
Phong shading Interpolate normal vectors at polygon vertices
Procedure
1. Determine the average unit normal vector at each vertex
2. Linearly interpolate the vertex normals over the projected area of the polygon
3. Apply an illumination model at positions along scan lines to calculate pixel intensities n1
n2n3
![Page 34: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/34.jpg)
Gouraud versus Phong ShadingGouraud versus Phong Shading
Gouraud shading is faster than Phong shading OpenGL supports Gouraud shading
Phong shading is more accurate
![Page 35: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/35.jpg)
Texture MappingTexture Mapping
![Page 36: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/36.jpg)
Can you do this …Can you do this …
![Page 37: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/37.jpg)
Visual RealismVisual Realism
![Page 38: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/38.jpg)
Texture MappingTexture Mapping
Surfaces in real world are very complex
Objects have properties that vary across surface
Cannot model all the fine variations
We need to find ways to add surface detail
How?
![Page 39: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/39.jpg)
Texture MappingTexture Mapping
Of course, one can model the exact micro-geometry + material property to control the look and feel of a surface
But, it may get extremely costly
So, graphics use a more practical approach – texture mapping
![Page 40: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/40.jpg)
Texture MappingTexture Mapping
Texture Mapping
Want a function that assigns a color to each point The the surface is a 2D domain, so that is essentially an
image can represent using any image representation raster texture images are very popular
![Page 41: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/41.jpg)
Photo-texturesPhoto-textures
![Page 42: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/42.jpg)
OpenGL functions - demoOpenGL functions - demo
Usually texture is a (2D/3D) image.
During initialization read in or create the texture image and place it into the OpenGL state.
glTexImage2D (GL_TEXTURE_2D, 0, GL_RGB, imageWidth, imageHeight, 0, GL_RGB, GL_UNSIGNED_BYTE, imageData);
Before rendering your textured object, enable texture mapping and tell the system to use this particular texture.
glBindTexture (GL_TEXTURE_2D, 13);
![Page 43: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/43.jpg)
OpenGL functionsOpenGL functions
During rendering, give the cartesian coordinates and the texture coordinates for each vertex.
glBegin (GL_QUADS);glTexCoord2f (0.0, 0.0);glVertex3f (0.0, 0.0, 0.0);glTexCoord2f (1.0, 0.0);glVertex3f (10.0, 0.0, 0.0);glTexCoord2f (1.0, 1.0);glVertex3f (10.0, 10.0, 0.0);glTexCoord2f (0.0, 1.0);glVertex3f (0.0, 10.0, 0.0);
glEnd ();
![Page 44: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/44.jpg)
Texture and TexelTexture and Texel
Each pixel in a texture map is called a Texel
Each Texel is associated with a (u,v) 2D texture coordinate
The range of u, v is [0.0,1.0] due to normalization
![Page 45: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/45.jpg)
(u,v) tuple(u,v) tuple
For any (u,v) in the range of (0-1, 0-1) multiplied by texture image width and height, we can find the corresponding value in the texture map
![Page 46: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/46.jpg)
How do we get F(u,v)?How do we get F(u,v)?
We are given a discrete set of values: F[i,j] for i=0,…,N, j=0,…,M
Nearest neighbor: FF(u,v) = F[ round(N*u), round(M*v) ]
Linear Interpolation: i = floor(N*u), j = floor(M*v) interpolate from F[i,j], F[i+1,j], F[i,j+1], F[i+1,j]
Filtering in general !
![Page 47: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/47.jpg)
InterpolationInterpolation
Nearest neighbor Linear Interpolation
![Page 48: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/48.jpg)
Specifying texture coordinatesSpecifying texture coordinates
Texture coordinates needed at every vertex
Hard to specify by hand
Difficult to wrap a 2D texture around a 3D object
![Page 49: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/49.jpg)
Texture FilteringTexture Filtering
Resampling using mip mapping Magnification: Interpolation Minification: Averaging
Texture Image
Texture => Image
We would like a constant cost per pixel
![Page 50: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/50.jpg)
Mip MappingMip Mapping
MIP = Multim In Parvo = Many things in a small place
Constructs an image pyramid. Each level is a prefilteredversion of the level below resampled at half the frequency.
Whilerasterizing use the level with the sampling rate closest to the desired sampling rate.
![Page 51: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/51.jpg)
Mip MappingMip Mapping
• Used with bilinear/trilinear interpolation
G
R
B
R
G B
Trilinear interpolation
![Page 52: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/52.jpg)
Mip Mapping - ExampleMip Mapping - Example
Courtesy of John hart
• used to save some of the filtering work needed during texture minification
![Page 53: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/53.jpg)
Texture Filtering MethodsTexture Filtering Methods
Nearest Neighbor interpolation
Bilinear Interpolation
Trilinear Interpolation
Anisotropic filtering Precomputed rectangular(trapezoidal) maps
<anisotropic filtering)
![Page 54: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/54.jpg)
exampleexample
No mip mapping vs with mip mapping
![Page 55: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/55.jpg)
exampleexample
Bilinear mip mapping vs trilinear mip mapping
![Page 56: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/56.jpg)
Specifying texture coordinatesSpecifying texture coordinates
Texture coordinates needed at every vertex
Hard to specify by hand
Difficult to wrap a 2D texture around a 3D object
![Page 57: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/57.jpg)
Planar mappingPlanar mapping
Compute texture coordinates at each vertex by projecting the map coordinates onto the model
![Page 58: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/58.jpg)
Cylindrical MappingCylindrical Mapping
![Page 59: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/59.jpg)
Spherical MappingSpherical Mapping
![Page 60: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/60.jpg)
Cube MappingCube Mapping
![Page 61: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/61.jpg)
Modelling Surface PropertiesModelling Surface Properties
Can use a texture to supply any parameter of the illumination model ambient, diffuse, and specularcolor Specular exponent roughness
![Page 62: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/62.jpg)
Environment MapsEnvironment Maps
Use texture to represent reflected color
Texture indexed by reflection vector
Approximation works when objects are far away from the reflective object
![Page 63: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/63.jpg)
Environment MapsEnvironment Maps
Using a spherical environment map
Spatially variant resolution
![Page 64: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/64.jpg)
Environment MapsEnvironment Maps
Using a cubical environment map
![Page 65: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/65.jpg)
Environment MappingEnvironment Mapping
Environment mapping produces reflections on shiny objects
Texture is transferred in the direction of the reflected ray from the environment map onto the object
Reflected ray: R=2(N·V)N-V
Object
ViewerReflected ray
Environment Map
![Page 66: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/66.jpg)
Approximations MadeApproximations Made The map should contain a view of the world
with the point of interest on the object as the eye We can’t store a separate map for each point, so
one map is used with the eye at the center of the object
Introduces distortions in the reflection, but the eye doesn’t notice
Distortions are minimized for a small object in a large room
The mapping can be computed at each pixel, or only at the vertices
![Page 67: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/67.jpg)
ExampleExample
![Page 68: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/68.jpg)
Refraction MapsRefraction Maps
Use texture to represent refraction
![Page 69: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/69.jpg)
Opacity MapsOpacity Maps
Use texture to represent opacity
RGB channels
alpha channels
Use the alpha channel to make portions of the texture transparent. Cheaper than explicit modelling
![Page 70: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/70.jpg)
Illumination MapsIllumination Maps
Use texture to represent illumination footprint
![Page 71: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/71.jpg)
Illumination MapsIllumination Maps
Quake light maps
![Page 72: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/72.jpg)
Bump MappingBump Mapping
Use texture to perturb normals
Textures are treated as height field
creates a bump-like effect
+ =
original surface bump map modified surface
),( vuO ),( vuB ),(' vuO
Does not change silhouette edges
![Page 73: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/73.jpg)
Bump mappingBump mapping
![Page 74: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/74.jpg)
Normal Mapping (bump mapping)Normal Mapping (bump mapping)
Replace normals
![Page 75: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/75.jpg)
Bump MappingBump Mapping
Many textures are the result of small perturbations in the surface geometry
Modeling these changes would result in an explosion in the number of geometric primitives.
Bump mapping attempts to alter the lighting across a polygon to provide the illusion of texture.
![Page 76: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/76.jpg)
Displacement MappingDisplacement Mapping
Use texture to displace the surface geometry
+ =
Bump mapping only affects the normals,
Displacement mapping changes the entire surface (including the silhouette)
![Page 77: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/77.jpg)
Displacement MappingDisplacement Mapping
![Page 78: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/78.jpg)
3D Textures3D Textures
Use a 3D mapping
tsrzyx ooo ,,,,
Can simulate an object carved from a material
• Marble or wood•The object is “carved”out of the solid texture
![Page 79: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/79.jpg)
Texture SynthesisTexture Synthesis
Texture Synthesis
![Page 80: Visual Appearance (Shading & Texture mapping) Course Note Credit: Some of slides are extracted from the course notes of prof. J. Lee (SNU), prof. M. Desbrun](https://reader035.vdocuments.us/reader035/viewer/2022062519/56649ccb5503460f94994cab/html5/thumbnails/80.jpg)
TransparencyTransparency
Alpha Blending a: foreground object , b: background object, o: output Alpha : opacity , C : color