CSE 381 – Advanced Game Programming Terrain

Slides:



Advertisements
Similar presentations
CSE 380 – Computer Game Programming Tile Based Graphics Legend of Zelda, by Nintendo, released 1987.
Advertisements

Adam Miles. Transport Tycoon Deluxe (TTD): Written by Chris Sawyer for Microprose in Written almost entirely in Assembly language. Designed for.
Exploration of advanced lighting and shading techniques
Reconstruction from Voxels (GATE-540)
Adam Miles.  Transport Tycoon Deluxe (TTD):  Written by Chris Sawyer for Microprose in  Written almost entirely in Assembly language.  Designed.
CS123 | INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © 1/16 Deferred Lighting Deferred Lighting – 11/18/2014.
Graphics Pipeline.
CSE 380 – Computer Game Programming Pathfinding AI
3D Game Programming All in One By Kenneth C. Finney.
Introduction General Data Structures - Arrays, Linked Lists - Stacks & Queues - Hash Tables & Binary Search Trees - Graphs Spatial Data Structures -Why.
Chapter 4 Digital Multimedia, 2nd edition Vector Graphics.
Introduction to 3D Graphics John E. Laird. Basic Issues u Given a internal model of a 3D world, with textures and light sources how do you project it.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Beyond Meshes Spring 2012.
Guilford County Sci Vis V204.01
CSS 522 Topics in Rendering March 01,2011 Scott and Lew.
CSE 381 – Advanced Game Programming Terrain Management
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Lightmaps from HDR Probes Bernhard Spanlang VECG Group University College London
CSE 381 – Advanced Game Programming Basic 3D Graphics
Introduction to Textures and Skins Chapter 8 & 9 3D Game Programming All-in-One By Ken Finney.
Computer Graphics Texture Mapping
Dynamic Meshing Using Adaptively Sampled Distance Fields
Main Goal Development of an application that allows flying virtually over El Hierro Island (Canary Islands), showing the building structures of a hydroelectric.
TERRAIN SET09115 Intro to Graphics Programming. Breakdown  Basics  What do we mean by terrain?  How terrain rendering works  Generating terrain 
CS 450: COMPUTER GRAPHICS REVIEW: INTRODUCTION TO COMPUTER GRAPHICS – PART 2 SPRING 2015 DR. MICHAEL J. REALE.
Advanced Computer Graphics Depth & Stencil Buffers / Rendering to Textures CO2409 Computer Graphics Week 19.
Computer Graphics Bitmaps & Sprites CO2409 Computer Graphics Week 3.
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
CSE 381 – Advanced Game Programming GLSL Lighting.
Game Programming 08 OGRE3D Material in Action 2010 년 2 학기 디지털콘텐츠전공.
CO1301: Games Concepts Dr Nick Mitchell (Room CM 226) Material originally prepared by Gareth Bellaby.
1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
Mark Nelson 3d projections Fall 2013
CSCE 552 Spring D Models By Jijun Tang. Triangles Fundamental primitive of pipelines  Everything else constructed from them  (except lines and.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
Sky Boxes and Vector Math 2 Course Information CVG: Programming 4 My Name: Mark Walsh Website:
CSE 380 – Computer Game Programming Tile Based Graphics & Scrolling Legend of Zelda, by Nintendo, released 1987.
CS324e - Elements of Graphics and Visualization Fractals and 3D Landscapes.
Games Development 1 Review / Revision CO2301 Games Development 1 Semester 2.
CS 325 Introduction to Computer Graphics 04 / 12 / 2010 Instructor: Michael Eckmann.
Build your own 2D Game Engine and Create Great Web Games using HTML5, JavaScript, and WebGL. Sung, Pavleas, Arnez, and Pace, Chapter 5 Examples 1.
Main characteristics of Vector graphics  Vector graphics provide an elegant way of constructing digital images (diagrams, technical illustration and.
Chapter 10: Computer Graphics
Model Optimization Wed Nov 16th 2016 Garrett Morrison.

- Introduction - Graphics Pipeline
Scene Manager Creates and places movable objects like lights and cameras so as to access them efficiently, e.g. for rendering. Loads and assembles world.
Ying Zhu Georgia State University
Week 2 - Monday CS361.
CSE 214 – Computer Science II Maps
Week 7 - Monday CS361.
Photorealistic Rendering vs. Interactive 3D Graphics
Deferred Lighting.
3D Graphics Rendering PPT By Ricardo Veguilla.
The Graphics Rendering Pipeline
CS451Real-time Rendering Pipeline
Statistical surfaces: DEM’s
Software Rasterization
Bitmap, Vector, Pixels, Resolution, Metadata.
Surface Analysis Tools
Lighting.
UMBC Graphics for Games
Lecture 13 Clipping & Scan Conversion
Computer Graphics Module Overview
Computer Graphics Introduction to Shaders
Chapter XV Shadow Mapping
Games Development 1 Review / Revision
Scalable light field coding using weighted binary images
Using billboards within games
GEARS: A General and Efficient Algorithm for Rendering Shadows
Presentation transcript:

CSE 381 – Advanced Game Programming Terrain Badlands, South Dakota

Think of it as a textured blanket

Obviously a rendering challenge Also a collision detection challenge Terrain Obviously a rendering challenge Also a collision detection challenge Requires a huge amount of data for outside game environments Usually pre-lit – what does this mean? Typically integrated with: sky water sun

Terrain Characteristics fidelity how realistic is it? for model & textures spread degree to which areas of the terrain are unique freedom how much are the player’s movements restricted by the terrain? Want real earth terrain data? http://edcwww.cr.usgs.gov

Some game engines have terrain managers Terrain Modeling Some game engines have terrain managers with their own GUI terrain generation tools with their own rendering optimizations Terrain building as models can also be positioned, rotated, etc. as one

Texturing provides this Typical textures: Terrain Cover Texturing provides this Typical textures: grass, flowers, dirt, pebbles, rocks, moss, sand, stone, etc. Most engines support terrain texture blending What’s that? good for transition areas at borders of differing terrain

When making Terrain Textures avoid making distinctive marks Why? avoid making textures with patterns Remember, these will be repeated over an area

How do you think terrain data is stored? Height maps What’s that? a 2D image that stores topographical info for a square map region different shades of gray represent different elevations brightness of a pixel denotes its elevation

Each pixel represents an area’s elevation More on height maps Each pixel represents an area’s elevation ex: 1 pixel is a square meter black may be the base elevation pure white may be the other extreme values in between are scaled Ex: 8 bits per pixel means 256 possible elevations

Each pixel represents a tile (square of terrain) For each tile Using Height Maps Terrain generator reads a height map file and creates the appropriate geometry How? Each pixel represents a tile (square of terrain) For each tile a vertex is generated at appropriate elevation two triangles are generated connecting new vertex to bordering vertices Some generators will add more vertices Why? Interpolation (more on this later)

Terrain Units WU – world units Example: refers to measurement scale for a game world basic WU is one inch Example: level tile is 10 X 10 units (meters or otherwise) 100 tiles X 100 tiles level is 1000 X 1000 NOTE: each tile may have many triangles again, depending on interpolation

Think of as its own level object Has a position, scale, rotation Water Think of as its own level object Has a position, scale, rotation Typically specified using a single rectangle can fit into non rectangular terrain contours For camera out of water: typically water drawn using multiple textures one for shallows, one for deep can be blended via depth gradient effects then applied E.g., specular highlights For camera under water: other effects like fog, viscosity, waves, etc.

Terrain Rendering What do we need to know? how to store the data how to load it how to render it how to detect collisions with it. Why? Nothing should go below the terrain

Height Maps Revisited Height maps are images When a level is loaded, how might we store terrain data such that it can be efficiently: rendered used in collision detection calculations

2 Terrain Management Options Static Option - Load height map into a mesh (or meshes) and treat terrain as any other mesh easy to implement typically divided into clumps Dynamic Option - Load height map data into data structure, each frame, use dynamically changing mesh based on location of frustum that’s a bit trickier

Clumps What’s a clump? What’s the benefit of managing clumps? Why? a chunk of terrain subset of a level’s full terrain What’s the benefit of managing clumps? more efficient rendering/management of terrain Why? problem reduction

Clump Construction Example Suppose we are loading a 256 x 256 height map Construct terrain as 16 x 16 clumps How many clumps is that? 256 How many vertices per height map pixels? depends on interpolation (more on this in a moment)

How do we use the clumps? Each frame, select only the visible clumps for rendering How do we do that? frustum culling is one way but there’s a simpler way clumps are cells in the 2D grid in what cell is the camera? render that clump in which direction is the look at vector? render those clumps know the max clump distance that can be viewed

Dynamic Terrain Generation Height map is a 2D grid At start of level: build a recyclable mesh to store dynamic terrain Each frame: determine where on the grid the camera is fill dynamic terrain with visible portions of grid

What’s the point of interpolation? Rounding terrain How? add more vertices to the grid Simple algorithm add 2 between each pair of vertices what height? make them closer to nearest existing vertex than 1/3 of height difference. Why?