1 / 54

Image Synthesis

Image Synthesis. Interactive Terrain Rendering. Motivation. Mobile Terrain Visualization. Mobile GPUs 250M pixels / second 5M triangles / second 6 Textures OpenGL ES / Direct3Dm Challenges 1,25 MB Video-RAM… Fixpoint formats Bandwidths Compression, streaming etc. Requirements.

camden
Download Presentation

Image Synthesis

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Image Synthesis Interactive Terrain Rendering

  2. Motivation

  3. Mobile Terrain Visualization • Mobile GPUs • 250M pixels / second • 5M triangles / second • 6 Textures • OpenGL ES / Direct3Dm • Challenges • 1,25 MB Video-RAM… • Fixpoint formats • Bandwidths • Compression, streaming etc.

  4. Requirements • Games • High, constant frame rates • Quality advantageous but not priorized • Simulators • Constant frame rates (~30fps) • High degree of realism and detail, optionally stereo • GIS • Interactive frame rates advantageous (15+ fps) • High resolution and precision

  5. Oberbayern and Alps Heightfield with texture ~ 350 MB Crater Lake, Oregon, US Heightfield with bathimetry and texture ~ 500 MB Puget Sound, WA, USA Heightfield with texture ~ 1.25 GB Challenges

  6. Mars, MOLA mission Heightfield with texture ~ 4.5 GB USA complete, USGS data Heightfield ~ 40 GB Mars, MarsExpress mission Heightfield with texture (Video) ~ 175 GB Challenges

  7. Challenges Data sets are: • Large to gigantic • Data volume is increasing rapidly • Sometimes multi-modal • Color, Albedo, Cloud coverage, Scattering properties, … • Sometimes annoted and commented • Additional layers with meta data Efficient Rendering ?

  8. Terrain rendering • Terrain: • A height field over a rectangular domain • Given at discretesample points

  9. Terrain rendering Rendering litandtexturedtriangles • Vertices, texturecoords, colors, normals

  10. Terrain rendering • Ray-Tracing • Ray-tracing triangle meshes • Trace rays until a triangle is hit • Implicit occlusion culling

  11. Terrain rendering • Ray-Tracing - performanceissues • Meshdatastructurehastobestored • Hierarchicalrepresentationnecessaryforimprovedintersectiontest OctreeorkD-tree max/min(H) max/min(H) max/min(H) Store max/min heightsforsubregions Skip regionsbelow minimal heightofray Employraycoherences

  12. Terrain rendering • Rendering polygonal models – analysis • Aliasing due toundersamplingofsmallfeatures • Noexploitationofthe LOD-nature

  13. Terrain rendering • Rendering techniquesforterrains • Render eachtriangleseparately • Draw: (v0,v1,vX), (v1,vX,vX+1), ... • Eachvertexisrendered (transmitted, transformed) sixtimes ... VX VX+1 VX+2 VX+3 ... VX-1 V0 V1 V2 V3

  14. Terrain rendering • Rendering techniques for terrains • Render triangle strips: v0,vX,v1,vX+1,v2,vX+1, ... • Triangle defined by new point and previous two points • Each vertex is rendered only once ... VX VX+1 VX+2 VX+3 ... VX-1 V0 V1 V2 V3

  15. Terrain rendering • Height fieldpre-processing • Reducenumberof primitives bymeshdecimation • Meshdecimationbased on anydecimationctriterion • Curvature („flatness“) • Usefewer but larger triangleswheretheheightfieldis flat

  16. Terrain rendering • Even with mesh decimation there are still too many triangles • Some features might not be visible because they are too far from the viewer • Feature size is smaller than size of a pixel • Level-of-detail should be adapted to the size of details when displayed rather than to their size in world space

  17. Terrain rendering • Approach: adaptively decimate the mesh with regard to the current view • General idea: • Top-down approach • Start with coarse resolution (2 triangles) and adaptively refine until desired level-of-detail is reached • Consider world space and screen space deviation • Re-build mesh for every frame

  18. Terrain rendering • Recursive split operation (as in ROAM)

  19. Terrain rendering • Error criterion for split operation • Deviation in world space • Difference between height value at center vertex and average of left and right vertex • Deviation in screen space • Determine upper bound for screen space length of world space difference vector (0,d,0)

  20. Previous Work • Processand render Batches ofgeometry: (P-)BDAM • Hugepre-processingrequirements • Hardware requirements (SCSI Raid) • Average Quality • Hierarchical, regularGrids: (GeometryClipmaps) • Goodcompression, goodframerates • Error controlveryhard, qualitysuffers • Losasso & Hoppe SIGGRAPH 2004 • Vastbodyofliterature… seewww.vterrain.org • Key Insight: Dynamic remeshingtoo expensive

  21. Geometry clipmaps • Terrain as mipmap pyramid- LOD using nested grids- LOD is shifted over domain, with varying height values Coarsest Level Finest Level

  22. Geometry clipmaps • Advantages: • Regular structure of nested grids enables fast rendering using triangle strips • Only regular and continuous chunks of memory have to be read • Disadvantages: • Does not allow to control local world/pixel error • Renders more triangles than necessary • Introduces a significant higher pixel error in general

  23. GPU-friendly terrain rendering • Tile-based, restrictedQuadtree • Lmaxerrormetricallowsforpreciseerrorcontrol • Low pre-processingtimes (15M vertices/min) • Nestedhierarchy • Pre-filtered, tiled S3TC-Mipmaps • High-qualityLanczospre-filtering • Reducesartifactsattileborders • S3TC virtuallyforfree • Precise Level of Detail Oracle • Based on theJacobianoftheprojection • Does not make linear approximations • Better anti-aliasingcontrol

  24. Tile-based… • Partition dataintosquaretiles • Can bepre-processedindependently • Frustumculling per tile • Progressive datatransfer per tile • T-Vertices: Fix withzero-areatriangles • Onlydynamictriangulationduringrun-time.

  25. Restricted Quadtree Hierarchy • Tiledmeshesaredecimated in a pre-process • Meshdecimationas in ROAM (Real-Time OptimallyAdaptingMeshes - seewww.vterrain.org) • Exploits a trianglebintreestructure: splitalongthebaseedge

  26. Restricted Quadtree Hierarchy • The recursivesplitoperation • A triangleshouldbesplit but has a baseneighborfrom a coarserlevel • Force splitofbaseneighborfirst • Recursivelyforcefurthersplitsifnecessaryuntildiamondisfound • Diamond canbesplitwithoutfurthersplits

  27. Restricted Quadtree Hierarchy • Recursive split operation

  28. Restricted Quadtree Hierarchy • Vertices can be shared across levels • „Coarse“ Vertices used in all finer levels • Progressive encoding, less memory consumption

  29. Restricted Quadtree Hierarchy • Bygeneratingapproximationsoftheheightfieldwithdecreasinglylowerapproximationerror, a meshhierarchythatrepresentsthe original terrainateverfinerscalesisconstructed • Togenerate a discretesetofhierarchylevels, an errorvector (e0; e1; … ;e(n-1)) ofexponentiallydecreasingentries ei:= 2(n-1-i)isspecified • Hierarchylevelsthatsatisfytheseerrorsareconstructed via adaptive triangulation

  30. Restricted Quadtree Hierarchy • Eachhierarchylevelcanbe render as „recursivetrianglefans“ • Fans around „quadtreecenters“ • Exploit primitive restarts on nVidiaarchitectures • A flag in the primitive streamthatindicates a newfan • Usedtoavoidfrequentcallsfromapplicationprogram

  31. Restricted Quadtree Hierarchy • Nested Mesh Hierarchy: • Quadtree refinement: • Automatically results in nested mesh • Each new triangle re-uses two old vertices • Elegant geomorphing possible • Requires only one height value per vertex & level • Can be implemented in vertex shader „The parameter domain of each triangle is a subset of the parameter domain of exactly one triangle at the coarser levels.“

  32. Tiled, S3TC Mipmaps • Tiled Mipmaps: • Start with large 2D texture • Generate large Clipmap using Lanczos filter • Tile after filtering  artifacts at boundaries reduced • S3 Texture Compression • Designed for Games  Supported by virtually all GPUs • Fast encoding in driver • Decoding virtually for free • Block Truncation Code, 4x4 pixels per block • Lossy compression: 6:1  Quality ? • We are researching other GPU-friendly methods…

  33. S3TC Quality ? Pros: „rough“ textures

  34. S3TC Qualität And Cons… - „smooth“ textures

  35. Texture compression • Vector quantization Input mapping Encoder in=E(Xn) Xn Codebook C with codewords Decoder in X‘n=C(in) Output mapping

  36. Vector Quantization • Find centroids (representativevectors) towhich all elementsareassigned • Elements getassignedto „closest“ representative

  37. Texture compression Vectorquantization: the LBG-Algorithm • Initalcodebook {Yi(0)}i=1..M; IRn: setofinputvectors; • Initialization k=0, D(0) =0, set • Find quantizationregionsVi(k) = {XI: d(X,Yi) < d(X,Yj) j≠i, j=1..M} • Computedistortion • Test: If (D(k)-D(k-1))/D(k) < ) stop elsecontinue • Update: increment k, find newcodebook{Yi(k)}i=1..MfromregionsVi(k-1); goto 3

  38. Texture compression True-Color (3*8 Bit) vs. 12 Bit Quantization + Codebook

  39. Texture compression 8 Bit 6 Bit 4 Bit 2 Bit

  40. Texture compression Region quantization 2 bpp, 2x2 pixel encoding 2 bpp

  41. Confocal scan 10242x64 RGBA 32 bpp 1 bpp

  42. CT scan 2563 Original Hierarchical encoding 21:1

  43. Engine CT scan 2562x128 Original Hierarchical encoding 21:1

  44. Visible Male RGB slice 2048x1216 Original 24 bpp Hierarchical encoding 0.3 bpp

  45. Vortex simulation 100 x 1283 Original, 200 MB Hierarchical encoding 11 MB

  46. Shockwave simulation 96 x 2563 Original, 1.4 GB Hierarchical encoding 70 MB

  47. Texture compression • Vector quantization for GPUs • Easy to decode in fragment shader • Only requires a dependent texture fetch (uses index to lookup the entry in the codebook) • Does not allow for texture filtering (so far) • Interpolation between indices gives errorenous results • Eventually larger regions can be decoded, rendered into texture render target and then used to texture the object • Functionality is available but mipmapping might be a problem

  48. Scale of detail • Question: • Now that we have a geometry and a texture MipMap, how is the resolution determined at which a particular tile has to be rendered • Guess: • Depends on distance to viewer • Depends on projection used for rendering • Depends on orientation of tile

  49. Scale of detail • Projectionis non-linear (hom. division) • Pixel coords s(v), where v vertex in objectspace • Objectspacescaletopixelcorrespondence • SimilartoMipmapping • Requires partial derivatives • Can beobtainedbythe inverse Jacobianof s(v): • Jacobian s(v) = ∂si/∂vi • Jacobian-1 s(v) = ∂vi/∂si

  50. From scale to level of detail • Pre-process: levels L with errors 2L meters • LOD =log2() for bounding box corners of tiles • Tri-linear interpolation of  in box • LOD per vertex for geomorphs • Find minimum of  for each box • Finest detail determines used topology • Project vertices to appropriate level (geomorph) • Requires pre-computed height for each vertex & level • But only for coarser levels • And can be done in reduced precision (i.e. 8bits)

More Related