-
Notifications
You must be signed in to change notification settings - Fork 370
/
README
157 lines (116 loc) · 6.06 KB
/
README
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
The Disney BRDF Explorer is an application that allows the development and analysis
of bidirectional reflectance distribution functions (BRDFs). It can load and plot
analytic BRDF functions (coded as snippets of OpenGL GLSL programs), measured
material data from the MERL database, and anisotropic measured material data from
MIT CSAIL.
Most of the application should be (hopefully) self explanatory, so the goal here is to
document the less obvious bits of usage, as well as providing some useful info.
WHICH BRDF(S) YOU'RE SEEING
------------------------------------
In the BRDF Parameters window, each BRDF has a colored background. The plotted values
(for the 3D, polar, and cartesian plots) are drawn in the corresponding colors.
In the Image Slice, Lit Object, and Lit Sphere windows, you're seeing the first
(topmost in the parameters window) enabled BRDF.
NAVIGATING POLAR/CARTESIAN PLOTS
------------------------------------
Use the left mouse button to pan around in the plot. Right dragging will zoom in/out
around the centered location. Double-clicking anywhere resets the view to the default
zoom and location. For cartesian plots, Control+left drag stretches ONLY the x-axis,
while Control+right drag stretches only the y-axis.
NAVIGATING 3D PLOTS
------------------------------------
Left-drag spins around the origin (there's no current way to change this). Right drag
zooms in and out. Double clicking resets to the default view.
PARAMETER SLIDERS
------------------------------------
Parameters sliders (a slider plus a text entry box) are all over the application. To
reset one to its default value, Control+Click in the text box.
SOLOING BRDFS
------------------------------------
Pressing the "solo" (circle) button for a given BRDF makes ONLY that BRDF visible,
hiding all the others. The "Solo this BRDF's color channels" button also hides all
the other channels, but shows a separate plot for the red, green, and blue channels
(in their respective colors). Click the solo button again to exit solo mode.
LIT SPHERE VIEW
------------------------------------
You can drag the left mouse button on the surface of the sphere to change the
incident angle. If "Double Theta" is enabled, the specular highlight will track
the position of the mouse.
LIT OBJECT VIEW
------------------------------------
The lit object view allows an arbitrary object to be viewed under with a directional
light from the incident direction (in "No IBL" mode) or under illumination from an
arbitrary environment map. Left dragging rotates the object; right dragging zooms
the object; Control+left dragging rotates the environment probe.
The combo box lets you choose "No IBL", "IBL: No IS" (quasirandom sampling from
the environment map with no importance sampling) and "IBL: IBL IS" (importance
sampling from the IBL). Multiple importance sampling is planned but not implemented.
The "Keep Sampling" mode, when enabled, progressively refines the image until
4096 samples have been applied.
The buttons allow changing out the object (any OBJ should work) and the environment
probe (which must be in ptex format).
ALBEDO VIEW
------------------------------------
Albedo computation by brute force sampling proved too expensive to do interactively,
so the application can use several different sampling strategies to compute the albedo.
Use the combo box on the right to choose between these sampling strategies. The
Resample x10 button adds more samples to that view of the graph.
IMAGE SLICE VIEW
------------------------------------
An "image slice" is an alternative way of looking at BRDF data that we have found
helpful at Disney. Along the x-axis, the half angle is varied from zero to 90
degrees; along the y-axis, the difference angle is varied from 0 to 90 degrees.
BRDF FILES
------------------------------------
.brdf files consist of a set of parameters and a BRDF function written in GLSL.
At runtime, the application creates UI elements for each parameter, and creates
shaders for different views that incorporate the GLSL function.
The BRDF function looks like this (this example is for a lambertian BRDF):
::begin shader
vec3 BRDF( vec3 L, vec3 V, vec3 N, vec3 X, vec3 Y )
{
return vec3(reflectance / 3.14159265);
}
::end shader
Anything valid in GLSL can go between "::begin shader" and "::end shader" as
long as it's valid GLSL.
The application allows float, color, and boolean parameters. The float parameters
have the form
float [name] [min val] [max val] [default val]
for example:
float reflectance 0.0 1.0 1.0
Boolean parameters have the form
bool [name] [default], where default is 0 or 1 (keywords such as true and
false aren't recognized)
for example:
bool hasDiffuse 0
Color parameters have the form
color [name] [defaultR] [defaultG] [defaultB], where defaultR/G/B are in [0..1]
for example:
color diffuseColor 0.5 0.1 1.0
Parameters are passed into the resulting GLSL shaders as uniforms of the same
name (so parameter names must be valid GLSL variable names, although the
application doesn't enforce this). Float parameters come in as uniform floats,
color parameters as vec3s, and boolean parameters as bools. The application
declares them when constructing shaders, so your GLSL BRDF functions can
refer to them knowing that they'll exist and have the proper values at runtime.
LIGHT PROBE ATTRIBUTION
------------------------------------
HDR Light Probe Images Copyright 1998 courtesy of Paul Debevec,
www.debevec.org, used with permission.
Please see:
Paul Debevec. Rendering Synthetic Objects Into Real Scenes: Bridging Traditional and
Image-Based Graphics With Global Illumination and High Dynamic Range Photography.
Proceedings of SIGGRAPH 98, Computer Graphics Proceedings, Annual Conference Series,
July 1998, pp. 189-198.
WHERE TO GET MEASURED BRDF DATA
------------------------------------
MERL data can be requested here:
http://www.merl.com/brdf/
MIT CSAIL data is here:
http://people.csail.mit.edu/addy/research/brdf/
BUILD INSTRUCTIONs
------------------
To install brdf run:
make install [prefix=<some-directory>]
If you do not specify "prefix=..." then brdf will be installed into the current directory.