rasterize & interp figures
go-vxlab.csc.ncsu.edu / projectiondiscussion
http://go-vxlab.csc.ncsu.edu/projectiondiscussion
rasterization & interpolation
CGClass @ NCSU
Intro CG @ NCSU
Ben Watson
cgclass.csc.ncsu.edu
http://cgclass.csc.ncsu.edu/
rasterization
go-vxlab.csc.ncsu.edu/
rasterizeslides
http://go-vxlab.csc.ncsu.edu/rasterizeslides
http://go-vxlab.csc.ncsu.edu/rasterizeslides
history
https://archive.org/details/principlesofinter00newm
rasterize vs. ray tracing
ray tracing
ray tracing
for each pixel
for each primitive
/* shade etc */
ray tracing
(image order)
for each primitive
for each pixel
/* shade etc */
rasterization
(object order)
rasterization
rasterization
bilerp of triangles (bilerp of rectangles)
(0,1,1) = LL
(3,4,3) = U (= UL/UR)
LR = (6,2,2)
(4,3,?) = P
https://docs.google.com/presentation/d/1JiHs1Wq2Xbz7qGIcC82pPqUvpResezgP8USshq010rg/edit#slide=id.g904a4c32c9_5_226
bilerp of triangles
(0,1,1) = LL
(3,4,3) = U (= UL/UR)
LR = (6,2,2)
PL PR
(4,3,?) = P
sL = (Py-Uy) / (LLy-Uy)
sL = (3-4) / (1-4)
sL = 1 / 3
sR = (Py-Uy) / (LRy-Uy)
sR = (3-4) / (2-4)
sR = 1 / 2
(bilerp of rectangles)
https://docs.google.com/presentation/d/1JiHs1Wq2Xbz7qGIcC82pPqUvpResezgP8USshq010rg/edit#slide=id.g904a4c32c9_5_226
bilerp of triangles
(0,1,1) = LL
(3,4,3) = U (= UL/UR)
LR = (6,2,2)
PL PR
PLx = Ux + sL (LLx – Ux)
PLx = 3 + ⅓ (0 – 3) = 2
PLz = Uz + sL (LLz – Uz)
PLz = 3 + ⅓ (1 – 3) = 2⅓
PRx = Ux + sR (LRx – Ux)
PRx = 3 + ½ (6 – 3) = 4½
PRz = Uz + sR (LRz – Uz)
PRz = 3 + ½ (2 – 3) = 2½
(bilerp of rectangles)
https://docs.google.com/presentation/d/1JiHs1Wq2Xbz7qGIcC82pPqUvpResezgP8USshq010rg/edit#slide=id.g904a4c32c9_5_226
bilerp of triangles
PL PR
t = (Px – PLx) / (PRx – PLx)
t = (4 – 2) / (4½ – 2)
t = 2 / 2½ = 4 / 5
Pz = PLz + t (PRz – PLz)
Pz = 2⅓ + ⅘ (2½ – 2⅓)
Pz = 2⅓ + ⅘ ⅙ = 2 7/15
(4,3,?) = P
(bilerp of rectangles)
https://docs.google.com/presentation/d/1JiHs1Wq2Xbz7qGIcC82pPqUvpResezgP8USshq010rg/edit#slide=id.g904a4c32c9_5_226
rasterization ray tracing
rasterization ray tracing
speed faster
shadows easier
reflections easier
refractions easier
Z Z
depth complexity 2 depth complexity 5
1965 1985 2005 2015 2035
1965 1985 2005 2015 2035
rasterization
ray tracing
perspective bilerp
affine 2d bilerp perspective bilerp
Let’s say that we want to interpolate texture coordinates s
and t and have homogeneous coordinate w (with depth):
1. Perform perspective divide to go to 3d:
(s/w,t/w)
2. Append the denominator:
(s/w,t/w,1/w)
3. Perform bilerp to point p, including denominator:
(s/wp,t/wp,1/wp)
4. Undo the divide:
(sp,tp) = (s/wp / 1/wp , t/wp / 1/wp)
go deeper with readings…
https://sites.google.com/view/cgwiki-ncsu/topics/rasterization
post reactions and… we might discuss them next time
log them and… get reading credit
https://sites.google.com/view/cgwiki-ncsu/topics/rasterization
http://go-vxlab.csc.ncsu.edu/cgclassforumreadings
http://go-vxlab.csc.ncsu.edu/cgclassreadinglog
…and with videos
http://cgclass.csc.ncsu.edu/p/topic-notes.html#rasterization
(youtube)
http://cgclass.csc.ncsu.edu/p/topic-notes.html#rasterization
Requests, questions, thoughts?
go-vxlab.csc.ncsu.edu / rasterizationdiscussion
post them and… we’ll discuss them next time
log them and… get participation credit
http://go-vxlab.csc.ncsu.edu/rasterizationdiscussion
32
BREAK
TIME
↖
ask your
questions
listen to
tunes
↓
♬
https://youtu.be/1cmq0c9PjRI
https://goo.gl/forms/u2Cxevg9NieeJpKy2