Real-time Terrain Rendering and Processing Shiben ...

Real-time Terrain Rendering and Processing Shiben ...

Real-time Terrain Rendering and Processing Shiben Bhattacharjee 200607022 [email protected] 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 Animation Movies

Study of terrains Chapters

What is terrain rendering? Real-time Terrain Rendering Spherical Terrain Rendering Painterly Rendering of Terrains What is terrain rendering?

Terrain Data 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 Theoretically

Divide the terrain in tiles Discard tiles not in view Reduce the detail of tiles farther from camera Real-time Terrain Rendering Representation

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

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 Terrain Rendering Divided in two stages Stage 1: CPU View frustum culling (level1) Render tiles

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

2 Level of Culling nd Test tilelet bounds against screen bounds If outside, GS doesnt generate tilelet CPU load reduced e

as eb nc sta Di od dl

Culled tilelet Tilelets which undergo 2nd level of culling Tilelets assumed to be inside Constant Memory Usage

Camera moving up Wide view range required Detail is not necessary Caching, types of job Merge 4 blocks in to 1

Bring new block from main memory 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 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 Spherical Terrain Rendering Cartography

Latitude-Longitude system 2D coordinates to refer any point on planet Map of planet: a 2D image 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 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 Redundant Information Data contains a lot of redundant information Compare the size of marked regions

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

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

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

HTM and Terrain Rendering Each diamond data for two base triangles Each sample maps one-to-one to a vertex in the HTM 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

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 a Terr ins

Triangles World Space HTM World Space

2D Data Triangles Known terrain rendering techniques use right triangles New technique needed 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 Hexagonal Geometry Clipmaps Clip all clipmaps: we get a Hexagonal Clipmap Pyramid High level Intermediate level

Low level Etc. Note: Clipmap data remains 2D with 7/16 of it unusable 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 View Frustum Culling Camera yaw required Determine which three sides to be shown Max fov ~ 120o (use more sides for greater fov)

Painterly Rendering of Terrains 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]

For animation 3D space information used for rendering brush strokes [B Meier, 96] Brush strokes alpha blended, sorted back to front 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 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

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 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 Back to front stroke ordering A scan order of regular 2D samples looks sorted from some orientation

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

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 Thats only one decision!

No performance affect on rendering 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 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 strokes orientation Aesthetics considerations Shiny oil painting

Conclusions Conclusions Aimed to find methods for different needs for handling terrains Rendering large terrains Constant memory usage Cache update adaptive to rendering load Tessellation done by Geometry Shader

Two level culling system Manipulations on GPU Designed for full accessibility Spherical Terrain Rendering Hexagonal Geometry Clipmaps = Geometry Clipmaps + HTM New method to sample maps of planet earth

Painterly rendering of terrains Strokes rendered with back to front order without sorting Level of detail scheme for strokes Use of GPU to render strokes for performance The End Thank you

Recently Viewed Presentations

  • OWASP Plan - Strawman

    OWASP Plan - Strawman

    OWASP CLASP. Comprehensive, Lightweight Application Security Process. Prescriptive and Proactive. Centered around 7 AppSec Best Practices. Cover the entire software lifecycle (not just development) Adaptable to any development process. CLASP defines roles across the SDLC. 24 role-based process components. Start...
  • Research and Impact

    Research and Impact

    EC as a technique and an approach. EC as a way of being and a way of becoming. EC model. Aware. Accept. A. dopt. A. dapt. Sustain 'gives you a sense as a person, or that feeling, like you have...
  • Demand Elasticity - Mr. Brown's Webpage

    Demand Elasticity - Mr. Brown's Webpage

    The price elasticity of demand is closely related to the slope of the demand curve. Rule of thumb: The flatter the curve, the bigger the elasticity. The steeper the curve, the smaller the elasticity. Five different classifications of . D....
  • Humanistic

    Humanistic

    How does this relate to the Social Learning Theory? Humanistic. Strive for self-actualization (one's unique potential) Developing sense of self; subjective. Abraham Maslow (Self-actualization) & Carl Rogers ("The Self") How are these people similar?
  • ECO290E: Game Theory

    ECO290E: Game Theory

    ECO290E: Game Theory ... However, rationality alone is often insufficient to lead to NE. (see Battle of the sexes, Hawk-Dove game, etc.) A common (and correct) belief about future actions combined with rationality is enough to achieve NE. 2 and...
  • Unidad Iii Estequiometría

    Unidad Iii Estequiometría

    El peso molecular o formular, corresponde al peso total, es decir, al 100 % del compuesto. De acuerdo a la ley de la composición definida, la composición porcentual de una substancia o compuesto siempre es la misma, sin importar el...
  • Student Information System (SIS) & myCourses This week

    Student Information System (SIS) & myCourses This week

    myCourses - Helpful Hints. Drop Box: When submitting an assignment SAVE your confirmation email and VERIFY you sent it to the correct course . If you have an assignment partially done and the cut-off time is running close, submit it...
  • Department of Consumer Protection

    Department of Consumer Protection

    30-6-A23 Sanitation SANITATION PERMIT FRAMED & HUNG IN PLAIN VIEW PERMIT RECORDED Conduct of permit premises 30-6-A24a Memo by Director Suchy Re: Gambling Press Release From Commissioner Farrell RE: Gambling 30-6-A10 REFUSAL TO COOPERATE 30-86 SALE TO MINORS PACKAGING MATERIAL...