1 / 53

Why render terrains?

Real-time Terrain Rendering and Processing Shiben Bhattacharjee 200607022 shiben@research.iiit.ac.in Advisor: Prof. P. J. Narayanan. Why render terrains?. Terrains are a basic need in most graphics application Geographical information systems E.g. Google Earth Entertainment: Computer Games

denali
Download Presentation

Why render terrains?

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. Real-time Terrain Rendering and ProcessingShibenBhattacharjee200607022shiben@research.iiit.ac.inAdvisor: Prof. P. J. Narayanan

  2. Why render terrains? • Terrains are a basic need in most graphics application • Geographical information systems • E.g. Google Earth • Entertainment: • Computer Games • Animation Movies • Study of terrains

  3. Chapters • What is terrain rendering? • Real-time Terrain Rendering • Spherical Terrain Rendering • Painterly Rendering of Terrains

  4. What is terrain rendering?

  5. Terrain Data

  6. Terrain Rendering • Do not render geometry which is not visible • View Frustum Culling • Control the detail of geometry rendered according to amount of visibility • Level of Detail scheme • Keep a representation (data structure) • Memory management • Fast processing • Accessibility

  7. Theoretically… • Divide the terrain in tiles • Discard tiles not in view • Reduce the detail of tiles farther from camera

  8. Real-time Terrain Rendering

  9. Representation Array of tilelets (Rendering by GPU) Array of tiles (Rendering by CPU) Blocks (Used for caching)

  10. Global LoD System • Merge level • LoD based on elevation • Whole GPU cache resolution is changed • Lowered, if camera is going higher • Increased, if camera is coming to the ground • Distance level • Tiles’ detail is reduced based on camera distance

  11. Terrain Rendering • Divided in two stages • Stage 1: CPU • View frustum culling (level1) • Render tiles

  12. Terrain Rendering • Stage 2: GPU • Tessellate region between vertices • Access height data for elevation of vertices • 2nd Level of culling • Only for tiles intersecting with view frustum

  13. 2nd Level of Culling • Test tilelet bounds against screen bounds • If outside, GS doesn’t generate tilelet • CPU load reduced Distance based lod Culled tilelet Tilelets which undergo 2nd level of culling Tilelets assumed to be inside

  14. Constant Memory Usage Camera moving up Wide view range required Detail is not necessary

  15. Caching, types of job Merge 4 blocks into 1 Bring new block from main memory

  16. Terrain Deformation • Blocks reside in memory as textures • Edited with fragment shader (like GPGPU) • Procedural deformation or mouse based interactions • Cache is edited directly, thus changes are reflected instantly in the rendering • Deforming a block takes 0.25ms

  17. Interactions: Simple Physics • Textures used to keep position and velocities of point objects • A fragment shader pass updates the values according to collision with terrain • Physics uses terrain in cache, behaves according to its deformation

  18. Spherical Terrain Rendering

  19. Cartography • Latitude-Longitude system • 2D coordinates to refer any point on planet • Map of planet: a 2D image

  20. Terrain Rendering and Cartography • Terrain data available in 2D • Convert 2D samples of data to Polar Coordinates • Render Spherical Structure • Though convenient, has serious problems

  21. Samples on planet – Not uniform • More samples near polar regions • Fewer samples near equator • Uneven distribution of detail • Poles have singularity • Too many vertices coincide

  22. Redundant Information • Data contains a lot of redundant information Compare the size of marked regions

  23. Hierarchical Triangular Mesh (HTM) • Start with an octahedron – 8 equilateral base triangles • Recursive subdivision of the triangles • Stop recursion when appropriate detail reached A. SZALAY, J. GRAY, et al., In MSR-TR-2005-123

  24. HTM: Regular Sampling of Sphere • Uniform sampling of sphere • No pole singularity Poles not cluttered All regions equally sampled

  25. HTM and Terrain Rendering • Transform cartographic data to form 4 images / diamonds • Redundant information removed (saves 50% memory) Eg. 1024x512 4x (256x256)

  26. HTM and Terrain Rendering • Each diamond – data for two base triangles • Each sample maps one-to-one to a vertex in the HTM

  27. Geometry Clipmaps (State-of-the-art Terrain Rendering) • Real-time Terrain Rendering • High Rendering Throughput • Constant memory usage • Square geometry clipmaps cannot be used directly • Equilateral triangles needed • Data still needed in 2D – friendly with GPUs • Changes needed F. Losasso and H. Hoppe., SIGGRAPH, 2004 A. Asirvatham and H. Hoppe., GPU Gems 2, 2005

  28. Terrains World Space Triangles HTM World Space 2D Data Triangles Data is 2D, World Space is not • HTM contains equilateral triangles between samples • A square region in the 2D data = A rhombus in world space • Known terrain rendering techniques use right triangles • New technique needed

  29. Hexagonal Geometry Clipmaps • Clip two opposite corners of a square region at ½ distance • Form a six sided polygon • This polygon takes shape of a hexagon in world space

  30. Hexagonal Geometry Clipmaps • Clip all clipmaps: we get a Hexagonal Clipmap Pyramid • Note: Clipmap data remains 2D with 7/16 of it unusable High level Intermediate level Low level Etc.

  31. Rendering • Clipmaps of different resolution update with different rate • Hexagonal nest distorted periodically due to this • Hexagonal clipmaps tessellated with Rendering Blocks Each red quadrilateral uses a rendering block

  32. View Frustum Culling • Camera yaw required • Determine which three sides to be shown • Max fov ~ 120o (use more sides for greater fov)

  33. Painterly Rendering of Terrains

  34. What is painterly rendering? • Non-photo realistic rendering (NPR) • Convert a photo-realistic image into a artistic hand painted drawing • Use of brush strokes [Perlin, Hertzmann ‘98]

  35. For animation • 3D space information used for rendering brush strokes [B Meier, 96] • Brush strokes alpha blended, sorted back to front

  36. For real-time rendering • 3D space information used for rendering brush strokes/sprites [Bhattacharjee, Adabala, ICVGIP ‘06] • Brush strokes alpha blended • Sorting not done • Depth image used to decide visibility

  37. Terrains • 3D space information can be used from terrain data as well • Brush strokes alpha blended • Getting a depth image is heavy • Terrain have wide view range • Terrains are heavy object • Level of detail complexities

  38. How does an artist does it? • An artist paints on a canvas • 3D information vaguely in the imagination • An artist draws far objects first so that front objects cover them • He/she may be creating 3D environments but strokes individually look flat • Artist may be using different brushes but mostly they remain of the same size • E.g. Close by objects drawn with detail but farther objects abstracted with 2 or 3 strokes

  39. Rendering • Stage 2: GPU • Convert the incoming vertex into a sprite • Access height data for position of stroke • Access slope map for orientation of stroke • Access texture for color of stroke • Maintain size, Ignore change due to projection

  40. Back to front stroke ordering • A scan order of regular 2D samples looks sorted from some orientation camera camera

  41. Back to front stroke ordering • A total of 8 such orientations are enough camera

  42. Back to front stroke ordering • Ordering used for rendering tiles • Ordering used for rendering strokes • No sorting needed • 8 Scanning orders stored • Order is chosen depending on camera pan • That’s only one decision! • No performance affect on rendering

  43. Stroke Orientation • Slope map is a dudv map • Gives the direction of maximum gradient at every point • Stroke accesses the direction • Transforms it in camera space • Orientation of sprite decided

  44. Aesthetics considerations • Using different stroke textures can produce varied painterly styles • Apart from using slope-map for stroke orientation • normal map can be used • A constant can be used • User can create his own texture for stroke’s orientation

  45. Aesthetics considerations • Shiny oil painting

  46. Conclusions

More Related