130 likes | 226 Views
Terrain Rendering and Level of Detail (LOD) using Stream Processors on GPU. Meghashyam Boyapati. About me. Working as Research Programmer at La Trobe University I had my Masters in Computer Science from La Trobe University
E N D
Terrain Rendering and Level of Detail (LOD) using Stream Processors on GPU MeghashyamBoyapati
About me • Working as Research Programmer at La Trobe University • I had my Masters in Computer Science from La Trobe University • My Interests are ‘Real-time Rendering’ and ‘Constructive Solid Geometry’ in Computer Graphics
Outline • Overview of Terrain Generation Algorithms and LOD techniques for Terrains • Stream Processing • Various Game Engine Terrain Algorithms • My Research
Level of Detail for Terrain Generation Algorithms • Fractal Terrain • Fault Formation • Midpoint Displacement Algorithm • Particle Disposition Algorithm • Various level of detail • Discrete Level of Detail • Continuous level of Detail • View dependent level of detail • CLOD • Quadtrees • ROAM
Height map • Buffer pointer • Size of Height map • 128 * 128 • X axis and Z axis
Fractal Terrain • Fault Formation • Generate a random line • Generate a random height and add to one of the sides • Decrease the height value every iteration linearly from the second pass • Height= Max - ( ( Max-Min )*Iterator)/NumIterations; [1] • Suitable for hills and plateaus. • Time complexity O(n2) • Midpoint Displacement • plasma fractal or diamond-square algorithm. • Dimensions must be power of 2 • Midpoint of the adjacent vertices • Add a random displacement to the midpoint • Both are not able to represent caves and other architectures due to height map configuration
Progressive Meshes • Hughes Hoppe, Microsoft research • A Coarser mesh M0 together with a sequence of ‘n’ detailed records. • Vertex split • Vertex Collapse • Each record stores information associated with vertex split • Represents discrete and scalar attributes required for overall appearance rather than geometry of the surface • Used in DirectX • Another technique called View dependent Progressive meshes is used to refine M0 to Mn based on the viewing frustum • For terrain he created another technique ‘Smooth view-dependent LOD control and its application to terrain rendering’
Quadtrees • The rectangular region is divided into 4 smaller rectangles • The process is iterated until a desired LOD is attained. • It can cause cracks and T-Joints as with hoppe approach
Stream Processing • Streams • Kernels, Nodes in a graph • Local memory reused for I/O streams to minimise external memory bandwidth • No read write operation or external DMA usage while processing streams • Temporary values in kernel are stored Local • Hide costs of memory access using parallelism • Advantages • Explicitly express data dependencies • Exposes parallelism
Computational Primitives in Stream Processing • Read only memory (input streams) • Random Access read only (gather) • Per data element Interpolants • Temperory storage • Map • map(A, f) = applies f(x) to all ai∈ A • F(x) = shader programs • A = Texture, quad • ai = texels, pixels • Gather X = a[i] • Scatter A[i] = X • Reductions • reduce(op, s) returns a0 ⊕ a1 ⊕ … ⊕ an-1 • Op = ⊕, *, avg • Example:reduce(+, [3 1 7 0 4 1 6 3]) = 25 • Scan (parallel prefix) • Given: – Binary associative operator ⊕ with identity I – Ordered set s = [a0, a1, …, an-1] of n elements • scan(⊕, s) returns [I, a0, (a0 ⊕ a1), …, (a0 ⊕ a1 ⊕ … ⊕ an-1)] • Min, Max • Sort, search, … • No Conditional Operations
Various Game Engine Techniques • OGRE • CLOD • GameBryo • CLOD • Unreal • CLOD • Splatting • Anno
Terrain Generation on SIMD • Create a height map texture array • Subdivide() • Select random fragments and displace their height values • Surrounding fragments • Filter (erosion)
Thank You Any Questions?