Overview. 9 - Game World: textures, skyboxes, etc. Texture Mapping. Texture Space. Vertex Texture Coordinates. Texture Mapping. Game World Backgrounds

Similar documents
Overview. 8 - Game World: textures, skyboxes, etc. Texture Mapping. Texture Space. Creating Textures. Vertex Texture Coordinates.

Systems & Biomedical Engineering Department. Transformation

Texture Mapping. Texture Mapping. Map textures to surfaces. Trompe L Oeil ( Deceive the Eye ) Texture map. The texture

CENG 477 Introduction to Computer Graphics. Modeling Transformations

geometric transformations

Spline Curves. Color Interpolation. Normal Interpolation. Last Time? Today. glshademodel (GL_SMOOTH); Adjacency Data Structures. Mesh Simplification

Flow graph/networks MAX FLOW APPLICATIONS. Flow constraints. Max flow problem 4/26/12

Ray Casting. Outline. Outline in Code

Last Time: Curves & Surfaces. Today. Questions? Limitations of Polygonal Meshes. Can We Disguise the Facets?

Curves & Surfaces. Last Time? Today. Readings for Today (pick one) Limitations of Polygonal Meshes. Today. Adjacency Data Structures

Overview. From Point Visibility. From Point Visibility. From Region Visibility. Ray Space Factorization. Daniel Cohen-Or Tel-Aviv University

Interactive Rendering of Atmospheric Scattering Effects Using Graphics Hardware

Traditional Rendering (Ray Tracing and Radiosity)

Effects needed for Realism. Ray Tracing. Ray Tracing: History. Outline. Foundations of Computer Graphics (Fall 2012)

Today. Curves & Surfaces. Can We Disguise the Facets? Limitations of Polygonal Meshes. Better, but not always good enough

NEWTON S SECOND LAW OF MOTION

Gauss-Jordan Algorithm

CS 428: Fall Introduction to. Geometric Transformations (continued) Andrew Nealen, Rutgers, /20/2010 1

Implementing Ray Casting in Tetrahedral Meshes with Programmable Graphics Hardware (Technical Report)

Unfolding Orthogonal Polyhedra with Quadratic Refinement: The Delta-Unfolding Algorithm

Projection & Interaction

Schedule. Curves & Surfaces. Questions? Last Time: Today. Limitations of Polygonal Meshes. Acceleration Data Structures.

STEREO PLANE MATCHING TECHNIQUE

Ray Tracing II. Improving Raytracing Speed. Improving Computational Complexity. Raytracing Computational Complexity

4.1 3D GEOMETRIC TRANSFORMATIONS

RULES OF DIFFERENTIATION LESSON PLAN. C2 Topic Overview CALCULUS

Shortest Path Algorithms. Lecture I: Shortest Path Algorithms. Example. Graphs and Matrices. Setting: Dr Kieran T. Herley.

MOTION DETECTORS GRAPH MATCHING LAB PRE-LAB QUESTIONS

Texture Mapping. Motivation. Examples Image Textures. Idea. towards more realism

Rou$ng. Rou$ng: Mapping Link to Path. Data and Control Planes. Rou$ng vs. Forwarding. Rou$ng Protocols. What Does the Protocol Compute?

Test - Accredited Configuration Engineer (ACE) Exam - PAN-OS 6.0 Version

Fill in the following table for the functions shown below.

6.8 Shortest Paths. Chapter 6. Dynamic Programming. Shortest Paths: Failed Attempts. Shortest Paths

Optimal Crane Scheduling

Sam knows that his MP3 player has 40% of its battery life left and that the battery charges by an additional 12 percentage points every 15 minutes.

Syntax Specification by Graph Grammars and Meta-Models

AML710 CAD LECTURE 11 SPACE CURVES. Space Curves Intrinsic properties Synthetic curves

A time-space consistency solution for hardware-in-the-loop simulation system

In fmri a Dual Echo Time EPI Pulse Sequence Can Induce Sources of Error in Dynamic Magnetic Field Maps

Geometry Transformation

Voltair Version 2.5 Release Notes (January, 2018)

Motor Control. 5. Control. Motor Control. Motor Control

Virtual Recovery of Excavated Archaeological Finds

Structural counter abstraction

CS 152 Computer Architecture and Engineering. Lecture 7 - Memory Hierarchy-II

Simple Network Management Based on PHP and SNMP

Why not experiment with the system itself? Ways to study a system System. Application areas. Different kinds of systems

BI-TEMPORAL INDEXING

LAMP: 3D Layered, Adaptive-resolution and Multiperspective Panorama - a New Scene Representation

Mobile Robots Mapping

Assignment 2. Due Monday Feb. 12, 10:00pm.

Data Structures and Algorithms. The material for this lecture is drawn, in part, from The Practice of Programming (Kernighan & Pike) Chapter 2

A High-Performance Area-Efficient Multifunction Interpolator

EP2200 Queueing theory and teletraffic systems

GPU-Based Parallel Algorithm for Computing Point Visibility Inside Simple Polygons

DETC2004/CIE VOLUME-BASED CUT-AND-PASTE EDITING FOR EARLY DESIGN PHASES

A GRAPHICS PROCESSING UNIT IMPLEMENTATION OF THE PARTICLE FILTER

Finding Paths in Graphs. Robert Sedgewick Princeton University

An Adaptive Spatial Depth Filter for 3D Rendering IP

EECS 487: Interactive Computer Graphics

COSC 3213: Computer Networks I Chapter 6 Handout # 7

Hands on Lab Manual Coherence Introduction

Improved TLD Algorithm for Face Tracking

On Romeo and Juliet Problems: Minimizing Distance-to-Sight

Computer Graphics. Lecture 9 Environment mapping, Mirroring

MIC2569. Features. General Description. Applications. Typical Application. CableCARD Power Switch

DEFINITION OF THE LAPLACE TRANSFORM

A Principled Approach to. MILP Modeling. Columbia University, August Carnegie Mellon University. Workshop on MIP. John Hooker.

Outline. CS38 Introduction to Algorithms 5/8/2014. Network flow. Lecture 12 May 8, 2014

Speeding up your game

High Resolution Passive Facial Performance Capture

The Planar Slope Number of Planar Partial 3-Trees of Bounded Degree

Constant-Work-Space Algorithms for Shortest Paths in Trees and Simple Polygons

COMP26120: Algorithms and Imperative Programming

A GRAPHICS PROCESSING UNIT IMPLEMENTATION OF THE PARTICLE FILTER

REDUCTIONS BBM ALGORITHMS DEPT. OF COMPUTER ENGINEERING ERKUT ERDEM. Bird s-eye view. May. 12, Reduction.

A Tool for Multi-Hour ATM Network Design considering Mixed Peer-to-Peer and Client-Server based Services

Using CANopen Slave Driver

FLOW VISUALIZATION USING MOVING TEXTURES * Nelson Max Lawrence Livermore National Laboratory Livermore, California

Section 2. Mirrors and Prism Systems

M y. Image Warping. Targil 7 : Image Warping. Image Warping. 2D Geometric Transformations. image filtering: change range of image g(x) = T(f(x))

Citation Precision Engineering (2009), 33(2)

Representing Non-Manifold Shapes in Arbitrary Dimensions

3-D Object Modeling and Recognition for Telerobotic Manipulation

Data Structures and Algorithms

Java Metadata Interface(JMI) Specification

Streamline Pathline Eulerian Lagrangian

Scattering at an Interface: Normal Incidence

Location. Electrical. Loads. 2-wire mains-rated. 0.5 mm² to 1.5 mm² Max. length 300 m (with 1.5 mm² cable). Example: Belden 8471

Evaluation and Improvement of Region-based Motion Segmentation

MB86297A Carmine Timing Analysis of the DDR Interface

The Vertex-Adjacency Dual of a Triangulated Irregular Network has a Hamiltonian Cycle

1 œ DRUM SET KEY. 8 Odd Meter Clave Conor Guilfoyle. Cowbell (neck) Cymbal. Hi-hat. Floor tom (shell) Clave block. Cowbell (mouth) Hi tom.

Point Cloud Representation of 3D Shape for Laser- Plasma Scanning 3D Display

A Matching Algorithm for Content-Based Image Retrieval

FINITE DIFFERENCE SOLUTIONS TO THE TIME DEPENDENT HEAT CONDUCTION EQUATIONS. T T q 1 T + = (1)

Optics and Light. Presentation

Image Based Computer-Aided Manufacturing Technology

CAMERA CALIBRATION BY REGISTRATION STEREO RECONSTRUCTION TO 3D MODEL

Exercise 3: Bluetooth BR/EDR

Transcription:

CSc 165 Compuer Game Archiecure Overview Texure Mapping 9 - Game World: exure, kyboxe, ec. Game World Background SkyBoxe & SkyDome World Bound and Viibiliy Render Sae 2 Texure Mapping Texure Space Baic idea: aach an image o an objec o Objec == polygon() o Image ued hi way are called exure Texure have heir own coordinae pace: exel Image Objec Polygon Texure-mapped objec 3 4 4 Verex Texure Coordinae Each verex ha an aociaed exure coordinae o Texure coordinae can be e by he program V = (10, 20) T = (0.0, 1.0) V = (30, 20) T = (1.0, 1.0) combining ligh and exure Color = exurecolor * ( ambienligh + diffueligh ) + pecularligh or Color = exurecolor * ( ambienligh + diffueligh + pecularligh ) or Color = (ambligh * ambmaerial) + (diffligh * diffmaerial) + pecligh fragcolor = 0.5 * exurecolor + 0.5 * lighcolor 10 20 V = (10, 10) T = (0.0, 0.0) V = (30, 10) T = (1.0, 0.0) 5

RAGE Texure clae (inerface) AeManager + ebaedirecorypah (Sring pah) Game World Background (abrac) AbracAeManager + geaebyname (Sring name) + geaebypah (Sring pah) + geaecoun () TexureManager Texure * + eimage (java.aw.image.bufferedimage img) + geimage () Real cene alway have background Game world background MUST be 3D Why? Indoor: room wall Oudoor: horizon cenery TexureManager m = eng.getexuremanager(); Texure redtexure = m.geaebypah("reddolphin.jpg"); 7 8 RoomBoxe SkyBoxe Bu wha abou oudoor game?? Camera RoomBox Soluion: SkyBox o Texure-mapped oudoor cene o Can be mapped ono differen geomerie Recangle Cube Hemiphere 9 10 Texure Cube Map Creaing Texure Cube Map Unfolded cube 11 (6) differen image file Creae a 3D cene Place camera in middle wih 90 FOV Render image in each of ix direcion Some ool: Terragen Blender Bryce SkyPain 3DSudio Max Maya 12

Terragen Example Scene SkyBoxe challenge: Require ix exure ue valuable exure memory Time-conuming o build Cube can caue diorion near corner Can how arifac a exure eam mimache in adjacen exure pixel Inconien definiion of fron & back download Terragen: hp://www.planeide.co.uk 13 14 SKYDOMES World Box Bound N ack M lice (ide) Y Φ r Ө P X Careian (x,y,z) = Polar (r,θ,φ) x = r * co(θ) * co(φ) y = r * in(φ) z = r * in(θ) * co(φ) SkyBox hould alway be far away no maer where uer move Trick: move box wih camera camera alway ay a cener of box. box move, bu doe no urn, wih camera. Blender, Phoohop, and many oher have ool for manipulaing fih-eye panoramic phoo Mo common approach: ranlae box o camera locaion before drawing 15 16 Building a imple SkyBox from crach // Called from eupscene() // - creae a imple SkyBox ou of a Cube creaeskybox: { inaniae a Cube inaniae a SceneNode for he Cube, wih roo a paren aach he Cube o he SceneNode exure he cube wih SkyBox exure (require appropriae exure coordinae) poiion he cube a he camera locaion SkyBox Viibiliy Problem: objec may lie ouide box HSR mean he box will hide hoe objec // Updae() now alo poiion he SkyBox a he camera locaion Updae: { ge camera locaion ranlae SkyBox SceneNode o camera locaion (noe do NOT roae he kybox cube) SkyBox Eye a cener of box Objec ouide of box hould be viible! 17 18

The Z-Buffer ( Deph Buffer ) Pixel (x, y, z) (r, g, b) The Z-Buffer algorihm: Color if (pixel.z < dephbuffer[x,y]) { colorbuffer[x,y] = pixel(r,g,b); dephbuffer[x,y] = pixel(z); y Deph (Z) x 19 Color Buffer y x Deph ( Z ) Buffer SkyBox Viibiliy (coninued) Rendering rick: Effec: o Ree (clear) deph buffer o max deph o Diable deph eing/updaing o Draw SkyBox fir o Re-enable deph eing o SkyBox pixel will have maximum deph o Subequen objec drawn wih updaing enabled will appear cloer How can we make hi API-independen? 20 Render Sae Render Sae (con.) Deired render ae for hi Renderable Renderable Renderer diplay() { for each Renderable r { erendersae(r) drawrenderable(r) Curren renderer ae <<inerface>> RenderSae - enabled : boolean abrac getype(); abrac apply(); Render Sae example: ZBuffer mode Texure mode many oher erendersae(r) { r.gerendersae for each render ae { if enabled, apply drawrenderable(r) { drawarray(r.buffer) <<inerface>> ZBufferSae <<inerface>> TexureSae <<inerface>> FronFaceSae GL4ZBufferSae DXZBufferSae GL4TexureSae DXTexureSae 21 22 in ome engine, render ae are aociaed wih cene node (e.g., SAGE, JMonkey). Differen render ae ype can have differen capabiliie and funcionaliy in hi cae, render ae propagae hierarchically <<inerface>> RenderSae in ome engine, render ae are aociaed wih eniie or renderable, no cene node. Thi i how RAGE work. In hi cae, if a render ae i inended for an enire ubree (e.g., ranparency), he applicaion mu e he render ae for each node individually. <<inerface>> ZBufferSae GLZBufferSae gegltefuncion(); <<inerface>> TexureSae GLTexureSae eminificaionfiler(); ewrapmode(); <<inerface>> FronFaceSae 23 24

Creaing a Skybox in RAGE void eupscene() {... Configuraion conf = eng.geconfiguraion(); TexureManager exuremgr = geengine().getexuremanager(); exuremgr.ebaedirecorypah(conf.valueof("ae.kyboxe.pah")); Texure fron = exuremgr.geaebypah("fron.jpeg"); Texure back = exuremgr.geaebypah("back.jpeg"); Texure lef = exuremgr.geaebypah("lef.jpeg"); Texure righ = exuremgr.geaebypah("righ.jpeg"); Texure op = exuremgr.geaebypah("op.jpeg"); Texure boom = exuremgr.geaebypah("boom.jpeg"); exuremgr.ebaedirecorypah(conf.valueof("ae.exure.pah")); // cubemap exure mu be flipped up-ide-down o face inward; // all exure mu have he ame dimenion, // o any image heigh will do AffineTranform xform = new AffineTranform(); xform.ranlae(0, fron.geimage().geheigh()); xform.cale(1d, -1d); coninued 25 fron.ranform(xform); back.ranform(xform); lef.ranform(xform); righ.ranform(xform); op.ranform(xform); boom.ranform(xform); SkyBox b = m.creaeskybox( myskybox ); b.etexure(fron, SkyBox.Face.FRONT); b.etexure(back, SkyBox.Face.BACK); b.etexure(lef, SkyBox.Face.LEFT); b.etexure(righ, SkyBox.Face.RIGHT); b.etexure(op, SkyBox.Face.TOP); b.etexure(boom, SkyBox.Face.BOTTOM); m.eaciveskybox(b);