Texturing, culling
Instructor: Christopher Rasmussen (cer@cis.udel.edu)
April 13, 2021 ❖ Lecture 15
Outline
Texture mapping: Steps
Texture mapping: Steps
Texture mapping: Rasterization issue
Texture mapping: Rasterization issue
Texture mapping: Rasterization issue
Take "nearest neighbor" texel color or some kind of blend of surrounding texels?
Linear Interpolation (aka lerp)
p(t) = p0 + t(p1 - p0), where t in [0, 1]
= p0 - t p0 + t p1
= (1 - t)p0 + t p1
from Akenine-Möller & Haines
like a “blend” of
the two endpoints
= lerp(p0, p1, t)
Bilinear interpolation for LIGHTING
m = lerp(mleft, mright, t)
mleft= lerp(m3, m4, tleft)
mright= lerp(m1, m2, tright)
dest
I = texture image, Idest = image we are rendering
Rasterization: Magnification and minification
Magnification
Minification
from Angel
courtesy of H. Pfister
Rasterization: Magnification and minification
Magnification
Minification
from Angel
courtesy of H. Pfister
Filtering for minification
image courtesy of D. Cohen-Or
Supersampling: Using more than BLI’s 4 texels
from Hill
Regular supersampling
with 2x frequency
Jittered supersampling
Mipmaps
from Woo, et al.
Clipping
courtesy of L. McMillan
Clipping
courtesy of L. McMillan
Clipping
courtesy of L. McMillan
Geometry pipeline
Coordinate change rigid transform
(View)
Perspective transformation
(and orthographic scaling)
(Projection)
2-D scale and shift
(Viewport)
Perspective division
Orthographic projection
Camera coordinates
Clip coordinates
Normalized device coordinates (CVV)
Window coordinates
Screen coordinates (pixels)
World coordinates
Model coordinates
Coordinate change rigid transform
(Model)
When to clip?
☺
Clipping: Basic issues
from E. Angel
Cohen-Sutherland 2-D line clipping (not in textbook)
VA
xmin
xmax
ymax
ymin
adapted from F. Pfenning
y < ymax
y > ymin
x > xmin
x < xmax
= ∩
Cohen-Sutherland clipping: Outcodes
from Hill
Cohen-Sutherland clipping
from Hill
Cohen-Sutherland clipping
adapted from E. Angel
Cohen-Sutherland: Algorithm
compute outcodes
compute intersection
Computing the intersection point
adapted from Hill
Δx
Δy
c
a
b
xmin
xmax
ymax
ymin
Computing the intersection point
adapted from Hill
Δx
Δy
c
a
b
xmin
xmax
ymax
ymin
Computing the intersection point
adapted from Hill
Δx
Δy
c
a
b
xmin
xmax
ymax
ymin
Computing the intersection point
adapted from Hill
Δx
Δy
c
a
b
xmin
xmax
ymax
ymin
Line clipping: Notes
from E. Angel
from Hill
Clipping Triangles
courtesy of L. McMillan
Keep complete triangle
Throw away complete triangle
Keep triangular portion inside
Split quadrilateral portion inside into 2 triangles