A Real-Time Photo-Realistic Visual Flythrough
Total Page:16
File Type:pdf, Size:1020Kb
A RealTime PhotoRealistic Visual Flythrough 1;2 1 1 1 Daniel CohenOr Eran Rich Uri Lerner and Victor Shenkar 1 Tiltan System Engineering BneiBrak Israel 2 Scho ol of Mathematical Sciences TelAviv University RamatAviv Israel Abstract In this pap er we present a comprehensive ythrough system which generates photorealistic images in true realtime The high p erfor mance is due to an innovative rendering algorithm based on a discrete ray casting approach accelerated by ray coherence and multiresolu tion traversal The terrain as well as the D ob jects are represented by a textured mapp ed voxelbased mo del The system is based on a pure software algorithm and is thus p ortable It was rst implemented on a workstation and then p orted to a generalpurp ose parallel architecture to achieve realtime p erformance Keywords Terrain Visualization Parallel Rendering Flight Simulator Vi sual Simulations VoxelBased Mo deling Ray Casting Intro duction The quest for realtime photorealistic rendering has b een one of the ma jor goals of D computer graphics in recent years Techniques for adding real ism to the image such as shading shadow textures and transparency have b een develop ed The generation of realistic images in realtime is currently b eing researched Flight simulator applications have always led the way in realtime p erformance Sp ecialpurp ose machines dedicated to ight simulation have b een develop ed These machines generate images with rea sonable realism in realtime but are exp ensive more than a few million US dollars The main contribution of the work presented in this pap er is that the realtime p erformance was achieved on commercial generalpurp ose parallel architecture as opp osed to sp ecialized rendering hardware Generating images of arbitrary complex scenes is not within the reach of current technology However the rate of image generation in ight simulation can achieve realtime b ecause the scenes that are viewed from the sky are not to o complex Typical views contain terrains which are merely D or D ob jects which are seen as relatively simple featureless ob jects Nevertheless simulating photorealistic aerial views in realtime is by no means easy The term visual ythrough can b e distinguished from ight simulation Visual ythrough generates simulated images as seen from a video camera attached to a ying ob ject The camera generates photorealistic images although not necessarily in color since many video cameras have a greylevel output It should b e emphasized that the generation of true photorealistic images is critical for applications where the user needs to recognize the area or identify ob jects on the ground ie targeting mission rehearsal See the photorealistic impression of the images presented in Figure In a typical ythrough scenario the camera views a very large area es p ecially when the camera pitch angle is high ie towards the horizon In many applications the camera ies at high sp eed over long distances and the area covered during a few seconds of ight is vast This suggests that it is not p ossible to load the entire terrain data onto the main memory For some applications even a Gigabyte of RAM is not enough It is safe to say that no size will ever suce since the application demands will always increase according to the availability of space This suggests that ythroughs require a large secondary storage together with a fast paging mechanism An image of an aerial view gains its realistic impression by mapping a digital photograph onto the terrain mo del In order to achieve high quality full resolution of b oth the digital terrain mo del and the corresp onding aerial photograph need to b e employed This causes a ma jor load on conventional graphics hardware based on a geometric pip eline First a high resolution p olygonal terrain mo del contains a vast numb er of p olygons which need to b e pro cessed by the geometric pip eline while pro cessing tiny p olygons loses the costeectiveness of the rasterization hardware The high resolution photo graph that needs to b e texturemapp ed during rasterization creates a further problem since large photographic maps need to b e loaded onto an exp ensive cache For example the RealityEngine b oard cannot hold more than a few Kilobytes of texture while larger textures need to b e paged from the main memory in realtime To avoid that many ight simulators use rep etitive patterns as ground texture but for some applications where a sp e cic target area is a vital requirement a true photograph has to b e mapp ed on the terrain These photographs are huge and must b e loaded on the y to the rasterization hardware forming a serious b ottleneck in the rendering pip eline Instead of using a p olygonal mo del and a geometric pip eline we have favored a software solution where the mo del is represented by a voxelbased representation The texturemapping of the photograph over the mo del is a prepro cessing stage which is decoupled from the rendering stage Voxel based mo deling also lends itself to representing ne grained geometry The voxel data is regular internally represented in an array and oers easy and fast access to the data Each voxel represents and stores some discrete lo cal attributes of the mo del Voxels representing the terrain contain a height value and a color value while the voxels representing a D mo del contain a texture photograph as will b e describ ed b elow in Section A voxel based visual ight simulator with realtime p erformance has b een develop ed at Hughes Training Inc Their ight simulator runs on sp ecial purp ose hardware but yields p o or results on a graphics workstation The visual ythrough that we have develop ed is hardware indep endent and thus p ortable Portability is imp ortant since it enables integration of the ythrough system with rapid progress in hardware platforms However a software rendering algorithm must b e fast enough around a second or two p er frame running on a sequential machine so that on a parallel machine with pro cessors it achieves a rate higher than frames p er second That Figure Two aerial photorealistic images generated by the ythough is of course assuming little overhead is imp osed on the parallel version of the algorithm Although we have employed a parallel machine the real time p erformance is mainly due to an innovative rendering algorithm The new algorithm gen erates a photorealistic image such as in Figure within two seconds on a common workstation The implementation of a parallel version of the al gorithm on a way multipro cessor architecture has sp ed up the rendering to achieve the desired realtime rates It should b e noted that other hard ware indep endent ray casting algorithms have reached reasonable sp eeds but just for p oint sampling Avoiding aliasing artifacts is quite involved and time costly The algorithm presented here resembles the prin ciples of the pro jection algorithm in However their algorithm is based on a forward mapping metho d and was designed to b e implemented in hard ware The algorithm presented in the next section is a simple ray casting Figure The image footprint over the terrain is dened by the viewing parameters forward mapping accelerated by ray coherence and multiresolution traver sal and highly optimized for hardware indep endent implementation The remainder of this pap er is structured as follows Section describ es the rendering algorithm Section presents the IBM Power Visualization System the current parallel platform of the parallel algorithm implementa tion details concerning the parallelization of the algorithm and some results We discuss the generation of voxelbased ob jects in Section and conclude with a brief discussion on our current activity and some nal remarks The Rendering Algorithm The sequence of images generated by the rendering algorithm is indep endent Each image is dened by the lo cation of the camera in D space the camera eld of view and its orientation namely the pitch roll yaw angles and image resolution Figure depicts the image footprint dened by the pro jection of the image frame over the terrain The terrain mo del is represented by a voxelbased map generated from a discrete elevation map colored by a corresp onding aerial photo map The rendering algorithm is based on a backward mapping approach known as ray casting The image is generated by casting a rayofsight emanating from the viewp oint through each of the image pixels towards the mo del see Figure The ray traverses ab ove the Figure Discrete ray casting of a voxelbased terrain terrain voxels until it intersects the terrain The terrain color is sampled and mapp ed back to the source pixel Since the mo del is discrete there is no explicit intersection calculation but a sequential search for a hit b etween the ray and a voxel The sp eed of the ray traversal is crucial for achieving realtime p erformance The technique we employ is based on a discrete grid traversal where the steps along the ray are p erformed on the pro jection of the ray on the plane rather than in D The heights along the ray are incrementally and uniformly sampled and compared to the height of the terrain b elow it until a hit o ccurs and the color of the terrain at the hit p oint is mapp ed back to the source pixel If there is no hit then the background color of the sky is mapp ed This apparently naive traversal is at in contrast to a hierarchical traversal In a pyramidal elevation map is used The multiresolution pyramid is treated as a hierarchy of b ounding b oxes through which the ray traverses in