REAL-TIME RECURSIVE SPECULAR REFLECTIONS ON PLANAR AND CURVED SURFACES USING GRAPHICS HARDWARE

Kasper Høy Nielsen Niels Jørgen Christensen

Informatics and Mathematical Modelling The Technical University of Denmark DK 2800 Lyngby, Denmark {khn,njc}@imm.dtu.dk

ABSTRACT Real-time rendering of recursive reflections have previously been done using different techniques. How- ever, a fast unified approach for capturing recursive reflections on both planar and curved surfaces, as well as glossy reflections and interreflections between such primitives, have not been described. This paper describes a framework for efficient simulation of recursive specular reflections in scenes containing both planar and curved surfaces. We describe and compare two methods that utilize and en- vironment mapping, while having reasonable memory requirements. The methods are texture-based to allow for the simulation of glossy reflections using image-filtering. We show that the methods can render recursive reflections in static and dynamic scenes in real-time on current consumer graphics hardware. The methods make it possible to obtain a realism close to ray traced images at interactive frame rates.

Keywords: Real-time rendering, recursive specular reflections, texture, environment mapping.

1 INTRODUCTION mapped surface sees the exact same surroundings re- gardless of its position. Static precalculated environ- Mirror-like reflections are known from , ment maps can be used to create the notion of reflec- where shiny objects seem to reflect the surrounding tion on shiny objects. However, for modelling reflec- environment. Rays are continuously traced through tions similar to ray tracing, reflections should capture the scene by following reflected rays recursively un- the actual synthetic environment as accurately as pos- til a certain depth is reached, thereby capturing both sible, while still being feasible for interactive render- reflections and interreflections. Although common in ing. In dynamic scenes, reflections need to be updated ray traced images, the realistic shading of highly re- to match the actual state of the scene. flective surfaces is seldomly seen in real-time virtual Although environment mapping techniques can be reality applications. However, pipeline rendering fea- used to render reflections on planar surfaces (e.g. a tures available in consumer graphics hardware, such floor), this is normally not used in practice, since it as texture mapping and environment mapping, can be can lead to severe artifacts. As an environment map used to approximate some of these effects. captures the surrounding environment with respect to Environment mapping methods are normally used to a single fixed viewpoint, an environment mapped pla- achieve effects that resemble ray tracing on curved nar reflector will miss important motion parallax ef- surfaces (e.g. a sphere), by modelling reflections as fects. Instead planar reflections are traditionally cap- distant. Standard environment mapping methods are tured by rendering reflected geometry from a mirror only a function of direction and therefore ignore mo- viewpoint. tion parallax and self reflection, i.e. environment The recursive concept in ray tracing can generally be mapping only takes the reflection direction into ac- adapted to pipeline rendering in a simplified form. count and ignores the position of the reflected ray. Recursive reflections allow reflective objects to ap- This can be noticeable for reflections of objects close pear in other reflections. Instead of achieving this ef- to the reflector, since every point on an environment Viewpoint Viewpoint 2nd order 2nd order reflection B reflection B 1st order reflection A 1st order reflection A Virtual Virtual Viewpoint 1 Viewpoint 2

Figure 1: Second order recursive planar reflection: Figure 2: Second order curved mirror reflection in a The reflected view generated by reflector A sees an- scene with two reflective spheres. Object A contains other reflector B and processes this reflection in a re- object B in its reflection. By recursion, object B also cursive manner. contains object A in its reflection. fect by tracing individual rays recursively through a 2 PREVIOUS WORK scene as in ray tracing, reflective objects can be ren- dered explicitly into reflection images of other reflec- 2.1 Overview tors. By extending existing reflection methods, this means rendering other planar or curved reflections The use sphere, cube and dual paraboloid mapping into previously generated reflection images in a re- for rendering mirror reflections on curved surfaces cursive manner. See Fig. 1 and Fig. 2. We will refer (both convex and concave) is thoroughly described in to this concept as reflection tracing [Niels00]. As in the literature [Green86, Voorh94, Heidr98, Heidr99, ray tracing, the maximum recursion depth can be de- Kilga99a, Kilga99b, McRey00, Watt00]. A good termined to limit the maximum number of interreflec- discussion of their pros and cons can be found in tions to be rendered. [McRey00]. A visual comparison of environment mapping versus ray tracing can be found in [Watt00]. Previous work have performed hardware rendering of Other methods have been proposed for rendering re- recursive reflections using different techniques, yet flections: Warped Geometric Reflections [Ofek98], have not described an approach for capturing recur- Tetrahedron Environment Mapping [Forte00], and sive reflections on both planar and curved surfaces, as Extended Environment Mapping [Cho00]. [Ofek98] well as interreflections between such primitives. This and [Cho00] can capture recursive reflections. How- paper addresses this topic. The goal is to design a ever, unlike sphere, cube and dual paraboloid envi- method that: ronment mapping, these methods are not supported by graphics hardware today, but could well be candidates 1. Efficiently captures reflections and interreflec- for future hardware implementations. While meth- tions on both planar and curved surfaces. ods have been developed for capturing recursive re- 2. Uses texture-based techniques in order to ap- flections on curved surfaces using sphere [Kilga99a] proximate glossy reflections by low-pass filter- and [McRey00], none of these meth- ing reflection images. ods consider planar surfaces. Planar recursive re- 3. Works in both static and dynamic environ- flections are captured using either the stencil-buffer ments. [Diefe97, Kilga99c, McRey00] or texture mapping [McRey00]. An interesting alternative is suggested in 4. Uses rendering features available in low-end [Basto98], but it cannot run on todays graphics hard- consumer graphics hardware. ware due to the use of forward mapping. An approx- 5. Integrates easily into virtual reality applica- imate technique that uses ray-sphere intersections to tions. calculate environment map lookups is also described in [Gritz01]. Finally, the use of reflection map- To achieve our goal, we design a novel recursive ping techniques to approximate more general BRDF- texture-based method for capturing recursive planar based reflection models have been addressed by sev- reflections. We then extend this method to also cap- eral authors [Mille84, Green86, McRey00, Cabra99, ture recursive curved reflections, by using two differ- Heidr99, Basto99, Wynn00, Kautz00]. In the next ent existing environment mapping techniques. We de- two subsections we conduct a detailed discussion of scribe and compare these two closely related meth- existing methods related to our approach. ods that meet our goals. In the next section, we dis- cuss previous work and their limitations, and con- duct a detailed discussion of existing methods related 2.2 Planar Reflections to our approach. Section 3 describes our approach, and section 4 discusses the results. Finally, section The methods for capturing recursive reflections on 5 draws the conclusion and points out directions of planar reflectors [Diefe97, McRey00] are generally future work. based on beam tracing [Heckb84]. The entire view frustrum of a planar reflector is bent and the mirrored An alternative solution, described by [McRey00], ap- view is followed in a recursive manner (see Fig. 1). proximates interreflections by taking advantage of Given a scene with n reflective surfaces and a recur- view-independent environment mapping and frame- sion depth of d, the method has a time complexity to-frame coherence. The method can be described as: of O(nd+1). However, as pointed out by Diefenbach When rendering a frame, we generate top-level (i.e. [Diefe97], culling can greatly reduce the actual num- recursion level 0) environment maps for each reflect- ber of n for each iteration. ing object in the scene, one at a time. During gener- ation of an environment map E, we determine the set Using multi-pass rendering, reflections are imple- of reflecting objects that will be visible in this envi- mented by first rendering the scene without the mir- ronment map. For each object we check: rored surfaces. A second rendering is performed for each reflected viewpoint, and the resulting image is 1. If an environment map has already been gener- applied to the reflector. This process can be repeated ated for this object in the current frame, we use recursively in scenes with multiple reflectors. Sten- this environment map for rendering the object cil operations are arranged so the reflected images are into environment map E. masked by the stencil buffer. 2. If such an environment map does not exist, we check if an environment map has been gener- McReynolds et al. [McRey00] also describe how tex- ated for this object in the previous frame. If so, ture maps can be used to store the final reflection we use this instead for rendering the object into images. The stencil buffer is used for rendering in- environment map E. terreflections into the reflection textures (reflection maps), and texture mapping is used for rendering the 3. If no environment map has been generated we final image. [McRey00] state that one of the advan- draw the interreflecting object into E without tages of the texture mapping technique compared to reflection. Note, that this is only the case the the stencil technique, is that it may be acceptable to first time an object appears, e.g. in the first use reflection textures with the contents from the pre- frame. vious frame in a dynamic environment. The method uses previously generated environment maps to approximate reflections of interreflecting ob- jects. At frame i the method captures between (i ∗ n) 2.3 Curved Reflections and (i ∗ n + n − 1) interreflections, where n is the number of reflectors1. Thus, the method does not Recursive reflections on curved surfaces can be ap- make use of recursion. In dynamic environments proximated using environment mapping techniques. the method regenerates n environment maps for each By pre-generating environment maps for reflected ob- frame, and therefore has a time-complexity of O(n). jects, these can be used for rendering interreflections In static environments the method runs in constant into other environment maps [Kilga99a, McRey00] time, after initializing the environment maps with the (see Fig. 2). The regeneration of many environ- desired number of interreflections. As the method re- ment maps can however be computationally expen- lies on previously generated environment maps for sive in a dynamic environment, especially when using rendering interreflections, there will be a small er- complex environment map representations (e.g. cube ror in the rendered interreflections compared to real maps). This needs to be solved in order to make our recursive interreflections, when using the method in algorithm efficient. a dynamically changing environment. The error is largest for the first environment map rendered, as all One solution is to use a simpler representation, such interreflections here are based on previous frames, as a (view-dependent) sphere map. A sphere map and smallest for the last environment map, as all re- should normally be generated by warping a view- flections here are based on environment maps gener- independent environment map, yet approximate tech- ated in the current frame. The error depends on the niques can also be used. One technique is to only frame rate and the speed of dynamic changes. How- generate a single distorted projection of the reflec- ever, in general it can be hard to distinguish flaws in tion as seen from the reflecting object in the direction secondary reflections on curved objects. Furthermore, of the virtual viewer, and use this as an approximate the higher the frame rate is on a real-time system, sphere map [Palli99]. The projection can be generated the smoother the animation is, and the smaller the er- by using a high field-of-view and/or post-warping the ror will be between successive interreflections. Thus, rendered view using non-linear distortion. This tech- there is a good chance that such errors hardly will be nique does not produce an accurate environment map noticeable on a system exhibiting smooth, fluid ani- since the back and parts of the sides of the environ- mation. ment are disregarded, and since the generated image does not accurately model a sphere. Still, the tech- 1With the exception of n =1, where the number of interreflec- nique can produce acceptable results. tions equals 0, regardless of i. 3 OUR APPROACH Reflection Maps Reflection Tree 0 By using beam-tracing principles it is possible to cap- ture specular interreflections. Yet, the method is re- 2 1 1 stricted to planar surfaces, and cannot account for in- 2 0 terreflections on curved surfaces. Methods exist for 22 capturing approximate interreflections on curved sur- 12 faces using environment mapping. However, none of 333 these methods consider planar surfaces.

While beam-tracing can be computationally expen- sive, this concept appears to be the only accurate way Figure 3: Example reflection tree, showing the assign- to simulate recursive planar reflections using graph- ment of one reflection map for each recursion level. ics hardware. McReynolds et al. [McRey00] have The number of reflections encountered at each node shown how to capture planar interreflections using is shown circled, while the recursion level is shown in texture mapping. Yet, as interreflections are captured italics. using the stencil-buffer, the method does not allow DrawScene(view, depth) { for glossy interreflections. Furthermore, because such Clear frame buffer for (each object i in scene) { textures need to be of relatively high resolution to cap- if ((object is reflector) && ture reflections accurately, the method can be memory (depth < maxdepth)) { Select refl.map n = depth as intensive as a reflection map is generated for each re- render-target flecting object before rendering. Setup mirror_view DrawScene(mirror_view, depth + 1) Restore render-target We propose an alternative planar method that does Apply refl.map n to object i } allow for glossy interreflections and which has con- Draw object i } stant low memory requirements that depend on the se- } lected recursion depth. We extend this method to also capture curved reflections and interreflections using environment mapping. We design two variations of Figure 4: Pseudo code for rendering a scene with our algorithm: One, based on a view-dependent en- recursive planar reflections. DrawScene renders the vironment representation, and one based on a view- scene from a previously defined view. When a reflect- independent representation. Both have advantages ing object is met, DrawScene is called recursively. and disadvantages which we discuss in section 5. For The recursion depth is passed as a parameter and n simplicity we first describe our planar method (sec- used to determine the render-texture level , and ter- tion 3.1), and then extend the method to curved sur- mination of the reflection tracing branch, based on faces (section 3.2). maxdepth. An initial call of DrawScene(view, 0) is used for rendering the entire scene.

3.1 Planar Reflections dering task is immediately discontinued and the cor- responding reflection map is generated. After gener- The concept of our planar reflection tracing method ation, control is returned to the rendering task, the re- is simple: For each rendering of the scene we gener- flection map is applied to the reflector, and the render- ate a reflection map for each reflecting surface, and ing task is continued. Reflection maps are thus gen- apply it onto the reflector during rendering. As each erated, used, and discarded, and the texture space can reflection map in itself is a rendered view of the scene therefore be reused for subsequent rendering of re- from a mirror viewpoint, this process can be repeated flections. The pseudo code for the algorithm is shown recursively until a certain depth d is reached. in Fig. 4. The time complexity for this algorithm is O(n ∗ (n − k)d), where n is the total number of Because of the limited amount of texture memory, it objects, and k is the number of non-reflecting ob- is generally wasteful to compute the reflections be- jects. The method can therefore be computationally fore rendering. Instead we propose that reflections expensive, particularly for deep recursion levels, e.g. are computed during rendering, thereby minimizing d ≥ 3. However, as in [Diefe97], the actual runtime memory requirements. Using this scheme, only one of the method can be improved by using culling tech- reflection map is required for each recursion level, niques. Moreover, to further reduce scene complex- as illustrated in Fig. 3. Note, that the method im- ity, it can be advantageous to use low level-of-detail plicitly requires render-to-texture capabilities as the objects (LODs) when rendering interreflections. The back-buffer constantly is occupied by the contents of resolution of the generated reflection maps can also the current frame. When a reflecting surface is met, be dynamically scaled, based on the projected area of during rendering of the polygons in a scene, the ren- the reflector, thus minimizing rendering overhead for distant reflections. Finally, as in ray tracing, good re- DrawScene(view, depth, objref) { sults can be achieved with low recursion depths (e.g. Clear frame buffer for (each object i in scene) { d<3), depending on the specularity of surfaces. if ((object is reflector) && For surfaces exhibiting subtle specular reflections, re- (depth < maxdepth)) { if (objref) Unhide object objref flection contributions are diminished significantly for Select refl.map n = depth as render-target each recursion level, and it may be acceptable to ter- if (curved object) { minate a reflection tracing branch if the specular level Hide object i Setup env_view goes below a certain threshold. DrawScene(env_view, depth + 1, i) Unhide object i } else { // planar We note that the described scheme precludes any use Setup mirror_view of reflection coherence between successive frames, as DrawScene(mirror_view,depth + 1,NULL) } the reflection maps are discarded after use. We choose Restore render-target to trade speed for memory, because planar reflections Apply refl.map n to object i if (objref) Hide object objref are only rotation-invariant and must be regenerated } Draw object i for new viewpoints, causing the practical use of co- } herence to be somewhat limited. }

Figure 5: Pseudo code for rendering a scene contain- 3.2 Planar and Curved Reflections ing recursive planar and curved reflections, where a single approximate view of the environment is used The described reflection tracing process can be ex- as a view-dependent environment map representation tended to also handle curved reflections, by gener- for curved reflectors. Again, the recursion depth is ating environment maps for curved reflectors instead passed as parameter. An extra objref parameter en- of planar reflection maps. This can be achieved by sures that an object, hidden during environment map generating view-dependent environment maps, e.g. generation, is made visible during recursive render- sphere maps through warped cube maps, or by using ing. An initial call of DrawScene(view, 0, NULL) is approximate techniques. used for rendering the entire scene.

For generating an environment map for a reflecting object, that object is normally hidden to avoid self- ing object, we may actually attempt to use the envi- reflection. Yet, for letting each environment map con- ronment map that we are currently working on. One tain interreflections of both planar and curved sur- solution is to first render all the non-reflecting geom- faces, the environment map must be generated by re- etry into the environment map, thereby ensuring that cursion. As the hidden object should be visible at the environment map can be used as a reflection, but deeper recursion levels, it is necessary to account for it will still miss one of more interreflections. Another the hidden objects during the recursion process. With approach is to take advantage of temporal coherence this in mind, the planar algorithm can be extended to by using previously generated environment maps to also handle curved objects by using the pseudo code approximate higher order reflections. The method de- shown in Fig. 5. scribed by McReynolds et al. [McRey00] is advan- tageous, since it has a linear time-complexity, while Still, since some environment mapping methods are still capturing deep levels of interreflections in both view-independent, it seems reasonable to exploit this static and dynamic environments. We extend the pro- during the reflection tracing process. Unlike planar posed planar algorithm to include curved surfaces by reflection maps, view-independent environment maps using this method. This requires generation of view- can draw reflections seen from different viewpoints independent environment maps for each curved re- and can therefore be reused for generating different flector, before rendering the main frame (recursion views of the same reflector. level 0). Since recursive calls might access the en- vironment map currently being generated, a com- It is advantageous to use a view-independent pa- plete representation of the environment map should rameterization for top-level reflections, as these can be available at all times. To achieve this, an environ- be re-used for successive frames in momentarily ment map should first be updated when rendering of static scenes. For interreflecting objects, the view- the entire map is completed, i.e. similar to a dou- independence means that an environment map only ble buffering scheme. Using this technique, the com- needs to be generated once per frame, and that a re- bined algorithm for capturing both curved and pla- flecting object that sees itself through another reflect- nar reflections is as shown in Fig. 6. As the planar ing object, in theory can use the same environment recursion is dominant, the time-complexity becomes map to generate the interreflection. However, this O(n∗(n−k−c)d), where n is the total number of ob- poses a problem: For generating an environment map jects, k is the number of non-reflective planar objects, for an object that sees itself through another reflect- and c is the number of curved objects. Scene (a) (b) (c) (d) DrawScene(view, depth, objref) { Clear frame buffer Recursion depth 2 2 2 3 // create view-indep. environment maps Planar objects 6 1 2 3 if (depth == 0) { Curved objects 1 3 2 1 for (each reflecting curved object ) { i Triangles in scene 1078 1106 3890 1002 Hide object i Assign unique cube map to object i View dependent method: for (each cube face j) { Generated refl. 38 16 16 46 Select cube face j as render-target Setup env_view for cube face j Fps, static/dyn. 19 fps 32 fps 29 fps 13 fps DrawScene(env_view, depth + 1, i) Used texture mem. 0.5MB 0.5MB 0.5MB 0.8MB Restore render-target - Traditional 1.8MB 1.0MB 1.0MB 1.0MB } Unhide object i View independent method: Update cube map Gen. planar refl. 62 (26) 19 (1) 28 (4) 69 (15) } } Gen. curved refl. 6*1 6*3 6*2 6*1 // draw the objects Fps, dynamic 10 fps 17 fps 8 fps 7 fps for (each object i in scene) { Fps, static 21 fps 97 fps 44 fps 27 fps if ((object is planar reflector) && Used texture mem. 0.9MB 1.6MB 1.3MB 1.1MB (depth < maxdepth)) { if (objref) Unhide object objref - Traditional 1.9MB 1.4MB 1.3MB 1.1MB Select refl.map n = depth as render-target Setup mirror_view Table 1: Measured performance statistics for each DrawScene(mirror_view, depth + 1, NULL) method run for each of the tested scenes. The table Restore render-target Apply refl.map n to object i shows the number of generated reflections, the mea- if (objref) Hide object objref sured frame rates, and the amounts of used texture } else if (object is curved reflector) { Apply assigned cube map to object i memory. The number of planar reflections generated } in static scenes is written in parenthesis. For com- Draw object i } parison, the memory used when using a traditional } method is also shown.

Figure 6: Pseudo code for rendering a scene con- taining both planar and curved reflectors, where cube We observe that both planar and curved recursive re- maps are used as environment map representations for flections can be captured using the proposed meth- curved reflectors. An environment map is generated ods. The results show that the methods can be com- for each curved reflector before rendering the actual putationally expensive for deep recursion levels, due scene (at depth 0). Again, depth and objref are passed to the recursive nature of the algorithms. However, as a parameters. An initial call of DrawScene(view, 0, this was expected as the algorithms are based on NULL) is used for rendering the entire scene. beam-tracing principles. Still, real-time frame rates have been achieved for all of the tested scenes. Al- though the methods are based on texture-based re- 4 RESULTS AND DISCUSSION flection techniques, they exhibit reasonable memory requirements. In the view-dependent implementa- We have implemented both variations of our algo- tion, the requirements solely depend on d, due to the rithm: A view-dependent method (Fig. 5) and a view- utilization of render-to-texture functionality. In the independent method (Fig. 6). Both have been used to view-independent implementation, the memory re- render reflections in scenes containing different num- quirements depend on d for planar objects, and the bers of planar and curved reflectors, at fixed recursion number of curved objects n, as a view-independent depths. The results are shown in Fig. 7, and the mea- environment map is allocated for each curved object. sured performance statistics are shown in Table 1. Thus, in most cases both methods show a reduction in memory requirements compared to methods where All tests were conducted on an Intel Pentium III 450 reflections are pre-generated for each object before MHz PC, with 128 MB RAM, running Windows, rendering into the frame buffer. The savings are most and equipped with a GeForce 3 graphics accelera- significant in scenes with many reflectors. The view- tor. The test program was written in C++ using Di- dependent method is the least memory intensive. rectX 8.0. The view-dependent method used an ap- proximate sphere-mapping technique, while the view- By comparing the visual quality and performance of independent method used cube mapping. Planar re- the two methods in practice, we observe that they flection maps and sphere maps were drawn into tex- both have advantages and disadvantages. The view- ture maps with a 256×256 texel resolution and a 32 dependent method is computationally cheap in scenes bit pixel representation. The cube map resolution was with few reflections at low recursion depths, as only set to 128×128. For a fair comparison, our imple- one view is generated for each reflector. However, mentation did not use LODs or any culling besides because the method requires regeneration of environ- backface culling. Instead, we have used simple test- ment maps for viewpoint changes, it suffers from scenes. However, the use of simple frustrum culling the same computational cost in both static and dy- improves the frame rates by a factor of 2 to 3. namic environments, making it difficult to capture deep interreflections in real-time. Furthermore, the 5 CONCLUSION AND FUTURE WORK use of approximate sphere mapping results in inaccu- rate curved reflections. We have described a texture-based approach for cap- turing recursive reflections on planar and curved sur- The view-independent method is more expensive in faces in both static and dynamic environments. It dynamic scenes, due to the updates of a complex en- takes advantage of hardware texture mapping, render- vironment map. Yet, the method is very computa- to-texture and environment mapping capabilities. tionally cheap in static scenes, and appears to cap- ture infinite recursive reflections on curved objects. We have designed two variations of our basic al- The approximation of interreflections, achieved by re- gorithm. Both use beam-tracing principles to cap- cycling environment maps, yields good results with ture planar reflections, but differ with respect to the fluid, smooth, dynamic animation (high frame rates), parameterization used for curved surfaces: A view- but bad results for fast or jerky animation (low frame dependent method, which uses a view-dependent en- rates). Given a less complex environment map rep- vironment map representation, generated recursively resentation than cube mapping (e.g. dual-paraboloid as in the planar case. And a view-independent mapping), the view-independent method would make method, which uses a view-independent environment it possible to capture deep recursive reflections faster map representation, pre-generated before each frame than the view-dependent method. The method runs and used for rendering all reflections of a single ob- in linear time with respect to the number of curved ject, including interreflections in successive frames. reflectors in dynamic scenes, and in constant time Due to exploitation of render-to-texture functional- in static scenes. Because the method efficiently ex- ity, both algorithms reuse reflection maps when gen- ploits both view-independence and coherence, cap- erating recursive reflections, thereby reducing mem- tures deep interreflections in both static and dynamic ory requirements. Finally, because the methods are scenes, and has potential for being faster than the texture-based, glossy interreflections can be simu- view-dependent method, it is in our opinion the most lated by filtering reflection images. advantageous of the two. The results show that the algorithms can be expensive for deep recursion levels. For only capturing low lev- In general, the environment mapping approximation els of recursive reflections, the view-dependent algo- works well for reflectors that are small compared to rithm is found to be fastest. However, we find that the surrounding environment, but it can be very inac- the view-independent algorithm is the most advan- curate when a reflector’s curvature is large or when tageous of the two, since it captures deep levels of reflected objects are very close to the reflector. This recursive reflections, runs in constant time in static is a problem that our method cannot solve. To do so, scenes (for curved surfaces only), and will be faster we need hardware support for more sophisticated en- than the view-dependent method in dynamic scenes, vironment mapping methods, e.g. [Ofek98, Cho00]. when given a simpler environment map representa- Furthermore, the use of texture-based techniques can tion that allows for fast regeneration. cause texture related magnification artifacts, result- ing in a blocky looking appearance when moving too Future work should examine extensions of the pro- close to a reflector or using low resolution textures. posed methods and test their behavior in more com- Similarly, minification artifacts can arise when look- plex scenes. It would be interesting to examine other ing at a reflector from afar or when using high resolu- environment mapping parameterizations for curved tion textures. Both artifacts can be partially reduced surfaces, e.g. dual paraboloid mapping or a more ac- by scaling the resolution to the projected screen area curate view-dependent parameterization. One could of a reflector. However, this reduces the sampling also investigate ways to use different (preferably interval and can result in temporal aliasing, and as view-independent) parameterizations for planar sur- the maximum size of textures is limited, magnifica- faces, which would yield a faster algorithm. For tion artifacts cannot be completely eliminated. Thus, faster rendering, different LODs and culling schemes for large reflectors the method produces inferior re- should also be tested. Finally, it should be straightfor- sults compared to e.g. stencil buffer reflections. Still, ward to extend the methods to also capture (approx- the lack of quality should be weighted against the fact imate) recursive refraction, as well as simulate more that texture reflections let us use filtering to simulate sophisticated BRDF based reflections. glossy reflections.

Finally, the methods use common pipeline rendering 6 ACKNOWLEDGEMENTS features, and combine well with existing rendering The authors would like to thank Tomas Moller¬ for methods, e.g. and texture mapping, his encouragement and helpful comments. Thanks and are therefore easily integrated into a virtual real- to Scott Cutler and Chris Wynn for additional help. ity system. This work was supported in part by the STVF project DMM and the Nordunit2 project NETGL. (a) (b)

(c) (d) Figure 7: Test scenes containing both planar and curved reflectors. Here, scene (a) is shown rendered using the view-dependent method, while scenes (b,c,d) are rendered using the view-independent method. Scene (b) simulates a glossy floor. The static illumination in these scenes (shadows, etc.) is pre-calculated using radiosity.

REFERENCES

[Basto98] Bastos, R., Sturzlinger,¬ W.: Forward Mapped [Kautz00] Kautz, J., McCool, M. D.: Approximation of Planar Mirror Reflections. Univ. of North Carolina Glossy Reflection with Prefiltered Environment Maps. at Chapel Hill, Computer Science Technical Report Graphics Interface 2000, pp. 119-126, 2000. TR98-026, 1998. [Kilga99a] Kilgard, M. J.: Real-time Environment Reflec- [Basto99] Bastos, R., Hoff, K., Wynn, W., Lastra, A.: tions with OpenGL, Slides, nVidia Corp.,1999. Increased Photorealism for Interactive Architectural [Kilga99b] Kilgard, M. J.: Perfect Reflections and Specu- Walkthroughs. Symposium on Interactive 3D Graphics, lar Lighting Effects With Cube Environment Mapping, pp. 183-190, 1999. Technical Brief, nVidia Corp., 1999. [Cabra99] Cabral, B., Olano, M, Nemec, P.: Reflection [Kilga99c] Kilgard, M. J.: Improving Shadows and Reflec- Space Image Based Rendering. tions via the Stencil Buffer, Technical Report, nVidia (SIGGRAPH’99 Proceedings), 1999. Corp., 1999. [Cho00] Cho, F. S.: Rendering Reflective and Refractive [McRey00] McReynolds, T., Blythe, D., Grantham, B., Objects with Extended Environment Mapping. Com- Nelson, S.: Advanced graphics programming tech- puter Science Division, Berkeley, 2000. niques using OpenGL. SIGGRAPH 2000 Course 32, [Diefe97] Diefenbach, P. J., Badler, N.: Multi-Pass 2000. Pipeline Rendering: Realism For Dynamic Environ- [Mille84] Miller, G. S., Hoffman, C. R.: Illumination and ments. Symposium on Interactive 3D Graphics, Pro- Reflection Maps: Simulated Objects in Simulated and ceedings, 1997. Real Environments. Course Notes for Advanced Com- [Forte00] Fortes, T.: Tetrahedron Environment Maps, puter Graphics Animation, SIGGRAPH’84, 1984. Master’s Thesis, Department of Computing Science, [Niels00] Nielsen, K. H.: Real-Time Hardware-Based Chalmers University of Technology, Gothenburg, Swe- Photorealistic Rendering. Master’s Thesis, Informatics den, 2000. and Mathematical Modelling. Technical University of [Green86] Greene, N.: Environment Mapping and Other Denmark, 2000. Applications of World Projections, IEEE Computer [Ofek98] Ofek, E., Rappoport, A.: Interactive reflections Graphics and Applications, pp. 21-29, 1986. on curved objects. Computer Graphics (SIGGRAPH [Gritz01] Gritz, L., Apodaca, T., Pharr, M., Hery, C. ’98 Proceedings), pp. 333Ð342, 1998. Bjorke, K., Treweek, L. : Advanced RenderMan 3: [Palli99] Pallister, K.: Rendering to Texture Surfaces Us- Render Harder, SIGGRAPH 2001 Course 48, 2001. ing DirectX7, Gamasutra, 1999. [Heckb84] Heckbert, P. S., Hanrahan, P.: Beam Tracing [Voorh94] Voorhies, D., Foran, J.: Reflection vector shad- Polygonal Objects, Computer Graphics (SIGGRAPH ing hardware. Computer Graphics (SIGGRAPH ’94 ’84 Proceedings), 1984. Proceedings), pp. 163Ð166, 1994. [Heidr98] Heidrich, W., Seidel, H. P.: View-independent [Watt00] Watt, A.: 3D Computer Graphics, Addison- Environment Maps. SIGGRAPH, Workshop on Graph- Wesley, 3rd edition, 2000. ics Hardware, pp. 39-44, 1998. [Wynn00] Wynn, C.: Real-Time BRDF-based Lighting us- [Heidr99] Heidrich, W., Seidel, H. P.: Realistic, hardware- ing Cube-Maps, nVidia Corp., 2000. accelerated shading and lighting. Computer Graphics (SIGGRAPH ’99 Proceedings), 1999.