LOCAL ILLUMINATION MODELS FROM SURFACE GEOMETRYByGang HuoB. Sc. Peking UniversityA THESIS SUBMITTED IN PARTIAL FULFILLMENT OFTHE REQUIREMENTS FOR THE DEGREE OFMASTER OF SCIENCEinTHE FACULTY OF GRADUATE STUDIESCOMPUTER SCIENCEWe accept this thesis as conformingto the required standardTHE UNIVERSITY OF BRITISH COLUMBIAApril 1993© Gang Huo, 1993(Signature)In presenting this thesis in partial fulfilment of the requirements for an advanceddegree at the University of British Columbia, I agree that the Library shall make itfreely available for reference and study. I further agree that permission for extensivecopying of this thesis for scholarly purposes may be granted by the head of mydepartment or by his or her representatives. It is understood that copying orpublication of this thesis for financial gain shall not be allowed without my writtenpermission.Coy jeir SciiiriceDepartment ofThe University of British ColumbiaVancouver, CanadaDate /1-tr,19 oi7, I??3 DE-6 (2/88)AbstractIn this thesis, we propose a model to simulate the small-scale geometry of cloth anddevelop a method to derive the BRDF (Bidirectional Reflectance-Distribution Function)of this model from the underlying surface geometry, taking into account the blocking andshadowing phenomena at the small scale. Sample images of cloth generated with thisBRDF look highly realistic. As a starting point to the inter-reflection problem, we exam-ine the secondary reflection phenomena on the surface model made of parallel cylinders(as proposed by Poulin and Fournier) and the model proposed here for cloth. Two so-lutions are presented sampling through raytracing and an analytical approximation.The results convincingly indicate that the intensity from multiply reflected light could besubstantial for bumped surfaces with low specular exponent n. Therefore inter-reflectionshould be accounted for in the lighting model for these surfaces. Generated cloth imagesincluding secondary reflection effects exhibit a higher degree of realism. The computationof secondary reflection effects is however quite expensive.The techniques presented can be extended to extract macroscopic reflection behaviourfrom the knowledge of the microscopic geometric structure.iiTable of ContentsAbstract^ iiList of Tables vList of Figures^ viAcknowledgements ix1 Introduction and Previous Work 12 Establishing the Surface Geometry 102.1 Threads ^ 112.2 Weave Patterns 132.3 Description of Surface Geometry^ 143 The Basic Geometry 173.1 Interactions Between the Thread Segments ^ 173.2 Range of Consideration ^ 233.3 Summary ^ 284 Computation of Direct Reflected Light 294.1 Shadowing, Blocking and Computation of Projected Area ^ 294.2 Reflected Intensity ^ 344.3 Rendered Result 36iii5 Inter-Reflection^ 415.1 Geometric Model 425.2^Ray Tracing Solution ....... . ........... . . . . . . . . . ^425.2.1 First Level Sampling Scheme^ 425.2.2 Second Level Sampling Scheme 435.3 Analytical Solution ^485.3.1 Maximum Reflection Point and Peak Line Determination ^ 495.3.2 Formula for Secondary Reflection ^ 495.4 Result ^ 556 Conclusion and Future Work^ 71Bibliography^ 74ivList of Tables3.1 Look -up Table for One Direction ^ 245.2 Maximum Values for different specular exponents ^ 58vList of Figures1.1 Vector Notation in Illumination Formulas ^21.2 Definition of BRDF ^42.1 Woven Fabric ^ 112.2 Approximation to the Cross-section of a Fiber ^ 122.3 Weave Representation on Point Paper^ 132.4 Weave Pattern & Point Paper & Weave Period ^ 153.1 The Global Coordinate System ^ 183.2 Interactions Between the Cylinders: the First Case ^ 193.3 Approximation of Semi-Circle by Rectangle ^ 193.4 Cross-section of the First Case ^ 203.5 Interactions Between the Cylinders: the Second Case ^ 213.6 Cross-section of the Second Case ^ 213.7 Interactions Between the Cylinders: the Third Case ^ 223.8 Cross-section of the Third Case ^ 233.9 Range of Influence ^ 233.10 "Scanning the Cylinders" 253.11 Graph for the Pseudocode ^ 263.12 Active Cylinder Lookup Table Computation: case 2 ^ 273.13 Active Cylinder Lookup Table Computation: case 3 284.1 Visible and Illuminated Cylinder: Case 1 ^ 30vi4.2 Length of Visible and Illuminated Cylinder ^ 304.3 Length of the Arc Projected in the Eye Direction 324.4 Visible and Illuminated Cylinder: Case 2 ^ 334.5 Sample Cloth Images ^ 374.6 Surface Characterization of Sample Basket Weave ^ 384.7 Surface Characterization of Sample Twill Weave 395.1 Secondary Reflection ^ 425.2 Sampling as Seen by the Viewer ^ 435.3 Second Level Sampling ^ 445.4 Determination of Sampling Range on Adjacent Cylinder ...... . . ^ 465.5 Maximum Reflection Point and Peak Line Determination ..... . . . ^ 485.6 Integration for Secondary Reflection ^ 505.7 Additional Constraints for the Integration Range ^ 545.8 Numerical Comparison of Raytracing and Analytical Solution R s vs. 13) 595.9 Numerical Comparison of Raytracing and Analytical Solution (/„// s vs ^/8) ^ 605.10 A Disk Shaded with Specular Secondary Reflection I s for various specularexponents (to be continued) ^ 615.10 A Disk Shaded with Specular Secondary Reflection / 83 for various specularexponents (continued) ^ 625.11 A Disk Shaded with Overall Secondary Reflection / 2 for various specularexponents (to be continued) ^ 635.11 A Disk Shaded with Overall Secondary Reflection 12 for various specularexponents (continued) ^ 645.12 Numerical Comparison of Iss and Is for various specular exponents . . ^ 65vii5.13 Numerical Comparison of /2 and II for various specular exponents . . . . 665.14 Distributions of I33, Isd, Ids and Idd in /2 for Various specular exponents . 675.15 Variation of Secondary Reflection with Respect to specular exponent . . 685.16 Variation of /2 //i with Respect to specular exponent ^ 695.17 Sample Cloth Images with Inter-reflection Accounted 70viiiAcknowledgementsI am indebted to a number of people without whose advice and encouragement thiswork would not have been possible. Foremost on this list is Alain Fournier, who hassupervised and contributed significantly to the development of this thesis. I am deepestgrateful for the guidance, support, encouragement and solicitude that he has given methrough my years at the University of British Columbia. His enthusiasm, approachability,inspiration, and generosity greatly helped produce the work presented here. I had thevery good fortune to have studied under his supervision.David Forsey, the second reader of my thesis, has spent a lot of time to review myearly drafts, though he is himself very busy. I am truly grateful for his advices andsuggestions which have substantially improved my thesis.I would like to express my special gratitude to Pierre Poulin, whose work has had adeep impact on my own. Thanks give to him for generously taking the time to explainhis early work, discuss and comment on my research. I am also very grateful to ChrisRomanzin for reading early drafts of this thesis twice, offering helpful comments, as wellas correcting language errors; John (Juancho) Buchanan for generously offering me codefor numerical integration; Atjeng S. Gunawan and Robert Scharein for helpful discussions.I would also like to extend my gratitude to all UBC graduate students, faculty,and staff who made my graduate study a rewarding experience, especially those in Im-ager/GraFic labs.My family my wife, our parents, my brother has been a constant source of inspira-tion and support, and I would especially like to acknowledge my wife Jun Zhang in thisregard.ixChapter 1Introduction and Previous WorkCalculating the shading of an object requires the computation of the intensity of thelight reflected off the object and towards the viewer according to some illuminationmodel. Correct shading is essential to achieving a high degree of realism. Improvingthe quality of the illumination model leads to direct improvements of realism. Phong[Phon73] introduced to computer graphics the first lighting model which went beyondthe diffuse Lambertian shading model and included specular highlights. Blinn [Blin77][Blin78] introduced and adapted the lighting models of Torrance and Sparrow [Torr67]and Trowbridge and Reitz [Trow75] to a form suitable for computer graphics. Thesewere derived from a geometrical optics model for light reflection from surfaces. Cookand Torrance [Cook81] adapted these models and used a model based on [Beck63] thatdeals with the scattering of electromagnetic radiation from rough surfaces. Beckmannand Spizzichino's models [Beck63] do not make the same geometrical optics assumption.Wavelength dependence was a new factor in their work. All these led the way to wellaccepted and used illumination models. We can summarize their various formulationswith a single equation:/(A) = Ka (A)S(A)L())m+Kd(A)S(A) ( • Li)h(A)m-Fifs (A)[(1 — M(A))S(A) MO)] E1Chapter 1. Introduction and Previous Work^ 2where &PO, Kd(A), and K3 (A) represent respectively the proportion of light reflected inambient, diffuse, and specular fashion, S(A) corresponds to the surface colour, M(a) theratio metal/dielectric of the surface, n the surface specular exponent, / a (A) the intensityof the ambient light and II (A) the intensity of each light source, Li the direction to eachlight source (see figure 1.1), ./q the surface normal, and Ht the bisector of E and Li .Figure 1.1: Vector Notation in Illumination FormulasSeveral other parameters have been added to improve this simplistic model. Differentroughness functions have been studied, geometric attenuations due to self-blocking havebeen taken into account and the Fresnel coefficient has been included for grazing angleeffects. The same parameters controlling reflection have also been applied to refraction[Ha1183] [Hal189].Each of these improvements was justified as necessary in order to render scenes witha higher degree of realism. More recently, He et al. [11e91] introduced a more accuratereflection model based on a more complete description of the surface characteristics.In order to derive such a comprehensive model, they introduced into their model severalvariables that capture certain previously neglected aspects of real reflection. Their modelincludes polarization of light, surface local height and slope, statistical connection ofChapter 1. Introduction and Previous Work^ 3surface asperities, and the concept of effective roughness. The model is based on physicaloptics and includes specular, directional diffuse, and uniform diffuse reflection from asurface.To fully describe the characteristics of the light source, Gartaganis [Gart92] developedan illumination model that incorporates critical parameters related to the wave propertiesof light. This model describes the modification of optical disturbances that occurs whenlight is dispersed or diffracted. Gartaganis shows that this enhanced feature is crucialfor successful duplication of some complex illumination effects such as dispersion anddiffraction.Looking realistic and being quickly computable are sufficient criteria for most lightingmodels used in raytracing systems. However, for the models used in radiosity systems, itis important to ensure that they satisfy the physical constraints of energy conservationand Helmholtz reciprocity. In [Lewi93], Lewis examined a number of lighting modelscommonly used in graphics in terms of the abovementioned criteria. His analysis showsthat Torrance-Sparrow, Neumann-Neumann [Neum89] and Minnaert [Minn41] modelsconserve energy and satisfy reciprocity, while the Phong model fails on both counts. Amodified Phong model is provided that is reciprocal and can be constrained to conserveenergy.These models reproduce many effects and are effective in simulating the reflectionfrom surfaces with microscopic roughness, they can not model surfaces such as those withanisotropic roughness above the microscopic level. Aimed at such a common shortcoming,an alternate approach is to exploit specific details about the surface configuration togenerate a more accurate BRDF (Bidirectional Reflectance-Distribution Function) model.Such models have been proposed by Kajiya [Kaji85], Cabral et al. [Cabr87], Poulin andFournier [Pou189] [Pou190], Fournier [Four92], and more recently, Westin et al. [West92].Chapter 1. Introduction and Previous Work^ 4BRDF (Bidirectional Reflectance-Distribution Function) is sometimes used in com-puter graphics to describe the reflectance properties of an opaque surface element. Toquote [ANS86], "the Bidirectional Reflectance-Distribution Function fr is the ratio of thedifferential luminance of a ray dL r (Or , Or ) reflected in a given direction (O r , Or ) to thedifferential luminous flux density dEi(0i 3 Oi) incident from a given direction of incidence,(0.i ,cki ) that produces it." (See figure 1.2)Figure 1.2: Definition of BRDFfr (0i3 Oi3 Or , Or )^dL,(0,,çbr )1dEi (Oi3 Oi ). dLr(0,,Or)1Li(0i,(ki)dS2iwhere dfli^dc.o • cos Oi .Chapter 1. Introduction and Previous Work^ 5In [Kaji85], Kajiya attempted to compute analytically the reflected intensity froma continuous surface. He based his approach on the general Kirchhoff solution for thescattering of electromagnetic waves [Bass79] [Beck63]. For given incident and reflecteddirections, the intensity reflected by a surface is computed. However, the method hasits restrictions. For instance, the Kirchhoff solution is valid only if self-shadowing andmultiple scattering are negligible. Even when this limitation is not considered, the size ofthe surface required (Fresnel zones) by the Kirchhoff solution and the stationary phasemethod used to approximate the integral [Born75] introduce new problems that aredependent on each surface type. Moreover, his method needs expensive preprocessingand a large memory.Cabral et al. [Cabr87] start from the facet level. Facets are created from a height fieldand the reflection off each facet is studied, including the blocking factor for incident andreflected light. This method, which can be qualified as brute force, is computationallyexpensive. The computation of the blocking factor is done via a modification of Max'smethod for the self-shadowing of bump maps [Max88]. This method will seriously aliasthe shadows when used for surfaces that exhibit a high frequency behaviour. In these twoapproaches, the reflected intensities are computed once and stored in tables; interpolationbetween table entries is used for fast rendering. However, a new table needs to becomputed for every type of surface and this computation involves a few hours of CPUtime.In [Pou189] [Pou190], Poulin and Fournier introduced a reflection and refraction modelfor anisotropic surfaces. The anisotropy is simulated by small parallel cylinders (addedor subtracted from the base surface) distributed on the anisotropic surface. This cor-responds to a "hidden" level between the micro-facet and macroscopic level. Differentlevels of anisotropy are achieved by varying the distance between each cylinder and/orraising the cylinders more or less from the surface. Their computation determines theChapter 1. Introduction and Previous Work^ 6visible and illuminated portions of the cylinders first, taking self-shadowing, shadowing,self-blocking and blocking into account. Two techniques are presented to compute theintensity of reflected light. In one, the intensity is computed by sampling the surfaceof the cylinders and the other uses an analytical solution. For the diffuse term, the an-alytical solution is exact. For the specular term, an approximation is developed usingChebyshev polynomials and integrating them.Fournier [Four92] introduces for local shading the concept of Normal DistributionFunctions, or NDF for short. His motivation stems from the observation that, for manysurfaces seen from a sufficient distance, the light reflected by a surface element is theresult of reflection from a distribution of surface normals. Based on this observation, anormal distribution function for a surface is defined as a function that for each pointon the surface gives the density of normals as a function of direction. This functioncan be used in traditional illumination models wherever the normal appears. By doingso, the BRDF is compactly represented and approximated. By treating the resultingsurface as a multiple surface, i.e. one where each point has more than one normal, eachnormal contributes to the total reflectance. The technique allows simultaneous use ofillumination models at different scales, ensuring smooth transition between scales whenthe scale changes. However, for some surfaces, the memory requirement of storing a NDFfor each point on the surface would be very large. In practice, Fournier discretized theNDF and approximated it in several directions. The shading operation is just a sum oftraditional operations. This might result in a loss of accuracy. Another problem is thatit is difficult to take into account blocking and shadowing effects for normal distributionson non-convex surfaces. But they are approximated in the method.Westin et al. [West92] described a Monte Carlo technique for approximating a BRDFby directly simulating optical scattering. They use spherical harmonics to represent theBRDF and store it in the form of a matrix of spherical harmonic coefficients. Using aChapter 1. Introduction and Previous Work^ 7Monte Carlo technique, they estimate the coefficients of the representation by directlysimulating optical scattering at a smaller scale. BRDFs for complex surfaces are simu-lated hierarchically by using the result of one simulation in generating the BRDF for thenext larger scale. Their technique removes most restrictions on surface microgeometryand is therefore more general though still memory intensive. Even after reduction, thecoefficient matrix of the spherical harmonics typically contains several thousands of ele-ments. If the BRDF is sharper (i.e. the BRDF changes more sharply when the reflectiondirection varies.), the demand for storage could be expected to be much larger. For ascene with different scales of object detail, the storage required is almost intolerable. Toestimate the coefficients by raytracing is very time consuming and the accuracy of theobtained result is questionable.Another model was devised specifically for the reflection of cloth surfaces. In [Yasu92],T. Yasuda et al. attempted to establish a lighting model for cloth objects. This modelimplicitly inserts an intermediate level of facets between the macroscopic and microscopiclevel, corresponding to the scale of yarns. They assume the micro-facets composing eachthread exhibits pure mirror reflection. Woven fabrics are made by interlacing two setsof yarns usually at right angles to each other (see figure 2.1). The lengthwise yarns areknown as warp yarns, while the widthwise yarns are known as weft (or woof) yarns. Atthe intermediate level, the two groups of yarns (warps and wefts) are treated separately.They first experimentally measured the normal distribution function a(H) of one groupof yarns over a small area. a(H) is the probability that a facet will have a normal inthe direction of H. With the presence of the other group of yarns, the accuracy of themeasured normal distribution function a(H) is questionable.After obtaining experimentally a(H) and r,, the weight of specular reflection, thespecularly reflected intensity is computed as:Chapter 1. Introduction and Previous Work^ 8= a(H) • rs • I„Here, I, is the intensity of the incident light.They also account for the light reflected or refracted several times at the border ofinternal fabric layers, namely internal reflection. Finally, they add some diffuse light tothe reflected intensity:Id = lo • rd • (N • L)where L is the intensity of the incident light, rd the experimentally measured weight ofdiffuse term, L the direction of the light source, N the global normal of the surface.the reflected intensity from one group of yarns is calculated as the sum of the threecomponents (specular, internal, and diffuse reflection). The reflection of the other groupof yarns is calculated similarly. It seems that they rotate the previous measured a(H)such that it could be adapted as the normal distribution function of this group. Theyweighted the two components according to the ratio of warp and weft yarns appeared onthe cloth surface, then simply sum them up as the final reflected intensity.There are several problems and limitations in this approach. A fundamental as-sumption they make is that yarns are comprised of mirror-like facets. This is a veryquestionable assumption, since the gap between the scale of yarns and that of mirror-likefacets is too large. There should be another level between them. This level should becharacterized by Phong's or Blinn's lighting model but not a mirror-reflection model.The model totally ignores the blocking phenomena which, as verified in [Tail92], isvery important, especially for cloth surfaces, where the yarns may have very differentsizes. When measuring the normal distribution function, as indicated in their paper[Yasu92], the technique is effective only for those weave patterns in which yarns in onedirection dominates that of the other direction. This severely restricts the applicabilityof their method. More importantly, they transfer the normal distribution function of theChapter 1. Introduction and Previous Work^ 9dominant group of yarns to the subordinate groups, which is physically incorrect. Theyexperimentally measured the relative weight of specular, internal and diffuse reflectionwith fixed lighting and viewing parameters, and then incorrectly assume that these ra-tios will remain unchanged under different viewing and lighting conditions. All thesecontribute to their somewhat unrealistic images.'Woven fabric are composed by two sets of yarns. For some weave patterns, one can see more threadsegments of one set per unit area than that of the other. This set of yarns is called the dominant groupand the other set is called the subordinate group.Chapter 2Establishing the Surface GeometryIn establishing illumination models, one has to start with the surface geometry. It hasbeen generally recognized that only in this way can the calculated BRDF accuratelyreflect the surface's optical behaviour. However, the application of this principle is notsimple. One problem is that at the very beginning one has to properly identify the pixellevel, that is, the level of detail that will be encompassed by a single pixel in the finalimage. Traditionally, it has been assumed that a two-level-partition is enough. That is, amicroscopic level corresponding to the pixel level, and a macroscopic level correspondingto the large-scale visible geometry. This assumption is valid only if the viewer looks atthe surface from a small distance or the surface of the object is very smooth. However,many scenes rendered nowadays in computer graphics are beyond this scope, and recentlyit has been realized in [Pou189] [Pou190] that two levels are not enough and that anotherlevel (called the mesoscopic level in [Four92]), corresponding to the pixel level, must beinserted between the microscopic and the macroscopic level. The underlying philosophyis that the eye is so far away relative to the dimension of the surface bumps' that a singlepixel in the final image will include a small 2 region consisting of many surface bumps.Consequently, traditional lighting models are not valid for the reflectance off this smallregion, since those models are only for the micro-facets composing the surface bumps.Thus new models need to be constructed to accurately capture these situations.Here we want to determine the reflected light off the cloth surface, and the situationlIn their approach [Pou189] [Pou190], the surface bumps are modeled as cylinders.'yet very large compared to the surface bumps.10Chapter 2. Establishing the Surface Geometry^ 11is very similar. We are interested in the case where the viewer and the light source arefar away from the surface in comparison to the dimension Consequently, the individualthread can not be seen. by the eye. As such, the mesoscopic level corresponds to groupsof threads, and the microscopic level corresponds to the facets consisting these threads.For these facets, we assume that they can be characterized by the traditional lightingmodels in computer graphics (e.g. Phong, Blinn). For groups of threads, the computationof their reflectance is a lot more complicated. In the remaining part of this chapter, wewill elaborate first on the geometry of the mesoscopic level.2.1 ThreadsFigure 2.1: Woven Fabric* taken from [Corb79], page 78, figure 5-6 (a).As stated before, woven fabrics are made by interlacing two sets of yarns usually atright angles to each other (see figure 2.1). The lengthwise yarns are known as warpChapter 2. Establishing the Surface Geometry^ 12yarns, while the widthwise yarns are known as weft (or woof) yarns. The cross-sectionalshape of fibers exhibits some slight variations, but it is generally circular. Thus it isapproximated with a semi-circle embedded into a plane (see figure 2.2). By adjustingthe ratio of h and r, the cross-sections range from semi-circle to semi-ellipse. For somewoven cloth, warps and wefts have different radii, and the warp (or weft) yarns are alsocomposed of different kinds of threads with different radii. Accordingly, in our model,the mesoscopic level consists of two groups of cylinders corresponding to warp and weftyarns respectively. The orientation of the cylinders in one group is perpendicular to thatof the other. The radii of the cylinders in different groups or even in a single group maynot necessarily be the same.It should be pointed out that our model is actually a simplification of the real ge-ometry. We ignore the non-cylindrical parts of threads to simplify the computation.However, this might cause inaccuracy. But since the cylindrical parts are the dominantportion of the threads, the error will hopefully not be very much.Figure 2.2: Approximation to the Cross-section of a Fiber21 16 1123 18 13 8a 170[0141141.113 IIII20 15 10 5Chapter 2. Establishing the Surface Geometry^ 132.2 Weave PatternsDepending on the direction of the light vector, one cylinder can block part of the lightcoming to another cylinder. This phenomena is called shadowing. Moreover, the cylindercan prevent part of itself from being lighted. This is called self-shadowing. Similarly,one cylinder can make part of another cylinder invisible to the viewer, called blocking; itcan also make part of itself invisible, called self-blocking. For different weave patterns,the percentage of warps and wefts per unit area differs, and the shadowing and blockingscenarios also vary radically, resulting in very different reflection behaviours. In order todetermine the BRDF accurately, we have to incorporate the weave pattern within ourcomputation, since it is another very important aspect of surface geometry. To develop ageneral solution applicable to most of the encountered cloths, we have to look into whatis common to the various weave patterns and is sufficient to characterizing the surfacegeometry.Figure 2.3: Weave Representation on Point Paper* taken from [Pizz87], page 110, figure 4-9.Chapter 2. Establishing the Surface Geometry^ 14In Fabric Science, Point Paper (see figure 2.3) is used to show the weave or the orderin which the yarns interlace in a fabric. It is used by textile designers to characterize adesign. Each vertical row of squares represents a warp yarn and each horizontal row ofsquares represents a weft yarn. A warp crossing over a weft is usually shown by markingin the square. A blank square is used to show the weft yarn passing over the warp.For more knowledge about fabric science and textiles, consult [Corb79] [Pizz61] [Pizz87][Tort87] [Wing84]. While it is sufficient to capture the entire surface constructions, PointPaper is still not the ultimate choice since the pattern might contain more than oneperiod. By discarding redundancy, we can extract one period, which will be referred toas a weave period. For any given cloth, its weave pattern is completely determined by itsweave period. Figure 2.4 shows a typical weave pattern, its Point Paper and its weaveperiod.2.3 Description of Surface GeometryAs stated before, our method will derive the BRDF of a surface from its geometry. Fora cloth surface, two parameters are needed to specify the surface geometry: the weaveperiod and relative dimension of the warp and weft yarns.In our algorithm, the weave period is specified in the form of an array of binary l'sand 0's. A "1" corresponds to the marking in the weave period and "0" to the blank. Asan illustration, the specification of the weave period in figure 2.4 is as follow:1 0 11 1 00 1 1Depending on the weave period, the size of the specification might be different.Chapter 2. Establishing the Surface Geometry^ 15Figure 2.4: Weave Pattern & Point Paper & Weave Period* taken from [Wing84], page 88, figure 4.12 (a) and (c).Chapter 2. Establishing the Surface Geometry^ 16The cylinders in different thread groups or even in a single group can be different.Therefore, we have to specify the radius and height of every thread in the weave period.In addition, the distances between adjacent warps (or wefts) may vary over the weaveperiod. Therefore, the distance between every adjacent cylinder in each group mustbe provided. Later, we will see that this information about the weave pattern and therelative dimension of threads is sufficient and indispensable. From them, we can recoverthe relative positions of the thread segments so that we can determine the shadowingand blocking situations, and finally compute the reflected intensity from the surface.Chapter 3The Basic GeometryThis thesis addresses the specific case where the eye and the light source are far awayfrom the cloth surface and therefore each displayed pixel will cover many weave periods.Because the distance from the eye to the surface is so large in comparison to the dimensionof these weave periods, the direction of E is assumed to be constant over them. By thesame token, i is also assumed constant over the weave periods embraced in a single pixel.Therefore, the light reflected from each weave period in this small region is the same. Thusthe light reflected off a small region of cloth could be approximated by the reflectance ofonly one weave period in that region. For the units 1 in a weave period, because of theirdifferent orientations, or different kinds of neighbourhood, their blocking, shadowing, orreflection behaviours are different and must be counted individually. Furthermore, sincetiE and i are identical over any thread segment in a weave period, its reflectance can becalculated as the reflectance off only one cross-section of the segment. Before going intothe detail of the computation, we first examine the shadowing and blocking phenomenaon the cloth surface.3.1 Interactions Between the Thread SegmentsThe calculation of self-shadowing and self-blocking is the same as that appeared in[Pou189] [Pou190]. We will not repeat it here. Next we concentrate only on the interactionsbetween the thread segments including shadowing and blocking.lunit refers to a cylinder segment.17Chapter 3. The Basic Geometry^ 18Figure 3.1: The Global Coordinate SystemFigure 3.1 presents the global coordinate system. The X and Y axes are orientedalong the directions of the threads. The local normals of the cylinders are either in the XNplane or the NY plane. The computations of shadowing and blocking are similar for thetwo groups of cylinders. Without loss of generality, here we only discuss the computationfor the group of cylinder segments whose orientation is in the X axis direction.The interactions between the thread segments can be categorized into three cases. Wewill examine each in detail. In the first case (figure 3.2), segment 2 shadows or blockssegment 1, depending on which vector we are considering. From the information of PointPaper, segment 3 does not influence segment 1. The influence of segment 4 on segment 1is negligible, since in the shaded area, segment 4 is flattened out by segment 2, thereforeit is too low to shadow or block segment 1. Another reason for ignoring the influence ofsegment 4 on segment 1 is that the length of the shaded part on segment 4 in figure 3.2is not larger than the distance between two adjacent warps (or wefts). In most of thecases, it is very small relative to the radius of segment 2. To simplify the case further, weapproximate the semi-circle (one cross-section of segment 2.) by an equal-area rectanglewith length 2r2 (figure 3.3). This is reasonable since the viewer can only see the overalleffect of shadowing and blocking. If r2 is the radius of the semi-circle, the height of theChapter 3. The Basic Geometry^ 19Figure 3.2: Interactions Between the Cylinders: the First CaseFigure 3.3: Approximation of Semi-Circle by RectangleChapter 3. The Basic Geometry^ 20Figure 3.4: Cross-section of the First Caserectangle is determined as :h = ir * r2 /4^ (3.1)Figure 3.4 shows the projection of the two cylinders on the NY plane. One can see thatsegment 2 blocks part of segment 1 starting from angle 0 to 0. In LABC, we have:sin(r — 0)r isin(V) — 0) = AB (3.2)AB = ri + d — h/ tan li,^ (3.3)combining 3.2 and 3.3, we can get:0 = V) + sin-l fsin 0/ri * [h/tan0 — ri — d]}^ (3.4)where r1 , r2 are the radii of segment 1 and segment 2 respectively, d is the distancebetween the two cylinders, 0 is the angle between the Y axis and the projection of V onthe NY planet.For the second case (figure 3.5), segment 2 blocks segment 1. Figure 3.6 depicts thecross-section of the two cylinder segments. The blocking (or shadowing) angle 0 can becomputed from the following equation:2The projection is denoted by^in figure 3.4. V could be L or E.Chapter 3. The Basic Geometry^ 21Figure 3.5: Interactions Between the Cylinders: the Second CaseFigure 3.6: Cross-section of the Second CaseChapter 3. The Basic Geometry^ 220 = ik + sin -1 (sinO/ri * (r2 /sin/ — r1 — d — r2 ))^ (3.5)where r 1 , r2 , are the same as that appeared in equation 3.4, The meanings of the othersymbols are depicted in figure 3.6.Figure 3.7: Interactions Between the Cylinders: the Third CaseThe third interaction is depicted in Figure 3.7. Segment 2 blocks segment 1. Similaras for the first case, we approximate the cross-section of segment 1 by an equal-arearectangle so that the length of the shadow' that segment 2 casts on segment 1 is expressedas follows (figure 3.8):/s = (r2 — h/ cos 0)/ sin 0 — (d + r2 ) + h tan b^ (3.6)'or the length of the blocked part, depending on what 17 is.Chapter 3. The Basic Geometry^ 23Figure 3.8: Cross-section of the Third Casewhereh = * ri /4and the meanings of the other symbols are either the same as before or depicted in figure3.8.We have here only discussed the situations where the blocking cylinder is on the rightor top of the blocked one. By symmetry same logic is applied to the cases where theblocking segment is on the left or below of the blocked one.3.2 Range of ConsiderationCo^ C1^ C2Figure 3.9: Range of InfluenceChapter 3. The Basic Geometry^ 24The struggle with blocking is not yet over. In our model, because the radii of vari-ous cylinders in a weave period can be different, depending on the direction of E or Lthe segment actually blocking a certain cylinder may not be its immediately adjacentneighbour. For example, in figure 3.9, when the incident angle is less than &, segment 2will actually influence segment 0 instead of segment 1. More generally, for any cylindersegment and different ranges of incident angle, the blocking cylinder can differ. For sucha situation, we will preprocess the weave period so as to identify the "active" cylinderscorresponding to different ranges of incident angle. For each of those units in a weaveperiod with different radii or lengths, or different kinds of neighbourhood, we create fourlook-up tables, corresponding to its above, below, left and right directions. Table 3.1illustrates the form of the tables. The look-up tables only depend on the weave pattern,not on L or E, so this preprocessing procedure needs to be done only once for each givenweave pattern. After establishing the look-up tables, given L and -É, we inspect the ap-propriate look-up table and find the corresponding "active" cylinder so that we can usethe prototypes presented in the previous section to calculate the shadowing and blockingsituations. Next we will present in detail the preprocessing procedure.rangle of incident angle active cylinder90 ,,, Tk i01 '`' 02ClC2Table 3.1: Look-up Table for One DirectionFor each unit in a weave period with a unique set of parameters'', we use a "cylinderscan" algorithm to establish the look-up table in each of four directions: above, below,4include radius, height, length, neighbourhoodChapter 3. The Basic Geometry^ 25C2C o CFigure 3.10: "Scanning the Cylinders"left and right. The initial direction of the scan is perpendicular to the surface. Thenwe move the scan toward the floor (figure 3.10). The first cylinder segment met by thescan is C1 . Next we keep on moving the scan away from Co toward the horizon whileit remains tangential to C1 until it meets a new cylinder C2. Suppose 1 is the anglebetween the axis Y (or X) and the current scan, then C 1 will be the active segment while0, the incident angle of 4 or 4, is in the range of [0 1 , 90]. We append the entry 0 1 andC1 to the look-up table. Next we continue to move the scan while it keeps tangential toC2. The new cylinder encountered is denoted by C3. The angle between the Y (or X)axis and the current scan is 02. If 02 > 0, then when the incident angle 0 E [02101],the active cylinder will be C2 accordingly. If, however, 0 2 < 0, then when E [0, 01 ],the active cylinder will be C2 and the algorithm stops immediately. This process willcontinue for C3 similarly. The algorithm will stop once we have exhausted one weaveperiod or the scan's incident angle reaches 0 degree. Next we will present the pseudocodeof the algorithm. Figure 3.11 helps to understand the code. In figure 3.11, Ci +r, is therepetition of C, after one weave period. The pseudocode for the algorithm is as follows:For each unit C[i] with independent parameters in a weave period{j = i+1;repeatChapter 3. The Basic Geometry^ 26Figure 3.11: Graph for the Pseudocode{k = j+1;MaxAngle = 0;/* find the first cylinder met by the scan tangential to C[j]repeat{find the common tangent of C[j] and C[k];find the angle Psi from the common tangent tothe Y (or X) axis;if (MaxAngle < Psi){MaxAngle = Psi;MaxCylinder = C[k];}k++;until ( k > i+n );if (MaxAngle > 0)/* when the incident angle is between MaxAngle and theangle in the previous table entry, then C[j] is theactive cylinder */Append (MaxAngle, C[j]) to the table;else{/* when the incident angle is between the angle in theprevious table entry and 0, then C[j] is the activecylinder, and the calculation for the current tablefinishes. */Append (0, C[j]) to the table;break;abch= r? + d2 + 2r id -I- h 2= 2r1 (ri + d)= r2 - h21= 7r * r2 /4Chapter 3. The Basic Geometry^ 27/* next round should start with the MaxCylinder */j = index of MaxCylinder;} until ( j >= i+n)}The computation mainly involves finding the common tangent of two cylinder seg-ments. This can be classified into three categories. For the first case (figure 3.9), i' isdetermined by the following equation:V) = sin -1 ((r2 — ri )/(r2 + r1 + d))^ (3.7)where r1 , r2 are the radii of segment 1 and segment 2 respectively.Figure 3.12: Active Cylinder Lookup Table Computation: case 2For the second case (figure 3.12), 0 is determined by the following equations:ti) = sin-1 ((02 — 4ac — b)/(2a))^ (3.8)Chapter 3. The Basic Geometry^ 28Figure 3.13: Active Cylinder Lookup Table Computation: case 3For the third case (figure 3.13), tk is determined by the following equations:= sin -1 ((b — N/b2 — 4ac)/(2a))^ (3.9)a = (ii + d + r2 ) 2 + h2b = 2r2 (11 + d + r2 )c = z' — h2h = r *ri /43.3 SummarySo far, we have presented the basic equations needed for the blocking and shadowingcalculations. In summary, we first preprocess the weave period and establish look-uptables to determine the active cylinder. Then for some given 1: and E, we query theproper look-up tables to find the corresponding active cylinders. Using the prototypesdiscussed in section 3.1, we can calculate the blocking and shadowing angles and lengths.In the next chapter, we will examine how to combine these results plus the angles fromself-blocking and self-shadowing, and thereafter determine the visible and illuminatedportion of cylinders. We will also present the computation of the final reflected intensity.Chapter 4Computation of Direct Reflected LightIn the previous two chapters, we elaborated on the surface geometry and the blockingphenomena. At this point, it should be clear how to calculate the blocking and shad-owing angles and lengths for each "unit" in a weave period. This chapter examines thecalculation of the directly reflected intensity. By directly we mean the light that is re-flected only once by the surface towards the viewer. This computation is divided intothree steps. Initially, determine the visible and illuminated portion of the cylinders andcompute its projected area in theti direction; secondly, for each independent "unit"in a weave period, calculate the amount of light reflected from it; finally, sum up andaverage all these intensities. The projected areas computed at the beginning are used asweighting factors at the final step. We will now present each of these steps in detail.4.1 Shadowing, Blocking and Computation of Projected AreaAs detailed in the previous chapter, given L and E, we use the look-up tables for eachunit to determine the shadowing and blocking angles, and the lengths of the shadowedor the blocked part. Using the same calculation as in [Pou189] [Pou190], we can find theself-shadowing and self-blocking angles as well.In general, two situations exist in the calculation of the visible and illuminated arc.Figure 4.1 depicts the first case. The length of the illuminated and visible cylinder(figure 4.2) can be calculated by the following code segment:length_vi: length of visible and illuminated cylinder;29Chapter 4. Computation of Direct Reflected Light^ 30Figure 4.1: Visible and Illuminated Cylinder: Case 1Figure 4.2: Length of Visible and Illuminated CylinderChapter 4. Computation of Direct Reflected Light^ 31:^length of shadowed cylinder;1_b: length of blocked cylinder;1:^length of the cylinder segment;if ( L and E on the same side of N when projected on to the XN plane)length_vi = Max(0, l-Max(l_s, 1_b) );elselength_vi = Max(0, l-1_s-l_b);Similarly, the length of visible cylinder is:/, = / —^ (4.1)By combining the self-blocking, blocking, self-shadowing, shadowing angles, we can findthe angles 0 1 and 02 . The arc between [0 1 , 02] is the illuminated and visible portion. Inour computation of the final reflected intensity, we will need the projected area in the eyedirection Pp of this visible and illuminated portion. We first need to find dui, the lengthtiof the arc when projected in the eye direction .gp (figure 4.3). It is determined as:dvi = r * (sin(02 —^— sin(Oi — 0))Therefore, the projected area isSvi = lvi * dvi^(4.3)where l,, is the length of the visible and illuminated portion of the cylinder.Figure 4.4 depicts the second case. For the portion of the cylinder between 02 , 03 ,the calculation of the projected area in the Bc, direction is the same as before, and wedenote it as Svii.For the portion of the cylinder between 0 1 , 02 , it is slightly more complicated. Thelength of the visible and illuminated portion is determined by the following code segment:1_temp = (l-2*r3)/2;if ( L and E are on the same side of N when projected on the XN plane){(4.2)Chapter 4. Computation of Direct Reflected Light^ 32Figure 4.3: Length of the Arc Projected in the Eye Direction1_max = Max(1_s, 1_b);if (1_max < 1_temp)1_vi = 2*1_temp - 1_max;elseif (1 max < 1_temp+2*r3)1_vi = 1_temp;else1_vi = Max(0, 1 - 1_max);}else /* L and E are not on the same side of N */if ( (1_b > 2*r3+1_temp) or (1_s > 2*r3+1_temp) )1_vi = Max(0, 1 - 1_b - 1_s);else1_vi = Max(0, 1_temp - 1_b) + Max(0, 1_temp - 1_s);After obtaining lvi, the calculation of the projected area is straightforward. we denote itas Svi2 -A similar calculation can be applied to find the projected area in the Ep directionChapter 4. Computation of Direct Reflected Light^ 33Figure 4.4: Visible and Illuminated Cylinder: Case 2Chapter 4. Computation of Direct Reflected Light^ 34of the visible portion of a cylinder. We denote it as S„, which will be used later in thecomputation of the final reflected intensity.So far we have examined the group of cylinders oriented in the X axis direction. Forthe other group, the calculation is analogous.4.2 Reflected IntensityAs stated before, since L and E are assumed constant over the numerous weave periodsthat will be embraced in a single pixel, the reflected intensity off this small region canbe calculated as the reflectance off only one weave period. Furthermore, the reflectanceoff a thread segment can be computed as the reflectance off only one cross-section of thesegment.Reflectance off Individual Cylinder SegmentFor thread segments, there are two cases in general. For the first case (figure 4.1),the reflected light is calculated asI = Svi 192 (I, -I- I4d0Si, elwhere Id, L are the diffuse and specular term respectively, Svi is the visible and illumi-nated area when projected in Pp direction as given by equation 4.3, Su is the sum ofthe projected areas in gp direction of the visible portion of the cylinders over the weaveperiod.For the second case (figure 4.4),= SS„ j (^/d)d0 —Svi2 1 '2 + Id)d0^ (4.5)Si, 02 Si, oiwhere Svii, Svi2 are the projected areas in the Pp direction of the visible and illumi-nated portion of the cylinder between the arcs [02 , 03 ], and [0 1 , 02 ], respectively, the othersymbols are the same as that in equation 4.4.(4.4)Chapter 4. Computation of Direct Reflected Light^ 35The terms s—.ass ,^in equation 4.4 and 4.5 serve as weighting factors.The term Id in equations 4.4 and 4.5 is expressed as:Id = N • L^ (4.6)Adding a correction factor cos(0 — 0E) to the integrals in equations 4.4 and 4.5, we have:I /0/0 = f cos(0 — 0E)Ar. • LdO^ (4.7)The term Is in equations 4.4 and 4.5 is expressed as:= (g • fir^ (4.8)where, n is the surface specular exponent.In this thesis, we use the phong-like model to characterize the micro-facets, since thismodel is well accepted in graphics. Other models can be easily used in our approach. Weare concerned in this work about the reflection behaviours at the mesoscopic level andthe comparison of the primary and the secondary reflection. As long as the micro-facetmodel is consistently used, our goals can be achieved.Adding a correction factor cos(0 — OE) to the integrals in equations 4.4 and 4.5, wehave:I Isd0 = f (IV • fir cos(0 — OE)d0^ (4.9)The approximations and evaluations of equations 4.7 and 4.9 are discussed thoroughlyin [Pou189] [Pou190]. We will not repeat it here. Obviously, due to the added correctionfactor, the solution obtained must be normalized by dividing by02cos(0 — 0E)d0 = cos 0E(sin 0 2 — sin 01) + sin 0E(cos 02 — cos 01)^(4.10)elTotal Reflected IntensityChapter 4. Computation of Direct Reflected Light^ 36Assume that in the weave period of a given cloth there are m independent "units".By independent, we mean the "units" have different radii, lengths, or neighbourhood'.Furthermore, for the ith "unit", there are D2 such instances in a weave period. Usingthe calculation we have just discussed, we can compute the intensity It reflected off acylinder segment of the ith case. The total reflected intensity is then:mI . E DiIii.,..4The pseudocode for the calculation is as follows:I_total = S_total = 0.;For each independent unit C[i] in the weave period{if ( C[i] is case 1 (figure 4.2) ){(4.11)calculate S_vi, the projected area of visible and illuminated portion;calculate S_v, the projected area of visible portion;evaluate the integral of the specular term: I_si;evaluate the integral of the diffuse term: I_di;I = S_vi * (I_si + I_di);}else /* C[i] is case 2 (figure 4.4) */{calculate S_vil, S_vi2;calculate S_v;for part 1, evaluate the integral for I_sil, I_dil;for part 2, evaluate the integral for I_si2, I_di2;I = S_vil * (I_sil + I_dil) + S_vi2 * (I_si2 + I_di2);}/* D[i] is the number of instances of case C[i] */S_total += S_v * D[i]; /* accumulate the visible areas */I_total += I* D[i];^/* accumulate the reflected intensities */}I_total 1= S_total;^/* averaging */4.3 Rendered ResultChapter 4. Computation of Direct Reflected Light^ 37Image 1: basket weave (eye at (0, -55, 45)); Image 2: basket weave (eye at (-45, 45, 80));Image 3: twill weave (eye at (0, -55, 45);^Image 4: twill weave (eye at (-45, 45, 80)).Figure 4.5: Sample Cloth ImagesChapter 4. Computation of Direct Reflected Light^ 38Figure 4.6: Surface Characterization of Sample Basket WeaveFigure 4.5 shows some images of cloth generated with this technique. For all fourimages, the surface is modelled by cubic spline resting on the average on the Z = 0plane. In the figure, the upper two pictures are for a typical weave pattern, called "basketweave". Its weave pattern and some parameters used here are depicted in figure 4.6. Thelocal surface geometry is characterized as two groups of cylinder segments perpendicularto each other. The radius of all cylinders is 1.5. The length of each cylinder segment is3.2; the distance between two adjacent parallel cylinders is 3.1. The surface reflectionparameters are specified as pa = 0.3, pd = 0.4, p, = 0.3, n = 10. The directional lightsource is in the direction of (0, 0.707, 0.707). For the upper left image, the eye is at (0,-55, 45). For the upper right image, the eye is at (-45, 45, 80).The lower two pictures in figure 4.5 are for another typical weave pattern, called1 Neighbourhood refers to the immediately adjacent units.Chapter 4. Computation of Direct Reflected Light^ 39Figure 4.7: Surface Characterization of Sample Twill WeaveChapter 4. Computation of Direct Reflected Light^ 40"twill weave". In these two pictures, the surface modelling, surface reflection parametersand light source are the same as those of the upper two pictures. The twill weave andsome parameters used here are depicted in figure 4.7. For the local surface geometry,one group of cylinder segments has radius 1.5, length 6.3, the other has radius 1.5, length3.2. The distance between two adjacent parallel cylinders is 3.1 for both directions. Theeye position of the lower left picture is the same as that of the upper left one, and theeye position of the lower right picture is the same as that of the upper right one.From the sample pictures, one can see that our approach is very successful. Theimages rendered using our algorithm look highly realistic. Comparing the images for thetwo different weave patterns, we are convinced that weave pattern is an important factorin determining the reflection behaviour. Therefore our algorithm have to be associatedwith weave pattern.Regretfully, we lack the necessary equipment for measuring the reflectance propertiesof real cloth surfaces. Therefore, we can not yet compare the results with real data as afurther verification of our approach. In addition, pa , pd, p s and n are chosen empirically.Noticed that the weave patterns cannot be seen in the images. This is due to our assump-tion that the region embraced in a pixel is very large in comparison to the dimensionof the weave period. Consequently, for different weave patterns, their difference is onlyperceived as different reflection behaviours. This is the limitation of our model.Chapter 5Inter-ReflectionInter-reflection occurs when light reflects two or more times on a surface before it reachesthe eye. Due to its complexity, this phenomena has not been dealt with quantitatively ata local scale in computer graphics. How important it is compared to direct reflection andblocking effects has yet to be determined. Traditionally, it has been taken for granted thatthis phenomena could be approximated by the diffuse term in lighting models. However,it is hard to tell how good this approximation is. It has been one of the continuous goalsand trends in graphics to accurately capture the interaction between light and objects.As such, in order to achieve high degree of realism and be confident with our lightingmodel, we have to answer these questions, at least to some extent.Secondary reflection, as indicated by its name, is when light is reflected two timesat the surface before it comes to the eye (see figure 5.1). Obviously, the light reachingthe eye via this process is the most significant portion of the multiply reflected intensity.Therefore, as a starting point to the inter-reflection problem, we will focus on the phe-nomena of secondary reflection in this chapter. The surface model under investigation isthe anisotropic model proposed in [Pou189] [Pou190]. In what follows we will first brieflydescribe the surface model, then present two approaches to the solution ray tracingand an analytical solution.41Chapter 5. Inter-Reflection^ 425.1 Geometric ModelOur primary concern here is at the mesoscopic level. As detailed in figure 5.1, at thislevel, the cylinders are embedded into a flat floor, r 1 and r2 are the radii of cylinder C1and C2 respectively and d is the distance between the centers of two adjacent cylinders.Some portion of the incoming light hits one cylinder C2, reaches its adjacent cylinder C1 ,and finally is reflected to the viewer. This is the phenomena of secondary reflection andis of our primary interest in this chapter.Figure 5.1: Secondary Reflection5.2 Ray Tracing SolutionIn spite of the computational cost required, raytracing is usually an effective techniqueto simulate the interaction between light and objects. In this section we will present thesampling schemes.5.2.1 First Level Sampling SchemeWe use the sampling scheme presented in [Pou189] [Pou190] as our first level scheme, thatis, sampling the cylinder at regular intervals as seen by the viewer (see figure 5.2). We74(5.1)Chapter 5. Inter-Reflection^ 43Figure 5.2: Sampling as Seen by the Viewerfirst identify the sampling positions and their normals on the visible arc. Then for eachof these positions, we calculate the intensity h reflected via secondary reflection fromthis point to the eye. The final reflected intensity to the viewer is the average of all theseintensities h from each sampling position (equation 5.1.)/ = 1—nwhere n is the number of samples on each cross-section of the cylinder.5.2.2 Second Level Sampling SchemeTo calculate the abovementioned h, the intensity reflected from position P, to the viewer,we have to sample the area that is visible to Pi and illuminated by the light source onits adjacent cylinder C2 (see figure 5.3).The determination of this area is slightly more involved. Along the y axis direction,the length considered is decided by the user, taking distance attenuation into account.Normally, a range of [-1.5, 1.5] for a cylinder radius of 1.0 is sufficient for a visually goodChapter 5. Inter-Reflection^ 44Figure 5.3: Second Level Samplingimage. However, for each cross-section we have to compute the arc which is visible to P iand illuminated by the light source. In figure 5.4, we suppose that the arc P uPi on C2 isvisible to P, on cylinder C1. 0, and 01 are the angles measured from the z axis to 02P.and 02 P1 respectively. These angles are calculated as follows.In figure 5.4, line PiPi, is tangent to circle C2. Its equation is:(x i, — d)(x — d) zaz = r2^ (5.2)where (x„,za ) is Pa 's coordinate, r2 is the radius of cylinder C2 , d the distance betweenthe centers of the two cylinders.Also we know Pa 's coordinate is (d — r2 sin Oa , r2 cos 0„), Pi's is (ri sin 0, r1 cos 0), andPi is on the line PiPa . Here r1 is the radius of circle C1 . Therefore we have the followingequation:(d — r2 sin Oth — d)(ri sin 0 — d) r2 ri cos Oa cos c = r2^ (5.3)Chapter 5. Inter-Reflection^ 45For Pi on the other side of the x axis, the equation is the same. By solving equation 5.3,0„ is computed as follows:k1 = d — r1 sin(0);k2 = 7.1 cos(0);0„^arcsin( 2r * ki — k2 * (k?^— r3) 1 /2);Similarly, line PiPi is tangent to circle C 1 . Its equation is:xix ziz = 7'1where (xi, zi) is Pi's coordinate, r 1 is the radius of cylinder C1 . Also since Pi 's coordinateis (7.1 sin 0, 7'1 cos 0), Pu 's is (d — r2 sin 0/, r2 cos 0k), P1 is on the line PPP/, we have thefollowing equation:7.1 sin 0(d — r2 sin 0/) r1 r2 cos 0 cos 0/ = ri2^(5.6)For Pi on the other side of the x axis, the equation is the same. By solving equation 5.6,0 is computed as follows:0/ = arccos(ri — d * sin 0)^ (5.7)r2The above computation can be summarized as:= d — r 1 sin(q);k2^ri cos(0););k?01 = arccos( ri — d * sin 0)^0;r2(5.4)(5.5)2. ,r * — k2 * (14 + — rW/ 20„^arcsm( 7 9^, 9(5.8)where r1 is the radius of cylinder C 1 , r2 is the radius of cylinder C2, d the distancebetween the centers of the two cylinders, 0 is the angle between 0 1 Pi and the z axis.Chapter 5. Inter-Reflection^ 46C 1 0 1^02 C 2Figure 5.4: Determination of Sampling Range on Adjacent CylinderWith the two angles Ou and Oi, and the shadowing angle Os from the light source, thesampling range on one cross-section of C2 is determined to be from Ou to min(01,0s ).After finding this range, we sample it regularly as shown in figure 5.3. For each cross-section, we divide it by a constant interval Da; along the y axis, we divide the cylinderby a constant interval A/. Normally, Da = 0.2, A/ = 0.2 will give very good result. Foreach of these patches, we shoot a ray to its center Pj. The light reflected from Pi toPi and finally to the viewer has two reflections on its way. Therefore, the light reflectedin this way has four components: light reflected specularly at the two reflections whoseintensity will be referred to as Iss,; light first reflected specularly and then diffusely, Isd.;light first reflected diffusely and then specularly, Ids; ; and light reflected twice diffusely,Idds . For iss,I„, E^. flingi . pipj )dwij^(5.9)where /Is is the specular-reflection coefficient,^is the intensity reflected from Pi to P1,Pi-Pi is the unit vector from Pi to Pj, 1 is the normal at Pi ,^is the bisector of E anddwii is the solid angle of patch j with respect to P.Chapter 5. Inter-Reflection^ 47The term /ii in the above equation is:Ps^• 17.1)n^ (5.10)where Ni the normal at Pi, Hi the bisector of L and P.Combining equations 5.9 and 5.10 we have:^= p!E(gi Ili)n(Rj •^PiPj)dwij^ (5.11)Similarly, we have:= pspdE(gi • Pd3i)(1Crj • iii)n(gi • PaDj )dwii^(5.12)= PsPd E(gri • ili)n (Áfi • 1,)(gi • pil)i )dwii^(5.13)Iddi = p2d E(fiti • Pil3i)(Rj •^• PTh)dcoii (5.14)Ii = Iss ,^+^+ idd, (5.15)where pd is the diffuse reflection coefficient.tTo compute the term (I • Pi-Pi)dwii in the above equations, Siegel et. al. have shown[Sieg81] that it is equivalent to projecting patch j onto a unit hemisphere centered aboutPi and projecting this projected area orthographically down onto the hemisphere's unitcircle base. Here we use this method for its accuracy. Alternatives exist. If we discretizethe patches finely enough, the solid angle can be approximated as the patch's foreshort-ened surface area divided by the square of the distance from P.; to Pi. Foreshortenedsurface area, also known as projected surface area, refers to the projection of patch j ontothe plane perpendicular to Pi-Pi. Accordingly, the solid angle can also be approximatedas:(Ni • PiPi ) dAR2dwi^ (5.16)-where Ni the normal at Pi , PiPi the unit vector from Pi to Pi , dAj the area of patch jand R the distance from Pi to Pi.Chapter 5. Inter-Reflection^ 485.3 Analytical SolutionTo compute the secondary reflection analytically, we first have to realize several facts.In the surface model proposed in [Poul89] [Pou190], for each cylinder, given I, and E, oneach side of the z axis, there exists at most one point P1 on C1 , such that: there exists aline on its adjacent cylinder C2; for any point (say P2 ) on this line, light ray hits P2, thenreaches P1 , then is reflected to the viewer; the two reflections on this path when projectedonto the xz plane are all pure mirror reflections. Figure 5.5 depicts this situation. Wecall P1 the maximum reflection point and the special line on cylinder C2 peak line. Fromthe definition of the peak line we can know it is parallel to the y axis.Figure 5.5: Maximum Reflection Point and Peak Line DeterminationDue to the curvature of the cylinder, the contribution of the secondary reflectedintensity drops dramatically for those positions slightly offset from P 1 or the peak line.The regions surrounding P1 and the peak line contribute the most to the secondaryreflection. Thus in our analytical solution we only need to consider these regions. Nextwe will describe how to determine the maximum reflection point and the peak line.Chapter 5. Inter-Reflection^ 495.3.1 Maximum Reflection Point and Peak Line DeterminationIn figure 5.5, 4 and 4 are the projections of t. and 1, on the XZ plane, respectively.Pi is the maximum reflection point, while P2 is a point on the peak line with same ycoordinate as Pi . Our goal in determining the peak line is to compute the angle fromthe x axis to 02 P2 , 02 in figure 5.5. To determine the maximum reflection point P1 wemust compute the angle 01 in figure 5.5. Consider the triangles 00102Q and AP1P2Q,we have02 — 01 = 7 — (OE — 01) — (02 — OL)From equation 5.17, we can get01,- 0EO02 — 01 = 7r/2 +^2(5.17)(5.18)The coordinate of Pi. is (ri cos 0 1 , ri sin 0 1 ), and P2 's is (d+r2 cos 02 , r2 sin 02 ). ConsideringAACP1 , the angle between Pi P2 and the x axis is OE — 2(0E — 01) (i.e. 201 — OE). Hencewe have equationr2 sin 02 — ri sin 0 1 = tan(20 1 — OE) (5.19)d + r2 cos 02 — ri s cos 01The combination of equation 5.18 and 5.19 results in a four-degree polynomialequation. By solving it and finding out the correct answer, we can determine 0 1 and 02.For the case that the points are on either side of the z axis, the equations are the same.5.3.2 Formula for Secondary ReflectionFrom the underlying assumption about the surface model (i.e. the scale of cylinders isvery small compared to eye and light source), the intensity reflected by all the cylinderscan be calculated as the reflection from a single cylinder s . Furthermore, since the radius of'This is true only if the radii of the cylinders are the same. If, however, this is not the case, wehave to compute the reflected intensities for each kind of cylinder with different radii, then average themweighted by the projected area in the eye direction of the visible cylinder. The rest of the computationis the same as presented next.Chapter 5. Inter-Reflection^ 50a cylinder is very small in comparison to its length, the intensity reflected from a cylindercan be approximated by the reflection off only one cross-section of it. For each cylinder,the viewer position is so far away relative to the cylinder's radius that its direction canbe assumed to be constant over the cylinder. By the same token, the light direction isalso assumed constant over each cylinder.Figure 5.6: Integration for Secondary ReflectionIn figure 5.6, P1 is the maximum reflection point and P2 is a point on the peak line.Point P2 is on the same cross-section as Pi., deviated from it at an angle a and thus theangle between 01 Pi and the x axis is 01 -I- a. Since the eye is so far away, the viewercan only see the overall reflectance from the visible arc. Therefore the reflected intensityis actually the average intensity over the visible arc. We first formulate the intensity oflight twice reflected specularly. Consider a small arc [0 1 + a, 01 + a + dal starting fromaup AL AIIss = L (5.20)Chapter 5. Inter-Reflection^ 51Pi. Suppose its length when projected in the 4 2 direction is AL. If A/ is the intensityreflected from Pi to the viewer3, the intensity of light reflected from every point on thissmall arc can be assumed to be A/, since we are considering a very small arc. Thereforewe have the following equation:where L is the length of the visible arc when projected in the gp direction. Hereserves as an averaging factor.In equation 5.20, AL can be rewritten as:AL =^(sin(0i + a + da — Oe ) — sin(ei + a — Be ))ri cos(0i + a — Oe)da^ (5.21)tiwhere r1 is the radius of cylinder C1 , 0, the angle from Ep to the x axis.If we suppose the visible arc starts from in f and ends at CYsup when measured counter-clockwisely from the x axis direction, then the term L in equation 5.20 can be rewrittenas:L = ri * (sin(0,up — 0e) — sin(Oinf — 00)^ (5.22)In equation 5.20, AI is the intensity of light coming to Pi from its adjacent cylinderand then reflected to the viewer. Consider the small region at point Pj on cylinder C2(figure 5.6). Its cross-section starts from Pi and ends after a small angle A#, and alongthe y axis it begins at Pi and expands at a length of A/. Since 0 t3 and A/ are small, theintensity of light sent from every point on this small region to Pi can be assumed to beconstant, which will be referred to as Im . Then the intensity of light reflected from thissmall region to Pi and then to the viewer is:'fp is the projection of E on the xz plane.3Again, A/ refers to the intensity reflected only specularly at the two points.Chapter 5. Inter-Reflection^ 52= ps (Igi • Iiir(gi • Pil3i)I7,,dco^ (5.23)where gi is the normal vector at Pi ,^is the bisector of E and the unit vector Pa Pi , nis the the specular-reflection exponent, dw is the the solid angle of the small region withrespect to P.As indicated before, In, can be regarded as equal to the intensity sent from 13.; to Pisince we are considering a very small region. This yields the following equation:Im = ps (Áfi .^ (5.24)where Ni is the the normal vector at Pi , Ili is the bisector of L and unit vector P7Pi ,is the the intensity of light source.For the small area, the solid angle can be calculated as the foreshortened surface areadivided by the square of the distance from Pi to P. Therefore du; in equation 5.23 canbe rewritten as:dw = (Ni • 6Pi)dAl R2= (At • P37.1)i)r2d0d11^ (5.25)where dA is the the surface area of the small region, R is the the distance from Pi to Pi,r2 is the radius of cylinder C2.Combining equations 5.23, 5.24, and 5.25, the intensity of light reflected from thesmall region to Pi and then to the viewer can be written as:r2 2= 2p(Ni • Hi )n (Ni • Hi )n(Ni PiPi )(N; pi Pi)Iidfldl^(5.26)Therefore, AI in equation 5.20, the intensity of light reflected from its adjacent cylinderto P2 and then to the viewer is:DI = ruP 1 . R2 s11P2 K • ilir(gri • 17.i) n (gi • P:P.i)(gi P3713i )Iidfidl^(5.27)-/Chapter 5. Inter-Reflection^ 53Combining equations 5.20, 5.21, and 5.27, we have:^r2 * r1 —al.^10^-I"uP^Pup toIss^L= p!Ii ^cos(0i - a — 0,)(/Vi • Iiir(gi • 'fir—(gi • PM)(1Crj • 001 R2 dcali3c11 (5.28)where ps is the specular-reflection coefficient, h is the the intensity of light source, r 1is the the radius of cylinder C1 , r2 is the the radius of cylinder C2, 01 is the angle ofmaximum reflection point, 0, is the angle fromti to the x axis, /qi is the normal vector-at Pi , Hi is the bisector of E and the unit vector Pi Pi, n is the the specular-reflectionexponent, ./q^ 7; is the normal vector at Ph^is the bisector of and the unit vector P; Pi ,R is the the distance from Pi to P2.Similarly, for the light reflected first specularly then diffusely, the final intensity re-flected to the viewer is:r2 * ri - 0, up^Pup 10-rsd = PsPdlt r^^I COS(01 + a — 0,)(gi Pi-Pi) 2 (gi • -airb azow-10(Ni • 133-..Pi)1R2 dad,8d1^ (5.29)the intensity of light reflected first diffusely then specularly to the viewer is:r2 * r1 aup [Pup floIds^J- PsPdli ^ COS(Oi + a — 0,)(gri • Ilir(Rj •^L4)L aloes --olow -to(Ni • PiPi)(1Cli • P;POIR 2 dadficll^ (5.30)the intensity of light reflected diffusely twice is:r2 * r2 Ti 2^1c'uP fPup^cos(01 a — oe )(gi . pi-Idd^ p-^di pj)2(gj. 1.1)L Liow J-01. J—to(1\-1.i • Pi-POI Wdad,3d1 (5.31)As discussed before, we integrate the reflected intensities over the regions surroundingthe maximum reflection point Pi and the peak line because in this way we will not missthe peak reflectance and will ensure quick convergence of the result. Consequently, theChapter 5. Inter-Reflection^ 54xFigure 5.7: Additional Constraints for the Integration Rangeregions being integrated can be minimized. When we formulate the secondary reflec-tion, we assume that any point in the integrated region on C 1 is visible to all of thepoints in the integrated region on C2. This is another reason why we have to minimizeaup , alow, flup, Mow. In practice, we constrain them by a small constant Cmax. In any case,it is sufficient if Cmax is chosen as 0.3. Normally, a value of 1.5 is enough for / 0 , sincedistance is another crucial attenuation factor in our formula. In addition, we have toensure that the integrated region on cylinder C 1 is visible to the viewer and the regionon C2 is illuminated by the light source. Another constraint is that aup and Aoi, be smallenough so that any region under integration stays in only one side of the z axis (figure5.7). Finally, aup, aim, #up and Mow are determined by the following pseudocode:if ( EX same side) {aup = min(x/2 — 01, Cmax);alow = min(Ob — (1f/2 — 01 ), Cmax); }else {aup = min(r/2 — 01, C...);alow = min(Osb + 01 — 7112, Cmax); }Chapter 5. Inter-Reflection^ 55if ( LX same side ) {13 up = MiTl(C max ) 0 ss — (02 — ir/2));Pi. = min(Cmax , 02 — 7r/2); }else {13up = min(Cmax, Os — (02 — ir/2));Or. = min(Cma„ 02 — ir/2); }For the case that P1 on the other side of the z axis, the calculation is:if ( EX same side ) {aup = m,in(Osb — (01 — ir/2 ), Cmax);aic,„ = min(Oi — 7r/2, Cmax); }else {aim = min(Ob — (01 — 7r/2), Cmax);aiou, = min(0 1 — 7r/2, Cmax); }if ( LX same sside ) {Alp = rnill(C ma x ) 7r/2 — 02);Pt. = min(C„,,as,O. — (7r/2 — 02)); }else {Pup = min(Cmax , 7r/2 — 02 );/how = min(Cmax, 088 — (7/2 — 02)); }At the current stage, we have not found a more easily integrable formulation of thesecondary reflection, and we have not been able to closely approximate the terms underintegration by some polynomial or other easily integrated form. In our current implemen-tation, we use numerical integration, specifically Simpson's Adaptive Quadrature Method[Burd81] to evaluate the integrals.5.4 ResultWe have presented the raytracing and analytical solution to the secondary reflectionproblem. Initially, to have some degree of verification, we will compare the results fromthe two approaches. We rendered a sphere using each of the two approaches. We chosea sphere since it can represent a wide range of parameters. The sphere is centered at(0,0,0). The light source is in the direction of (0, -0.5, 0.87), the eye is at (0, -10, 10).Chapter 5. Inter-Reflection^ 56The material property of the sphere is: pd = 0.4, ps = 0.7, n = 1. The anisotropy of thesphere is modeled as longitudinal cylinder group with parameters d = 2, r = 1, h = 0. Werendered the sphere using the two solutions separately and for each of them, we recordedthe direct specularly reflected intensity Is and the secondary specularly reflected intensity/„ of every pixel on the sphere. In figure 5.8, for each of these pixels, a point is plottedwith the recorded Is as its x coordinate and Iss as its y coordinate. The data from theraytracing solution are plotted in red and those from the analytical solution are in green.Figure 5.9 is plotted similarly except that the y coordinate is the ratio of I„ and Isinstead of I„. From the two figures one can see that the results from the two solutionsare very similar. The small difference might be caused by the fact that, in our analyticalsolution, part of the cylinders are truncated for numerical integration. We are convincedin some degree that the two solutions are correct.Our initial goal was to calculate the secondary reflection and compare it to the directreflection. Next, we will show the comparison numerically as well as visually. The resultspresented in the following are from the analytical solution. We rendered a disk residingon the z = 0 plane. The directional light source is 75° with the z = 0 plane and theeye is at (0, -10, 10). The material property of the disk is: pd = 0.4, ps = 0.7, withdifferent n's for different scenes. The anisotropy of the disk is modeled with longitudinalcylinders with parameters d = 2, r = 1, h = 0. For each scene in figure 5.10, the diskis shaded with only secondary specular reflection I„. In figure 5.11, the disk is shadedwith the overall secondary reflection /2 (i.e. /„ Ld+ ids + Idd). From these two pictures,one can perceive how the secondary reflection changes when n varies. As our numericalresults, we will compare /3„ with direct specular reflection Is and 12 with the overalldirect reflection h (i.e. Is + Id). Again, this is presented in the form of a point plot withthe intensity of direct reflection as x coordinate and the intensity of secondary reflectionas y coordinate. Figure 5.12 compares I„ and Is . Figure 5.13 compares /2 and I. ForChapter 5. Inter-Reflection^ 57different n's, the points are plotted in different colours.Figure 5.14 depicts the distributions of the four components Iss, Isd , his and Idd of 12for various n's. Table 5.2 summarizes the numerical results. It lists for different n's themaximum Iss , maximum 195 //,, maximum 12 and maximum /2 /11 . Based on table 5.2,we plot points with n (column 1 in the table) as its horizontal coordinate and maximum12 (column 4 in the table) as its vertical coordinate in figure 5.15. We then connect thesepoints in order of increasing n to form a polyline. We plot figure 5.16 similarly with nas the horizontal coordinate and the maximum ratio /2/4 (column 5 in table 5.2) asthe vertical coordinate. It should be noted that in figure 5.15 and 5.16, the horizontaland the vertical axes are drawn at different scales. The information conveyed in thesetwo graphs gives us a good visualization of how the secondary reflected intensity changeswhen n varies for a typical scene. However, it should be pointed out that all the data intable 5.2 and figures 5.15 and 5.16 are from a specific scene. When the object, L or Echange, we anticipate different proportions.From the above results, one can see that when n is small (less than 8 to 12), I„and /2 are very strong. Among the four components of /2 , Iss is the most importantcomponent. However, when n increases, its weight decreases sharply, but the Idd termincreases its relative contribution. The distributions of /sd and Ids are fairly stable butstill increase slightly as n increases. When n is greater than 16, the term I ss becomes verysmall. However, the overall reflection /2 is still impressive. When n lies in this range, theterm Idd becomes the heaviest component, Isd the next, Iss the least. When n becomeseven larger (greater than 35), 12 and 121h are very small and tends to be stable. Thisis because its most significant component Idd does not change as n changes. Thereforewhen n > 35, /2 can be neglected although it is still noticeable, since the computationof secondary reflection is very expensive. It takes about 3 to 4 hours to render a sceneas simple as a single disk. To summarize the results presented here, we conclude thatChapter 5. Inter-Reflection^ 58n maximum 498 I maximum /„//, I maximum 12 I maximum hill1 0.207819 0.362343 0.469707 0.5333712 0.164824 0.323570 0.412178 0.5067874 0.117699 0.273994 0.332843 0.4623168 0.071946 0.230949 0.246033 0.39957012 0.050398 0.204543 0.200293 0.35687216 0.038186 0.184313 0.171976 0.32791920 0.030145 0.175941 0.152782 0.30552124 0.024738 0.124271 0.138825 0.28842532 0.016490 0.111017 0.118240 0.26117640 0.011692 0.266447 0.106005 0.24618855 0.009911 0.262630 0.093535 0.22823670 0.007606 0.286665 0.084388 0.22093690 0.007606 0.286665 0.084388 0.220936Table 5.2: Maximum Values for different specular exponentsthe secondary reflection shows strong anisotropy and it can not be simply approximatedby the diffuse term in traditional lighting models. When n is small (less than 20), thesecondary reflected intensity is quite strong and not negligible. When n is large (greaterthan 35), the secondary reflected intensity is very small and thus can be neglected dueto the computational expense. When n is inbetween, accuracy and speed requirementsbecomes important.For cloth surfaces, normally the specular exponent n is relatively small (between 6and 15). Therefore the inter-reflection should be taken into consideration. Due to thelocal geometry of the cloth surface, the inter-reflection consists of two elements: inter-reflected intensity from parallel cylinder segments and that from perpendicular cylindersegments. We use raytracing to test and compare these two elements and find out thatinter-reflected intensity from perpendicular cylinder segments seldom exceeds a quarter ofthe inter-reflected intensity from parallel cylinder segments. Thus we conclude that if weChapter 5. Inter-Reflection^ 59disregard the inter-reflection between perpendicular cylinder segments, and approximatethe total inter-reflection by the inter-reflection between parallel cylinder segments, theerror will not be intolerable. The following pictures in figure 5.17 are rendered withthe analytical solution accounting for inter-reflection. It corresponds to figure 4.5 inchapter 4; the four scenes are in the same order and the object, light and eye for eachscene are the same. We can see that the pictures with inter-reflection look more realistic.However, this is offset by a longer rendering time. Previously about 10 minutes wasrequired to render each of the four pictures without inter-reflection. For the four withinter-reflection, about 40 minutes are required for each.Figure 5.8: Numerical Comparison of Raytracing and Analytical Solution (/„ vs. Is)Chapter 5. Inter-Reflection^ 60Figure 5.9: Numerical Comparison of Raytracing and Analytical Solution (/„//s vs. Is )Chapter 5. Inter-Reflection^ 611 1 23 1 4Image 1: n =1;^Image 2: n=2; Image 3: n=4;^Image 4: n=8;Figure 5.10: A Disk Shaded with Specular Secondary Reflection L s for various specularexponents (to be continued)Chapter 5. Inter-Reflection^ 625Image 5: n =16.Figure 5.10: A Disk Shaded with Specular Secondary Reflection Iss for various specularexponents (continued)Chapter 5. Inter-Reflection^ 6324Image 1: n =1;^Image 2: n=2; Image 3: n=4;^Image 4: n=8;Figure 5.11: A Disk Shaded with Overall Secondary Reflection 12 for various specularexponents (to be continued)Chapter 5. Inter-Reflection^ 645 67Image 5: n =16; Image 6: n=24;^Image 7: n=32.Figure 5.11: A Disk Shaded with Overall Secondary Reflection 12 for various specularexponents (continued)Chapter 5. Inter-Reflection^ 65Figure 5.12: Numerical Comparison of Iss and Is for various specular exponents0.600.500.400.30n=1n=2n=4n=8n=16n=32n=900.200.100.00••---•••1 T 11.000.00 0.600.400.20 0.80Chapter 5. Inter-Reflection^ 6612Figure 5.13: Numerical Comparison of /2 and ./1 for various specular exponentsn= I n='?21%n=4n=8^ n=16^ n=24n=32^ n=55^ n=90Chapter 5. Inter-Reflection^ 67Figure 5.14: Distributions of Iss , Isd, Ids and Idd in /2 for Various specular exponentsChapter 5. Inter-Reflection^ 68Figure 5.15: Variation of Secondary Reflection with Respect to specular exponentChapter 5. Inter-Reflection^ 69Figure 5.16: Variation of /2// i with Respect to specular exponentChapter 5. Inter-Reflection^ 70Image 1: basket weave (eye at (0, -55, 45)); Image 2: basket weave (eye at (-45, 45, 80));Image 3: twill weave (eye at (0, -55, 45);^Image 4: twill weave (eye at (-45, 45, 80)).Figure 5.17: Sample Cloth Images with Inter-reflection AccountedChapter 6Conclusion and Future WorkIn this thesis, we propose a model to simulate the small-scale geometry of cloth anda method to derive the BRDF (Bidirectional Reflectance-Distribution Function) of thismodel from the underlying surface geometry, taking into account the blocking and shad-owing phenomena at the small scale. Sample images of cloth generated with this BRDFlook highly realistic. As a starting point to the inter-reflection problem, we examinethe secondary reflection phenomena for the surface model made of parallel cylinders (asproposed by Poulin and Fournier in [Pou189] [Pou190]) and the model proposed here forcloth. We assume the facets composing the cylinders as phong-like model. Two solu-tions are presented sampling through raytracing and an analytical approximation.The result convinces us that the multiply reflected intensity could be substantial forbumped surfaces with low specular exponent n (less than 20). Therefore inter-reflectionshould be accounted for in the lighting model for these surfaces. Generated cloth imageswith secondary reflection effects included exhibit a higher degree of realism. However,the computation of secondary reflection effects is quite expensive. For some scenes, theadditional cost is several times of that required for computing the direct reflection.The techniques presented can be extended to extract macroscopic reflection behaviourfrom the knowledge of the microscopic geometric structure.For the inter-reflection, there are still many possible extensions and additional worksfor the problem. First of all, a faster computation is highly desired for the analytical71Chapter 6. Conclusion and Future Work^ 72solution. The convergence of the inter-reflection is still unknown. Given that raytrac-ing will be expensive, can we find an analytical solution? In this thesis, we have onlyexamined the secondary reflection on some specific surface models. The inter-reflectionphenomena on different surface geometries (including regular and random) need furtherinvestigation. In our solutions for secondary reflection problem, we assume that themicro-facets composing the cylinders are phong model. As shown in [Lewi93], phongmodel does not satisfy the physical constraints of energy conservation and Helmholtzreciprocity. It will be physically more plausible if we assume that the facets are thosemodels that conserve energy and satisfy reciprocity. It will also be interesting to see thedifference in the rendered results when different models are applied.The approaches presented in this thesis are implemented in a raytracing systems called"optik". How to integrate these algorithms into large rendering software is challenging.In addition, the integration of these approaches into global illumination systems requiresadditional works. We have to adjust our algorithms to make sure they fulfill all thenecessary physical constraints.There is another issue that needs to be addressed, i.e. hierarchy of models. In somecircumstances, only one intermediate level between the macroscopic and the microscopiclevel will not be enough. For example, when one looks at a desert' from an airplane, eachgrain of sand can be thought of comprising the lowest level, or the micro-facets. Thecharacter of these facets could be described by the traditional lighting models in computergraphics. The next higher level corresponds to the scale of grains of sand. The thirdlevel, which corresponds to the pixel level, is the level with scale equivalent to small sanddune. The highest level is the geometric shape of the large region. In this situation, thereare two levels between the microscopic and macroscopic level. Two possible approachesexist. One is to examine all of the four levels from the bottom up to the top, with the full1 0f course, we assume it is not cloudy.Chapter 6. Conclusion and Future Work^ 73cost associated with this. The alternative is to first find a good BRDF for the level rightbelow the pixel level, and thereafter simplify the multiple intermediate levels to only asingle intermediate level.Yes, still have a long way to go ^Bibliography[ANS86] American National Standard, Nomenclature and Definitions for IlluminatingEngineering. Illuminating Engineering Society of North America, 1986.[Bass79] F. G. Bass, and I. M. Fuks. Wave Scattering from Statistically Rough Surfaces.Pergamon Press Ltd., 1979.[Beck63] P. Beckmann, and A. Spizzichino. The Scattering of Electromagnetic Wavesfrom Rough Surfaces. Pergamon, Oxford 1963.[Blin77] J. Blinn. Models of Light Reflection for Computer Synthesized Pictures, Com-puter Graphics, Vol. 11, No. 2, July 1977, pp. 192-198.[Blin78] J. Blinn. Simulation of Wrinkled Surfaces, Computer Graphics, Vol. 12, No. 3,August 1978, pp. 286-292.[Born75] M. Born, and E. Wolf. Principles of Optics. Pergamon, Oxford, 1975.[Burd81] R. L. Burden, J. D. Faires, and A. C. Reynolds. Numerical Analysis. SecondEdition, PWS Publishers, Boston, Massachusetts, 1981.[Cabr87] B. Cabral, N. Max, and R. Springmeyer. Bidirectional Reflection Functionsfrom Surface Bump Maps, Computer Graphics, Vol. 21, No. 4, July 1987, pp.273-281.[Cook81] R. Cook, and K. Torrance. A Reflection Model for Computer Graphics, Com-puter Graphics, Vol. 15, No. 3, August 1981, pp. 307-316. Also in ACM Transac-tions on Graphics, Vol. 1, No. 1, January 1982, pp. 7-24.[Corb79] B. P. Corbman. Textiles: Fiber to Fabric. Canadian Edition. McGraw-Hill,1979.[Four92] A. Fournier. Normal Distribution Functions and Multiple Surfaces, Proceedingsof Graphics Interface'92, In Workshop on Local Illumination (May 1992), pp. 45-52.[Gart92] J. A. Gartaganis. A Wave-based Illumination Model for Computer Graphics,Ph.D thesis, Department of Computing Science, University of Alberta 1992.[Ha1183] R. A. Hall, and D. P. Greenberg. A Testbed for Realistic Image Synthesis, IEEEComputer Graphics and Applications Vol. 3, No. 8, November 1983, pp. 10-20.74Bibliography^ 75[Ha1189] R. A. Hall. Illumination and Color in Computer Generated Imagery. Springer-Verlag, 1989.[He91] X. He, K. E. Torrance, F. X. Sillion, and D. P. Greenberg. A ComprehensivePhysical Model for Light Reflection, Computer Graphics, Vol. 25, No. 4, July 1991,pp. 175-186.[Kaji85] J. T. Kajiya. Anisotropic Reflection Models, Computer Graphics, Vol. 19, No.3, July 1985, pp. 15-21.[Lewi93] R. R. Lewis. Making Shaders More Plausible, submitted to 4th EurographicsConference on Rendering, June 1993.[Max88] N. Max. Horizon Mapping: Shadows for Bump-Mapped Surfaces, The VisualComputer, Vol. 4, 1988, pp. 109-117.[Minn41] M. Minnaert. The Reciprocity Principle in Lunar Photometry, AstrophysicalJournal, Vol. 93, May 1941, pp. 403-410.[Neum89] L. Neumann, and A. Neumann. Photosimulation: Interreflection with Arbi-trary Reflectance Models and Illumination, Computer Graphics Forum, Vol. 8, No.1, March 1989, pp. 21-34.[Phon73] B. Phong. Illumination for Computer Generated Pictures, Communications ofACM, Vol. 18, No. 6, June 1975, pp. 311-317.[Pizz61] J. J. Pizzuto. 101 Weaves in 101 Fabrics. Textile Press, 1961.[Pizz87] J. J. Pizzuto. Fabric Science. Fifth Edition, Fairchild Publications, 1987.[Pou189] P. Poulin. Anisotropic Reflection Models, M.Sc thesis, Department of ComputerScience, University of Toronto 1989.[Pou190] P. Poulin, and A. Fournier. A Model for Anisotropic Reflection, ComputerGraphics, Vol. 24, No. 4, August 1990, pp. 273-282.[Sieg81] R. Siegel, and J. Howell. Thermal Radiation Heat Transfer, Second Edition,Hemisphere, 1981.[Tai192] F. Taillefer. Fast Inverse Displacement Mapping and Shading in Shadow, Pro-ceedings of Graphics Interface'92, In Workshop on Local Illumination (May 1992),pp. 53-60.[Torr67] K. Torrance, and E. Sparrow. Theory of Off-specular Reflection from RoughedSurfaces, Journal of the Optical Society of America, Vol. 57, No. 9, September1967, pp. 1105-1114.Bibliography^ 76[Tort87] P. G. Tortora. Understanding Textiles. Third Edition, Macmillan, 1987.[Trow75] T. Trowbridge, and K. Reitz. Average Irregularity Representation for aRoughed Surface for Ray Reflection, Journal of the Optical Society of America,Vol. 65, No. 5, May 1975, pp. 531-536.[West92] S. H. Westin, J. R. Arvo, and K. E. Torrance. Predicting Reflectance Functionsfrom Complex Surfaces. Computer Graphics, Vol. 26, No. 2, July 1992, pp. 255-264.[Wing84] I. B. Wingate, and J. F. Mohler. Textile Fabrics and Their Selection. EighthEdition, Prentice-Hall, 1984.[Yasu92] T. Yasuda, S. Yokoi, J. Toriwaki, and K. Inagaki. A Shading Model for ClothObjects, IEEE Computer Graphics and Applications, Vol. 12, No. 6, November1992, pp. 15-24.
- Library Home /
- Search Collections /
- Open Collections /
- Browse Collections /
- UBC Theses and Dissertations /
- Local illumination models from surface geometry microform
Open Collections
UBC Theses and Dissertations
Featured Collection
UBC Theses and Dissertations
Local illumination models from surface geometry microform Huo, Gang 1993
pdf
Page Metadata
Item Metadata
Title | Local illumination models from surface geometry microform |
Creator |
Huo, Gang |
Date Issued | 1993 |
Description | In this thesis, we propose a model to simulate the small-scale geometry of cloth and develop a method to derive the BRDF (Bidirectional Reflectance-Distribution Function) of this model from the underlying surface geometry, taking into account the blocking and shadowing phenomena at the small scale. Sample images of cloth generated with this BRDF look highly realistic. As a starting point to the inter-reflection problem, we examine the secondary reflection phenomena on the surface model made of parallel cylinders (as proposed by Poulin and Fournier) and the model proposed here for cloth. Two solutions are presented sampling through raytracing and an analytical approximation. The results convincingly indicate that the intensity from multiply reflected light could be substantial for bumped surfaces with low specular exponent n. Therefore inter-reflection should be accounted for in the lighting model for these surfaces. Generated cloth images including secondary reflection effects exhibit a higher degree of realism. The computation of secondary reflection effects is however quite expensive. The techniques presented can be extended to extract macroscopic reflection behaviour from the knowledge of the microscopic geometric structure. |
Extent | 12140829 bytes |
Genre |
Thesis/Dissertation |
Type |
Text |
FileFormat | application/pdf |
Language | eng |
Date Available | 2008-09-15 |
Provider | Vancouver : University of British Columbia Library |
Rights | For non-commercial purposes only, such as research, private study and education. Additional conditions apply, see Terms of Use https://open.library.ubc.ca/terms_of_use. |
IsShownAt | 10.14288/1.0051246 |
URI | http://hdl.handle.net/2429/1992 |
Degree |
Master of Science - MSc |
Program |
Computer Science |
Affiliation |
Science, Faculty of Computer Science, Department of |
Degree Grantor | University of British Columbia |
GraduationDate | 1993-05 |
Campus |
UBCV |
Scholarly Level | Graduate |
AggregatedSourceRepository | DSpace |
Download
- Media
- 831-ubc_1993_spring_huo_gang.pdf [ 11.58MB ]
- Metadata
- JSON: 831-1.0051246.json
- JSON-LD: 831-1.0051246-ld.json
- RDF/XML (Pretty): 831-1.0051246-rdf.xml
- RDF/JSON: 831-1.0051246-rdf.json
- Turtle: 831-1.0051246-turtle.txt
- N-Triples: 831-1.0051246-rdf-ntriples.txt
- Original Record: 831-1.0051246-source.json
- Full Text
- 831-1.0051246-fulltext.txt
- Citation
- 831-1.0051246.ris
Full Text
Cite
Citation Scheme:
Usage Statistics
Share
Embed
Customize your widget with the following options, then copy and paste the code below into the HTML
of your page to embed this item in your website.
<div id="ubcOpenCollectionsWidgetDisplay">
<script id="ubcOpenCollectionsWidget"
src="{[{embed.src}]}"
data-item="{[{embed.item}]}"
data-collection="{[{embed.collection}]}"
data-metadata="{[{embed.showMetadata}]}"
data-width="{[{embed.width}]}"
async >
</script>
</div>
Our image viewer uses the IIIF 2.0 standard.
To load this item in other compatible viewers, use this url:
http://iiif.library.ubc.ca/presentation/dsp.831.1-0051246/manifest