Direct Volume Rendering with Shading via Three-Dimensional Textures Allen Van Gelder Kwansik Kim Baskin Center for Computer Engineering and Computer Science University of California Santa Cruz , CA 95064 USA E-mail : avg@cse.ucsc.edu, ksk@cse.ucsc.edu UCSC?CRL ? 96 ? 16 July 19 , 1996 Abstract A new and easy-to-implement method for direct volume rendering that uses 3D texture maps for acceleration , and incorporates directional lighting , is described . The implementation , called Voltx , produces high-quality images at nearly interactive speeds on workstations with hardware support for three-dimensional texture maps . Previously reported methods did not incorporate a light model , and did not address issues of multiple texture maps for large volumes . Our research shows that these extensions impact performance by about a factor of ten . Voltx supports orthographic , perspective , and stereo views . This paper describes the theory and implementation of this technique , and compares it to the shear-warp factorization approach . A rectilinear data set is converted into a three-dimensional texture map containing color and opacity information . Quantized normal vectors and a lookup table provide efficiency . A new tesselation of the sphere is described , which serves as the basis for normal-vector quantization . A new gradient-based shading criterion is described , in which the gradient magnitude is interpreted in the context of the field-data value and the material classification parameters , and not in isolation . In the rendering phase , the texture map is applied to a stack of parallel planes , which effectively cut the texture into many slabs . The slabs are composited to form an image . Note : This report appears in Proceedings of ACM/IEEE Symposium on Volume Visualization , San Francisco , Oct. , 1996 , except for the following modifications . The appendix of this report does not appear in the proceedings . References to the appendices are replaced by references to this report , in the proceedings . The proceedings includes 1/2 page of color images that are not included in the report , as distributed electronically . The color images are available separately from the authors . 1 Introduction Rendering speed has always been a major problem in direct volume rendering , because all regions of the volume may contribute to the image , and because new orientations generally require considerable re-computation . A spectrum of methods offering different combinations of rendering speed versus image quality have been presented -LSB- DCH88 , Sab88 , UK88 , Lev88 , Kru90 , Lev90a , MHC90 , Wes90 , LH91 , Lev92 -RSB- . Image-order algorithms like ray casting produce superior quality images , but have to traverse the data structure redundantly -LSB- Lev90b , DH92 -RSB- . Some object-order methods use hardware-assisted Gouraud-shading capabilities to accelerate rendering , by calculating the projections of volume regions and treating them as polygons -LSB- ST90 , LH91 , WVG91 , Wil92 , VGW93 , WVG94 -RSB- . Shear-warp factorization methods have been developed for parallel volume rendering -LSB- CU92 , SS92 -RSB- , and serial -LSB- LL94 -RSB- . The method of this paper is compared with shear-warp in Section 4 . This paper presents a new method for direct volume rendering , called Voltx , that takes advantage of hardwareassisted , 3D texture mapping , and incorporates a light model . We have found Voltx to be significantly faster than the hardware-assisted Gouraud-shading method -LRB- called coherent projection -RRB- , and comparable in speed to the shear-warp algorithm of Lacroute and Levoy -LRB- called LL -RRB- when comparable imaging options are selected . Whenever one voxel does not cover too many pixels , Voltx produces images comparable to ray-casting . Perspective projections , which are essential for comfortable stereographic viewing , do not degrade the performance . A stereo interface has been implemented . Voltx is robust in the sense that it is able to produce images of good quality even though the transfer function has high frequencies or discontinuities . Also , rotations of the volume do not introduce artifacts , and perspective projections do not degrade the performance . All of these problems were reported for LL by Lacroute and Levoy -LSB- LL94 -RSB- . Their paper suggests ways to get around some of the problems . Some limitations of Voltx are the restriction to rectilinear volumes , the need to redefine 3D texture maps whenever the volume is viewed from a new rotation , and the fact that color , not data , is loaded into texture memory . The first limitation may be inherent in the method . The latter limitations apply only when directional lighting is chosen , but such lighting is usually needed to obtain informative images . They might be addressed as described in Section 3.3 . Several other papers describe the use of 3D texture-mapping hardware for direct volume rendering . Akeley briefly mentioned the possibility for the SGI Reality Engine -LSB- Ake93 -RSB- . Cullip and Neumann sketch two approaches , which they call object space -LRB- somewhat related to shear-warp -RRB- and image space , and apply them to CT data -LSB- CN93 -RSB- . Guan and Lipes discuss hardware issues -LSB- GL94 -RSB- . Cabral , Cam and Foran describe how to use texture-mapping hardware to accelerate numerical Radon transforms -LSB- CCF94 -RSB- . All of the methods described in these papers require substantial programming to ? hand compute ? transformations , clipping , and the like , details of which are omitted . Wilson et al. . reported on an earlier version of Voltx -LSB- WVGW94 -RSB- . To our knowledge no previously reported 3D texture-map method addresses either shading with a light model or the necessity of multiple texture maps for large volumes . Our research shows that these extensions impact performance by about a factor of ten . After a quick overview in Section 2 , this paper describes how most of the technical programming used by previously reported 3D texture-map methods can be eliminated by use of graphics library procedures to perform texture space transformations and set clipping planes -LRB- Section 3.2 -RRB- . A new method to judge which voxels are on a material boundary within the volume , for shading purposes , is described in Section 3.1.2 . We also present a software look-up table technique with quantized gradients -LRB- actually , normal vectors -RRB- , which makes our rendering technique nearly interactive , while providing excellent image quality -LRB- Section 3.1.3 -RRB- . A new tesselation of the sphere is described , which serves as the basis for normal-vector quantization -LRB- Section 3.1.4 -RRB- . Section 4 compares Voltx to shear-warp factorization . Experimental results are reported in Section 5 . Conclusions and future directions are discussed in Section 6 . Additional details are available in the appendices . Figure 1 : Slices through the volume in original orientation -LRB- left -RRB- , and rotated -LRB- right -RRB- . The viewer 's line of sight is orthogonal to the slices . In both orientations , texture coordinates are assigned to corners of the square slices in such a way that they interpolate into the range -LSB- 0 ; 1:0 -RSB- exactly when they are within the volume . 2 Overview of 3D Texture-Map Technique In an initial step , the quantized gradient index and material classification of each voxel in the volume are computed . A voxel may be classified as either reflecting or ambient , depending on the client-supplied gradient-magnitude threshold . -LRB- If this threshold is modified , the voxels must be reclassified . -RRB- The result of this step is an index for each voxel into the lookup table described next . Whenever a new orientation of the volume or new light position is specified by the client , a software lookup table is created that assigns , for each combination of quantized gradient 1 and reflecting material , the appropriate color and opacity -LRB- RGBA -RRB- . Color and opacity are calculated to account for depth integration . Color calculations for ambient material are also performed , but they are independent of the gradient , and consume negligible time . Thus the size of the lookup table is effectively the product of the number of quantized gradients and the number of reflecting materials , and is independent of the size of the volume . References to ? color ? generally mean color and opacity in the ensuing discussion . With the pre-assigned look-up table index of each voxel , 3D texture maps are filled with pre-computed color values , one ? texel ? per volume voxel . While this work is proportional to the size of the volume , it involves only few integer operations from one array to another , per voxel . The preceding steps are easily parallelizable in a MIMD shared-memory environment . However , transferring the texture maps into texture memory , which uses the graphics pipeline , is not parallelizable . Limits on texture memory force large volumes to be partitioned into multiple texture maps . These texture maps are then processed in the back-to-front visibility order of the partitions of the volume that they represent . Each one is applied to many parallel planes , which make slices through the texture -LRB- see Figure 1 -RRB- . Each plane , orthogonal to screen-z , is rendered as a square , so texture coordinates need be specified only at its four corners . Whenever the lighting model changes or the client 's viewing direction changes , the lookup table entries are updated and the texture map is redefined . In 3D texture mapping , each polygon vertex is given a point in the texture space , and the graphics system maps values from the texture map onto the polygon surface by interpolating texture coordinates . This is very similar to Gouraud shading except that texture coordinates are being interpolated instead of colors . The crucial difference is that texture coordinates outside of the range -LSB- 0 ; 1:0 -RSB- are still interpolated , whereas such colors would be clamped . The corners of the squares have out-of-range texture coordinates , but interpolation creates in-range values precisely when the pixel is within the volume . 1We shall refer to ? quantized gradients ? although only the direction is quantized , and not the magnitude . The squares are parallel to the projection plane in screen space , while the 3D texture map can be oriented as the client desires . More squares at thinner spacing , up to a point , give better image quality , while fewer give greater speed . The major advantage of this method is that after the original data is converted into 3D texture maps , the Reality Engine 's specialized texture hardware can perform the rendering and compositing of squares very quickly . While few graphics workstations offer 3D texture mapping in hardware at present , we believe it will become more common , providing a quick and simple direct volume rendering method for rectilinear data . 3 Detailed Description of Voltx The two major steps in Voltx are : first , create the texture map -LRB- Section 3.1 -RRB- ; and second , render the slices -LRB- Section 3.2 -RRB- . Frequencies of these steps is discussed in Section 3.3 . 3.1 Creating the Texture Map The texture-map calculations have several parts , which are triggered by different events . Voxel classification occurs when the transfer function or certain gradient parameters change ; a lookup table is recalculated when the volume rotation changes , or the light position changes ; the texture map is filled whenever any of the above events occur . This description assumes directional lighting is in effect . For ambient light only , faster alternatives exist -LRB- Section 3.3 -RRB- . Each texture-map entry , or ? texel ? , corresponds to one voxel . Its color is the sum of ambient and reflecting components . The ? ambient ? component is based on the traditional ? luminous gas ? model used in direct volume rendering . The reflecting component is based on a surface responding to directional light , and only applies at parts of the volume judged to represent the boundary surface between different materials . Details are spelled out below . 3.1.1 Ambient Light Component We interpret each plane to be rendered as being at the center of a slab -LRB- slice with thickness -RRB- through the data . This means that each plane must contribute the color intensity and opacity due to one such slab . The thickness of every slab , D , is just the total distance covered by the stack of planes divided by the number of planes . Let D be the slab thickness . Let E -LRB- p -RRB- denote the color emission per unit distance , for each primary color p , and let A1 denote opacity per unit distance . These values are computed at each voxel of the volume based on the client-supplied classification function and transfer function . The color C -LRB- p -RRB- and opacity A that must go into the texture map are computed by now-standard methods -LSB- WVG91 , VGW93 -RSB- . Briefly , the formulas are : = ln ? 1 1 ? A1 ? C -LRB- p -RRB- = E -LRB- p -RRB- ? 1 ? e ? D D ? A = 1 ? e ? D where p ranges over Red , Green and Blue . Note that C is well-defined as approaches 0 , by taking a power series expansion . This equation expresses the integration of color and opacity through the thickness of the slab , without considering the shading model , and is applied to both ambient and reflecting materials . For perspective viewing , the effective slab thickness increases slightly with the off-axis angle . Our implementation ignores this effect , which is at most 4 % on the periphery of the image , for normal viewing geometry with a 600-pixel window width -LRB- about 15 cm . -RRB- and viewing distance 70 cm . The error can increase to 14 % for a 1000-pixel window width . One way to compensate for this variation is to render concentric spherical shells , rather than planes . The spherical tesselation technique of Section 3.1.4 is suitable for generating the triangles . 3.1.2 Reflecting Surface Classification A voxel is considered to be reflecting material when it is judged to be ? near ? the boundary of a volume segment composed of that material , based on the range of field values for that material , and the gradient of the field function . Example 3.1 : Consider a CT data set with unit spacing between voxels , in which bone is considered to be 110 and greater densities . Suppose a voxel 's data is 114 , and the gradient magnitude is 10 . We estimate that the bone boundary is 0.4 units from the location of this voxel , traveling in the direction of the negative gradient . If the voxel spacing is 1 unit , we judge the voxel to be on the boundary of bone , and classify it as reflecting material . However , if the voxel 's data is 130 , even though the gradient magnitude is still 10 , we judge that that neighboring voxels are also bone . Thus , this voxel is not considered to be on the surface , and we classify it as ambient material . Given a voxel at location ? q0 , with data value d , and gradient vector , an approximate model of the field function in its neighborhood is ? f -LRB- ? q -RRB- = d + ? -LRB- ? q ? ? q0 -RRB- Let b be the lower limit of the range of data that is classified as the same material as d. -LRB- In the example , b was 110 . -RRB- Let ? D be the inter-voxel spacing . Based on this linear approximation , one of the 26 neighboring voxels has data below b if and only if -LRB- d ? b -RRB- < s , where s = ? Dxj xj + ? Dy j yj + ? Dzj z j Let us call the quantity s the cell-diagonaldata shift . A similar test applies for the upper boundary a , using -LRB- a?d -RRB- < s . When s is near the value of -LRB- d ? b -RRB- or -LRB- a ? d -RRB- , we can assign a ? probability ? of being on the boundary , instead of making a binary decision , to allow for noise in the gradient and nonlinearity of the field function . In the implementation , when s < = :5 -LRB- d ? b -RRB- , the ? probability ? is set to 0 , and it increases linearly to become 1 when s = 1:5 -LRB- d ? b -RRB- . The client can fine tune the classification by means of a scaling factor to be applied to this probability function , causing either more or fewer voxels to be judged to be on a surface with some nonzero ? probability ? . The final shading for the voxel combines the ambient and reflecting colors and opacities according to the ? probability ? . Thus the gradient magnitude is interpreted in the context of the data value and the classification parameters , and not in isolation , departing from earlier work -LSB- Lev90a , LL94 -RSB- . 3.1.3 Reflected Light Component As mentioned , for each combination of quantized gradient and material , the material 's surface response to directional lights is calculated , added to the ambient component , and stored in a lookup table . Our implementation uses the ? half-way vector ? specularity model -LSB- TM67 , CT82 -RSB- , as well as Lambertian diffuse shading . Gradient quantization is discussed in Section 3.1.4 . The resulting color intensities , clamped if necessary , are real numbers in the range -LSB- 0 ; 1:0 -RSB- where is black and 1.0 is full color . These floating point values must be converted to integers in an appropriate range , and packed into a 32-bit or 64-bit texture-map entry , for storage immediately in the lookup table , and eventually in the texture map . Let the client have specified : ffl m as the number of materials ; ffl k as the number of refinement levels for quantized gradients , as described in Section 3.1.4 ; then ffl g = 30 ? 4k + 2 is the number of quantized gradients . The lookup table will have -LRB- m + 1 -RRB- ? g entries which are possible combinations of materials and gradients . Material is the null material ; however its places in the lookup table are used to store colors for ambient materials , which need not be combined with a gradient index . dLxds -LRB- - d/2 -RRB- s -LRB- d/2 -RRB- Figure 2 : Geometry of Texture Coordinates . This illustrates an orthographic projection of a 3-D volume of size -LRB- Lx ; Ly ; Lz -RRB- and the bounding cube of side d. Sides Ly and Lz are not labeled . The long diagonal through the volume is length d = -LRB- L2x + L2y + L2z -RRB- 12 . In the setup procedure , each voxel 's material index M is classified and its field gradient is calculated . If the voxel has reflection properties , according to the criteria of Section 3.1.2 , then the quantized gradient index G is determined by finding the closest available quantized gradient . The voxel 's final lookup index is -LRB- Mg + G -RRB- . If the voxel has no reflection properties , its index is simply M . The lookup table needs to be recalculated whenever any factor involving light changes , including a rotation of the volume or a movement of the light source . Previously reported methods for volume rendering with 3D texture maps did not allow for directional lighting effects , and therefore could avoid recalculation after rotation of the volume -LSB- CN93 , CCF94 , WVGW94 -RSB- . 3.1.4 Gradient Quantization We quantize the gradient direction space into a finite number of unit gradients . The goal is to distribute a set of points on a unit sphere as evenly as possible , and take the vectors from origin to the points as the quantized gradients . Our method tesselates the sphere into triangles , and uses the triangles ' vertices as the quantized gradient directions . Numerous tesselations of the sphere are known . Two are based on equilateral spherical triangles as the starting point : the regular octahedron , with 8 triangles and the regular icosahedron , with 20 triangles . We have developed a new method by considering both an icosahedron and its dual figure , the dodecahedron , with 12 pentagons . See Figure 7 , top , which shows the vertices of these dual polyhedra . Note that the icosahedron has 12 vertices -LRB- black -RRB- and the dodecahedron has 20 vertices -LRB- gray -RRB- . This combination provides 60 congruent , but not quite equilateral , triangles as the starting point . A typical method to refine the initial quantization is with recursive subdivision on the starting triangles . By connecting midpoints of sides , each triangle is partitioned into four new triangles . However , on the sphere , unlike the plane , the new triangles are not congruent . For example , a quick and easy way is to subdivide the equilateral triangles from the regular octahedron . Unfortunately , this method will not produce very evenly distributed gradients , because certain triangles will continue to have a 90ffi angle , while others approach the more desirable 60ffi angles . Starting from the icosahedron 's 20 triangles , the discrepancy is less , varying from 72ffi to 60ffi . Our new method starts from the 32 vertices of the icosahedron and dodecahedron , combined , which produce 60 triangles . These triangles , being more nearly planar than the starting spherical triangles associated with the regular polyhedra , undergo less distortion during subdivision . The result of two levels of refinement is shown on the bottom of Figure 7 , where refinement vertices are shown as smaller dots . Images in this paper are based on four levels of refinement , yielding 7682 vertices . The general rule for the number of vertices after k levels of refinement is g = 30 ? 4k + 2 . 3.2 Rendering Slices Once the 3D texture is created , we render the volume by applying the texture to parallel planes -LRB- represented as squares in screen-space -RRB- and , thus , build up a stack of slabs through the texture , each slab being the region between two adjacent slices -LRB- see Figure 1 -RRB- . The squares are drawn from back to front . 3.2.1 Texture Coordinates for Original Orientation Consider a world space -LRB- x ; y ; z -RRB- coordinate frame in which the center of the volume is the origin . Texture coordinates -LRB- s ; t ; r -RRB- will become proxies for spatial -LRB- x ; y ; z -RRB- . Essentially , we construct a bounding cube centered on the origin that is large enough to contain any rotation of the volume . The side of the bounding cube needs to be the length of the diagonal through the volume , which we shall denote by d . The squares to be rendered -LRB- see Figure 1 -RRB- comprise a series of slices through the bounding cube , parallel to the cube 's xy faces . Now suppose the volume has resolution -LRB- nx ; ny ; nz -RRB- and spacing -LRB- Dx ; Dy ; Dz -RRB- . We view this as a set of voxels , so the volume has sides of lengths nxDx , nyDy , and nzDz . The existing hardware requires the texture-map resolutions to be powers of two . Therefore , let Nx , Ny and Nz be the least powers of two that are at least as great , respectively , as nx , ny and nz . We also define Lx = NxDx ; Ly = NyDy ; Lz = NzDz : In its initial orientation , we want the texture coordinates of the point -LRB- ? 12 nxDx ; ? 12 nyDy ; ? 12 nzDz -RRB- to be -LRB- 0 ; ; -RRB- . Similarly we want the texture coordinates of -LRB- 12 nxDx ; ? 12 nyDy ; ? 12 nzDz -RRB- to be -LRB- nx = Nx ; ; -RRB- , and so on for other corners of the volume . The constraints are satisfied by the functions s -LRB- x -RRB- = -LRB- x + 12 nxDx -RRB- = -LRB- NxDx -RRB- t -LRB- y -RRB- = -LRB- y + 12 nyDy -RRB- = -LRB- NyDy -RRB- r -LRB- z -RRB- = -LRB- z + 12 nzDz -RRB- = -LRB- NzDz -RRB- -LRB- 1 -RRB- Since the corners of the bounding cube are -LRB- ? 12 d ; ? 12 d ; ? 12 d -RRB- , it follows that we want to assign texture coordinates to these corners by evaluating s , t , and r in Eq . 1 at ? 12 d . We can represent the required 3D transformation from -LRB- x ; y ; z -RRB- to -LRB- s ; t ; r -RRB- as a combination of scales and translation . Let matrix D denote the uniform scale by d , let matrix S denote the nonuniform scale by -LRB- d = Lx ; d = Ly ; d = Lz -RRB- -LRB- the reason for two scales will become evident later -RRB- , and let matrix T denote the translation by -LRB- 12 nx = Nx ; 12 ny = Ny ; 12 nz = Nz -RRB- . Then -LRB- s ; t ; r -RRB- = -LRB- x ; y ; z -RRB- D ? 1 S T -LRB- 2 -RRB- The texture map has resolution -LRB- Nx ; Ny ; Nz -RRB- . Once the texture coordinates for the corners of the bounding cube have been found , those for the squares that slice up the cube are found easily by interpolation in z ; only the r coordinates are affected . 3.2.2 Arbitrary Viewing Angles From the description in Section 3.2.1 , the volume can be correctly rendered if it is being viewed ? from head-on ? , in its original orientation . -LRB- Observe that nz ordinary 2D textures could be used to do this . -RRB- However , to view the volume from an arbitrary angle requires a 3D texture map , to correctly calculate the intersection of the rendered squares with the 3D volume . To render the volume from a rotated viewpoint , we keep the bounding cube stationary in screen space , Data , Gradients3D texture map buffers3-4 parameter texture lookup table texture memoryFrame buffer Classification , map to colors Ideal ArchitectureData , Gradients3D texture map bufferstexture memoryFrame buffer Classification , map to colors Current Architecture3-4 parameter software lookup table Data , Gradients3D texture map bufferstexture memoryFrame buffer Classification , map to colors Open GL Alternative4 one-parameter color-index lookups Figure 3 : Alternatives for use of 3D texture maps . Heavy boxes denote special hardware ; light boxes are software tables . Double arrows indicate operations needed for each new viewpoint . Single arrows denote occasional operations . Trilinear interpolation applies to contents of texture memory . Ideal architecture would apply 3-4 parameter texture lookup table to the interpolated values . Reality engine offers 4 one-parameter texture lookup tables , which suffice only for rendering without directional lighting . and instead rotate the texture-space coordinates of the corners of the squares that slice up the bounding cube -LRB- see right half of Figure 1 -RRB- . This can be done in program code using standard matrix multiplication techniques . Alternatively one can use the texture matrix , which is part of the graphics system . This matrix is just like a viewing matrix : it transforms texture coordinates before they actually are used . In this way the programmer gives the same texture coordinates at geometry vertices no matter what the orientation and the texture matrix does the rotation . In either method , the CPU overhead is small . The required texture-space transformation is obtained simply by inserting the inverse of the client 's rotation matrix R into the transformation of Equation 2 , as follows : -LRB- s ; t ; r -RRB- = -LRB- x ; y ; z -RRB- R ? 1 D ? 1 S T = -LRB- x ; y ; z -RRB- D ? 1 R ? 1 S T -LRB- 3 -RRB- using the fact that uniform scaling commutes with rotation . Evaluating -LRB- s ; t ; r -RRB- at the corners of the bounding cube -LRB- i.e. , -LRB- ? 12 d ; ? 12 d ; ? 12 d -RRB- -RRB- can be accomplished by applying the texture-space transformation R ? 1 S T to -LRB- ? 12 ; ? 12 ; ? 12 -RRB- . The graphics library calls , while in texture mode , are therefore the given translate T , nonuniform scale S , as defined before Equation 2 , following by negated , reversed order , rotation calls as specified by the client . The mapping from world space to texture space is linear , therefore any rotation of it is also linear . Trilinear interpolation -LRB- done in hardware , in our case -RRB- of linear functions commutes with rotation . Therefore the image of the volume is not deformed . Care must be taken however with regards to the order in which scaling and rotation operations are performed on the texture coordinates . If a volume does not have the same D 's in each dimension , matrix S specifies a non-uniform scale , which does not commute with rotation . The wrong order leads to shearing distortion . When transforming the texture coordinates , the correct order of operations is rotation , then scaling . More details and examples appear in Appendix A. 3.2.3 Planar Regions Outside the Volume One issue is how to deal with rendering regions of the planes that lie outside the volume . Recall that the planes always remain parallel to the projection plane , and extend to the bounding cube , but the image of the volume within them rotates . Previous methods ? hand-clipped ? planes by intersecting them with the faces of the volume , producing a 3 ? 6 sided polygon . The solution we chose uses clipping planes . We can position six programmable world-space clipping planes -LRB- available in Silicon Graphics workstations -RRB- at the six faces of the volume , to clip out any parts of the rendered squares that lie outside the volume . Clipping planes may also be controlled by the client to restrict the portion of the volume to be drawn . 3.2.4 Number of Planes The default number of planes is chosen as d = Dz , so that when viewed straight on , each data point is sampled by one plane . For example , a 643 volume with uniform D 's would get 110 planes . The rendered images are more accurate as more planes are used . With few planes , artifacts may be noticeable where a clipped edge of a rendered square is visible . We usually chose two to four times the default , as the cost of additional rendered planes is a very minor factor with directional lighting . 3.3 Hardware Texture Map Issues Several possible organizations of a volume rendering system based on 3D texture maps in hardware are shown in Figure 3 . Ideal texture-mapping hardware would be able to interpolate data and gradient , then map to color -LRB- ? color ? includes opacity in this discussion -RRB- . This produces the greatest accuracy in the presence of nonlinear mappings from data to color -LSB- WVG94 -RSB- . For such interpolation to make sense , the texture memory must be a continuous function of the data and gradient values .2 For rendering without directional lighting , the gradient is irrelevant , and a one-parameter texture lookup table , as offered in the SGI Reality Engine , suffices . In this case , Voltx realizes the ? ideal ? architecture . But such images have limited usefulness . One possible application is simulation of x-ray views -LRB- Figure 6 -RRB- . In the more common case where directional lighting is desired , Voltx realizes the architecture in the middle of Figure 3 . In this case , and in the Open GL alternative , the texture memory contains color , computed independently at each voxel of the volume . Buffers contain discontinuously encoded representations of the gradient , as described in Section 3.1.3 . -LRB- In the figure , the ? Data , Gradient ? are so encoded in the ? current ? architecture ; this one-time operation is not shown . The buffers in the middle section are maintained by the SGI GL library , and contain color . The buffer shown in the ? Open GL alternative ? is encoded and maintained by the application program . -RRB- Thus the hardware interpolates color , rather than data . This leads to inaccuracies in the presence of nonlinear mappings from data to color -LSB- WVG94 -RSB- . The inaccuracies are more pronounced in close-up views . The 3 ? 4 parameter texture lookup table needed to realize the ? ideal ? architecture seems unlikely to be economically justified for commercial systems in the foreseeable future . 4 Comparison to Shear-Warp Factorization The Voltx method has certain similarities to the shear-warp technique , in that the volume is represented as a series of parallel planes for rendering purposes . In the shear-warp technique , those planes correspond to slices of the original volume . The principal slices are used , which are those most nearly orthogonal to the sight line . In general , they are oblique to the line of sight . The principal face is the principal slice closest to the viewer . In the Voltx method the planes are parallel to the projection plane , and are , in general , oblique to the volume . The shear-warp method can be viewed as a form of ray-casting in which the rays are sparse , and arranged in a parallelogram pattern that corresponds to the vertices in the principal face of the volume -LRB- Figure 4 , left -RRB- , rather than the usual square pattern of pixels . Values computed on these obliquely arranged rays in the ? shear ? phase are 2An attempt to encode data and gradient discontinuously into one parameter , and sample the texture memory by the ? nearest neighbor ? method failed on the SGI Reality Engine . Following our problem report , the new SGI documentation states that the ? nearest neighbor ? method is only approximate . Due to inaccuracy of a filter , values that do not correspond to any neighbor may be delivered . This makes it impossible to use a discontinuous texture lookup table to perform arbitrary decodings of the texture map . Shear-Warp `` Ray '' Sampling3D Texture Map `` Ray '' Sampling Figure 4 : Shear-warp and volume texture methods are equivalent to certain ray-casting policies , as discussed in Section 4 . The volume is 4 ? 4 ? 4 . Screen-z is out of the page on the left , where the volume is represented by its principal slices . Screen-z is down in the center and right , where the principal slices slant up to the right . interpolated at screen pixels in the ? warp ? phase . Figure 4 , center , shows how shear-warp ? rays ? sample the volume . The dots represent points sampled , and the lines going up from the dots indicate where the volume is assumed to have the sampled value for color/opacity integration purposes . Figure 4 , right , shows the comparable situation for Voltx , assuming 20 pixels and 8 rendered planes . In effect , a ray is shot from each pixel , and the sample is computed by trilinear interpolation . Lacroute and Levoy have reported on a fast shear-warp implementation -LSB- LL94 -RSB- , a limited version of which has been distributed . It will be called LL in this discussion . It is apparent from their paper and their code that speed was a major design objective of LL , and they have succeeded admirably in attaining this objective . We have made comparison tests of the same volume data on LL and Voltx . The general rule is that LL is somewhat faster , while Voltx is less prone to artifacts . Some of the issues are discussed below . Both methods use planes through the volume , and increasing the number of planes improves the resolution . In Voltx the number of planes is a minor cost consideration and can be adjusted at run time , as it is independent of the volume . In LL , the number of planes is fixed by the resolution of the volume . To increase it requires resampling the volume in a preprocessing step , and the increased resolution has a substantial impact on performance . This appears to be an implementation choice , not an inherent property of shear-warp . Both methods currently compute color -LRB- ? color ? includes opacity in this discussion -RRB- independently at each voxel of the volume , then interpolate color from those points . This leads to inaccuracies in the presence of nonlinear mappings from data to color , which are more pronounced in close-up views , as discussed in Section 3.3 . The shear-warp technique , being entirely in software , can interpolate data and gradient , then map to color . Smoothing out the transfer function was also recommended as a way to improve the shear-warp image quality , but such a step must bring image accuracy into question . Actually , Voltx always uses discontinuous transfer functions , as the each voxel is always classified as a single material . This can cause aliasing artifacts , but they are not noticeably sensitive to the orientation of the volume . Lacroute and Levoy reported that artifacts increase for LL as the rotation approaches 45 degrees . 5 Results Rendering times for data with various sizes are summarized in Figure 5 . The rendering was done on a Silicon Graphics Reality Engine II with two megabytes of 3D texture-map hardware and one raster manager . Classification time includes material classification , and quantizing the voxel gradients , and is based on one processor . This task is needed only once per run , as a rule . Rendering time includes updating the lookup table and rendering with new rotation or new lighting model for material definition . Times are real elapsed seconds , rather than CPU seconds , because CPU times do not reflect delays due to the graphics pipeline , which is heavily used . For comparison , the last column shows times without directional lighting , which are about 10 times faster . Figures 6 and 8 -LRB- color plate -RRB- present a sample rendering of data sets listed in Figure 5 . We used 1000 planes to render all volumes except Hipip , -LRB- High Potential Iron Protein -RRB- for which we used 128 . -LRB- ? Planes ? were discussed in Section 3.2 . -RRB- All images were rendered at 600 ? 600 pixels , with four 8-bit color channels . We found that times can be reduced by a factor of 1.2 to 2.5 by using four processors . These disappointing speed-ups are due to the fact that the graphics pipeline must be used serially , and it comprises a large fraction of the elapsed time . The GL interface requires redundant copying and processing of of 3D texture maps . For example , on the MR brain data set , 8 seconds are consumed in defining the 32 texture maps with texdef3d , using one processor . Open GL offers a different interface -LRB- glTexImage3DEXT with COLOR INDEX format , and mapping tables for each of R , G , B , A -RRB- , but our test showed that it still took 8 seconds to process 32 texture maps . However , perspective projections incur no observable time penalty , in contrast to shear-warp techniques . They are essential for comfortable stereographic viewing . Also a pair of stereo images often requires much less than twice the time of a single view , as one pass through the texture loading suffices . 6 Conclusions and Future Directions Volume texturing is a fast and simple method for direct volume rendering of rectilinear volumes available to those with appropriate hardware . With a directional light model , images have very good quality . Our implementation uses either orthographic or perspective projection , and supports stereo viewing -LRB- Figure 6 and color plate Figure 8 -RRB- . By turning over many tasks to the hardware and libraries , we have simplified the programming task , but have given up on many optimization opportunities . On the other hand , with directionally shaded 3D texture-map images , the best-quality options consume only a little more time than the cheapest , so you might as well use them . Lacroute and Levoy describe several optimizations that greatly increase the performance of LL . Their best reported times depended heavily on : -LRB- 1 -RRB- skipping over low-opacity -LRB- .05 -RRB- voxels and nearly opaque -LRB- .95 -RRB- pixels , -LRB- 2 -RRB- monochrome imaging , and -LRB- 3 -RRB- the use of orthographic , rather than perspective , projection . These practices compromise image quality under some circumstances , but they are not inherent parts of shear-warp . The fact that LL software competes with hardware-dependent Voltx calls into question the value of hardware 3D texture maps , at least as offered in the Reality Engine , for this application . -LRB- The fact that hardware designs can not be fixed or modified by end-users is another practical consideration . -RRB- While the graphics library and hardware handle many implementation details that would otherwise require handcoding , there is some possibility that a software implementation of the same transformations could be competitive through increased ability to use parallelism . This would permit improved accuracy by interpolating data and gradients , rather than color , as discussed in Section 4 . This is one topic for future investigation . A related question that deserves investigation is whether the shear-warp technique can be improved in accuracy by interpolating data and gradients , rather than color , without incurring too great a loss of time . Acknowledgements Funds for the support of this study have been allocated by a cooperative agreement with NASA - Ames Research Center , Moffett Field , California , under Interchange No . NAG2-991 , and by the National Science Foundation , Grant Number ASC-9102497 , and Grant Number CCR-9503829 . Texture Wall-Clock Seconds Data Size Maps Class - Render , 1 proc Render , 4 procs 1 proc Set -LRB- voxels -RRB- Needed ific 'n 1 view stereo 1 view stereo unshaded Hipip 64 ? 64 ? 64 1 1 1.0 1.4 .8 1.2 .16 MR brain 256 ? 256 ? 109 32 61 13.3 17.4 5.0 9.5 .70 Engine 256 ? 256 ? 110 32 62 13.5 16.9 4.7 8.8 1.10 CT head 256 ? 256 ? 113 32 77 13.5 17.0 5.3 9.5 1.33 Figure 5 : Rendering and classification times for Voltx . Times are for a Reality Engine II , with one raster manager , using one or four 150-MHz processors . Rendered images are 600x600 pixels . See Section 5 for discussion . References -LSB- Ake93 -RSB- Kurt Akeley . RealityEngine graphics . Computer Graphics -LRB- ACM Siggraph Proceedings -RRB- , 27:109 ? 116 , 1993 . -LSB- CCF94 -RSB- Brian Cabral , Nancy Cam , and Jim Foran . Accelerated volume rendering and tomographic reconstruction using texture mapping hardware . In ACM Symposium on Volume Visualization , pp. 91 ? 98 , Washington , 1994 . -LSB- CN93 -RSB- T. J. Cullip and U. Neumann . Accelerating volume reconstruction with 3D texture hardware . Technical Report TR93-027 , University of North Carolina , Chapel Hill , N. C. , 1993 . -LSB- CT82 -RSB- Robert L. Cookand Kenneth E. Torrance . A reflectance model for computer graphics . ACM Transactions on Graphics , 1 -LRB- 1 -RRB- :7 ? 24 , 1982 . -LSB- CU92 -RSB- G. G. Cameron and P. E. Undrill . Rendering volumetric medical image data on a SIMD-architecture computer . In Third Eurographics Workshop on Rendering , Bristol , UK , MAy 1992 . -LSB- DCH88 -RSB- Robert A. Drebin , Loren Carpenter , and Pat Hanrahan . Volume rendering . Computer Graphics -LRB- ACM Siggraph Proceedings -RRB- , 22 -LRB- 4 -RRB- :65 ? 74 , 1988 . -LSB- DH92 -RSB- John Danskin and Pat Hanrahan . Fast algorithms for volume ray tracing . In ACM Workshop on Volume Visualization , pp. 91 ? 98 , Boston , 1992 . -LSB- GL94 -RSB- S. Guan and R. G. Lipes . Innovative volume rendering using 3D texture mapping . In Image Capture , Formatting and Display . SPIE 2164 , 1994 . -LSB- Kru90 -RSB- Wolfgang Krueger . Volume rendering and data feature enhancement . Computer Graphics -LRB- Proceedings of the San Diego Workshop on Volume Visualization -RRB- , 24 -LRB- 5 -RRB- :21 ? 26 , 1990 . -LSB- Lev88 -RSB- Marc Levoy . Display of surfaces from volume data . IEEE Computer Graphics and Applications , 8 -LRB- 3 -RRB- :29 ? 37 , March 1988 . -LSB- Lev90a -RSB- Marc Levoy . Efficient ray tracing of volume data . ACM Transactions on Graphics , 9 -LRB- 3 -RRB- :245 ? 261 , 1990 . -LSB- Lev90b -RSB- Marc Levoy . A hybrid ray tracer for rendering polygon and volume data . IEEE Computer Graphics and Applications , 10 -LRB- 2 -RRB- :33 ? 40 , March 1990 . -LSB- Lev92 -RSB- Marc Levoy . Volume rendering using the fourier projection-slice theorem . In Proceedings of Graphics Interface ' 92 , Vancouver , B.C. , 1992 . Also Stanford University Technical Report CSL-TR-92-521 . -LSB- LH91 -RSB- David Laur and Pat Hanrahan . Hierarchical splatting : A progressive refinement algorithm for volume rendering . Computer Graphics -LRB- ACM Siggraph Proceedings -RRB- , 25 -LRB- 4 -RRB- :285 ? 288 , 1991 . -LSB- LL94 -RSB- Philippe Lacroute and Marc Levoy . Fast volume rendering using a shear-warp factorization of the viewing transformation . Computer Graphics -LRB- ACM Siggraph Proceedings -RRB- , pp. 451 ? 458 , 1994 . -LSB- MHC90 -RSB- Nelson Max , Pat Hanrahan , and Roger Crawfis . Area and volume coherence for efficient visualization of 3D scalar functions . ACM Workshop on Volume Visualization , 24 -LRB- 5 -RRB- :27 ? 33 , 1990 . -LSB- Sab88 -RSB- Paolo Sabella . A rendering algorithm for visualizing 3D scalar fields . Computer Graphics , 22 -LRB- 4 -RRB- :51 ? 58 , 1988 . -LSB- SS92 -RSB- Peter Schroeder and Gordon Stoll . Data parallel volume rendering as line drawing . In ACM Workshop on Volume Visualization , pp. 25 ? 32 , Boston , 1992 . -LSB- ST90 -RSB- Peter Shirley and Allan Tuchman . A polygonal approximation to direct scalar volume rendering . Computer Graphics , 24 -LRB- 5 -RRB- :63 ? 70 , December 1990 . -LSB- TM67 -RSB- Kenneth E. Torrance and Sparrow E. M. Theory for off-specular reflection from roughened surfaces . Journal of the Optical Society of America , 57 -LRB- 9 -RRB- :1105 ? 1114 , 1967 . -LSB- UK88 -RSB- Craig Upson and Michael Keeler . The v-buffer : Visible volume rendering . Computer Graphics -LRB- ACM Siggraph Proceedings -RRB- , 22 -LRB- 4 -RRB- :59 ? 64 , 1988 . -LSB- VGW93 -RSB- Allen Van Gelder and Jane Wilhelms . Rapid exploration of curvilinear grids using direct volume rendering . In IEEE Visualization ' 93 , 1993 . -LRB- extended abstract -RRB- Also , Univ. of California technical report UCSC-CRL-93-02 . -LSB- Wes90 -RSB- Lee Westover . Footprint evaluation for volume rendering . Computer Graphics -LRB- ACM Siggraph Proceedings -RRB- , 24 -LRB- 4 -RRB- :367 ? 76 , 1990 . -LSB- Wil92 -RSB- Peter Williams . Interactive splatting of nonrectilinear volumes . In IEEE Visualization ' 92 , pp. 37 ? 44 , 1992 . -LSB- WVG91 -RSB- Jane Wilhelms and Allen Van Gelder . A coherent projection approach for direct volume rendering . Computer Graphics -LRB- ACM Siggraph Proceedings -RRB- , 25 -LRB- 4 -RRB- :275 ? 284 , 1991 . -LSB- WVG94 -RSB- Jane Wilhelms and Allen Van Gelder . Multi-dimensional trees for controlled volume rendering and compression . In ACM Symposium on Volume Visualization , Washington , 1994 . -LSB- WVGW94 -RSB- Orion Wilson , Allen Van Gelder , and Jane Wilhelms . Direct volume rendering via 3D textures . Technical Report UCSC-CRL-94-19 , Univ. of California , Santa Cruz , 1994 . Figure 6 : Autostereograms of CT head and MRI head -LRB- left and center -RRB- , to be viewed without instruments at a distance of 1 ? 2 feet . Try to look at a point about three times the distance of the page , 3 ? 6 feet away . Raise page into line of sight , seeing 3 images . Middle image should fuse , giving stereo effect . Blinking the eyes might help . Alternatively , place a card or piece of stiff paper between images , and extending towards the eyes ; page should still be about one foot away . Right upper image is x-ray-style image of CT head . Volume has opacity only , and light is emitted from back plane . CT head is classified as bone on a ramp from 0 % at 90 to 100 % at 130 Hounsfield units . MRI uses binary classification at threshold 550 . For a new viewpoint , stereo images required 18 seconds per pair ; x-ray image required 1 second . All images required 32 texture maps . Figure 7 : Vertices of regular icosahedron -LRB- black -RRB- and its dual dodecahedron -LRB- gray -RRB- are triangulated into 60 triangles -LRB- right , center -RRB- , which are recursively subdivided -LRB- right , lower -RRB- to give points on the unit sphere that serve as quantized normal vectors . Color plates omitted ; available separately from authors . Figure 8 : Autostereogram of Hipip -LRB- left , center , see Fig. 6 for viewing hints -RRB- , and image of Engine -LRB- right -RRB- . 0,00,11,01,1.75 , .750 , .75.75,0 Translate .5,0 Rotate = 3 , 6 = 4 , 1 = 12 , 6 = 4 , 8 = 13.416 = 63.58 ? = 0.839 , 1.677 = 0.375 , 0.375 0 , -.5 -.5,0 -.5 , -.5.5 , -.5.5,0 The Geometry Square .375 , -.375 Scale .447 , -.224 Data Resolution Data Deltas Data Side Lengths Texture Map Resolution Data Diagonal Rotate Scale Translate Data in the Texture MapThe Texture MapResulting Image of the Data , with texture coordinates via interpolation.after Scaling.Coordinatesafter Rotation.CoordinatesCoordinates which get used in the texture map . Figure 9 : 2-D Example of Texture Coordinate transformations . Coordinates are specified at the corners of the Geometry Square , then by a series of matrix transformations are mapped to the texture map . Appendix A Texture Coordinate Examples We thank Orion Wilson for helping to work out these examples and for drawing the accompanying picture . Example A. 1 : Assume the volume has resolution -LRB- 3 ; 4 ; 4 -RRB- and spacing -LRB- Dx ; Dy ; Dz -RRB- = -LRB- 1 ; 3 ; 1 -RRB- . The diagonal is d = 13 . Then -LRB- Nx ; Ny ; Nz -RRB- = -LRB- 4 ; 4 ; 4 -RRB- . We get s -LRB- ? d = 2 -RRB- = ? 1:25 s -LRB- d = 2 -RRB- = 2:00 t -LRB- ? d = 2 -RRB- = ? 0:041667 t -LRB- d = 2 -RRB- = 1:041667 r -LRB- ? d = 2 -RRB- = ? 1:125 r -LRB- d = 2 -RRB- = 2:125 Example A. 2 : This 2-D example works thru a texture-matrix calculation to show that the pre-matrix texture coordinates for a given corner of the data rectangle get transformed to the correct final texture coordinates . Assume the data has resolution -LRB- nx ; ny -RRB- = -LRB- 3 ; 6 -RRB- and spacing -LRB- Dx ; Dy -RRB- = -LRB- 4 ; 1 -RRB- . Then the diagonal is d = 13:42 , and the texture map resolution -LRB- Nx ; Ny ; Nz -RRB- = -LRB- 4 ; 8 -RRB- . Assume the viewer has rotated the volume Qz = ? 63:58 ffi . -LRB- In case of multiple rotations by the viewer , their order must be reversed here -RRB- . The parameters of the texture matrices are : Rotate = -LRB- ? Qz ; z0 -RRB- = -LRB- 63:58 ffi -RRB- : Scale = ? d Lx ; d Ly ? = ? 13:42 4 ; 13:42 8 ? = -LRB- :839 ; 1:677 -RRB- : Translate = ? nx 2Nx ; ny 2Ny ? = ? 3 8 ; 3 8 ? = -LRB- :375 ; :375 -RRB- : We choose the pre-matrix texture coordinates at the corners of the planes to be -LRB- ? :5 ; ? :5 -RRB- ; : : : ; -LRB- :5 ; :5 -RRB- , as explained in connection with Equation 3 . For example , the interpolated ? raw ? texture coordinates of the lower right corner of the rotated data set are -LRB- 0 ; ? :5 -RRB- . These are transformed in hardware by the texture matrices , as follows : Original Coordinates = -LRB- 0 ; ? :5 -RRB- After Rotation = -LRB- :447 ; ? :224 -RRB- After Scaling = -LRB- :375 ; ? :375 -RRB- After Translation = -LRB- :75 ; -RRB- which agrees with the corresponding texel in the texture map , whose coordinates are : ? 3 4 ; 8 ? = -LRB- :75 ; -RRB- : Appendix B Hardware Texture Map Details This section discusses some detailed choices to be made in the use of the hardware texture map feature . Appendix B. 1 Interpolation Options The Reality Engine can be set to sample the texture map either using a nearest neighbor method -LRB- so-called point interpolation -RRB- 3 or a trilinear interpolation . The trilinear method is about 50 % slower than point interpolation , but gives smoother-appearing images . Because the actual rendering time is dwarfed by the time needed to recalculate the texture map after a rotation , we normally choose the superior image . Appendix B. 2 Rounding Errors In creating the texture map , it is possible to encounter significant rounding error problems when using an eight-bit rather than a twelve-bit texture map . However , rendering with an eight-bit texture map is about twice as fast as with a twelve-bit map , the memory requirement is half as much , and the problem only occurs under certain conditions . Consequently , it is sometimes desirable to use an eight-bit map . For example , if the color contribution to a plane is small , rounding error can make it appear zero . This can be seen as blank areas in the final image when the number of slices is large enough so that the color contributions of many single pixels in each plane are rounded to zero . If the texture map has eight bits per color channel , then rounding errors are up to one half of 1 = 256 . In this case , rounding-error may become detrimental if several hundred slices are used . The problem is exacerbated if the data set in question is largely homogeneous , because in a region of constant value , the pixels are all rounded in the same direction and the error accumulates . In non-homogeneous data , rounding-errors tend to cancel each other out . The problem becomes negligible -LRB- for hardware texture maps of a size available now -RRB- when the texture map is given more bits per channel , simply reducing the magnitude of the errors . Twelve-bit textures -LRB- supported in the Reality 3Actually , the ? nearest neighbor ? method is only approximate . Due to inaccuracy of a filter , values that do not correspond to any neighbor may be delivered . This makes it impossible to use a discontinuous ? texture lookup table ? to perform arbitrary decodings of the texture map . Engine -RRB- let rounding-error be only one half of 1 = 4096 . This is quite sufficient to make an acceptable texture map for distributing the data even over several thousand slices . An accurate final image rarely requires more slices than 3.5 -LRB- 2 ? p 3 -RRB- times the maximum resolution in the volume . Besides rounding-errors in the storage of the texture , we were also concerned that errors would accumulate during the blending and compositing stage of rendering , but this has not been noticed .

B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O B I O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O

computer graphics
direct volume rendering
spherical tesselation
texture map