-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFilterFootprint.html
79 lines (79 loc) · 2.23 KB
/
FilterFootprint.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
<title>Filter Footprint</title>
</head>
<body>
<img src="uvellipse.png"><br>
The Ptex filter footprint is specified as two vectors in uv space:<br>
<div style="margin-left: 40px;"><br>
W<sub>1</sub> = [uw1, vw1]<br>
W<sub>2</sub> = [uw2, vw2]<br>
</div>
<br>
The vectors form a parallelogram around the sample point, [u, v].<br>
When the vectors are orthogonal, they form the major and minor axis of
the enclosed ellipse.<br>
<br>
<h3>Determining the filter footprint<br>
</h3>
In general, the vectors represent the uv sampling interval along two
axes, a and b:<br>
<br>
<div style="margin-left: 40px;">[uw1, vw1] = [du/da, dv/da]<br>
[uw2, vw2] = [du/db, dv/db]<br>
</div>
<br>
Two special cases are of interest:<br>
<br>
A) Texture aligned grid (the classic Ptex case) - the vectors form two
sides of a rectangle, uw by vw:<br>
<br>
<div style="margin-left: 40px;">[uw1, vw1] = [uw, 0]<br>
[uw2, vw2] = [0, vw]<br>
</div>
<br>
B) Projection from screen space (where a and b are screen coordinates
in pixels):<br>
<div style="margin-left: 40px;"><br>
Given derivatives of the screen coordinates:<br>
<br>
</div>
<div style="margin-left: 80px;">da/du = Du(a)<br>
db/du = Du(b)<br>
da/dv = Dv(a)<br>
db/dv = Dv(b)<br>
<br>
</div>
<div style="margin-left: 40px;">the vectors can be found by inverting
the Jacobian matrix [da/du, db/du ; da/dv, db/dv]:<br>
<div style="margin-left: 40px;"><br>
det = (da/du * db/dv - db/du * da/dv)<br>
du/da = (1/det) * db/dv<br>
dv/da = -(1/det) * db/du<br>
du/db = -(1/det) * da/dv<br>
dv/db = (1/det) * da/du<br>
[uw1, vw1] = [du/da, dv/da]<br>
[uw2, vw2] = [du/db, dv/db]<br>
<br>
</div>
</div>
<div style="margin-left: 40px;">Note: if the ptex u, v coordinates
aren't aligned with the renderer's uv coordinates, the chain rule can
be used.<br>
Given texture coordinates s and t:<br>
<div style="margin-left: 40px;"><br>
ds/du = Du(s)<br>
dt/du = Du(t)<br>
ds/dv = Dv(s)<br>
dt/dv = Dv(t)<br>
[uw1, vw1] = [ds/du*du/da + ds/dv*dv/da, dt/du*du/da + dt/dv*dv/da]<br>
[uw2, vw2] = [ds/du*du/db + ds/dv*dv/db, dt/du*du/db + dt/dv*dv/db]<br>
<br>
<br>
</div>
</div>
</body>
</html>