Terrain. Basic Terrain Rendering  산이나 계곡등의 지형을 나타내는 방식  텍스쳐를 추가하면 해변이나 풀덮인 언덕, 눈덮힌 산 등을 표현할 수도 있다.  전체 지형을 다 그리는 것은 낭비이며 보이는 부분만 그리고 (View Frustum.

Slides:



Advertisements
Similar presentations
Geometry Clipmaps: Terrain Rendering Using Nested Regular Grids
Advertisements

CSE 380 – Computer Game Programming Tile Based Graphics Legend of Zelda, by Nintendo, released 1987.
Collisions and Intersections When objects move, test for collision. When projecting surfaces, check for intersections. (Many slides adapted from Amitabh.
1 Convert this problem into our standard form: Minimize 3 x x 2 – 6 x 3 subject to 1 x x 2 – 3 x 3 ≥ x x 2 – 6 x 3 ≤ 5 7 x 1.
Introduction to Programming Lecture 39. Copy Constructor.
CSE 381 – Advanced Game Programming Scene Management
Korea Univ. Graphics Lab. 3D Game Engine Design Chapter 12. Spatial Sorting Chung Ji Hye
Terrain Level of Detail
Terrain rendering in games
1 Terrain. Game Type Oriented Game Type Oriented Terrain Terrain –For visual ( 廣義的場景 ) »Ground / Building / Static models / Dynamic models –For terrain.
Honours Graphics 2008 Session 6. Today’s focus Terrain rendering Heightfield generation Level-of-detail for terrain.
1 Further Terrain Rendering and Level of Detail Lecture 8 - Week 4 Advanced Programming for 3D Applications CE
4.4. L EVEL OF D ETAIL Exploration of 3D mesh level-of-detail approaches.
EFFICIENT RENDERING LARGE TERRAINS USING MULTIRESOLUTION MODELLING AND IMAGE PROCESSING TECHNIQUES Ömer Nebil YAVEROĞLU Department of Computer Engineering.
Point Rendering for Impostors Andreas Bærentzen IMM.
Space Partitioning for Broad Sweep Collision Detection Part 1 - Grids Game Design Experience Professor Jim Whitehead February 11, 2009 Creative Commons.
Image-Based Techniques Hierarchical Image Caching Michael Chung.
1 Terrain Rendering and Level of Detail Week 7 Advanced Programming for 3D Applications CE
8cm 5cm Area = 8 x 5 = 40cm 2 A parallelogram can be split up into a rectangle and 2 triangles – each with the same area. 10cm 5cm.
Week 1 - Friday.  What did we talk about last time?  C#  SharpDX.
Aaron Schultz. Idea: Objects close to a light shadow those far away. Anything we can see from the light’s POV is lit. Everything hidden is dark. Distance.
1 X file & Mesh Chapter 8. 2 What is X file? 1.X file is a file that is used to store D3D program's data. 2.Any X file has extension *.x. 3.X file could.
CS-378: Game Technology Lecture #11: Visibility Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic, Jessica.
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics1 Polygon Meshes and other modeling tools Object representation Polygon meshes Normals Scene graphs.
Managing Your Objects Paul Taylor 2009 Assignment Due Fri 5/6/2009.
© GCSE Computing Candidates should be able to:  explain the representation of an image as a series of pixels represented in binary  explain the need.
Graphics Graphics Korea University cgvr.korea.ac.kr Creating Virtual World I 김 창 헌 Department of Computer Science Korea University
NDVI-based Vegetation Rendering CGIM ‘07 Stefan Roettger, University of Erlangen
TERRAIN SET09115 Intro to Graphics Programming. Breakdown  Basics  What do we mean by terrain?  How terrain rendering works  Generating terrain 
Image Synthesis Rabie A. Ramadan, PhD D Images.
tiled Map Case Study: Rendering with JPanel © Allan C. Milne v
Real-Time Rendering SPEEDING UP RENDERING Lecture 04 Marina Gavrilova.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
Chapter 4: Representation of data in computer systems: Images OCR Computing for GCSE © Hodder Education 2011.
2 COEN Computer Graphics I Evening’s Goals n Discuss application bottleneck determination n Discuss various optimizations for making programs execute.
1 Manage Mesh Data Chapter 8. 2 How to manage Mesh data The most important two objects of mesh are VertexBuffer and IndexBuffer, which can obtained by.
Games Development 1 Camera Projection / Picking CO3301 Week 8.
3D Programming and DirectX API. Content Mathematics Mathematics Prepare to Write a 3D program Prepare to Write a 3D program Program Structure Program.
Frame work CWTFrameWork 멤버 CWTD3DFrameWork 멤버 CWTDummyFrameWork 멤버.
1 KIPA Game Engine Seminars Jonathan Blow Ajou University December 2, 2002 Day 6.
1 + 1 becomes 11 what does our software promise?.
NestedLoops-Mody7-part51 Two-Dimensional Arrays and Nested Loops – part 5 Rotations Barb Ericson Georgia Institute of Technology May 2007.
10/23/2001CS 638, Fall 2001 Today Terrain –Terrain LOD.
BUMP-MAPPING SET09115 Intro to Graphics Programming.
Mark Nelson 3d projections Fall 2013
Game Programming 07 OGRE3D Mesh in Action 2010 년 2 학기 디지털콘텐츠전공.
Representation and modelling 3 – landscape specialisations 4.1 Introduction 4.2 Simple height field landscapes 4.3 Procedural modeling of landscapes- fractals.
1 Subdivision. 2 Subdivision for game Why? Large model require many memory for storage Need to dynamically tessellated during game play Make surface modeling.
VTE File Creation By: Ricardo Veguilla Vazjier Rosario WALSAIP July 2008.
Where We Stand At this point we know how to: –Convert points from local to window coordinates –Clip polygons and lines to the view volume –Determine which.
Honours Graphics 2008 Session 5. Today’s focus Rasterization Visibility determination Coarse / fine visibility determination.
1 CSCE 441: Computer Graphics Hidden Surface Removal Jinxiang Chai.
Print Row Function void PrintRow(float x[ ][4],int i) { int j; for(j=0;j
Graphics, Modeling, and Textures Computer Game Design and Development.
1 Advanced Scene Management. 2 This is a game-type-oriented issue Bounding Volume Hierarchies (BVHs) Binary space partition trees (BSP Trees) “Quake”
Texture Mapping What is texture mapping? - a method for adding detail, surface texture (a bitmap or raster image), or color to a computer-generated graphic.

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.
Bounding Volume Hierarchies and Spatial Partitioning
Image Based Methods of Terrain Rendering Reimar Schubert and A
Terrain Level of Detail
HTML Tables CS 1150 Spring 2017.
Bounding Volume Hierarchies and Spatial Partitioning
What are Range Images?.
CSCE 441: Computer Graphics Hidden Surface Removal
Graphics, Modeling, and Textures
UMBC Graphics for Games
Design Patterns Difficult to describe abstractly Elements:
CS679 - Fall Copyright Univ. of Wisconsin
Run-Time LOD Run-time algorithms may use static or dynamic LOD models:
Presentation transcript:

Terrain

Basic Terrain Rendering  산이나 계곡등의 지형을 나타내는 방식  텍스쳐를 추가하면 해변이나 풀덮인 언덕, 눈덮힌 산 등을 표현할 수도 있다.  전체 지형을 다 그리는 것은 낭비이며 보이는 부분만 그리고 (View Frustum Culling), 멀리 있는 물체는 덜 세밀하게 그려야 (LOD:Level of Detail) 속도가 향상된다.

Terrain Representation  Height Map  사각형의 지역내 각각의 점에 높이 값이 저장되어 있는 map (2 차원 이미지와 비슷한 개념 )  Height Map 을 Geometry 로 변환 (0,0) (1,1) (1,0) (0,1) 높이 좌표는 height map 참조

Terrain LOD Cracks, T-junctions How do we solve this?

Terrain LOD  Subdivide the terrain such that this is easier or done for free  Quadtrees, Bintrees

Quadtree  Each quad is actually two triangles  Still have cracks and T-junctions  Easy to implement

Binary Triangle Tree (bintree)  Cracks and T-junctions are solved!  Any two triangles differ by no more than one resolution level  A little harder to implement  Forced Splitting

Error Estimation/Control τ = 2 pixels 79,382 triangles τ = 4 pixels 25,100 triangles

지형위를 걷기  현재 서있는 지점의 높이 (y 좌표 ) 에 따라 카메라의 높이를 조절한다.  카메라 위치 즉 x 와 z 축 좌표를 이용하여 현재의 셀 ( 삼각형 ) 을 찾아내야 한다.  그 후 x,z 좌표값에서 해당되는 삼각형의 높이값을 계산한다. (0,0) (1,1) (1,0) (0,1)

private: IDirect3DDevice9* _device; IDirect3DTexture9* _tex; IDirect3DVertexBuffer9* _vb; IDirect3DIndexBuffer9* _ib; int _numVertsPerRow; int _numVertsPerCol; int _cellSpacing; int _numCellsPerRow; int _numCellsPerCol; int _width; int _depth; int _numVertices; int _numTriangles; float _heightScale; std::vector _heightmap; // helper methods bool readRawFile(std::string fileName); bool computeVertices(); bool computeIndices(); bool lightTerrain(D3DXVECTOR3* directionToLight); float computeShade(int cellRow, int cellCol, D3DXVECTOR3* directionToLight); struct TerrainVertex { TerrainVertex(){} TerrainVertex(float x,float y,float z,float u,float v) { _x = x; _y = y; _z = z; _u = u; _v = v; } float _x, _y, _z; float _u, _v; static const DWORD FVF; }; class Terrain { public: Terrain( IDirect3DDevice9* device, std::string heightmapFileName, int numVertsPerRow, int numVertsPerCol, int cellSpacing, // space between cells float heightScale); ~Terrain(); int getHeightmapEntry(int row, int col); void setHeightmapEntry(int row, int col, int value); float getHeight(float x, float z); bool loadTexture(std::string fileName); bool genTexture(D3DXVECTOR3* directionToLight); bool draw(D3DXMATRIX* world, bool drawTris);