git.haldean.org artray / master
Update dox Will Brown 8 years ago
15 changed file(s) with 4374 addition(s) and 105 deletion(s). Raw diff Collapse all Expand all
77 import ArtRay.Geometry
88 import ArtRay.Primitives
99
10 -- | Get the color for a pixel in the scene
1011 pixelColor :: Size -> Scene -> Viewer -> Point2D -> ColorTriple
12 -- | Find the color at a pixel defined by the point
1113 pixelColor size scene viewer (Point2D ix iy) =
1214 pixelColor size scene viewer (toRelPoint size (Point2D ix iy))
1315
16 -- | Find the color at a pixel defined by a relative point (scalar multiples of
17 -- u and v).
1418 pixelColor size scene viewer (RelPoint2D hu hv) =
1519 meanColor $ map (colorAtRay scene 0) rays
1620 where rays = pointToRay scene viewer (RelPoint2D hu hv)
1721
22 -- | Finds the color at a point on a primitive, using the provided material.
23 -- Both the primitive and the material must be supplied, as some primitives may
24 -- have multiple materials that need to be calculated. The stack depth of ray
25 -- tracing is tracked but currently is unused and unlimited.
1826 colorFor :: Scene
1927 -- ^ The scene we're operating within
2028 -> Primitive
5765 FlatSum -> sumColor
5866 Multiply -> combine
5967
60 tracei x = trace (show x) x
61
68 -- | Returns how much occlusion occurs between two points x1 and x2. The shape
69 -- at x1 must be provided to ensure that it is excluded when calculating
70 -- intersections. The return value ranges from 0 to 1, where 0 is fully occluded
71 -- and 1 is not occluded at all. Intermediate values are possible because of
72 -- semi-transparent material that may be between x1 and x2.
6273 occluded :: Scene -> Primitive -> Vec3 -> Vec3 -> Double
6374 occluded scene shape x1 x2 =
6475 product
6677 . filter (\(s, loc, p) -> 0 < s && s < 1) $
6778 intersectWithScene scene (Ray (x2 &- x1) x1) [shape]
6879
69 phongLight :: Scene -> Primitive -> Material -> Ray -> Vec3 -> Light -> ColorTriple
80 -- | Calculates the illumination of a point on a primitive with a Phong
81 -- material.
82 phongLight :: Scene
83 -> Primitive
84 -> Material
85 -> Ray
86 -- ^ The incoming ray, whose location is the point of intersection
87 -> Vec3
88 -- ^ The surface normal at the illumination point
89 -> Light
90 -> ColorTriple
7091 phongLight scene shape mat ray surfacenorm light =
7192 let kd = diffuse mat `combine` difflight light
7293 ks = specular mat `combine` speclight light
79100 occlusion = occluded scene shape (position ray) (loclight light)
80101 in weightedCombine occlusion (sumLight [kd `scale` sd, ks `scale` ss]) (0, 0, 0)
81102
103 -- | Find the color of the first object that intersects a ray
82104 colorAtRay :: Scene -> Int -> Ray -> ColorTriple
83105 colorAtRay scene depth ray = colorAtRay' scene depth ray []
84106
107 -- | Find the color of the first object that intersects a ray, excluding the
108 -- provided primitives from the intersection.
85109 colorAtRay' :: Scene -> Int -> Ray -> [Primitive] -> ColorTriple
86110 colorAtRay' scene depth ray exclude =
87111 let geom = geomAtRay scene ray exclude
91115 else let (loc, shape) = fromJust geom
92116 in colorFor scene shape (material shape) (direction ray) loc depth
93117
94 sortTuples :: (Double, Vec3, Primitive) -> (Double, Vec3, Primitive) -> Ordering
95 sortTuples (s1, _, _) (s2, _, _)
118 -- | Order tuples representing intersections, from first to last intersection
119 orderTuples :: (Double, Vec3, Primitive) -> (Double, Vec3, Primitive) -> Ordering
120 orderTuples (s1, _, _) (s2, _, _)
96121 | s1 < s2 = LT
97122 | s1 == s2 = EQ
98123 | otherwise = GT
99124
125 -- | Find the first primitive at a ray
100126 geomAtRay :: Scene -> Ray -> [Primitive] -> Maybe (Vec3, Primitive)
101127 geomAtRay scene ray exclude =
102128 let intersections = intersectWithScene scene ray exclude
103129 in if null intersections then Nothing else
104 let (_, point, shape) = minimumBy sortTuples intersections
130 let (_, point, shape) = minimumBy orderTuples intersections
105131 in Just (point, shape)
106132
133 -- | Find all points of intersections of a ray with the scene
107134 intersectWithScene :: Scene -> Ray -> [Primitive] -> [(Double, Vec3, Primitive)]
108135 intersectWithScene scene ray exclude =
109136 mapMaybe (firstIntersection ray) (filter (`notElem` exclude) (geom scene))
2525 * Basic reflection model
2626 * Basic refraction model
2727 * Anti-aliasing (new!)
28 * Depth of field
2829
2930 Planned Features:
3031
3334 * B-Spline surfaces
3435 * Parallel rendering
3536 * Reflected light sources
37 * Metaballs
0 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>ArtRay.Geometry</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
0 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
1 <html xmlns="http://www.w3.org/1999/xhtml"
2 ><head
3 ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
4 /><title
5 >ArtRay.Geometry</title
6 ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean"
7 /><script src="haddock-util.js" type="text/javascript"
8 ></script
9 ><script type="text/javascript"
10 >//<![CDATA[
111 window.onload = function () {pageLoad();setSynopsis("mini_ArtRay-Geometry.html");};
212 //]]>
3 </script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">ArtRay: A Haskell Raytracer</p></div><div id="content"><div id="module-header"><p class="caption">ArtRay.Geometry</p></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><a href="#v:quadSolve">quadSolve</a> :: Double -&gt; Double -&gt; Double -&gt; (Double, Double)</li><li class="src short"><a href="#v:firstIntersection">firstIntersection</a> :: <a href="ArtRay-Primitives.html#t:Ray">Ray</a> -&gt; <a href="ArtRay-Primitives.html#t:Primitive">Primitive</a> -&gt; Maybe (Double, Vec3, <a href="ArtRay-Primitives.html#t:Primitive">Primitive</a>)</li><li class="src short"><a href="#v:pointToRay-39-">pointToRay'</a> :: <a href="ArtRay-Primitives.html#t:Viewer">Viewer</a> -&gt; <a href="ArtRay-Primitives.html#t:Point2D">Point2D</a> -&gt; <a href="ArtRay-Primitives.html#t:Ray">Ray</a></li><li class="src short"><a href="#v:farpoint">farpoint</a> :: <a href="ArtRay-Primitives.html#t:Ray">Ray</a> -&gt; Vec3 -&gt; Double -&gt; Vec3</li><li class="src short"><a href="#v:deformRay">deformRay</a> :: <a href="ArtRay-Primitives.html#t:Scene">Scene</a> -&gt; <a href="ArtRay-Primitives.html#t:Ray">Ray</a> -&gt; (Double, Double) -&gt; <a href="ArtRay-Primitives.html#t:Ray">Ray</a></li><li class="src short"><a href="#v:pointToRay">pointToRay</a> :: <a href="ArtRay-Primitives.html#t:Scene">Scene</a> -&gt; <a href="ArtRay-Primitives.html#t:Viewer">Viewer</a> -&gt; <a href="ArtRay-Primitives.html#t:Point2D">Point2D</a> -&gt; [<a href="ArtRay-Primitives.html#t:Ray">Ray</a>]</li><li class="src short"><a href="#v:reflectAbout">reflectAbout</a> :: Vec3 -&gt; Vec3 -&gt; Vec3</li><li class="src short"><a href="#v:refractVector">refractVector</a> :: Double -&gt; Vec3 -&gt; Vec3 -&gt; Vec3</li><li class="src short"><a href="#v:normal">normal</a> :: <a href="ArtRay-Primitives.html#t:Primitive">Primitive</a> -&gt; Vec3 -&gt; Vec3</li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><a name="v:quadSolve" class="def">quadSolve</a> :: Double -&gt; Double -&gt; Double -&gt; (Double, Double)</p><div class="doc"><p>Solve a quadratic. Returns NaN for non-real roots, and two equal values for
13 </script
14 ></head
15 ><body
16 ><div id="package-header"
17 ><ul class="links" id="page-menu"
18 ><li
19 ><a href="index.html"
20 >Contents</a
21 ></li
22 ><li
23 ><a href="doc-index.html"
24 >Index</a
25 ></li
26 ></ul
27 ><p class="caption"
28 >ArtRay: A Haskell Ray Tracer</p
29 ></div
30 ><div id="content"
31 ><div id="module-header"
32 ><p class="caption"
33 >ArtRay.Geometry</p
34 ></div
35 ><div id="synopsis"
36 ><p id="control.syn" class="caption expander" onclick="toggleSection('syn')"
37 >Synopsis</p
38 ><ul id="section.syn" class="hide" onclick="toggleSection('syn')"
39 ><li class="src short"
40 ><a href="#v:quadSolve"
41 >quadSolve</a
42 > :: Double -&gt; Double -&gt; Double -&gt; (Double, Double)</li
43 ><li class="src short"
44 ><a href="#v:firstIntersection"
45 >firstIntersection</a
46 > :: <a href="ArtRay-Primitives.html#t:Ray"
47 >Ray</a
48 > -&gt; <a href="ArtRay-Primitives.html#t:Primitive"
49 >Primitive</a
50 > -&gt; Maybe (Double, Vec3, <a href="ArtRay-Primitives.html#t:Primitive"
51 >Primitive</a
52 >)</li
53 ><li class="src short"
54 ><a href="#v:pointToRay-39-"
55 >pointToRay'</a
56 > :: <a href="ArtRay-Primitives.html#t:Viewer"
57 >Viewer</a
58 > -&gt; <a href="ArtRay-Primitives.html#t:Point2D"
59 >Point2D</a
60 > -&gt; <a href="ArtRay-Primitives.html#t:Ray"
61 >Ray</a
62 ></li
63 ><li class="src short"
64 ><a href="#v:farpoint"
65 >farpoint</a
66 > :: <a href="ArtRay-Primitives.html#t:Ray"
67 >Ray</a
68 > -&gt; Vec3 -&gt; Double -&gt; Vec3</li
69 ><li class="src short"
70 ><a href="#v:deformRay"
71 >deformRay</a
72 > :: <a href="ArtRay-Primitives.html#t:Scene"
73 >Scene</a
74 > -&gt; <a href="ArtRay-Primitives.html#t:Ray"
75 >Ray</a
76 > -&gt; (Double, Double) -&gt; <a href="ArtRay-Primitives.html#t:Ray"
77 >Ray</a
78 ></li
79 ><li class="src short"
80 ><a href="#v:pointToRay"
81 >pointToRay</a
82 > :: <a href="ArtRay-Primitives.html#t:Scene"
83 >Scene</a
84 > -&gt; <a href="ArtRay-Primitives.html#t:Viewer"
85 >Viewer</a
86 > -&gt; <a href="ArtRay-Primitives.html#t:Point2D"
87 >Point2D</a
88 > -&gt; [<a href="ArtRay-Primitives.html#t:Ray"
89 >Ray</a
90 >]</li
91 ><li class="src short"
92 ><a href="#v:reflectAbout"
93 >reflectAbout</a
94 > :: Vec3 -&gt; Vec3 -&gt; Vec3</li
95 ><li class="src short"
96 ><a href="#v:refractVector"
97 >refractVector</a
98 > :: Double -&gt; Vec3 -&gt; Vec3 -&gt; Vec3</li
99 ><li class="src short"
100 ><a href="#v:normal"
101 >normal</a
102 > :: <a href="ArtRay-Primitives.html#t:Primitive"
103 >Primitive</a
104 > -&gt; Vec3 -&gt; Vec3</li
105 ></ul
106 ></div
107 ><div id="interface"
108 ><h1
109 >Documentation</h1
110 ><div class="top"
111 ><p class="src"
112 ><a name="v:quadSolve" class="def"
113 >quadSolve</a
114 > :: Double -&gt; Double -&gt; Double -&gt; (Double, Double)</p
115 ><div class="doc"
116 ><p
117 >Solve a quadratic. Returns NaN for non-real roots, and two equal values for
4118 double roots.
5 </p></div></div><div class="top"><p class="src"><a name="v:firstIntersection" class="def">firstIntersection</a> :: <a href="ArtRay-Primitives.html#t:Ray">Ray</a> -&gt; <a href="ArtRay-Primitives.html#t:Primitive">Primitive</a> -&gt; Maybe (Double, Vec3, <a href="ArtRay-Primitives.html#t:Primitive">Primitive</a>)</p><div class="doc"><p>Find the first intersection between a primitive and a ray. Returns Nothing
119 </p
120 ></div
121 ></div
122 ><div class="top"
123 ><p class="src"
124 ><a name="v:firstIntersection" class="def"
125 >firstIntersection</a
126 > :: <a href="ArtRay-Primitives.html#t:Ray"
127 >Ray</a
128 > -&gt; <a href="ArtRay-Primitives.html#t:Primitive"
129 >Primitive</a
130 > -&gt; Maybe (Double, Vec3, <a href="ArtRay-Primitives.html#t:Primitive"
131 >Primitive</a
132 >)</p
133 ><div class="doc"
134 ><p
135 >Find the first intersection between a primitive and a ray. Returns Nothing
6136 if the ray never intersects the primitive.
7 </p></div></div><div class="top"><p class="src"><a name="v:pointToRay-39-" class="def">pointToRay'</a> :: <a href="ArtRay-Primitives.html#t:Viewer">Viewer</a> -&gt; <a href="ArtRay-Primitives.html#t:Point2D">Point2D</a> -&gt; <a href="ArtRay-Primitives.html#t:Ray">Ray</a></p><div class="doc"><p>Find the ray for a point on the image plane
8 </p></div></div><div class="top"><p class="src"><a name="v:farpoint" class="def">farpoint</a> :: <a href="ArtRay-Primitives.html#t:Ray">Ray</a> -&gt; Vec3 -&gt; Double -&gt; Vec3</p><div class="doc"><p>Finds the point on a ray whose projection on a vector has a specific length.
9 </p></div></div><div class="top"><p class="src"><a name="v:deformRay" class="def">deformRay</a> :: <a href="ArtRay-Primitives.html#t:Scene">Scene</a> -&gt; <a href="ArtRay-Primitives.html#t:Ray">Ray</a> -&gt; (Double, Double) -&gt; <a href="ArtRay-Primitives.html#t:Ray">Ray</a></p><div class="doc"><p>Deform a ray by (i, j) in the image plane, maintaining the focal point of
137 </p
138 ></div
139 ></div
140 ><div class="top"
141 ><p class="src"
142 ><a name="v:pointToRay-39-" class="def"
143 >pointToRay'</a
144 > :: <a href="ArtRay-Primitives.html#t:Viewer"
145 >Viewer</a
146 > -&gt; <a href="ArtRay-Primitives.html#t:Point2D"
147 >Point2D</a
148 > -&gt; <a href="ArtRay-Primitives.html#t:Ray"
149 >Ray</a
150 ></p
151 ><div class="doc"
152 ><p
153 >Find the ray for a point on the image plane
154 </p
155 ></div
156 ></div
157 ><div class="top"
158 ><p class="src"
159 ><a name="v:farpoint" class="def"
160 >farpoint</a
161 > :: <a href="ArtRay-Primitives.html#t:Ray"
162 >Ray</a
163 > -&gt; Vec3 -&gt; Double -&gt; Vec3</p
164 ><div class="doc"
165 ><p
166 >Finds the point on a ray whose projection on a vector has a specific length.
167 </p
168 ></div
169 ></div
170 ><div class="top"
171 ><p class="src"
172 ><a name="v:deformRay" class="def"
173 >deformRay</a
174 > :: <a href="ArtRay-Primitives.html#t:Scene"
175 >Scene</a
176 > -&gt; <a href="ArtRay-Primitives.html#t:Ray"
177 >Ray</a
178 > -&gt; (Double, Double) -&gt; <a href="ArtRay-Primitives.html#t:Ray"
179 >Ray</a
180 ></p
181 ><div class="doc"
182 ><p
183 >Deform a ray by (i, j) in the image plane, maintaining the focal point of
10184 the ray.
11 </p></div></div><div class="top"><p class="src"><a name="v:pointToRay" class="def">pointToRay</a> :: <a href="ArtRay-Primitives.html#t:Scene">Scene</a> -&gt; <a href="ArtRay-Primitives.html#t:Viewer">Viewer</a> -&gt; <a href="ArtRay-Primitives.html#t:Point2D">Point2D</a> -&gt; [<a href="ArtRay-Primitives.html#t:Ray">Ray</a>]</p><div class="doc"><p>Find a family of rays that converge at the focal distance for a point in
185 </p
186 ></div
187 ></div
188 ><div class="top"
189 ><p class="src"
190 ><a name="v:pointToRay" class="def"
191 >pointToRay</a
192 > :: <a href="ArtRay-Primitives.html#t:Scene"
193 >Scene</a
194 > -&gt; <a href="ArtRay-Primitives.html#t:Viewer"
195 >Viewer</a
196 > -&gt; <a href="ArtRay-Primitives.html#t:Point2D"
197 >Point2D</a
198 > -&gt; [<a href="ArtRay-Primitives.html#t:Ray"
199 >Ray</a
200 >]</p
201 ><div class="doc"
202 ><p
203 >Find a family of rays that converge at the focal distance for a point in
12204 the image plane.
13 </p></div></div><div class="top"><p class="src"><a name="v:reflectAbout" class="def">reflectAbout</a> :: Vec3 -&gt; Vec3 -&gt; Vec3</p><div class="doc"><p>Reflect the first vector about the second
14 </p></div></div><div class="top"><p class="src"><a name="v:refractVector" class="def">refractVector</a> :: Double -&gt; Vec3 -&gt; Vec3 -&gt; Vec3</p><div class="doc"><p>Refract the second vector around the first with the provided refraction
205 </p
206 ></div
207 ></div
208 ><div class="top"
209 ><p class="src"
210 ><a name="v:reflectAbout" class="def"
211 >reflectAbout</a
212 > :: Vec3 -&gt; Vec3 -&gt; Vec3</p
213 ><div class="doc"
214 ><p
215 >Reflect the first vector about the second
216 </p
217 ></div
218 ></div
219 ><div class="top"
220 ><p class="src"
221 ><a name="v:refractVector" class="def"
222 >refractVector</a
223 > :: Double -&gt; Vec3 -&gt; Vec3 -&gt; Vec3</p
224 ><div class="doc"
225 ><p
226 >Refract the second vector around the first with the provided refraction
15227 index.
16 </p></div></div><div class="top"><p class="src"><a name="v:normal" class="def">normal</a> :: <a href="ArtRay-Primitives.html#t:Primitive">Primitive</a> -&gt; Vec3 -&gt; Vec3</p><div class="doc"><p>Find the normal vector at a point on a primitive. Note that this function
228 </p
229 ></div
230 ></div
231 ><div class="top"
232 ><p class="src"
233 ><a name="v:normal" class="def"
234 >normal</a
235 > :: <a href="ArtRay-Primitives.html#t:Primitive"
236 >Primitive</a
237 > -&gt; Vec3 -&gt; Vec3</p
238 ><div class="doc"
239 ><p
240 >Find the normal vector at a point on a primitive. Note that this function
17241 does not require that the point be actually incident to the primitive.
18 </p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.9.2</p></div></body></html>
242 </p
243 ></div
244 ></div
245 ></div
246 ></div
247 ><div id="footer"
248 ><p
249 >Produced by <a href="http://www.haskell.org/haddock/"
250 >Haddock</a
251 > version 2.9.2</p
252 ></div
253 ></body
254 ></html
255 >
0 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>ArtRay.Primitives</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
0 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
1 <html xmlns="http://www.w3.org/1999/xhtml"
2 ><head
3 ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
4 /><title
5 >ArtRay.Primitives</title
6 ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean"
7 /><script src="haddock-util.js" type="text/javascript"
8 ></script
9 ><script type="text/javascript"
10 >//<![CDATA[
111 window.onload = function () {pageLoad();setSynopsis("mini_ArtRay-Primitives.html");};
212 //]]>
3 </script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">ArtRay: A Haskell Raytracer</p></div><div id="content"><div id="module-header"><p class="caption">ArtRay.Primitives</p></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">data</span> <a href="#t:Scene">Scene</a> = <a href="#v:Scene">Scene</a> {<ul class="subs"><li><a href="#v:background">background</a> :: <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></li><li><a href="#v:options">options</a> :: [<a href="ArtRay-Primitives.html#t:Option">Option</a>]</li><li><a href="#v:geom">geom</a> :: [<a href="ArtRay-Primitives.html#t:Primitive">Primitive</a>]</li><li><a href="#v:lights">lights</a> :: [<a href="ArtRay-Primitives.html#t:Light">Light</a>]</li><li><a href="#v:viewer">viewer</a> :: <a href="ArtRay-Primitives.html#t:Viewer">Viewer</a></li></ul>}</li><li class="src short"><span class="keyword">data</span> <a href="#t:Option">Option</a> <ul class="subs"><li>= <a href="#v:GlobalAmbient">GlobalAmbient</a> <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a> </li><li>| <a href="#v:Antialiased">Antialiased</a> { <ul class="subs"><li><a href="#v:msaaSamples">msaaSamples</a> :: Double</li></ul> }</li><li>| <a href="#v:DepthOfField">DepthOfField</a> { <ul class="subs"><li><a href="#v:focalLength">focalLength</a> :: Double</li><li><a href="#v:aperture">aperture</a> :: Double</li><li><a href="#v:dofSamples">dofSamples</a> :: Int</li></ul> }</li></ul></li><li class="src short"><span class="keyword">data</span> <a href="#t:Primitive">Primitive</a> <ul class="subs"><li>= <a href="#v:Sphere">Sphere</a> { <ul class="subs"><li><a href="#v:center">center</a> :: Vec3</li><li><a href="#v:radius">radius</a> :: Double</li><li><a href="#v:material">material</a> :: <a href="ArtRay-Primitives.html#t:Material">Material</a></li></ul> }</li><li>| <a href="#v:Plane">Plane</a> { <ul class="subs"><li><a href="#v:pnorm">pnorm</a> :: Vec3</li><li><a href="#v:point">point</a> :: Vec3</li><li><a href="#v:material">material</a> :: <a href="ArtRay-Primitives.html#t:Material">Material</a></li></ul> }</li></ul></li><li class="src short"><span class="keyword">data</span> <a href="#t:Ray">Ray</a> = <a href="#v:Ray">Ray</a> {<ul class="subs"><li><a href="#v:direction">direction</a> :: Vec3</li><li><a href="#v:position">position</a> :: Vec3</li></ul>}</li><li class="src short"><span class="keyword">type</span> <a href="#t:ColorTriple">ColorTriple</a> = (Double, Double, Double)</li><li class="src short"><span class="keyword">data</span> <a href="#t:Light">Light</a> = <a href="#v:PhongLight">PhongLight</a> {<ul class="subs"><li><a href="#v:speclight">speclight</a> :: <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></li><li><a href="#v:difflight">difflight</a> :: <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></li><li><a href="#v:loclight">loclight</a> :: Vec3</li></ul>}</li><li class="src short"><span class="keyword">data</span> <a href="#t:CombinationModel">CombinationModel</a> <ul class="subs"><li>= <a href="#v:WeightSum">WeightSum</a> { <ul class="subs"><li><a href="#v:weight">weight</a> :: Double</li></ul> }</li><li>| <a href="#v:FlatSum">FlatSum</a> </li><li>| <a href="#v:Multiply">Multiply</a> </li></ul></li><li class="src short"><span class="keyword">data</span> <a href="#t:Material">Material</a> <ul class="subs"><li>= <a href="#v:ColorMaterial">ColorMaterial</a> { <ul class="subs"><li><a href="#v:basecolor">basecolor</a> :: <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></li></ul> }</li><li>| <a href="#v:ReflectiveMaterial">ReflectiveMaterial</a> { <ul class="subs"><li><a href="#v:base">base</a> :: <a href="ArtRay-Primitives.html#t:Material">Material</a></li><li><a href="#v:reflectivity">reflectivity</a> :: Double</li></ul> }</li><li>| <a href="#v:PhongMaterial">PhongMaterial</a> { <ul class="subs"><li><a href="#v:specular">specular</a> :: <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></li><li><a href="#v:diffuse">diffuse</a> :: <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></li><li><a href="#v:ambient">ambient</a> :: <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></li><li><a href="#v:phongexp">phongexp</a> :: Int</li></ul> }</li><li>| <a href="#v:TransparentMaterial">TransparentMaterial</a> { <ul class="subs"><li><a href="#v:base">base</a> :: <a href="ArtRay-Primitives.html#t:Material">Material</a></li><li><a href="#v:cmodel">cmodel</a> :: <a href="ArtRay-Primitives.html#t:CombinationModel">CombinationModel</a></li><li><a href="#v:refindex">refindex</a> :: Double</li></ul> }</li><li>| <a href="#v:NullMaterial">NullMaterial</a> </li></ul></li><li class="src short"><span class="keyword">data</span> <a href="#t:Viewer">Viewer</a> = <a href="#v:Viewer">Viewer</a> {<ul class="subs"><li><a href="#v:location">location</a> :: Vec3</li><li><a href="#v:u">u</a> :: Vec3</li><li><a href="#v:v">v</a> :: Vec3</li><li><a href="#v:f">f</a> :: Vec3</li></ul>}</li><li class="src short"><span class="keyword">data</span> <a href="#t:Point2D">Point2D</a> <ul class="subs"><li>= <a href="#v:Point2D">Point2D</a> Double Double </li><li>| <a href="#v:RelPoint2D">RelPoint2D</a> Double Double </li></ul></li><li class="src short"><a href="#v:transmittance">transmittance</a> :: <a href="ArtRay-Primitives.html#t:Material">Material</a> -&gt; Double</li><li class="src short"><a href="#v:glambient">glambient</a> :: <a href="ArtRay-Primitives.html#t:Scene">Scene</a> -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></li><li class="src short"><a href="#v:subpixels">subpixels</a> :: <a href="ArtRay-Primitives.html#t:Scene">Scene</a> -&gt; Maybe Double</li><li class="src short"><a href="#v:dofinfo">dofinfo</a> :: <a href="ArtRay-Primitives.html#t:Scene">Scene</a> -&gt; Maybe <a href="ArtRay-Primitives.html#t:Option">Option</a></li><li class="src short"><a href="#v:dofenabled">dofenabled</a> :: <a href="ArtRay-Primitives.html#t:Scene">Scene</a> -&gt; Bool</li><li class="src short"><a href="#v:dofsamples">dofsamples</a> :: <a href="ArtRay-Primitives.html#t:Scene">Scene</a> -&gt; Int</li><li class="src short"><a href="#v:dofdepth">dofdepth</a> :: <a href="ArtRay-Primitives.html#t:Scene">Scene</a> -&gt; Double</li><li class="src short"><a href="#v:dofaperture">dofaperture</a> :: <a href="ArtRay-Primitives.html#t:Scene">Scene</a> -&gt; Double</li><li class="src short"><a href="#v:p2d">p2d</a> :: Int -&gt; Int -&gt; <a href="ArtRay-Primitives.html#t:Point2D">Point2D</a></li><li class="src short"><a href="#v:color">color</a> :: Double -&gt; Double -&gt; Double -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></li><li class="src short"><a href="#v:colorm">colorm</a> :: Double -&gt; Double -&gt; Double -&gt; <a href="ArtRay-Primitives.html#t:Material">Material</a></li><li class="src short"><a href="#v:toRelPoint">toRelPoint</a> :: Size -&gt; <a href="ArtRay-Primitives.html#t:Point2D">Point2D</a> -&gt; <a href="ArtRay-Primitives.html#t:Point2D">Point2D</a></li><li class="src short"><a href="#v:view">view</a> :: Vec3 -&gt; Double -&gt; Vec3 -&gt; Vec3 -&gt; <a href="ArtRay-Primitives.html#t:Viewer">Viewer</a></li><li class="src short"><a href="#v:colorFrom">colorFrom</a> :: <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a> -&gt; Color</li><li class="src short"><a href="#v:combine">combine</a> :: <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a> -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a> -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></li><li class="src short"><a href="#v:scale">scale</a> :: <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a> -&gt; Double -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></li><li class="src short"><a href="#v:weightedCombine">weightedCombine</a> :: Double -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a> -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a> -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></li><li class="src short"><a href="#v:sumLight">sumLight</a> :: [<a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a>] -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></li><li class="src short"><a href="#v:sumColor">sumColor</a> :: <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a> -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a> -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></li><li class="src short"><a href="#v:sumColor-39-">sumColor'</a> :: <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a> -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a> -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></li><li class="src short"><a href="#v:meanColor">meanColor</a> :: [<a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a>] -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Scene" class="def">Scene</a> </p><div class="doc"><p>The root object of any rendered scene in ArtRay
4 </p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:Scene" class="def">Scene</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:background" class="def">background</a> :: <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></dt><dd class="doc"><p>The background color of the scene -- displayed whenever a ray doesn't
13 </script
14 ></head
15 ><body
16 ><div id="package-header"
17 ><ul class="links" id="page-menu"
18 ><li
19 ><a href="index.html"
20 >Contents</a
21 ></li
22 ><li
23 ><a href="doc-index.html"
24 >Index</a
25 ></li
26 ></ul
27 ><p class="caption"
28 >ArtRay: A Haskell Ray Tracer</p
29 ></div
30 ><div id="content"
31 ><div id="module-header"
32 ><p class="caption"
33 >ArtRay.Primitives</p
34 ></div
35 ><div id="synopsis"
36 ><p id="control.syn" class="caption expander" onclick="toggleSection('syn')"
37 >Synopsis</p
38 ><ul id="section.syn" class="hide" onclick="toggleSection('syn')"
39 ><li class="src short"
40 ><span class="keyword"
41 >data</span
42 > <a href="#t:Scene"
43 >Scene</a
44 > = <a href="#v:Scene"
45 >Scene</a
46 > {<ul class="subs"
47 ><li
48 ><a href="#v:background"
49 >background</a
50 > :: <a href="ArtRay-Primitives.html#t:ColorTriple"
51 >ColorTriple</a
52 ></li
53 ><li
54 ><a href="#v:options"
55 >options</a
56 > :: [<a href="ArtRay-Primitives.html#t:Option"
57 >Option</a
58 >]</li
59 ><li
60 ><a href="#v:geom"
61 >geom</a
62 > :: [<a href="ArtRay-Primitives.html#t:Primitive"
63 >Primitive</a
64 >]</li
65 ><li
66 ><a href="#v:lights"
67 >lights</a
68 > :: [<a href="ArtRay-Primitives.html#t:Light"
69 >Light</a
70 >]</li
71 ><li
72 ><a href="#v:viewer"
73 >viewer</a
74 > :: <a href="ArtRay-Primitives.html#t:Viewer"
75 >Viewer</a
76 ></li
77 ></ul
78 >}</li
79 ><li class="src short"
80 ><span class="keyword"
81 >data</span
82 > <a href="#t:Option"
83 >Option</a
84 > <ul class="subs"
85 ><li
86 >= <a href="#v:GlobalAmbient"
87 >GlobalAmbient</a
88 > <a href="ArtRay-Primitives.html#t:ColorTriple"
89 >ColorTriple</a
90 > </li
91 ><li
92 >| <a href="#v:Antialiased"
93 >Antialiased</a
94 > { <ul class="subs"
95 ><li
96 ><a href="#v:msaaSamples"
97 >msaaSamples</a
98 > :: Double</li
99 ></ul
100 > }</li
101 ><li
102 >| <a href="#v:DepthOfField"
103 >DepthOfField</a
104 > { <ul class="subs"
105 ><li
106 ><a href="#v:focalLength"
107 >focalLength</a
108 > :: Double</li
109 ><li
110 ><a href="#v:aperture"
111 >aperture</a
112 > :: Double</li
113 ><li
114 ><a href="#v:dofSamples"
115 >dofSamples</a
116 > :: Int</li
117 ></ul
118 > }</li
119 ></ul
120 ></li
121 ><li class="src short"
122 ><span class="keyword"
123 >data</span
124 > <a href="#t:Primitive"
125 >Primitive</a
126 > <ul class="subs"
127 ><li
128 >= <a href="#v:Sphere"
129 >Sphere</a
130 > { <ul class="subs"
131 ><li
132 ><a href="#v:center"
133 >center</a
134 > :: Vec3</li
135 ><li
136 ><a href="#v:radius"
137 >radius</a
138 > :: Double</li
139 ><li
140 ><a href="#v:material"
141 >material</a
142 > :: <a href="ArtRay-Primitives.html#t:Material"
143 >Material</a
144 ></li
145 ></ul
146 > }</li
147 ><li
148 >| <a href="#v:Plane"
149 >Plane</a
150 > { <ul class="subs"
151 ><li
152 ><a href="#v:pnorm"
153 >pnorm</a
154 > :: Vec3</li
155 ><li
156 ><a href="#v:point"
157 >point</a
158 > :: Vec3</li
159 ><li
160 ><a href="#v:material"
161 >material</a
162 > :: <a href="ArtRay-Primitives.html#t:Material"
163 >Material</a
164 ></li
165 ></ul
166 > }</li
167 ></ul
168 ></li
169 ><li class="src short"
170 ><span class="keyword"
171 >data</span
172 > <a href="#t:Ray"
173 >Ray</a
174 > = <a href="#v:Ray"
175 >Ray</a
176 > {<ul class="subs"
177 ><li
178 ><a href="#v:direction"
179 >direction</a
180 > :: Vec3</li
181 ><li
182 ><a href="#v:position"
183 >position</a
184 > :: Vec3</li
185 ></ul
186 >}</li
187 ><li class="src short"
188 ><span class="keyword"
189 >type</span
190 > <a href="#t:ColorTriple"
191 >ColorTriple</a
192 > = (Double, Double, Double)</li
193 ><li class="src short"
194 ><span class="keyword"
195 >data</span
196 > <a href="#t:Light"
197 >Light</a
198 > = <a href="#v:PhongLight"
199 >PhongLight</a
200 > {<ul class="subs"
201 ><li
202 ><a href="#v:speclight"
203 >speclight</a
204 > :: <a href="ArtRay-Primitives.html#t:ColorTriple"
205 >ColorTriple</a
206 ></li
207 ><li
208 ><a href="#v:difflight"
209 >difflight</a
210 > :: <a href="ArtRay-Primitives.html#t:ColorTriple"
211 >ColorTriple</a
212 ></li
213 ><li
214 ><a href="#v:loclight"
215 >loclight</a
216 > :: Vec3</li
217 ></ul
218 >}</li
219 ><li class="src short"
220 ><span class="keyword"
221 >data</span
222 > <a href="#t:CombinationModel"
223 >CombinationModel</a
224 > <ul class="subs"
225 ><li
226 >= <a href="#v:WeightSum"
227 >WeightSum</a
228 > { <ul class="subs"
229 ><li
230 ><a href="#v:weight"
231 >weight</a
232 > :: Double</li
233 ></ul
234 > }</li
235 ><li
236 >| <a href="#v:FlatSum"
237 >FlatSum</a
238 > </li
239 ><li
240 >| <a href="#v:Multiply"
241 >Multiply</a
242 > </li
243 ></ul
244 ></li
245 ><li class="src short"
246 ><span class="keyword"
247 >data</span
248 > <a href="#t:Material"
249 >Material</a
250 > <ul class="subs"
251 ><li
252 >= <a href="#v:ColorMaterial"
253 >ColorMaterial</a
254 > { <ul class="subs"
255 ><li
256 ><a href="#v:basecolor"
257 >basecolor</a
258 > :: <a href="ArtRay-Primitives.html#t:ColorTriple"
259 >ColorTriple</a
260 ></li
261 ></ul
262 > }</li
263 ><li
264 >| <a href="#v:ReflectiveMaterial"
265 >ReflectiveMaterial</a
266 > { <ul class="subs"
267 ><li
268 ><a href="#v:base"
269 >base</a
270 > :: <a href="ArtRay-Primitives.html#t:Material"
271 >Material</a
272 ></li
273 ><li
274 ><a href="#v:reflectivity"
275 >reflectivity</a
276 > :: Double</li
277 ></ul
278 > }</li
279 ><li
280 >| <a href="#v:PhongMaterial"
281 >PhongMaterial</a
282 > { <ul class="subs"
283 ><li
284 ><a href="#v:specular"
285 >specular</a
286 > :: <a href="ArtRay-Primitives.html#t:ColorTriple"
287 >ColorTriple</a
288 ></li
289 ><li
290 ><a href="#v:diffuse"
291 >diffuse</a
292 > :: <a href="ArtRay-Primitives.html#t:ColorTriple"
293 >ColorTriple</a
294 ></li
295 ><li
296 ><a href="#v:ambient"
297 >ambient</a
298 > :: <a href="ArtRay-Primitives.html#t:ColorTriple"
299 >ColorTriple</a
300 ></li
301 ><li
302 ><a href="#v:phongexp"
303 >phongexp</a
304 > :: Int</li
305 ></ul
306 > }</li
307 ><li
308 >| <a href="#v:TransparentMaterial"
309 >TransparentMaterial</a
310 > { <ul class="subs"
311 ><li
312 ><a href="#v:base"
313 >base</a
314 > :: <a href="ArtRay-Primitives.html#t:Material"
315 >Material</a
316 ></li
317 ><li
318 ><a href="#v:cmodel"
319 >cmodel</a
320 > :: <a href="ArtRay-Primitives.html#t:CombinationModel"
321 >CombinationModel</a
322 ></li
323 ><li
324 ><a href="#v:refindex"
325 >refindex</a
326 > :: Double</li
327 ></ul
328 > }</li
329 ><li
330 >| <a href="#v:NullMaterial"
331 >NullMaterial</a
332 > </li
333 ></ul
334 ></li
335 ><li class="src short"
336 ><span class="keyword"
337 >data</span
338 > <a href="#t:Viewer"
339 >Viewer</a
340 > = <a href="#v:Viewer"
341 >Viewer</a
342 > {<ul class="subs"
343 ><li
344 ><a href="#v:location"
345 >location</a
346 > :: Vec3</li
347 ><li
348 ><a href="#v:u"
349 >u</a
350 > :: Vec3</li
351 ><li
352 ><a href="#v:v"
353 >v</a
354 > :: Vec3</li
355 ><li
356 ><a href="#v:f"
357 >f</a
358 > :: Vec3</li
359 ></ul
360 >}</li
361 ><li class="src short"
362 ><span class="keyword"
363 >data</span
364 > <a href="#t:Point2D"
365 >Point2D</a
366 > <ul class="subs"
367 ><li
368 >= <a href="#v:Point2D"
369 >Point2D</a
370 > Double Double </li
371 ><li
372 >| <a href="#v:RelPoint2D"
373 >RelPoint2D</a
374 > Double Double </li
375 ></ul
376 ></li
377 ><li class="src short"
378 ><a href="#v:transmittance"
379 >transmittance</a
380 > :: <a href="ArtRay-Primitives.html#t:Material"
381 >Material</a
382 > -&gt; Double</li
383 ><li class="src short"
384 ><a href="#v:glambient"
385 >glambient</a
386 > :: <a href="ArtRay-Primitives.html#t:Scene"
387 >Scene</a
388 > -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
389 >ColorTriple</a
390 ></li
391 ><li class="src short"
392 ><a href="#v:subpixels"
393 >subpixels</a
394 > :: <a href="ArtRay-Primitives.html#t:Scene"
395 >Scene</a
396 > -&gt; Maybe Double</li
397 ><li class="src short"
398 ><a href="#v:dofinfo"
399 >dofinfo</a
400 > :: <a href="ArtRay-Primitives.html#t:Scene"
401 >Scene</a
402 > -&gt; Maybe <a href="ArtRay-Primitives.html#t:Option"
403 >Option</a
404 ></li
405 ><li class="src short"
406 ><a href="#v:dofenabled"
407 >dofenabled</a
408 > :: <a href="ArtRay-Primitives.html#t:Scene"
409 >Scene</a
410 > -&gt; Bool</li
411 ><li class="src short"
412 ><a href="#v:dofsamples"
413 >dofsamples</a
414 > :: <a href="ArtRay-Primitives.html#t:Scene"
415 >Scene</a
416 > -&gt; Int</li
417 ><li class="src short"
418 ><a href="#v:dofdepth"
419 >dofdepth</a
420 > :: <a href="ArtRay-Primitives.html#t:Scene"
421 >Scene</a
422 > -&gt; Double</li
423 ><li class="src short"
424 ><a href="#v:dofaperture"
425 >dofaperture</a
426 > :: <a href="ArtRay-Primitives.html#t:Scene"
427 >Scene</a
428 > -&gt; Double</li
429 ><li class="src short"
430 ><a href="#v:p2d"
431 >p2d</a
432 > :: Int -&gt; Int -&gt; <a href="ArtRay-Primitives.html#t:Point2D"
433 >Point2D</a
434 ></li
435 ><li class="src short"
436 ><a href="#v:color"
437 >color</a
438 > :: Double -&gt; Double -&gt; Double -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
439 >ColorTriple</a
440 ></li
441 ><li class="src short"
442 ><a href="#v:colorm"
443 >colorm</a
444 > :: Double -&gt; Double -&gt; Double -&gt; <a href="ArtRay-Primitives.html#t:Material"
445 >Material</a
446 ></li
447 ><li class="src short"
448 ><a href="#v:toRelPoint"
449 >toRelPoint</a
450 > :: Size -&gt; <a href="ArtRay-Primitives.html#t:Point2D"
451 >Point2D</a
452 > -&gt; <a href="ArtRay-Primitives.html#t:Point2D"
453 >Point2D</a
454 ></li
455 ><li class="src short"
456 ><a href="#v:view"
457 >view</a
458 > :: Vec3 -&gt; Double -&gt; Vec3 -&gt; Vec3 -&gt; <a href="ArtRay-Primitives.html#t:Viewer"
459 >Viewer</a
460 ></li
461 ><li class="src short"
462 ><a href="#v:colorFrom"
463 >colorFrom</a
464 > :: <a href="ArtRay-Primitives.html#t:ColorTriple"
465 >ColorTriple</a
466 > -&gt; Color</li
467 ><li class="src short"
468 ><a href="#v:combine"
469 >combine</a
470 > :: <a href="ArtRay-Primitives.html#t:ColorTriple"
471 >ColorTriple</a
472 > -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
473 >ColorTriple</a
474 > -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
475 >ColorTriple</a
476 ></li
477 ><li class="src short"
478 ><a href="#v:scale"
479 >scale</a
480 > :: <a href="ArtRay-Primitives.html#t:ColorTriple"
481 >ColorTriple</a
482 > -&gt; Double -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
483 >ColorTriple</a
484 ></li
485 ><li class="src short"
486 ><a href="#v:weightedCombine"
487 >weightedCombine</a
488 > :: Double -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
489 >ColorTriple</a
490 > -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
491 >ColorTriple</a
492 > -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
493 >ColorTriple</a
494 ></li
495 ><li class="src short"
496 ><a href="#v:sumLight"
497 >sumLight</a
498 > :: [<a href="ArtRay-Primitives.html#t:ColorTriple"
499 >ColorTriple</a
500 >] -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
501 >ColorTriple</a
502 ></li
503 ><li class="src short"
504 ><a href="#v:sumColor"
505 >sumColor</a
506 > :: <a href="ArtRay-Primitives.html#t:ColorTriple"
507 >ColorTriple</a
508 > -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
509 >ColorTriple</a
510 > -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
511 >ColorTriple</a
512 ></li
513 ><li class="src short"
514 ><a href="#v:sumColor-39-"
515 >sumColor'</a
516 > :: <a href="ArtRay-Primitives.html#t:ColorTriple"
517 >ColorTriple</a
518 > -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
519 >ColorTriple</a
520 > -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
521 >ColorTriple</a
522 ></li
523 ><li class="src short"
524 ><a href="#v:meanColor"
525 >meanColor</a
526 > :: [<a href="ArtRay-Primitives.html#t:ColorTriple"
527 >ColorTriple</a
528 >] -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
529 >ColorTriple</a
530 ></li
531 ></ul
532 ></div
533 ><div id="interface"
534 ><h1
535 >Documentation</h1
536 ><div class="top"
537 ><p class="src"
538 ><span class="keyword"
539 >data</span
540 > <a name="t:Scene" class="def"
541 >Scene</a
542 > </p
543 ><div class="doc"
544 ><p
545 >The root object of any rendered scene in ArtRay
546 </p
547 ></div
548 ><div class="subs constructors"
549 ><p class="caption"
550 >Constructors</p
551 ><table
552 ><tr
553 ><td class="src"
554 ><a name="v:Scene" class="def"
555 >Scene</a
556 ></td
557 ><td class="doc empty"
558 >&nbsp;</td
559 ></tr
560 ><tr
561 ><td colspan="2"
562 ><div class="subs fields"
563 ><p class="caption"
564 >Fields</p
565 ><dl
566 ><dt class="src"
567 ><a name="v:background" class="def"
568 >background</a
569 > :: <a href="ArtRay-Primitives.html#t:ColorTriple"
570 >ColorTriple</a
571 ></dt
572 ><dd class="doc"
573 ><p
574 >The background color of the scene -- displayed whenever a ray doesn't
5575 intersect any geometry.
6 </p></dd><dt class="src"><a name="v:options" class="def">options</a> :: [<a href="ArtRay-Primitives.html#t:Option">Option</a>]</dt><dd class="doc"><p>A list of rendering options
7 </p></dd><dt class="src"><a name="v:geom" class="def">geom</a> :: [<a href="ArtRay-Primitives.html#t:Primitive">Primitive</a>]</dt><dd class="doc"><p>The geometry of the scene
8 </p></dd><dt class="src"><a name="v:lights" class="def">lights</a> :: [<a href="ArtRay-Primitives.html#t:Light">Light</a>]</dt><dd class="doc"><p>The lights in the scene
9 </p></dd><dt class="src"><a name="v:viewer" class="def">viewer</a> :: <a href="ArtRay-Primitives.html#t:Viewer">Viewer</a></dt><dd class="doc"><p>Camera information
10 </p></dd></dl><div class="clear"></div></div></td></tr></table></div><div class="subs instances"><p id="control.i:Scene" class="caption collapser" onclick="toggleSection('i:Scene')">Instances</p><div id="section.i:Scene" class="show"><table><tr><td class="src">Read <a href="ArtRay-Primitives.html#t:Scene">Scene</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">Show <a href="ArtRay-Primitives.html#t:Scene">Scene</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Option" class="def">Option</a> </p><div class="doc"><p>Rendering-related options for scenes
11 </p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:GlobalAmbient" class="def">GlobalAmbient</a> <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></td><td class="doc"><p>The global ambient light. If provided, this will illuminate all
576 </p
577 ></dd
578 ><dt class="src"
579 ><a name="v:options" class="def"
580 >options</a
581 > :: [<a href="ArtRay-Primitives.html#t:Option"
582 >Option</a
583 >]</dt
584 ><dd class="doc"
585 ><p
586 >A list of rendering options
587 </p
588 ></dd
589 ><dt class="src"
590 ><a name="v:geom" class="def"
591 >geom</a
592 > :: [<a href="ArtRay-Primitives.html#t:Primitive"
593 >Primitive</a
594 >]</dt
595 ><dd class="doc"
596 ><p
597 >The geometry of the scene
598 </p
599 ></dd
600 ><dt class="src"
601 ><a name="v:lights" class="def"
602 >lights</a
603 > :: [<a href="ArtRay-Primitives.html#t:Light"
604 >Light</a
605 >]</dt
606 ><dd class="doc"
607 ><p
608 >The lights in the scene
609 </p
610 ></dd
611 ><dt class="src"
612 ><a name="v:viewer" class="def"
613 >viewer</a
614 > :: <a href="ArtRay-Primitives.html#t:Viewer"
615 >Viewer</a
616 ></dt
617 ><dd class="doc"
618 ><p
619 >Camera information
620 </p
621 ></dd
622 ></dl
623 ><div class="clear"
624 ></div
625 ></div
626 ></td
627 ></tr
628 ></table
629 ></div
630 ><div class="subs instances"
631 ><p id="control.i:Scene" class="caption collapser" onclick="toggleSection('i:Scene')"
632 >Instances</p
633 ><div id="section.i:Scene" class="show"
634 ><table
635 ><tr
636 ><td class="src"
637 >Read <a href="ArtRay-Primitives.html#t:Scene"
638 >Scene</a
639 ></td
640 ><td class="doc empty"
641 >&nbsp;</td
642 ></tr
643 ><tr
644 ><td class="src"
645 >Show <a href="ArtRay-Primitives.html#t:Scene"
646 >Scene</a
647 ></td
648 ><td class="doc empty"
649 >&nbsp;</td
650 ></tr
651 ></table
652 ></div
653 ></div
654 ></div
655 ><div class="top"
656 ><p class="src"
657 ><span class="keyword"
658 >data</span
659 > <a name="t:Option" class="def"
660 >Option</a
661 > </p
662 ><div class="doc"
663 ><p
664 >Rendering-related options for scenes
665 </p
666 ></div
667 ><div class="subs constructors"
668 ><p class="caption"
669 >Constructors</p
670 ><table
671 ><tr
672 ><td class="src"
673 ><a name="v:GlobalAmbient" class="def"
674 >GlobalAmbient</a
675 > <a href="ArtRay-Primitives.html#t:ColorTriple"
676 >ColorTriple</a
677 ></td
678 ><td class="doc"
679 ><p
680 >The global ambient light. If provided, this will illuminate all
12681 primitives with nonzero ambient material response at all points.
13 </p></td></tr><tr><td class="src"><a name="v:Antialiased" class="def">Antialiased</a></td><td class="doc"><p>Antialiasing options. When the Antialiased option is provided with
682 </p
683 ></td
684 ></tr
685 ><tr
686 ><td class="src"
687 ><a name="v:Antialiased" class="def"
688 >Antialiased</a
689 ></td
690 ><td class="doc"
691 ><p
692 >Antialiasing options. When the Antialiased option is provided with
14693 msaaSamples &gt; 1, ArtRay will use MSAA subpixel sampling to antialias the
15694 image. Note that multiplying msaaSamples by n increases runtime by O(n^2).
16 </p></td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:msaaSamples" class="def">msaaSamples</a> :: Double</dt><dd class="doc empty">&nbsp;</dd></dl><div class="clear"></div></div></td></tr><tr><td class="src"><a name="v:DepthOfField" class="def">DepthOfField</a></td><td class="doc"><p>Depth of field options. If this option is not provided, the camera has
695 </p
696 ></td
697 ></tr
698 ><tr
699 ><td colspan="2"
700 ><div class="subs fields"
701 ><p class="caption"
702 >Fields</p
703 ><dl
704 ><dt class="src"
705 ><a name="v:msaaSamples" class="def"
706 >msaaSamples</a
707 > :: Double</dt
708 ><dd class="doc empty"
709 >&nbsp;</dd
710 ></dl
711 ><div class="clear"
712 ></div
713 ></div
714 ></td
715 ></tr
716 ><tr
717 ><td class="src"
718 ><a name="v:DepthOfField" class="def"
719 >DepthOfField</a
720 ></td
721 ><td class="doc"
722 ><p
723 >Depth of field options. If this option is not provided, the camera has
17724 infinite depth of field. When this option is provided, the camera simulates
18725 a real camera with focal length and aperture. Aperture is a number, usually
19726 on the order of 1, which controls how tight the depth of field is -- higher
22729 parameter is the square root of the number of rays shot out to determine
23730 the color at each pixel. For simple scenes, this can be as low as 2. The
24731 run time scales as O(samples^2).
25 </p></td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:focalLength" class="def">focalLength</a> :: Double</dt><dd class="doc empty">&nbsp;</dd><dt class="src"><a name="v:aperture" class="def">aperture</a> :: Double</dt><dd class="doc empty">&nbsp;</dd><dt class="src"><a name="v:dofSamples" class="def">dofSamples</a> :: Int</dt><dd class="doc empty">&nbsp;</dd></dl><div class="clear"></div></div></td></tr></table></div><div class="subs instances"><p id="control.i:Option" class="caption collapser" onclick="toggleSection('i:Option')">Instances</p><div id="section.i:Option" class="show"><table><tr><td class="src">Read <a href="ArtRay-Primitives.html#t:Option">Option</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">Show <a href="ArtRay-Primitives.html#t:Option">Option</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Primitive" class="def">Primitive</a> </p><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:Sphere" class="def">Sphere</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:center" class="def">center</a> :: Vec3</dt><dd class="doc empty">&nbsp;</dd><dt class="src"><a name="v:radius" class="def">radius</a> :: Double</dt><dd class="doc empty">&nbsp;</dd><dt class="src"><a name="v:material" class="def">material</a> :: <a href="ArtRay-Primitives.html#t:Material">Material</a></dt><dd class="doc empty">&nbsp;</dd></dl><div class="clear"></div></div></td></tr><tr><td class="src"><a name="v:Plane" class="def">Plane</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:pnorm" class="def">pnorm</a> :: Vec3</dt><dd class="doc empty">&nbsp;</dd><dt class="src"><a name="v:point" class="def">point</a> :: Vec3</dt><dd class="doc empty">&nbsp;</dd><dt class="src"><a name="v:material" class="def">material</a> :: <a href="ArtRay-Primitives.html#t:Material">Material</a></dt><dd class="doc empty">&nbsp;</dd></dl><div class="clear"></div></div></td></tr></table></div><div class="subs instances"><p id="control.i:Primitive" class="caption collapser" onclick="toggleSection('i:Primitive')">Instances</p><div id="section.i:Primitive" class="show"><table><tr><td class="src">Eq <a href="ArtRay-Primitives.html#t:Primitive">Primitive</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">Read <a href="ArtRay-Primitives.html#t:Primitive">Primitive</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">Show <a href="ArtRay-Primitives.html#t:Primitive">Primitive</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Ray" class="def">Ray</a> </p><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:Ray" class="def">Ray</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:direction" class="def">direction</a> :: Vec3</dt><dd class="doc empty">&nbsp;</dd><dt class="src"><a name="v:position" class="def">position</a> :: Vec3</dt><dd class="doc empty">&nbsp;</dd></dl><div class="clear"></div></div></td></tr></table></div><div class="subs instances"><p id="control.i:Ray" class="caption collapser" onclick="toggleSection('i:Ray')">Instances</p><div id="section.i:Ray" class="show"><table><tr><td class="src">Show <a href="ArtRay-Primitives.html#t:Ray">Ray</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:ColorTriple" class="def">ColorTriple</a> = (Double, Double, Double)</p></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Light" class="def">Light</a> </p><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:PhongLight" class="def">PhongLight</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:speclight" class="def">speclight</a> :: <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></dt><dd class="doc empty">&nbsp;</dd><dt class="src"><a name="v:difflight" class="def">difflight</a> :: <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></dt><dd class="doc empty">&nbsp;</dd><dt class="src"><a name="v:loclight" class="def">loclight</a> :: Vec3</dt><dd class="doc empty">&nbsp;</dd></dl><div class="clear"></div></div></td></tr></table></div><div class="subs instances"><p id="control.i:Light" class="caption collapser" onclick="toggleSection('i:Light')">Instances</p><div id="section.i:Light" class="show"><table><tr><td class="src">Read <a href="ArtRay-Primitives.html#t:Light">Light</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">Show <a href="ArtRay-Primitives.html#t:Light">Light</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:CombinationModel" class="def">CombinationModel</a> </p><div class="doc"><p>Combination models determine how materials on an object are combined.
26 </p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:WeightSum" class="def">WeightSum</a></td><td class="doc"><p>Sum the two colors after multiplying the primary by weight and the
732 </p
733 ></td
734 ></tr
735 ><tr
736 ><td colspan="2"
737 ><div class="subs fields"
738 ><p class="caption"
739 >Fields</p
740 ><dl
741 ><dt class="src"
742 ><a name="v:focalLength" class="def"
743 >focalLength</a
744 > :: Double</dt
745 ><dd class="doc empty"
746 >&nbsp;</dd
747 ><dt class="src"
748 ><a name="v:aperture" class="def"
749 >aperture</a
750 > :: Double</dt
751 ><dd class="doc empty"
752 >&nbsp;</dd
753 ><dt class="src"
754 ><a name="v:dofSamples" class="def"
755 >dofSamples</a
756 > :: Int</dt
757 ><dd class="doc empty"
758 >&nbsp;</dd
759 ></dl
760 ><div class="clear"
761 ></div
762 ></div
763 ></td
764 ></tr
765 ></table
766 ></div
767 ><div class="subs instances"
768 ><p id="control.i:Option" class="caption collapser" onclick="toggleSection('i:Option')"
769 >Instances</p
770 ><div id="section.i:Option" class="show"
771 ><table
772 ><tr
773 ><td class="src"
774 >Read <a href="ArtRay-Primitives.html#t:Option"
775 >Option</a
776 ></td
777 ><td class="doc empty"
778 >&nbsp;</td
779 ></tr
780 ><tr
781 ><td class="src"
782 >Show <a href="ArtRay-Primitives.html#t:Option"
783 >Option</a
784 ></td
785 ><td class="doc empty"
786 >&nbsp;</td
787 ></tr
788 ></table
789 ></div
790 ></div
791 ></div
792 ><div class="top"
793 ><p class="src"
794 ><span class="keyword"
795 >data</span
796 > <a name="t:Primitive" class="def"
797 >Primitive</a
798 > </p
799 ><div class="subs constructors"
800 ><p class="caption"
801 >Constructors</p
802 ><table
803 ><tr
804 ><td class="src"
805 ><a name="v:Sphere" class="def"
806 >Sphere</a
807 ></td
808 ><td class="doc empty"
809 >&nbsp;</td
810 ></tr
811 ><tr
812 ><td colspan="2"
813 ><div class="subs fields"
814 ><p class="caption"
815 >Fields</p
816 ><dl
817 ><dt class="src"
818 ><a name="v:center" class="def"
819 >center</a
820 > :: Vec3</dt
821 ><dd class="doc empty"
822 >&nbsp;</dd
823 ><dt class="src"
824 ><a name="v:radius" class="def"
825 >radius</a
826 > :: Double</dt
827 ><dd class="doc empty"
828 >&nbsp;</dd
829 ><dt class="src"
830 ><a name="v:material" class="def"
831 >material</a
832 > :: <a href="ArtRay-Primitives.html#t:Material"
833 >Material</a
834 ></dt
835 ><dd class="doc empty"
836 >&nbsp;</dd
837 ></dl
838 ><div class="clear"
839 ></div
840 ></div
841 ></td
842 ></tr
843 ><tr
844 ><td class="src"
845 ><a name="v:Plane" class="def"
846 >Plane</a
847 ></td
848 ><td class="doc empty"
849 >&nbsp;</td
850 ></tr
851 ><tr
852 ><td colspan="2"
853 ><div class="subs fields"
854 ><p class="caption"
855 >Fields</p
856 ><dl
857 ><dt class="src"
858 ><a name="v:pnorm" class="def"
859 >pnorm</a
860 > :: Vec3</dt
861 ><dd class="doc empty"
862 >&nbsp;</dd
863 ><dt class="src"
864 ><a name="v:point" class="def"
865 >point</a
866 > :: Vec3</dt
867 ><dd class="doc empty"
868 >&nbsp;</dd
869 ><dt class="src"
870 ><a name="v:material" class="def"
871 >material</a
872 > :: <a href="ArtRay-Primitives.html#t:Material"
873 >Material</a
874 ></dt
875 ><dd class="doc empty"
876 >&nbsp;</dd
877 ></dl
878 ><div class="clear"
879 ></div
880 ></div
881 ></td
882 ></tr
883 ></table
884 ></div
885 ><div class="subs instances"
886 ><p id="control.i:Primitive" class="caption collapser" onclick="toggleSection('i:Primitive')"
887 >Instances</p
888 ><div id="section.i:Primitive" class="show"
889 ><table
890 ><tr
891 ><td class="src"
892 >Eq <a href="ArtRay-Primitives.html#t:Primitive"
893 >Primitive</a
894 ></td
895 ><td class="doc empty"
896 >&nbsp;</td
897 ></tr
898 ><tr
899 ><td class="src"
900 >Read <a href="ArtRay-Primitives.html#t:Primitive"
901 >Primitive</a
902 ></td
903 ><td class="doc empty"
904 >&nbsp;</td
905 ></tr
906 ><tr
907 ><td class="src"
908 >Show <a href="ArtRay-Primitives.html#t:Primitive"
909 >Primitive</a
910 ></td
911 ><td class="doc empty"
912 >&nbsp;</td
913 ></tr
914 ></table
915 ></div
916 ></div
917 ></div
918 ><div class="top"
919 ><p class="src"
920 ><span class="keyword"
921 >data</span
922 > <a name="t:Ray" class="def"
923 >Ray</a
924 > </p
925 ><div class="subs constructors"
926 ><p class="caption"
927 >Constructors</p
928 ><table
929 ><tr
930 ><td class="src"
931 ><a name="v:Ray" class="def"
932 >Ray</a
933 ></td
934 ><td class="doc empty"
935 >&nbsp;</td
936 ></tr
937 ><tr
938 ><td colspan="2"
939 ><div class="subs fields"
940 ><p class="caption"
941 >Fields</p
942 ><dl
943 ><dt class="src"
944 ><a name="v:direction" class="def"
945 >direction</a
946 > :: Vec3</dt
947 ><dd class="doc empty"
948 >&nbsp;</dd
949 ><dt class="src"
950 ><a name="v:position" class="def"
951 >position</a
952 > :: Vec3</dt
953 ><dd class="doc empty"
954 >&nbsp;</dd
955 ></dl
956 ><div class="clear"
957 ></div
958 ></div
959 ></td
960 ></tr
961 ></table
962 ></div
963 ><div class="subs instances"
964 ><p id="control.i:Ray" class="caption collapser" onclick="toggleSection('i:Ray')"
965 >Instances</p
966 ><div id="section.i:Ray" class="show"
967 ><table
968 ><tr
969 ><td class="src"
970 >Show <a href="ArtRay-Primitives.html#t:Ray"
971 >Ray</a
972 ></td
973 ><td class="doc empty"
974 >&nbsp;</td
975 ></tr
976 ></table
977 ></div
978 ></div
979 ></div
980 ><div class="top"
981 ><p class="src"
982 ><span class="keyword"
983 >type</span
984 > <a name="t:ColorTriple" class="def"
985 >ColorTriple</a
986 > = (Double, Double, Double)</p
987 ></div
988 ><div class="top"
989 ><p class="src"
990 ><span class="keyword"
991 >data</span
992 > <a name="t:Light" class="def"
993 >Light</a
994 > </p
995 ><div class="subs constructors"
996 ><p class="caption"
997 >Constructors</p
998 ><table
999 ><tr
1000 ><td class="src"
1001 ><a name="v:PhongLight" class="def"
1002 >PhongLight</a
1003 ></td
1004 ><td class="doc empty"
1005 >&nbsp;</td
1006 ></tr
1007 ><tr
1008 ><td colspan="2"
1009 ><div class="subs fields"
1010 ><p class="caption"
1011 >Fields</p
1012 ><dl
1013 ><dt class="src"
1014 ><a name="v:speclight" class="def"
1015 >speclight</a
1016 > :: <a href="ArtRay-Primitives.html#t:ColorTriple"
1017 >ColorTriple</a
1018 ></dt
1019 ><dd class="doc empty"
1020 >&nbsp;</dd
1021 ><dt class="src"
1022 ><a name="v:difflight" class="def"
1023 >difflight</a
1024 > :: <a href="ArtRay-Primitives.html#t:ColorTriple"
1025 >ColorTriple</a
1026 ></dt
1027 ><dd class="doc empty"
1028 >&nbsp;</dd
1029 ><dt class="src"
1030 ><a name="v:loclight" class="def"
1031 >loclight</a
1032 > :: Vec3</dt
1033 ><dd class="doc empty"
1034 >&nbsp;</dd
1035 ></dl
1036 ><div class="clear"
1037 ></div
1038 ></div
1039 ></td
1040 ></tr
1041 ></table
1042 ></div
1043 ><div class="subs instances"
1044 ><p id="control.i:Light" class="caption collapser" onclick="toggleSection('i:Light')"
1045 >Instances</p
1046 ><div id="section.i:Light" class="show"
1047 ><table
1048 ><tr
1049 ><td class="src"
1050 >Read <a href="ArtRay-Primitives.html#t:Light"
1051 >Light</a
1052 ></td
1053 ><td class="doc empty"
1054 >&nbsp;</td
1055 ></tr
1056 ><tr
1057 ><td class="src"
1058 >Show <a href="ArtRay-Primitives.html#t:Light"
1059 >Light</a
1060 ></td
1061 ><td class="doc empty"
1062 >&nbsp;</td
1063 ></tr
1064 ></table
1065 ></div
1066 ></div
1067 ></div
1068 ><div class="top"
1069 ><p class="src"
1070 ><span class="keyword"
1071 >data</span
1072 > <a name="t:CombinationModel" class="def"
1073 >CombinationModel</a
1074 > </p
1075 ><div class="doc"
1076 ><p
1077 >Combination models determine how materials on an object are combined.
1078 </p
1079 ></div
1080 ><div class="subs constructors"
1081 ><p class="caption"
1082 >Constructors</p
1083 ><table
1084 ><tr
1085 ><td class="src"
1086 ><a name="v:WeightSum" class="def"
1087 >WeightSum</a
1088 ></td
1089 ><td class="doc"
1090 ><p
1091 >Sum the two colors after multiplying the primary by weight and the
271092 secondary by (1-weight). The weighting term should be in [0,1].
28 </p></td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:weight" class="def">weight</a> :: Double</dt><dd class="doc empty">&nbsp;</dd></dl><div class="clear"></div></div></td></tr><tr><td class="src"><a name="v:FlatSum" class="def">FlatSum</a></td><td class="doc"><p>Sum the colors, truncating if any component goes over the maximum.
29 </p></td></tr><tr><td class="src"><a name="v:Multiply" class="def">Multiply</a></td><td class="doc"><p>Take the product of the two colors. This creates weird effects which you
1093 </p
1094 ></td
1095 ></tr
1096 ><tr
1097 ><td colspan="2"
1098 ><div class="subs fields"
1099 ><p class="caption"
1100 >Fields</p
1101 ><dl
1102 ><dt class="src"
1103 ><a name="v:weight" class="def"
1104 >weight</a
1105 > :: Double</dt
1106 ><dd class="doc empty"
1107 >&nbsp;</dd
1108 ></dl
1109 ><div class="clear"
1110 ></div
1111 ></div
1112 ></td
1113 ></tr
1114 ><tr
1115 ><td class="src"
1116 ><a name="v:FlatSum" class="def"
1117 >FlatSum</a
1118 ></td
1119 ><td class="doc"
1120 ><p
1121 >Sum the colors, truncating if any component goes over the maximum.
1122 </p
1123 ></td
1124 ></tr
1125 ><tr
1126 ><td class="src"
1127 ><a name="v:Multiply" class="def"
1128 >Multiply</a
1129 ></td
1130 ><td class="doc"
1131 ><p
1132 >Take the product of the two colors. This creates weird effects which you
301133 almost certainly do not want, but it's interesting to look at.
31 </p></td></tr></table></div><div class="subs instances"><p id="control.i:CombinationModel" class="caption collapser" onclick="toggleSection('i:CombinationModel')">Instances</p><div id="section.i:CombinationModel" class="show"><table><tr><td class="src">Eq <a href="ArtRay-Primitives.html#t:CombinationModel">CombinationModel</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">Read <a href="ArtRay-Primitives.html#t:CombinationModel">CombinationModel</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">Show <a href="ArtRay-Primitives.html#t:CombinationModel">CombinationModel</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Material" class="def">Material</a> </p><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:ColorMaterial" class="def">ColorMaterial</a></td><td class="doc"><p>A material where every point on the material has the same color.
32 </p></td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:basecolor" class="def">basecolor</a> :: <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></dt><dd class="doc empty">&nbsp;</dd></dl><div class="clear"></div></div></td></tr><tr><td class="src"><a name="v:ReflectiveMaterial" class="def">ReflectiveMaterial</a></td><td class="doc"><p>A material which reflects rays. Optionally, the material can have a base
1134 </p
1135 ></td
1136 ></tr
1137 ></table
1138 ></div
1139 ><div class="subs instances"
1140 ><p id="control.i:CombinationModel" class="caption collapser" onclick="toggleSection('i:CombinationModel')"
1141 >Instances</p
1142 ><div id="section.i:CombinationModel" class="show"
1143 ><table
1144 ><tr
1145 ><td class="src"
1146 >Eq <a href="ArtRay-Primitives.html#t:CombinationModel"
1147 >CombinationModel</a
1148 ></td
1149 ><td class="doc empty"
1150 >&nbsp;</td
1151 ></tr
1152 ><tr
1153 ><td class="src"
1154 >Read <a href="ArtRay-Primitives.html#t:CombinationModel"
1155 >CombinationModel</a
1156 ></td
1157 ><td class="doc empty"
1158 >&nbsp;</td
1159 ></tr
1160 ><tr
1161 ><td class="src"
1162 >Show <a href="ArtRay-Primitives.html#t:CombinationModel"
1163 >CombinationModel</a
1164 ></td
1165 ><td class="doc empty"
1166 >&nbsp;</td
1167 ></tr
1168 ></table
1169 ></div
1170 ></div
1171 ></div
1172 ><div class="top"
1173 ><p class="src"
1174 ><span class="keyword"
1175 >data</span
1176 > <a name="t:Material" class="def"
1177 >Material</a
1178 > </p
1179 ><div class="subs constructors"
1180 ><p class="caption"
1181 >Constructors</p
1182 ><table
1183 ><tr
1184 ><td class="src"
1185 ><a name="v:ColorMaterial" class="def"
1186 >ColorMaterial</a
1187 ></td
1188 ><td class="doc"
1189 ><p
1190 >A material where every point on the material has the same color.
1191 </p
1192 ></td
1193 ></tr
1194 ><tr
1195 ><td colspan="2"
1196 ><div class="subs fields"
1197 ><p class="caption"
1198 >Fields</p
1199 ><dl
1200 ><dt class="src"
1201 ><a name="v:basecolor" class="def"
1202 >basecolor</a
1203 > :: <a href="ArtRay-Primitives.html#t:ColorTriple"
1204 >ColorTriple</a
1205 ></dt
1206 ><dd class="doc empty"
1207 >&nbsp;</dd
1208 ></dl
1209 ><div class="clear"
1210 ></div
1211 ></div
1212 ></td
1213 ></tr
1214 ><tr
1215 ><td class="src"
1216 ><a name="v:ReflectiveMaterial" class="def"
1217 >ReflectiveMaterial</a
1218 ></td
1219 ><td class="doc"
1220 ><p
1221 >A material which reflects rays. Optionally, the material can have a base
331222 material, whose color is blended with the reflections using the
341223 reflectivity parameter.
351224 TODO: Use a combination model here.
36 </p></td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:base" class="def">base</a> :: <a href="ArtRay-Primitives.html#t:Material">Material</a></dt><dd class="doc empty">&nbsp;</dd><dt class="src"><a name="v:reflectivity" class="def">reflectivity</a> :: Double</dt><dd class="doc empty">&nbsp;</dd></dl><div class="clear"></div></div></td></tr><tr><td class="src"><a name="v:PhongMaterial" class="def">PhongMaterial</a></td><td class="doc"><p>A Phong-reflectance based material.
37 </p></td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:specular" class="def">specular</a> :: <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></dt><dd class="doc empty">&nbsp;</dd><dt class="src"><a name="v:diffuse" class="def">diffuse</a> :: <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></dt><dd class="doc empty">&nbsp;</dd><dt class="src"><a name="v:ambient" class="def">ambient</a> :: <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></dt><dd class="doc empty">&nbsp;</dd><dt class="src"><a name="v:phongexp" class="def">phongexp</a> :: Int</dt><dd class="doc empty">&nbsp;</dd></dl><div class="clear"></div></div></td></tr><tr><td class="src"><a name="v:TransparentMaterial" class="def">TransparentMaterial</a></td><td class="doc"><p>A transparent material with a refractive index. This can be blended with
1225 </p
1226 ></td
1227 ></tr
1228 ><tr
1229 ><td colspan="2"
1230 ><div class="subs fields"
1231 ><p class="caption"
1232 >Fields</p
1233 ><dl
1234 ><dt class="src"
1235 ><a name="v:base" class="def"
1236 >base</a
1237 > :: <a href="ArtRay-Primitives.html#t:Material"
1238 >Material</a
1239 ></dt
1240 ><dd class="doc empty"
1241 >&nbsp;</dd
1242 ><dt class="src"
1243 ><a name="v:reflectivity" class="def"
1244 >reflectivity</a
1245 > :: Double</dt
1246 ><dd class="doc empty"
1247 >&nbsp;</dd
1248 ></dl
1249 ><div class="clear"
1250 ></div
1251 ></div
1252 ></td
1253 ></tr
1254 ><tr
1255 ><td class="src"
1256 ><a name="v:PhongMaterial" class="def"
1257 >PhongMaterial</a
1258 ></td
1259 ><td class="doc"
1260 ><p
1261 >A Phong-reflectance based material.
1262 </p
1263 ></td
1264 ></tr
1265 ><tr
1266 ><td colspan="2"
1267 ><div class="subs fields"
1268 ><p class="caption"
1269 >Fields</p
1270 ><dl
1271 ><dt class="src"
1272 ><a name="v:specular" class="def"
1273 >specular</a
1274 > :: <a href="ArtRay-Primitives.html#t:ColorTriple"
1275 >ColorTriple</a
1276 ></dt
1277 ><dd class="doc empty"
1278 >&nbsp;</dd
1279 ><dt class="src"
1280 ><a name="v:diffuse" class="def"
1281 >diffuse</a
1282 > :: <a href="ArtRay-Primitives.html#t:ColorTriple"
1283 >ColorTriple</a
1284 ></dt
1285 ><dd class="doc empty"
1286 >&nbsp;</dd
1287 ><dt class="src"
1288 ><a name="v:ambient" class="def"
1289 >ambient</a
1290 > :: <a href="ArtRay-Primitives.html#t:ColorTriple"
1291 >ColorTriple</a
1292 ></dt
1293 ><dd class="doc empty"
1294 >&nbsp;</dd
1295 ><dt class="src"
1296 ><a name="v:phongexp" class="def"
1297 >phongexp</a
1298 > :: Int</dt
1299 ><dd class="doc empty"
1300 >&nbsp;</dd
1301 ></dl
1302 ><div class="clear"
1303 ></div
1304 ></div
1305 ></td
1306 ></tr
1307 ><tr
1308 ><td class="src"
1309 ><a name="v:TransparentMaterial" class="def"
1310 >TransparentMaterial</a
1311 ></td
1312 ><td class="doc"
1313 ><p
1314 >A transparent material with a refractive index. This can be blended with
381315 a base material using the provided combination model.
39 </p></td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:base" class="def">base</a> :: <a href="ArtRay-Primitives.html#t:Material">Material</a></dt><dd class="doc empty">&nbsp;</dd><dt class="src"><a name="v:cmodel" class="def">cmodel</a> :: <a href="ArtRay-Primitives.html#t:CombinationModel">CombinationModel</a></dt><dd class="doc empty">&nbsp;</dd><dt class="src"><a name="v:refindex" class="def">refindex</a> :: Double</dt><dd class="doc empty">&nbsp;</dd></dl><div class="clear"></div></div></td></tr><tr><td class="src"><a name="v:NullMaterial" class="def">NullMaterial</a></td><td class="doc"><p>A material that doesn't exist. This can be convenient for a placeholder
1316 </p
1317 ></td
1318 ></tr
1319 ><tr
1320 ><td colspan="2"
1321 ><div class="subs fields"
1322 ><p class="caption"
1323 >Fields</p
1324 ><dl
1325 ><dt class="src"
1326 ><a name="v:base" class="def"
1327 >base</a
1328 > :: <a href="ArtRay-Primitives.html#t:Material"
1329 >Material</a
1330 ></dt
1331 ><dd class="doc empty"
1332 >&nbsp;</dd
1333 ><dt class="src"
1334 ><a name="v:cmodel" class="def"
1335 >cmodel</a
1336 > :: <a href="ArtRay-Primitives.html#t:CombinationModel"
1337 >CombinationModel</a
1338 ></dt
1339 ><dd class="doc empty"
1340 >&nbsp;</dd
1341 ><dt class="src"
1342 ><a name="v:refindex" class="def"
1343 >refindex</a
1344 > :: Double</dt
1345 ><dd class="doc empty"
1346 >&nbsp;</dd
1347 ></dl
1348 ><div class="clear"
1349 ></div
1350 ></div
1351 ></td
1352 ></tr
1353 ><tr
1354 ><td class="src"
1355 ><a name="v:NullMaterial" class="def"
1356 >NullMaterial</a
1357 ></td
1358 ><td class="doc"
1359 ><p
1360 >A material that doesn't exist. This can be convenient for a placeholder
401361 when you don't want to provide an actual material (like as the base
411362 material of a TransparentMaterial that is fully transparent).
42 </p></td></tr></table></div><div class="subs instances"><p id="control.i:Material" class="caption collapser" onclick="toggleSection('i:Material')">Instances</p><div id="section.i:Material" class="show"><table><tr><td class="src">Eq <a href="ArtRay-Primitives.html#t:Material">Material</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">Read <a href="ArtRay-Primitives.html#t:Material">Material</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">Show <a href="ArtRay-Primitives.html#t:Material">Material</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Viewer" class="def">Viewer</a> </p><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:Viewer" class="def">Viewer</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:location" class="def">location</a> :: Vec3</dt><dd class="doc"><p>The location of the viewer
43 </p></dd><dt class="src"><a name="v:u" class="def">u</a> :: Vec3</dt><dd class="doc"><p>A vector pointing horizontally along the image plane
44 </p></dd><dt class="src"><a name="v:v" class="def">v</a> :: Vec3</dt><dd class="doc"><p>A vector pointing vertically along the image plane
45 </p></dd><dt class="src"><a name="v:f" class="def">f</a> :: Vec3</dt><dd class="doc"><p>A vector pointing from the viewer to the center of the image plane
46 </p></dd></dl><div class="clear"></div></div></td></tr></table></div><div class="subs instances"><p id="control.i:Viewer" class="caption collapser" onclick="toggleSection('i:Viewer')">Instances</p><div id="section.i:Viewer" class="show"><table><tr><td class="src">Read <a href="ArtRay-Primitives.html#t:Viewer">Viewer</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">Show <a href="ArtRay-Primitives.html#t:Viewer">Viewer</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Point2D" class="def">Point2D</a> </p><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:Point2D" class="def">Point2D</a> Double Double</td><td class="doc"><p>Describes a point in the image using pixel coordinates, allowing for
1363 </p
1364 ></td
1365 ></tr
1366 ></table
1367 ></div
1368 ><div class="subs instances"
1369 ><p id="control.i:Material" class="caption collapser" onclick="toggleSection('i:Material')"
1370 >Instances</p
1371 ><div id="section.i:Material" class="show"
1372 ><table
1373 ><tr
1374 ><td class="src"
1375 >Eq <a href="ArtRay-Primitives.html#t:Material"
1376 >Material</a
1377 ></td
1378 ><td class="doc empty"
1379 >&nbsp;</td
1380 ></tr
1381 ><tr
1382 ><td class="src"
1383 >Read <a href="ArtRay-Primitives.html#t:Material"
1384 >Material</a
1385 ></td
1386 ><td class="doc empty"
1387 >&nbsp;</td
1388 ></tr
1389 ><tr
1390 ><td class="src"
1391 >Show <a href="ArtRay-Primitives.html#t:Material"
1392 >Material</a
1393 ></td
1394 ><td class="doc empty"
1395 >&nbsp;</td
1396 ></tr
1397 ></table
1398 ></div
1399 ></div
1400 ></div
1401 ><div class="top"
1402 ><p class="src"
1403 ><span class="keyword"
1404 >data</span
1405 > <a name="t:Viewer" class="def"
1406 >Viewer</a
1407 > </p
1408 ><div class="subs constructors"
1409 ><p class="caption"
1410 >Constructors</p
1411 ><table
1412 ><tr
1413 ><td class="src"
1414 ><a name="v:Viewer" class="def"
1415 >Viewer</a
1416 ></td
1417 ><td class="doc empty"
1418 >&nbsp;</td
1419 ></tr
1420 ><tr
1421 ><td colspan="2"
1422 ><div class="subs fields"
1423 ><p class="caption"
1424 >Fields</p
1425 ><dl
1426 ><dt class="src"
1427 ><a name="v:location" class="def"
1428 >location</a
1429 > :: Vec3</dt
1430 ><dd class="doc"
1431 ><p
1432 >The location of the viewer
1433 </p
1434 ></dd
1435 ><dt class="src"
1436 ><a name="v:u" class="def"
1437 >u</a
1438 > :: Vec3</dt
1439 ><dd class="doc"
1440 ><p
1441 >A vector pointing horizontally along the image plane
1442 </p
1443 ></dd
1444 ><dt class="src"
1445 ><a name="v:v" class="def"
1446 >v</a
1447 > :: Vec3</dt
1448 ><dd class="doc"
1449 ><p
1450 >A vector pointing vertically along the image plane
1451 </p
1452 ></dd
1453 ><dt class="src"
1454 ><a name="v:f" class="def"
1455 >f</a
1456 > :: Vec3</dt
1457 ><dd class="doc"
1458 ><p
1459 >A vector pointing from the viewer to the center of the image plane
1460 </p
1461 ></dd
1462 ></dl
1463 ><div class="clear"
1464 ></div
1465 ></div
1466 ></td
1467 ></tr
1468 ></table
1469 ></div
1470 ><div class="subs instances"
1471 ><p id="control.i:Viewer" class="caption collapser" onclick="toggleSection('i:Viewer')"
1472 >Instances</p
1473 ><div id="section.i:Viewer" class="show"
1474 ><table
1475 ><tr
1476 ><td class="src"
1477 >Read <a href="ArtRay-Primitives.html#t:Viewer"
1478 >Viewer</a
1479 ></td
1480 ><td class="doc empty"
1481 >&nbsp;</td
1482 ></tr
1483 ><tr
1484 ><td class="src"
1485 >Show <a href="ArtRay-Primitives.html#t:Viewer"
1486 >Viewer</a
1487 ></td
1488 ><td class="doc empty"
1489 >&nbsp;</td
1490 ></tr
1491 ></table
1492 ></div
1493 ></div
1494 ></div
1495 ><div class="top"
1496 ><p class="src"
1497 ><span class="keyword"
1498 >data</span
1499 > <a name="t:Point2D" class="def"
1500 >Point2D</a
1501 > </p
1502 ><div class="subs constructors"
1503 ><p class="caption"
1504 >Constructors</p
1505 ><table
1506 ><tr
1507 ><td class="src"
1508 ><a name="v:Point2D" class="def"
1509 >Point2D</a
1510 > Double Double</td
1511 ><td class="doc"
1512 ><p
1513 >Describes a point in the image using pixel coordinates, allowing for
471514 fractional pixels for subpixel sampling.
48 </p></td></tr><tr><td class="src"><a name="v:RelPoint2D" class="def">RelPoint2D</a> Double Double</td><td class="doc"><p>Describes a point in the image using offsets from the center, where each
1515 </p
1516 ></td
1517 ></tr
1518 ><tr
1519 ><td class="src"
1520 ><a name="v:RelPoint2D" class="def"
1521 >RelPoint2D</a
1522 > Double Double</td
1523 ><td class="doc"
1524 ><p
1525 >Describes a point in the image using offsets from the center, where each
491526 field goes from zero to one.
50 </p></td></tr></table></div><div class="subs instances"><p id="control.i:Point2D" class="caption collapser" onclick="toggleSection('i:Point2D')">Instances</p><div id="section.i:Point2D" class="show"><table><tr><td class="src">Show <a href="ArtRay-Primitives.html#t:Point2D">Point2D</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:transmittance" class="def">transmittance</a> :: <a href="ArtRay-Primitives.html#t:Material">Material</a> -&gt; Double</p><div class="doc"><p>Returns the transmittance (1 minus the opacity) of any material.
51 </p></div></div><div class="top"><p class="src"><a name="v:glambient" class="def">glambient</a> :: <a href="ArtRay-Primitives.html#t:Scene">Scene</a> -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></p><div class="doc"><p>Returns the global ambient of the scene
52 </p></div></div><div class="top"><p class="src"><a name="v:subpixels" class="def">subpixels</a> :: <a href="ArtRay-Primitives.html#t:Scene">Scene</a> -&gt; Maybe Double</p><div class="doc"><p>Returns the number of subpixels used for MSAA, or Nothing if no
1527 </p
1528 ></td
1529 ></tr
1530 ></table
1531 ></div
1532 ><div class="subs instances"
1533 ><p id="control.i:Point2D" class="caption collapser" onclick="toggleSection('i:Point2D')"
1534 >Instances</p
1535 ><div id="section.i:Point2D" class="show"
1536 ><table
1537 ><tr
1538 ><td class="src"
1539 >Show <a href="ArtRay-Primitives.html#t:Point2D"
1540 >Point2D</a
1541 ></td
1542 ><td class="doc empty"
1543 >&nbsp;</td
1544 ></tr
1545 ></table
1546 ></div
1547 ></div
1548 ></div
1549 ><div class="top"
1550 ><p class="src"
1551 ><a name="v:transmittance" class="def"
1552 >transmittance</a
1553 > :: <a href="ArtRay-Primitives.html#t:Material"
1554 >Material</a
1555 > -&gt; Double</p
1556 ><div class="doc"
1557 ><p
1558 >Returns the transmittance (1 minus the opacity) of any material.
1559 </p
1560 ></div
1561 ></div
1562 ><div class="top"
1563 ><p class="src"
1564 ><a name="v:glambient" class="def"
1565 >glambient</a
1566 > :: <a href="ArtRay-Primitives.html#t:Scene"
1567 >Scene</a
1568 > -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
1569 >ColorTriple</a
1570 ></p
1571 ><div class="doc"
1572 ><p
1573 >Returns the global ambient of the scene
1574 </p
1575 ></div
1576 ></div
1577 ><div class="top"
1578 ><p class="src"
1579 ><a name="v:subpixels" class="def"
1580 >subpixels</a
1581 > :: <a href="ArtRay-Primitives.html#t:Scene"
1582 >Scene</a
1583 > -&gt; Maybe Double</p
1584 ><div class="doc"
1585 ><p
1586 >Returns the number of subpixels used for MSAA, or Nothing if no
531587 antialiasing is to be performed.
54 </p></div></div><div class="top"><p class="src"><a name="v:dofinfo" class="def">dofinfo</a> :: <a href="ArtRay-Primitives.html#t:Scene">Scene</a> -&gt; Maybe <a href="ArtRay-Primitives.html#t:Option">Option</a></p><div class="doc"><p>Returns the DepthOfField option, or nothing if no depth of field is to be
1588 </p
1589 ></div
1590 ></div
1591 ><div class="top"
1592 ><p class="src"
1593 ><a name="v:dofinfo" class="def"
1594 >dofinfo</a
1595 > :: <a href="ArtRay-Primitives.html#t:Scene"
1596 >Scene</a
1597 > -&gt; Maybe <a href="ArtRay-Primitives.html#t:Option"
1598 >Option</a
1599 ></p
1600 ><div class="doc"
1601 ><p
1602 >Returns the DepthOfField option, or nothing if no depth of field is to be
551603 used.
56 </p></div></div><div class="top"><p class="src"><a name="v:dofenabled" class="def">dofenabled</a> :: <a href="ArtRay-Primitives.html#t:Scene">Scene</a> -&gt; Bool</p><div class="doc"><p>Returns True if depth of field is to be simulated, and false otherwise.
57 </p></div></div><div class="top"><p class="src"><a name="v:dofsamples" class="def">dofsamples</a> :: <a href="ArtRay-Primitives.html#t:Scene">Scene</a> -&gt; Int</p><div class="doc"><p>Returns the number of samples to use for calculating depth of field. This
1604 </p
1605 ></div
1606 ></div
1607 ><div class="top"
1608 ><p class="src"
1609 ><a name="v:dofenabled" class="def"
1610 >dofenabled</a
1611 > :: <a href="ArtRay-Primitives.html#t:Scene"
1612 >Scene</a
1613 > -&gt; Bool</p
1614 ><div class="doc"
1615 ><p
1616 >Returns True if depth of field is to be simulated, and false otherwise.
1617 </p
1618 ></div
1619 ></div
1620 ><div class="top"
1621 ><p class="src"
1622 ><a name="v:dofsamples" class="def"
1623 >dofsamples</a
1624 > :: <a href="ArtRay-Primitives.html#t:Scene"
1625 >Scene</a
1626 > -&gt; Int</p
1627 ><div class="doc"
1628 ><p
1629 >Returns the number of samples to use for calculating depth of field. This
581630 will throw an exception if depth of field is not enabled for the provided
591631 scene.
60 </p></div></div><div class="top"><p class="src"><a name="v:dofdepth" class="def">dofdepth</a> :: <a href="ArtRay-Primitives.html#t:Scene">Scene</a> -&gt; Double</p><div class="doc"><p>Returns the focal length of the camera. This will throw an exception if
1632 </p
1633 ></div
1634 ></div
1635 ><div class="top"
1636 ><p class="src"
1637 ><a name="v:dofdepth" class="def"
1638 >dofdepth</a
1639 > :: <a href="ArtRay-Primitives.html#t:Scene"
1640 >Scene</a
1641 > -&gt; Double</p
1642 ><div class="doc"
1643 ><p
1644 >Returns the focal length of the camera. This will throw an exception if
611645 depth of field is not enabled for the provided scene.
62 </p></div></div><div class="top"><p class="src"><a name="v:dofaperture" class="def">dofaperture</a> :: <a href="ArtRay-Primitives.html#t:Scene">Scene</a> -&gt; Double</p><div class="doc"><p>Returns the aperture size of the camera. This will throw an exception if
1646 </p
1647 ></div
1648 ></div
1649 ><div class="top"
1650 ><p class="src"
1651 ><a name="v:dofaperture" class="def"
1652 >dofaperture</a
1653 > :: <a href="ArtRay-Primitives.html#t:Scene"
1654 >Scene</a
1655 > -&gt; Double</p
1656 ><div class="doc"
1657 ><p
1658 >Returns the aperture size of the camera. This will throw an exception if
631659 depth of field is not enabled for the provided scene.
64 </p></div></div><div class="top"><p class="src"><a name="v:p2d" class="def">p2d</a> :: Int -&gt; Int -&gt; <a href="ArtRay-Primitives.html#t:Point2D">Point2D</a></p><div class="doc"><p>Convenience method for turning a pair of integers into a Point2D.
65 </p></div></div><div class="top"><p class="src"><a name="v:color" class="def">color</a> :: Double -&gt; Double -&gt; Double -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></p><div class="doc"><p>Convenience method for creating colors
66 </p></div></div><div class="top"><p class="src"><a name="v:colorm" class="def">colorm</a> :: Double -&gt; Double -&gt; Double -&gt; <a href="ArtRay-Primitives.html#t:Material">Material</a></p><div class="doc"><p>Convenience method for creating ColorMaterials.
67 </p></div></div><div class="top"><p class="src"><a name="v:toRelPoint" class="def">toRelPoint</a> :: Size -&gt; <a href="ArtRay-Primitives.html#t:Point2D">Point2D</a> -&gt; <a href="ArtRay-Primitives.html#t:Point2D">Point2D</a></p><div class="doc"><p>Converts pixel locations into relative locations in [-1,1], where -1
1660 </p
1661 ></div
1662 ></div
1663 ><div class="top"
1664 ><p class="src"
1665 ><a name="v:p2d" class="def"
1666 >p2d</a
1667 > :: Int -&gt; Int -&gt; <a href="ArtRay-Primitives.html#t:Point2D"
1668 >Point2D</a
1669 ></p
1670 ><div class="doc"
1671 ><p
1672 >Convenience method for turning a pair of integers into a Point2D.
1673 </p
1674 ></div
1675 ></div
1676 ><div class="top"
1677 ><p class="src"
1678 ><a name="v:color" class="def"
1679 >color</a
1680 > :: Double -&gt; Double -&gt; Double -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
1681 >ColorTriple</a
1682 ></p
1683 ><div class="doc"
1684 ><p
1685 >Convenience method for creating colors
1686 </p
1687 ></div
1688 ></div
1689 ><div class="top"
1690 ><p class="src"
1691 ><a name="v:colorm" class="def"
1692 >colorm</a
1693 > :: Double -&gt; Double -&gt; Double -&gt; <a href="ArtRay-Primitives.html#t:Material"
1694 >Material</a
1695 ></p
1696 ><div class="doc"
1697 ><p
1698 >Convenience method for creating ColorMaterials.
1699 </p
1700 ></div
1701 ></div
1702 ><div class="top"
1703 ><p class="src"
1704 ><a name="v:toRelPoint" class="def"
1705 >toRelPoint</a
1706 > :: Size -&gt; <a href="ArtRay-Primitives.html#t:Point2D"
1707 >Point2D</a
1708 > -&gt; <a href="ArtRay-Primitives.html#t:Point2D"
1709 >Point2D</a
1710 ></p
1711 ><div class="doc"
1712 ><p
1713 >Converts pixel locations into relative locations in [-1,1], where -1
681714 corresponds to the left or bottom edge, and 1 corresponds to the right or top
691715 edge.
70 </p></div></div><div class="top"><p class="src"><a name="v:view" class="def">view</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: Vec3</td><td class="doc"><p>The location of the viewer
71 </p></td></tr><tr><td class="src">-&gt; Double</td><td class="doc"><p>The field of view of the viewer, in radians
72 </p></td></tr><tr><td class="src">-&gt; Vec3</td><td class="doc"><p>The vector from viewer to center of image plane
73 </p></td></tr><tr><td class="src">-&gt; Vec3</td><td class="doc"><p>Unit vector pointing vertically along the image plane
74 </p></td></tr><tr><td class="src">-&gt; <a href="ArtRay-Primitives.html#t:Viewer">Viewer</a></td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p>Creates a viewer
75 </p></div></div><div class="top"><p class="src"><a name="v:colorFrom" class="def">colorFrom</a> :: <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a> -&gt; Color</p><div class="doc"><p>Convert an ArtRay color to a GD color.
76 </p></div></div><div class="top"><p class="src"><a name="v:combine" class="def">combine</a> :: <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a> -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a> -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></p><div class="doc"><p>Take the product of two colors
77 </p></div></div><div class="top"><p class="src"><a name="v:scale" class="def">scale</a> :: <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a> -&gt; Double -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></p><div class="doc"><p>Multiply a color by a scalar
78 </p></div></div><div class="top"><p class="src"><a name="v:weightedCombine" class="def">weightedCombine</a> :: Double -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a> -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a> -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></p><div class="doc"><p>Weight two colors with the provided weighting factor. The first color is
1716 </p
1717 ></div
1718 ></div
1719 ><div class="top"
1720 ><p class="src"
1721 ><a name="v:view" class="def"
1722 >view</a
1723 ></p
1724 ><div class="subs arguments"
1725 ><p class="caption"
1726 >Arguments</p
1727 ><table
1728 ><tr
1729 ><td class="src"
1730 >:: Vec3</td
1731 ><td class="doc"
1732 ><p
1733 >The location of the viewer
1734 </p
1735 ></td
1736 ></tr
1737 ><tr
1738 ><td class="src"
1739 >-&gt; Double</td
1740 ><td class="doc"
1741 ><p
1742 >The field of view of the viewer, in radians
1743 </p
1744 ></td
1745 ></tr
1746 ><tr
1747 ><td class="src"
1748 >-&gt; Vec3</td
1749 ><td class="doc"
1750 ><p
1751 >The vector from viewer to center of image plane
1752 </p
1753 ></td
1754 ></tr
1755 ><tr
1756 ><td class="src"
1757 >-&gt; Vec3</td
1758 ><td class="doc"
1759 ><p
1760 >Unit vector pointing vertically along the image plane
1761 </p
1762 ></td
1763 ></tr
1764 ><tr
1765 ><td class="src"
1766 >-&gt; <a href="ArtRay-Primitives.html#t:Viewer"
1767 >Viewer</a
1768 ></td
1769 ><td class="doc empty"
1770 >&nbsp;</td
1771 ></tr
1772 ></table
1773 ></div
1774 ><div class="doc"
1775 ><p
1776 >Creates a viewer
1777 </p
1778 ></div
1779 ></div
1780 ><div class="top"
1781 ><p class="src"
1782 ><a name="v:colorFrom" class="def"
1783 >colorFrom</a
1784 > :: <a href="ArtRay-Primitives.html#t:ColorTriple"
1785 >ColorTriple</a
1786 > -&gt; Color</p
1787 ><div class="doc"
1788 ><p
1789 >Convert an ArtRay color to a GD color.
1790 </p
1791 ></div
1792 ></div
1793 ><div class="top"
1794 ><p class="src"
1795 ><a name="v:combine" class="def"
1796 >combine</a
1797 > :: <a href="ArtRay-Primitives.html#t:ColorTriple"
1798 >ColorTriple</a
1799 > -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
1800 >ColorTriple</a
1801 > -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
1802 >ColorTriple</a
1803 ></p
1804 ><div class="doc"
1805 ><p
1806 >Take the product of two colors
1807 </p
1808 ></div
1809 ></div
1810 ><div class="top"
1811 ><p class="src"
1812 ><a name="v:scale" class="def"
1813 >scale</a
1814 > :: <a href="ArtRay-Primitives.html#t:ColorTriple"
1815 >ColorTriple</a
1816 > -&gt; Double -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
1817 >ColorTriple</a
1818 ></p
1819 ><div class="doc"
1820 ><p
1821 >Multiply a color by a scalar
1822 </p
1823 ></div
1824 ></div
1825 ><div class="top"
1826 ><p class="src"
1827 ><a name="v:weightedCombine" class="def"
1828 >weightedCombine</a
1829 > :: Double -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
1830 >ColorTriple</a
1831 > -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
1832 >ColorTriple</a
1833 > -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
1834 >ColorTriple</a
1835 ></p
1836 ><div class="doc"
1837 ><p
1838 >Weight two colors with the provided weighting factor. The first color is
791839 multiplied by the weight, the second by one minus the weight.
80 </p></div></div><div class="top"><p class="src"><a name="v:sumLight" class="def">sumLight</a> :: [<a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a>] -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></p><div class="doc"><p>Ensure that each component of the color is in [0, 1].
81 </p><p>Take the sum of a list of colors
82 </p></div></div><div class="top"><p class="src"><a name="v:sumColor" class="def">sumColor</a> :: <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a> -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a> -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></p><div class="doc"><p>Take the sum of a pair of colors, truncating if it results in a value
1840 </p
1841 ></div
1842 ></div
1843 ><div class="top"
1844 ><p class="src"
1845 ><a name="v:sumLight" class="def"
1846 >sumLight</a
1847 > :: [<a href="ArtRay-Primitives.html#t:ColorTriple"
1848 >ColorTriple</a
1849 >] -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
1850 >ColorTriple</a
1851 ></p
1852 ><div class="doc"
1853 ><p
1854 >Ensure that each component of the color is in [0, 1].
1855 </p
1856 ><p
1857 >Take the sum of a list of colors
1858 </p
1859 ></div
1860 ></div
1861 ><div class="top"
1862 ><p class="src"
1863 ><a name="v:sumColor" class="def"
1864 >sumColor</a
1865 > :: <a href="ArtRay-Primitives.html#t:ColorTriple"
1866 >ColorTriple</a
1867 > -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
1868 >ColorTriple</a
1869 > -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
1870 >ColorTriple</a
1871 ></p
1872 ><div class="doc"
1873 ><p
1874 >Take the sum of a pair of colors, truncating if it results in a value
831875 outside [0, 1].
84 </p></div></div><div class="top"><p class="src"><a name="v:sumColor-39-" class="def">sumColor'</a> :: <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a> -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a> -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></p><div class="doc"><p>Take the sum of a pair of colors without normalizing.
85 </p></div></div><div class="top"><p class="src"><a name="v:meanColor" class="def">meanColor</a> :: [<a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a>] -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></p><div class="doc"><p>Find the mean value of a list of colors.
86 </p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.9.2</p></div></body></html>
1876 </p
1877 ></div
1878 ></div
1879 ><div class="top"
1880 ><p class="src"
1881 ><a name="v:sumColor-39-" class="def"
1882 >sumColor'</a
1883 > :: <a href="ArtRay-Primitives.html#t:ColorTriple"
1884 >ColorTriple</a
1885 > -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
1886 >ColorTriple</a
1887 > -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
1888 >ColorTriple</a
1889 ></p
1890 ><div class="doc"
1891 ><p
1892 >Take the sum of a pair of colors without normalizing.
1893 </p
1894 ></div
1895 ></div
1896 ><div class="top"
1897 ><p class="src"
1898 ><a name="v:meanColor" class="def"
1899 >meanColor</a
1900 > :: [<a href="ArtRay-Primitives.html#t:ColorTriple"
1901 >ColorTriple</a
1902 >] -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
1903 >ColorTriple</a
1904 ></p
1905 ><div class="doc"
1906 ><p
1907 >Find the mean value of a list of colors.
1908 </p
1909 ></div
1910 ></div
1911 ></div
1912 ></div
1913 ><div id="footer"
1914 ><p
1915 >Produced by <a href="http://www.haskell.org/haddock/"
1916 >Haddock</a
1917 > version 2.9.2</p
1918 ></div
1919 ></body
1920 ></html
1921 >
0 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>ArtRay.RayTrace</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
0 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
1 <html xmlns="http://www.w3.org/1999/xhtml"
2 ><head
3 ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
4 /><title
5 >ArtRay.RayTrace</title
6 ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean"
7 /><script src="haddock-util.js" type="text/javascript"
8 ></script
9 ><script type="text/javascript"
10 >//<![CDATA[
111 window.onload = function () {pageLoad();setSynopsis("mini_ArtRay-RayTrace.html");};
212 //]]>
3 </script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">ArtRay: A Haskell Raytracer</p></div><div id="content"><div id="module-header"><p class="caption">ArtRay.RayTrace</p></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><a name="v:pixelColor" class="def">pixelColor</a> :: Size -&gt; <a href="ArtRay-Primitives.html#t:Scene">Scene</a> -&gt; <a href="ArtRay-Primitives.html#t:Viewer">Viewer</a> -&gt; <a href="ArtRay-Primitives.html#t:Point2D">Point2D</a> -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></p></div><div class="top"><p class="src"><a name="v:colorFor" class="def">colorFor</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="ArtRay-Primitives.html#t:Scene">Scene</a></td><td class="doc"><p>The scene we're operating within
4 </p></td></tr><tr><td class="src">-&gt; <a href="ArtRay-Primitives.html#t:Primitive">Primitive</a></td><td class="doc"><p>The shape to determine the color for
5 </p></td></tr><tr><td class="src">-&gt; <a href="ArtRay-Primitives.html#t:Material">Material</a></td><td class="doc"><p>The material to examine (not necessarily the result of (material shape)
6 </p></td></tr><tr><td class="src">-&gt; Vec3</td><td class="doc"><p>The incident vector of the ray
7 </p></td></tr><tr><td class="src">-&gt; Vec3</td><td class="doc"><p>The location of intersection
8 </p></td></tr><tr><td class="src">-&gt; Int</td><td class="doc"><p>The stack depth
9 </p></td></tr><tr><td class="src">-&gt; <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></td><td class="doc"><p>The color at that point
10 </p></td></tr></table></div></div><div class="top"><p class="src"><a name="v:occluded" class="def">occluded</a> :: <a href="ArtRay-Primitives.html#t:Scene">Scene</a> -&gt; <a href="ArtRay-Primitives.html#t:Primitive">Primitive</a> -&gt; Vec3 -&gt; Vec3 -&gt; Double</p></div><div class="top"><p class="src"><a name="v:phongLight" class="def">phongLight</a> :: <a href="ArtRay-Primitives.html#t:Scene">Scene</a> -&gt; <a href="ArtRay-Primitives.html#t:Primitive">Primitive</a> -&gt; <a href="ArtRay-Primitives.html#t:Material">Material</a> -&gt; <a href="ArtRay-Primitives.html#t:Ray">Ray</a> -&gt; Vec3 -&gt; <a href="ArtRay-Primitives.html#t:Light">Light</a> -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></p></div><div class="top"><p class="src"><a name="v:colorAtRay" class="def">colorAtRay</a> :: <a href="ArtRay-Primitives.html#t:Scene">Scene</a> -&gt; Int -&gt; <a href="ArtRay-Primitives.html#t:Ray">Ray</a> -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></p></div><div class="top"><p class="src"><a name="v:colorAtRay-39-" class="def">colorAtRay'</a> :: <a href="ArtRay-Primitives.html#t:Scene">Scene</a> -&gt; Int -&gt; <a href="ArtRay-Primitives.html#t:Ray">Ray</a> -&gt; [<a href="ArtRay-Primitives.html#t:Primitive">Primitive</a>] -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></p></div><div class="top"><p class="src"><a name="v:sortTuples" class="def">sortTuples</a> :: (Double, Vec3, <a href="ArtRay-Primitives.html#t:Primitive">Primitive</a>) -&gt; (Double, Vec3, <a href="ArtRay-Primitives.html#t:Primitive">Primitive</a>) -&gt; Ordering</p></div><div class="top"><p class="src"><a name="v:geomAtRay" class="def">geomAtRay</a> :: <a href="ArtRay-Primitives.html#t:Scene">Scene</a> -&gt; <a href="ArtRay-Primitives.html#t:Ray">Ray</a> -&gt; [<a href="ArtRay-Primitives.html#t:Primitive">Primitive</a>] -&gt; Maybe (Vec3, <a href="ArtRay-Primitives.html#t:Primitive">Primitive</a>)</p></div><div class="top"><p class="src"><a name="v:intersectWithScene" class="def">intersectWithScene</a> :: <a href="ArtRay-Primitives.html#t:Scene">Scene</a> -&gt; <a href="ArtRay-Primitives.html#t:Ray">Ray</a> -&gt; [<a href="ArtRay-Primitives.html#t:Primitive">Primitive</a>] -&gt; [(Double, Vec3, <a href="ArtRay-Primitives.html#t:Primitive">Primitive</a>)]</p></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.9.2</p></div></body></html>
13 </script
14 ></head
15 ><body
16 ><div id="package-header"
17 ><ul class="links" id="page-menu"
18 ><li
19 ><a href="index.html"
20 >Contents</a
21 ></li
22 ><li
23 ><a href="doc-index.html"
24 >Index</a
25 ></li
26 ></ul
27 ><p class="caption"
28 >ArtRay: A Haskell Ray Tracer</p
29 ></div
30 ><div id="content"
31 ><div id="module-header"
32 ><p class="caption"
33 >ArtRay.RayTrace</p
34 ></div
35 ><div id="synopsis"
36 ><p id="control.syn" class="caption expander" onclick="toggleSection('syn')"
37 >Synopsis</p
38 ><ul id="section.syn" class="hide" onclick="toggleSection('syn')"
39 ><li class="src short"
40 ><a href="#v:pixelColor"
41 >pixelColor</a
42 > :: Size -&gt; <a href="ArtRay-Primitives.html#t:Scene"
43 >Scene</a
44 > -&gt; <a href="ArtRay-Primitives.html#t:Viewer"
45 >Viewer</a
46 > -&gt; <a href="ArtRay-Primitives.html#t:Point2D"
47 >Point2D</a
48 > -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
49 >ColorTriple</a
50 ></li
51 ><li class="src short"
52 ><a href="#v:colorFor"
53 >colorFor</a
54 > :: <a href="ArtRay-Primitives.html#t:Scene"
55 >Scene</a
56 > -&gt; <a href="ArtRay-Primitives.html#t:Primitive"
57 >Primitive</a
58 > -&gt; <a href="ArtRay-Primitives.html#t:Material"
59 >Material</a
60 > -&gt; Vec3 -&gt; Vec3 -&gt; Int -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
61 >ColorTriple</a
62 ></li
63 ><li class="src short"
64 ><a href="#v:occluded"
65 >occluded</a
66 > :: <a href="ArtRay-Primitives.html#t:Scene"
67 >Scene</a
68 > -&gt; <a href="ArtRay-Primitives.html#t:Primitive"
69 >Primitive</a
70 > -&gt; Vec3 -&gt; Vec3 -&gt; Double</li
71 ><li class="src short"
72 ><a href="#v:phongLight"
73 >phongLight</a
74 > :: <a href="ArtRay-Primitives.html#t:Scene"
75 >Scene</a
76 > -&gt; <a href="ArtRay-Primitives.html#t:Primitive"
77 >Primitive</a
78 > -&gt; <a href="ArtRay-Primitives.html#t:Material"
79 >Material</a
80 > -&gt; <a href="ArtRay-Primitives.html#t:Ray"
81 >Ray</a
82 > -&gt; Vec3 -&gt; <a href="ArtRay-Primitives.html#t:Light"
83 >Light</a
84 > -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
85 >ColorTriple</a
86 ></li
87 ><li class="src short"
88 ><a href="#v:colorAtRay"
89 >colorAtRay</a
90 > :: <a href="ArtRay-Primitives.html#t:Scene"
91 >Scene</a
92 > -&gt; Int -&gt; <a href="ArtRay-Primitives.html#t:Ray"
93 >Ray</a
94 > -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
95 >ColorTriple</a
96 ></li
97 ><li class="src short"
98 ><a href="#v:colorAtRay-39-"
99 >colorAtRay'</a
100 > :: <a href="ArtRay-Primitives.html#t:Scene"
101 >Scene</a
102 > -&gt; Int -&gt; <a href="ArtRay-Primitives.html#t:Ray"
103 >Ray</a
104 > -&gt; [<a href="ArtRay-Primitives.html#t:Primitive"
105 >Primitive</a
106 >] -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
107 >ColorTriple</a
108 ></li
109 ><li class="src short"
110 ><a href="#v:orderTuples"
111 >orderTuples</a
112 > :: (Double, Vec3, <a href="ArtRay-Primitives.html#t:Primitive"
113 >Primitive</a
114 >) -&gt; (Double, Vec3, <a href="ArtRay-Primitives.html#t:Primitive"
115 >Primitive</a
116 >) -&gt; Ordering</li
117 ><li class="src short"
118 ><a href="#v:geomAtRay"
119 >geomAtRay</a
120 > :: <a href="ArtRay-Primitives.html#t:Scene"
121 >Scene</a
122 > -&gt; <a href="ArtRay-Primitives.html#t:Ray"
123 >Ray</a
124 > -&gt; [<a href="ArtRay-Primitives.html#t:Primitive"
125 >Primitive</a
126 >] -&gt; Maybe (Vec3, <a href="ArtRay-Primitives.html#t:Primitive"
127 >Primitive</a
128 >)</li
129 ><li class="src short"
130 ><a href="#v:intersectWithScene"
131 >intersectWithScene</a
132 > :: <a href="ArtRay-Primitives.html#t:Scene"
133 >Scene</a
134 > -&gt; <a href="ArtRay-Primitives.html#t:Ray"
135 >Ray</a
136 > -&gt; [<a href="ArtRay-Primitives.html#t:Primitive"
137 >Primitive</a
138 >] -&gt; [(Double, Vec3, <a href="ArtRay-Primitives.html#t:Primitive"
139 >Primitive</a
140 >)]</li
141 ></ul
142 ></div
143 ><div id="interface"
144 ><h1
145 >Documentation</h1
146 ><div class="top"
147 ><p class="src"
148 ><a name="v:pixelColor" class="def"
149 >pixelColor</a
150 > :: Size -&gt; <a href="ArtRay-Primitives.html#t:Scene"
151 >Scene</a
152 > -&gt; <a href="ArtRay-Primitives.html#t:Viewer"
153 >Viewer</a
154 > -&gt; <a href="ArtRay-Primitives.html#t:Point2D"
155 >Point2D</a
156 > -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
157 >ColorTriple</a
158 ></p
159 ><div class="doc"
160 ><p
161 >Get the color for a pixel in the scene
162 </p
163 ></div
164 ></div
165 ><div class="top"
166 ><p class="src"
167 ><a name="v:colorFor" class="def"
168 >colorFor</a
169 ></p
170 ><div class="subs arguments"
171 ><p class="caption"
172 >Arguments</p
173 ><table
174 ><tr
175 ><td class="src"
176 >:: <a href="ArtRay-Primitives.html#t:Scene"
177 >Scene</a
178 ></td
179 ><td class="doc"
180 ><p
181 >The scene we're operating within
182 </p
183 ></td
184 ></tr
185 ><tr
186 ><td class="src"
187 >-&gt; <a href="ArtRay-Primitives.html#t:Primitive"
188 >Primitive</a
189 ></td
190 ><td class="doc"
191 ><p
192 >The shape to determine the color for
193 </p
194 ></td
195 ></tr
196 ><tr
197 ><td class="src"
198 >-&gt; <a href="ArtRay-Primitives.html#t:Material"
199 >Material</a
200 ></td
201 ><td class="doc"
202 ><p
203 >The material to examine (not necessarily the result of (material shape)
204 </p
205 ></td
206 ></tr
207 ><tr
208 ><td class="src"
209 >-&gt; Vec3</td
210 ><td class="doc"
211 ><p
212 >The incident vector of the ray
213 </p
214 ></td
215 ></tr
216 ><tr
217 ><td class="src"
218 >-&gt; Vec3</td
219 ><td class="doc"
220 ><p
221 >The location of intersection
222 </p
223 ></td
224 ></tr
225 ><tr
226 ><td class="src"
227 >-&gt; Int</td
228 ><td class="doc"
229 ><p
230 >The stack depth
231 </p
232 ></td
233 ></tr
234 ><tr
235 ><td class="src"
236 >-&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
237 >ColorTriple</a
238 ></td
239 ><td class="doc"
240 ><p
241 >The color at that point
242 </p
243 ></td
244 ></tr
245 ></table
246 ></div
247 ><div class="doc"
248 ><p
249 >Find the color at a pixel defined by the point
250 </p
251 ><p
252 >Finds the color at a point on a primitive, using the provided material.
253 Both the primitive and the material must be supplied, as some primitives may
254 have multiple materials that need to be calculated. The stack depth of ray
255 tracing is tracked but currently is unused and unlimited.
256 </p
257 ></div
258 ></div
259 ><div class="top"
260 ><p class="src"
261 ><a name="v:occluded" class="def"
262 >occluded</a
263 > :: <a href="ArtRay-Primitives.html#t:Scene"
264 >Scene</a
265 > -&gt; <a href="ArtRay-Primitives.html#t:Primitive"
266 >Primitive</a
267 > -&gt; Vec3 -&gt; Vec3 -&gt; Double</p
268 ><div class="doc"
269 ><p
270 >Returns how much occlusion occurs between two points x1 and x2. The shape
271 at x1 must be provided to ensure that it is excluded when calculating
272 intersections. The return value ranges from 0 to 1, where 0 is fully occluded
273 and 1 is not occluded at all. Intermediate values are possible because of
274 semi-transparent material that may be between x1 and x2.
275 </p
276 ></div
277 ></div
278 ><div class="top"
279 ><p class="src"
280 ><a name="v:phongLight" class="def"
281 >phongLight</a
282 ></p
283 ><div class="subs arguments"
284 ><p class="caption"
285 >Arguments</p
286 ><table
287 ><tr
288 ><td class="src"
289 >:: <a href="ArtRay-Primitives.html#t:Scene"
290 >Scene</a
291 ></td
292 ><td class="doc empty"
293 >&nbsp;</td
294 ></tr
295 ><tr
296 ><td class="src"
297 >-&gt; <a href="ArtRay-Primitives.html#t:Primitive"
298 >Primitive</a
299 ></td
300 ><td class="doc empty"
301 >&nbsp;</td
302 ></tr
303 ><tr
304 ><td class="src"
305 >-&gt; <a href="ArtRay-Primitives.html#t:Material"
306 >Material</a
307 ></td
308 ><td class="doc empty"
309 >&nbsp;</td
310 ></tr
311 ><tr
312 ><td class="src"
313 >-&gt; <a href="ArtRay-Primitives.html#t:Ray"
314 >Ray</a
315 ></td
316 ><td class="doc"
317 ><p
318 >The incoming ray, whose location is the point of intersection
319 </p
320 ></td
321 ></tr
322 ><tr
323 ><td class="src"
324 >-&gt; Vec3</td
325 ><td class="doc"
326 ><p
327 >The surface normal at the illumination point
328 </p
329 ></td
330 ></tr
331 ><tr
332 ><td class="src"
333 >-&gt; <a href="ArtRay-Primitives.html#t:Light"
334 >Light</a
335 ></td
336 ><td class="doc empty"
337 >&nbsp;</td
338 ></tr
339 ><tr
340 ><td class="src"
341 >-&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
342 >ColorTriple</a
343 ></td
344 ><td class="doc empty"
345 >&nbsp;</td
346 ></tr
347 ></table
348 ></div
349 ><div class="doc"
350 ><p
351 >Calculates the illumination of a point on a primitive with a Phong
352 material.
353 </p
354 ></div
355 ></div
356 ><div class="top"
357 ><p class="src"
358 ><a name="v:colorAtRay" class="def"
359 >colorAtRay</a
360 > :: <a href="ArtRay-Primitives.html#t:Scene"
361 >Scene</a
362 > -&gt; Int -&gt; <a href="ArtRay-Primitives.html#t:Ray"
363 >Ray</a
364 > -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
365 >ColorTriple</a
366 ></p
367 ><div class="doc"
368 ><p
369 >Find the color of the first object that intersects a ray
370 </p
371 ></div
372 ></div
373 ><div class="top"
374 ><p class="src"
375 ><a name="v:colorAtRay-39-" class="def"
376 >colorAtRay'</a
377 > :: <a href="ArtRay-Primitives.html#t:Scene"
378 >Scene</a
379 > -&gt; Int -&gt; <a href="ArtRay-Primitives.html#t:Ray"
380 >Ray</a
381 > -&gt; [<a href="ArtRay-Primitives.html#t:Primitive"
382 >Primitive</a
383 >] -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
384 >ColorTriple</a
385 ></p
386 ><div class="doc"
387 ><p
388 >Find the color of the first object that intersects a ray, excluding the
389 provided primitives from the intersection.
390 </p
391 ></div
392 ></div
393 ><div class="top"
394 ><p class="src"
395 ><a name="v:orderTuples" class="def"
396 >orderTuples</a
397 > :: (Double, Vec3, <a href="ArtRay-Primitives.html#t:Primitive"
398 >Primitive</a
399 >) -&gt; (Double, Vec3, <a href="ArtRay-Primitives.html#t:Primitive"
400 >Primitive</a
401 >) -&gt; Ordering</p
402 ><div class="doc"
403 ><p
404 >Order tuples representing intersections, from first to last intersection
405 </p
406 ></div
407 ></div
408 ><div class="top"
409 ><p class="src"
410 ><a name="v:geomAtRay" class="def"
411 >geomAtRay</a
412 > :: <a href="ArtRay-Primitives.html#t:Scene"
413 >Scene</a
414 > -&gt; <a href="ArtRay-Primitives.html#t:Ray"
415 >Ray</a
416 > -&gt; [<a href="ArtRay-Primitives.html#t:Primitive"
417 >Primitive</a
418 >] -&gt; Maybe (Vec3, <a href="ArtRay-Primitives.html#t:Primitive"
419 >Primitive</a
420 >)</p
421 ><div class="doc"
422 ><p
423 >Find the first primitive at a ray
424 </p
425 ></div
426 ></div
427 ><div class="top"
428 ><p class="src"
429 ><a name="v:intersectWithScene" class="def"
430 >intersectWithScene</a
431 > :: <a href="ArtRay-Primitives.html#t:Scene"
432 >Scene</a
433 > -&gt; <a href="ArtRay-Primitives.html#t:Ray"
434 >Ray</a
435 > -&gt; [<a href="ArtRay-Primitives.html#t:Primitive"
436 >Primitive</a
437 >] -&gt; [(Double, Vec3, <a href="ArtRay-Primitives.html#t:Primitive"
438 >Primitive</a
439 >)]</p
440 ><div class="doc"
441 ><p
442 >Find all points of intersections of a ray with the scene
443 </p
444 ></div
445 ></div
446 ></div
447 ></div
448 ><div id="footer"
449 ><p
450 >Produced by <a href="http://www.haskell.org/haddock/"
451 >Haddock</a
452 > version 2.9.2</p
453 ></div
454 ></body
455 ></html
456 >
0 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>ArtRay.Render</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
0 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
1 <html xmlns="http://www.w3.org/1999/xhtml"
2 ><head
3 ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
4 /><title
5 >ArtRay.Render</title
6 ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean"
7 /><script src="haddock-util.js" type="text/javascript"
8 ></script
9 ><script type="text/javascript"
10 >//<![CDATA[
111 window.onload = function () {pageLoad();setSynopsis("mini_ArtRay-Render.html");};
212 //]]>
3 </script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">ArtRay: A Haskell Raytracer</p></div><div id="content"><div id="module-header"><p class="caption">ArtRay.Render</p></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><a href="#v:rayTraceImage-39-">rayTraceImage'</a> :: <a href="ArtRay-Primitives.html#t:Scene">Scene</a> -&gt; Size -&gt; <a href="ArtRay-Primitives.html#t:Point2D">Point2D</a> -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></li><li class="src short"><a href="#v:rayTraceImage">rayTraceImage</a> :: <a href="ArtRay-Primitives.html#t:Scene">Scene</a> -&gt; Size -&gt; Point -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></li><li class="src short"><a href="#v:applyToImage">applyToImage</a> :: (Size -&gt; Point -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a>) -&gt; Image -&gt; IO ()</li><li class="src short"><a href="#v:render">render</a> :: <a href="ArtRay-Primitives.html#t:Scene">Scene</a> -&gt; Int -&gt; FilePath -&gt; IO ()</li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><a name="v:rayTraceImage-39-" class="def">rayTraceImage'</a> :: <a href="ArtRay-Primitives.html#t:Scene">Scene</a> -&gt; Size -&gt; <a href="ArtRay-Primitives.html#t:Point2D">Point2D</a> -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></p><div class="doc"><p>Raytrace an image without antialiasing
4 </p></div></div><div class="top"><p class="src"><a name="v:rayTraceImage" class="def">rayTraceImage</a> :: <a href="ArtRay-Primitives.html#t:Scene">Scene</a> -&gt; Size -&gt; Point -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a></p><div class="doc"><p>Raytrace an image with antialiasing by subpixel sampling
5 </p></div></div><div class="top"><p class="src"><a name="v:applyToImage" class="def">applyToImage</a> :: (Size -&gt; Point -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple">ColorTriple</a>) -&gt; Image -&gt; IO ()</p><div class="doc"><p>Turn a function into a pretty picture
6 </p></div></div><div class="top"><p class="src"><a name="v:render" class="def">render</a> :: <a href="ArtRay-Primitives.html#t:Scene">Scene</a> -&gt; Int -&gt; FilePath -&gt; IO ()</p><div class="doc"><p>Render a square image and save it to the given file.
7 </p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.9.2</p></div></body></html>
13 </script
14 ></head
15 ><body
16 ><div id="package-header"
17 ><ul class="links" id="page-menu"
18 ><li
19 ><a href="index.html"
20 >Contents</a
21 ></li
22 ><li
23 ><a href="doc-index.html"
24 >Index</a
25 ></li
26 ></ul
27 ><p class="caption"
28 >ArtRay: A Haskell Ray Tracer</p
29 ></div
30 ><div id="content"
31 ><div id="module-header"
32 ><p class="caption"
33 >ArtRay.Render</p
34 ></div
35 ><div id="synopsis"
36 ><p id="control.syn" class="caption expander" onclick="toggleSection('syn')"
37 >Synopsis</p
38 ><ul id="section.syn" class="hide" onclick="toggleSection('syn')"
39 ><li class="src short"
40 ><a href="#v:rayTraceImage-39-"
41 >rayTraceImage'</a
42 > :: <a href="ArtRay-Primitives.html#t:Scene"
43 >Scene</a
44 > -&gt; Size -&gt; <a href="ArtRay-Primitives.html#t:Point2D"
45 >Point2D</a
46 > -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
47 >ColorTriple</a
48 ></li
49 ><li class="src short"
50 ><a href="#v:rayTraceImage"
51 >rayTraceImage</a
52 > :: <a href="ArtRay-Primitives.html#t:Scene"
53 >Scene</a
54 > -&gt; Size -&gt; Point -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
55 >ColorTriple</a
56 ></li
57 ><li class="src short"
58 ><a href="#v:applyToImage"
59 >applyToImage</a
60 > :: (Size -&gt; Point -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
61 >ColorTriple</a
62 >) -&gt; Image -&gt; IO ()</li
63 ><li class="src short"
64 ><a href="#v:render"
65 >render</a
66 > :: <a href="ArtRay-Primitives.html#t:Scene"
67 >Scene</a
68 > -&gt; Int -&gt; FilePath -&gt; IO ()</li
69 ></ul
70 ></div
71 ><div id="interface"
72 ><h1
73 >Documentation</h1
74 ><div class="top"
75 ><p class="src"
76 ><a name="v:rayTraceImage-39-" class="def"
77 >rayTraceImage'</a
78 > :: <a href="ArtRay-Primitives.html#t:Scene"
79 >Scene</a
80 > -&gt; Size -&gt; <a href="ArtRay-Primitives.html#t:Point2D"
81 >Point2D</a
82 > -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
83 >ColorTriple</a
84 ></p
85 ><div class="doc"
86 ><p
87 >Raytrace an image without antialiasing
88 </p
89 ></div
90 ></div
91 ><div class="top"
92 ><p class="src"
93 ><a name="v:rayTraceImage" class="def"
94 >rayTraceImage</a
95 > :: <a href="ArtRay-Primitives.html#t:Scene"
96 >Scene</a
97 > -&gt; Size -&gt; Point -&gt; <a href="ArtRay-Primitives.html#t:ColorTriple"
98 >ColorTriple</a
99 ></p
100 ><div class="doc"
101 ><p
102 >Raytrace an image with antialiasing by subpixel sampling
103 </p </