DESIGN Pi2inciples of HARDWARE-BASED PHONG SHADING and BUMP-MAPPING

DESIGN Pi2inciples of HARDWARE-BASED PHONG SHADING and BUMP-MAPPING

Comput. & Graphics, Vol. 21, No. 2, pp. 143-149, 1997 0 1997 Elsevier Science Ltd. All rights reserved Printed in Great Britain 0097*493/97 s17.oo+o.oo PII: s0097-8493@6)00077-5 Graphics Hardware DESIGN Pi2INCIPLES OF HARDWARE-BASED PHONG SHADING AND BUMP-MAPPING K. BENNEBROEK’, I. ERNST’, H. RUSSELER2 and 0. WITTIG2+ ‘Department of Electrical Engineering, Networking Theory Group, University of Twente, Twente, The Netherlands *German National Research Center for Computer Science,Institute for Computer Architecture and Software Technology (GMD FIRST), Rudower Chaussee 5, 12489Berlin, Germany e-mail: [email protected] Abstract-The VISA+ hardwarearchitecture is the first of a new generationof graphicsaccelerators designedprimarily to renderbump-, texture-, environment- and environment-bump-mappedpolygons. This paperpresents examples of the maingraphical capabilities and discusses methods and simplifications usedto createhigh quality images.One of the key conceptsin the VISA + design,the useof reflectance cubes,is predestinedfor environmentmapping. In combinationwith bump-and texture-mapping it shows the strengthof our new architecture.Furthermore it justifiessome of the decisionsmade during simulationand developmentof the complexVISA+ architecture.0 1997Elsevier Science Ltd 1. INTBODUCI’ION interpolation approach can be important if diffuse Even the fastest high quality graphics workstations intensitiesare calculatedon an incremental basis. like the recently announcedInfiniteReality@ graphics The normal-vector shading approach of the acceleratorsare still basedon common texturing in GMD-FIRST is a reflection map method. This combination with Gouraud shading. With continu- shadingtechnique, implemented in the VISA system ously improving VLSI technologiesin combination [5l operatesin a similar way to the reflection-vector with CAD tools to support full custom chip design, shadinghardware of Voorhies and Foran [6], new graphic architectures must evolve. As an A logical extension of the normal vector inter- important step towards higher realism, real-time polation principle was to support bump-mapping[9]. Phong shading will be the next technology-pushin Bumps improve visual effects for low-end game, as computer graphics. well as high-end VR applications.A combination of Over the past few decades,many attempts have texture and bump-mapsfor extremely perspective been made, to make Phong shadingpracticable for and huge polygons reduces the total setup- and hardware implementation. Bishop and Weimar [1] transfer-timefor computer graphicsscenes. proposed a Taylor seriesapproximation for N.H. In this paper, the quality aspectsof homogeneous For a curvature lessthan 60”, forward differencinga versus non-homogeneousinterpolation for Phong quadratic polynomial fits quite well and reducesthe shading,bump-mapping, environment and environ- computational efforts to five additions per pixel. ment bump-mapping,will be discussed.Focusing on Deering [2] presenteda shaderthat interpolatesthe efficient division schemesfor perspective texturing normal and eye vectors. In both approaches, and cube-reflectancemapping, a proposedhardware exponentiation of the cosine function was done by architecture is discussedin more detail. table lookup, which leads to intolerable hardware size if a broad range of exponentsis to be supported. 2. BASIC FUNDAMENTALS Another method usesangular interpolation tech- 2.1. Phongshading niquesrather than vector interpolation. This has the Phong Illumination was introduced by Tong Bui advantagethat the vector length remainsunchanged Phong in 1975[7] as an empirical model to simulate during the interpolation. This way, normalization highlights on shiny surfaces.The model has been can be reduced to vectors at the vertices and acceptedas a very good approximation of physical calculatedin software. While an approach suggested highlights. Phong introduced a specular exponent, by U. Clausen [3] interpolates polar angles,Kuijk reflecting material properties,and modelledthe steep and Blake [4] expand this principle to angular falloff of the highlight as the cosine of the angle interpolation on great-circles.The resulting expres- between the eye-vector and reflected light-vector, sions,however, are rather complicated.The angular raisedto the specularexponent. For the implementa- tion of Phong Illumination on a per pixel basis,the normal vector has to be interpolated over a polygon. Normal vector interpolation shadersare therefore + Author for correspondence. called Phong shaders,in contrast to the commonly 143 144 K. Bennebroek,1. Ernst, H. Riisselerand 0. Wittig used Gouraud shadersthat interpolate color-values over the polygon (that may have been calculated using Phong Illumination!). Phong’s Illumination model consists of an ambient, a diffuse and a Note the additional BumpMorph parameterwhich specularcomponent, resulting in: is used to control the amplitude of the bump perturbation (length of P). Since this parameter is I=a+~(d(N.L)+s(R.E)“) (1) constant over the polygon, it can be included in the I matrix A. This way, Equation (3) can be simplifiedto: for all lightsourcesi in the scene,with a, d and s ambient, diffuse and specular column-vectors (R,G,B)= respectively to depict material and light- source properties. N depicts the surface normal To convert Pi from WC to ScreenSpacewe need vector, L the vector pointing from the point on the two multiplications for each of its componentsby i surface to the light source,R the mirrored vector of However, in Section 3.2 we explain why we have to L around N (reflected light vector) and E the calculate the reflected ray in WC instead of Screen- reflected eye vector. All vectors need to be normal- Space coordinates. Hence we must convert the ized. normal N from ScreenSpaceto WC too. This is done by three divisions (i). 2.2. Bump-mapping The resulting formula, which is implemented in In 1974, Blinn [8] developed a technique that our hardware, then becomes: enables a surface to appear wrinkled or dimpled N’=N+[A.P] (5) without the need to model this roughnessgeome- trically. Note that N is generated by interpolating the For this purpose,he defined a specialtexture map normalized edge normal vectors of the triangle. called bump-map B(u,v) containing displacementor Hence N is unnormalized inside the triangle which height values to perturb the local normal vector. The leads to small highlight shifts on the surface. This perturbed normal vector is given asN’= N+ D where artifact can not be recognizedbecause there are no D is the perturbation vector. To calculate D, he color differencesnear the edgesof adjacent triangles defined two other vectors lying in the tangent plane [91. of the surface given by N. Thesevectors are defined The alignment matrix A can be used not only to as A=NxO, and B=NxO,, where O(u,v) is a get the correct perturbation vector, but also to parametrized function representing the position rotate, stretch, mirror or shorten the perturbation vectors of point 0 on the surface. Then, the vectors for one triangle. componentsof D are given by A = B,A- B$, This way, he defined a bump-map function as a displace- ment but uses its derivatives at the point (u,v) to calculate D. D can be better expressedby 3.2. Hardware reflected ray Basedon the M*L model [IO], with homogeneous D = B,(N x 0,) - B,(N x 0,) (2) eye vector B = E and surfacenormal vector x = $ _ the homogeneous reflected ray in ScreenSpace where N/IN] is written as N. coordinatesleads to 3. SIMPLIFICATIONS 7l = [r,rYrz] 3.1. Hardware bump-mapping Hardware bump-mapping needs to be much = 2N(NE) - (NN)E simplerthan the classicalapproach [Equation (2)]. Instead of constructing a perturbation vector out of local derivatives which have to be defined, we already store it in the bump-map. Since we inter- (6) polate the normal over one triangle, we already have the tangent plane of the surface.Given the perturba- tion vector Pi = [AuAvlT in WC, we might construct = ~[r,r,r,] = 2--$N(NE) - -!-(NN)Ew3 the resulting normal vector as N= N+ P. To guarantee a perturbation in the direction O,, 0, of the tangent plane at point i, we have to align the = $(2N(NE) - (NN)E) = -$R texture coordinate systemu, v, w to the tangent plane system0,, 0,, N. This transformation is done by an Sincecalculating R in ScreenSpaceleads to higher alignment matrix A. Then the resulting normal precision multipliers and adders (extra bits for vector becomes N’= N+ A.P. Since we have a homogeneouscomponent), we convert E and N to homogeneousinterpolated normal vector, the equa- WC to reducethe overall gate-costsfor the Reflected tion expands to Ray Unit. Hardware-based Phong shading and bump mapping 145 3.3. Hardware Phong 3.3.2. Using DirectPhong@ (VISA+). The com- There are two ways to calculate the color mon problem for designersof hardware shadersis contribution of each lightsource. the exponentiation in the Phong formula. Gouraud 3.3.1. Using reflection maps (VISA). N and R are Shaderscalculate the intensitieson polygon-vertices used as an index into the diffuse and specular in software and interpolate these RGB values to reflection map respectively. producepixelvalues. The flaw in this approach is that Diffuse: no real, focused highlights can be achieved if the highlight lies within a polygon. This reduces the [wynz] + max { Inxll~yllnrl}, &+wynz) realismof the renderedscene. Attempts to implement Phong shading all use table lookups for the MapAddress = [cl,a,,] = exponentiation. This resultsin intolerable hardware sizes if different exponent

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    7 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us