Steve Marschner CS5625 Spring 2019 Predicting Reflectance Functions from Complex Surfaces
Total Page:16
File Type:pdf, Size:1020Kb
08 Detail mapping Steve Marschner CS5625 Spring 2019 Predicting Reflectance Functions from Complex Surfaces Stephen H. Westin James R. Arvo Kenneth E. Torrance Program of Computer Graphics Cornell University Ithaca, New York 14853 Hierarchy of scales Abstract 1000 macroscopic Geometry We describe a physically-based Monte Carlo technique for ap- proximating bidirectional reflectance distribution functions Object scale (BRDFs) for a large class of geometriesmesoscopic by directly simulating 100 optical scattering. The technique is more general than pre- vious analytical models: it removesmicroscopic most restrictions on sur- Texture, face microgeometry. Three main points are described: a new bump maps 10 representation of the BRDF, a Monte Carlo technique to esti- mate the coefficients of the representation, and the means of creating a milliscale BRDF from microscale scattering events. Milliscale These allow the prediction of scattering from essentially ar- (Mesoscale) 1 mm Texels bitrary roughness geometries. The BRDF is concisely repre- sented by a matrix of spherical harmonic coefficients; the ma- 0.1 trix is directly estimated from a geometric optics simulation, BRDF enforcing exact reciprocity. The method applies to rough- ness scales that are large with respect to the wavelength of Microscale light and small with respect to the spatial density at which 0.01 the BRDF is sampled across the surface; examples include brushed metal and textiles. The method is validated by com- paring with an existing scattering model and sample images are generated with a physically-based global illumination al- Figure 1: Applicability of Techniques gorithm. CR Categories and Subject Descriptors: I.3.7 [Computer model many surfaces, such as those with anisotropic rough- Graphics]: Three-Dimensional Graphics and Realism. ness. Models that deal with anisotropic surfaces [8, 11] fail to spherical harmonics, Monte Carlo, Additional Key Words: assure physical consistency. anisotropic reflection, BRDF This paper presents a new method of creating local scat- tering models. The method has three main components: a concise, general representation of the BRDF, a technique to 1 Introduction estimate the coefficients of the representation, and a means of using scattering at one scale to create a BRDF for a larger Since the earliest days of computer graphics, experimenters scale. The representation used makes it easy to enforce the ba- have recognized that the realism of an image is limited by sic physical property of scattering reciprocity, and its approx- the sophistication of the model of local light scattering [3, 12]. imation does not require discretizing scattering directions as Non-physically-based local lighting models, such as that of in the work of Kajiya [8] and Cabral et al. [1]. Phong [12], although computationally simple, exclude many The method can predict scattering from any geometry that important physical effects and lack the energy consistency can be ray-traced: polygons, spheres, parametric patches, needed for global illumination calculations. Physically-based and even volume densities. Previous numerical techniques models [2, 5, 15] reproduce many effects better, but cannot were limited to height fields, and analytical methods have been developed only for specific classes of surface geome- try. The new method accurately models both isotropic and anisotropic surfaces such as brushed metals, velvet, and wo- Permission to copy without fee all or part of this material is granted ven textiles. provided that the copies are not made or distributed for direct commercial advantage, the ACM copyright notice and the title of the Figure 1 shows several representations used in realistic ren- publication and its date appear, and notice is given that copying is by dering, along with approximate scale ranges where each is permission of the Association for Computing Machinery. To copy applicable. At the smallest scale (size 1 mm), which we call otherwise, or to republish, requires a fee and/or specific permission. microscale,theBRDFaccuratelycapturestheappearanceofa 1992 ACM-0-89791-479-1/92/007/0255 Displacement and Bump/Normal Mapping Mimic effect of geometric detail/meso geometry • Also detail mapping Geometry Bump Displacement mapping mapping Displacement Mapping Pnew = Pold + DM(u)* N • p0(u, v)=p(u, v)+h(u, v)n(u, v) Displacement in vertex shader Displacement Maps Pros • Gives you very complex surfaces Cons • Gives you very complex surfaces • Or boring with small numbers of vertices Relationship with tesselation shaders [wikiwand] Original Tesselated Displacement Mapped Bump mapping “Simulation of Wrinkled Surfaces” Blinn 78 Blinn: keep surface, use new normals Normals in displacement mapping • Displacement changes the surface normal, depending on: – derivative of height function – orientation of texture coordinates – speed of texture coordinates normals unchanged displaced surface constant height function normals tilted displaced surface varying height function Cornell CS4620 Fall 2018 • Lecture 15 © 2017 Steve Marschner • 10 How to change the normal? First, need some frame of reference • Normal is modified with respect to that • Have tangent space basis: t and b • Normal, tangent and bitangent vectors Geometry for displacement • geometric inputs – u tangent (unnormalized) as vertex attribute – v tangent (unnormalized) as vertex attribute – height field as a texture • vertex stage – compute displaced vertex position – look up displacement value from texture – compute normal to displaced surface (or compute them ahead of time – compute derivatives of height by finite differences and store height and derivatives in a – add offset to the base surface tangents 3-channel texture) – normalized cross product is the shading normal • fragment stage: just compute shading Cornell CS4620 Fall 2018 • Lecture 15 © 2017 Steve Marschner • 12 Bump Mapping Alter normals of surface • Only affects shading normals Also, mimics effect of small scale geometry • Detail map • Except at silhouette • Adds perceived bumps, wrinkles 4. DEPENDANCE ON SCALE X(u,v) = u Y(u,v) = v One feature of the perturbation calculation Z(u,v) = 0 is that the perturbation amount is not invariant with the scale at which the object is drawn. If For this patch the original normal vector the X, Y, and Z surface definiton functions are perturbation gives scaled up by 2 then the normal vector length, INI, scaled up by a factor of 4 while the N = (0,0,1) perturbationszn pamount,le results IDI,that iscan onlybe acscaledhieved wbyith 2.this D = (-Fu,-Fv,0) This effectte chisniq uduee. toT hethe fi rsfactt pa tthattern, thea h anobjectd drawn isunit tan+ = sqrt(Fu'+Fv') cell of bricks was mapped onto the sphere on the being scaledcov er.but the displacement function F is not. (Scale changes due to the object moving Here the value of a is purely a function of F. nearer or farther from the viewer in perspective Use of the same function for arbitrary patches space do not affect the size of the wrinkles, only corresponds to a perturbation of scale shanges applied directly to the object.) The net effect of this is that if an object is scaled a = sqrt(Fu'+Fv.') up, the wrinkles flatten out. This is illustrated D' = a D lNl/lDl in figure 9. N" = N + D' The texture defining function F is now no longer being used as an actual displacement added to the position of the surface. It just serves to provide (in the form if its derivatives) a means of defining the rotation axis and angle as norma l stretched functions of u and v. Figure 9 - stretched Bump Texture 5 . ALIASING In an earlier paper 121, the author described This effect might be desirable for some the effect of aliasing on images made with color applications but undesirable for others. A scale texture mapping. The same problems can arise with invariant perturbation, D', must scale at the same this new form. That is, undesirable artifacts can rate as N. An obvious choice for this is enter the image in regions where the texture pattern maps into a small screen region. The D' = a D INI/IDI solution applied to color textures was to average the texture pattern over the region corresponding 50 ID’1 = a INI to each picture element in the final image. The bump texture definition function, however, does where a is independent of scales in P. The value not have a linear relationship to the intensity of of a is then the tangent of the effective rotation the final image. If the bump texture is averaged angle. the effect will be to smooth out the bumps rather than average the intensities. The correct tan+' = ID'l/lNl = a solution to this problem would be to compute the intensities at some high sub-pixel resolution and This can be defined in variousBump ways. mappingOne simple average them. Simply filtering the bump function choice is a generalization from the simple, flat can,- however,-. reduce the more offensive artifacts unit square patch o f aliasing. Figure 10 shows the result of such an operation. FigureFi gA-ure Hand8 DrawnHand D Bumprawn FuntionsFunctions [Blinn 1978] Before After : Figure 10 - Filtering Bump Texture 291 Bump Mapping Bump mapping Displacement mapping is expensive • requires densely tessellated geometry • many triangles to rasterize For small displacements, the most important effect is on the normal • so just do that part; don’t displace the surface Bump mapping is then a fragment operation • doesn’t require dense tessellation • doesn’t actually displace the surface • gives shading that looks just like displaced surface Bump Mapping Bump mapping Geometric