Game Programming 06 The Rendering Engine

Slides:



Advertisements
Similar presentations
Computer Graphics - Shading -
Advertisements

Virtual Realism TEXTURE MAPPING. The Quest for Visual Realism.
03/16/2009Dinesh Manocha, COMP770 Texturing Surface’s texture: its look & feel Graphics: a process that takes a surface and modifies its appearance using.
Week 7 - Monday.  What did we talk about last time?  Specular shading  Aliasing and antialiasing.
3D Graphics Rendering and Terrain Modeling
Real-Time Rendering TEXTURING Lecture 02 Marina Gavrilova.
ATEC Procedural Animation Introduction to Procedural Methods in 3D Computer Animation Dr. Midori Kitagawa.
University of New Mexico
HCI 530 : Seminar (HCI) Damian Schofield.
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Object-Order vs. Screen-Order Rendering April 24, 2003.
IN4151 Introduction 3D graphics 1 Introduction 3D Computer Graphics part 1 Projective display Viewing pipeline Graphics hardware Image-based rendering.
(conventional Cartesian reference system)
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Adv. Computer Graphics CS6500, Spring 2003.
Texture Mapping from Watt, Ch. 8 Jonathan Han. Topics Discussed Texture Map to Models Bump Maps, Light Maps Environment (Reflection) Mapping 3D Textures.
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Texture Mapping.
Objectives Learn to shade objects so their images appear three- dimensional Learn to shade objects so their images appear three- dimensional Introduce.
Coordinate Systems X Y Z (conventional Cartesian reference system) X Y Z.
Computer Graphics Inf4/MSc Computer Graphics Lecture 11 Texture Mapping.
Guilford County Sci Vis V204.01
SET09115 Intro Graphics Programming
MULTIMEDIA TECHNOLOGY SMM 3001 MEDIA - GRAPHICS. In this chapter how the computer creates, stores, and displays graphic images how the computer creates,
3D Concepts Coordinate Systems Coordinates specify points in space 3D coords commonly use X, Y, & Z A vertex is a 'corner' of an object Different coordinate.
1 Texturing. 2 What is Texturing? 3 Texture Mapping Definition: mapping a function onto a surface; function can be:  1, 2, or 3D  sampled (image) or.
1 Computer Graphics Week13 –Shading Models. Shading Models Flat Shading Model: In this technique, each surface is assumed to have one normal vector (usually.
Polygon Shading. Assigning color to a shape to make graphical scenes look realistic, or artistic, or whatever effect we’re attempting to achieve But first.
CS-321 Dr. Mark L. Hornick 1 3-D Object Modeling.
Shading (introduction to rendering). Rendering  We know how to specify the geometry but how is the color calculated.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 10: Computer Graphics Computer Science: An Overview Tenth Edition.
Modelling and Simulation Types of Texture Mapping.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Chapter 10: Computer Graphics
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 10: Computer Graphics Computer Science: An Overview Tenth Edition.
1 Texture Mapping ©Anthony Steed Overview n Texture mapping Inverse and Forward Mapping Bilinear interpolation Perspective correction n Mipmapping.
COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS 1 Shading (Shading) & Smooth Shading Graphics.
UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS Textures.
1 Virtual Reality Modeling Language (VRML97) ©Anthony Steed
3D Graphics for Game Programming Chapter IV Fragment Processing and Output Merging.
Rendering Overview CSE 3541 Matt Boggus. Rendering Algorithmically generating a 2D image from 3D models Raster graphics.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
CS 445 / 645: Introductory Computer Graphics Light.
CS-378: Game Technology Lecture #4: Texture and Other Maps Prof. Okan Arikan University of Texas, Austin V Lecture #4: Texture and Other Maps.
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Illumination and Shading
Game Programming 07 OGRE3D Mesh in Action 2010 년 2 학기 디지털콘텐츠전공.
RENDERING Introduction to Shading models – Flat and Smooth shading – Adding texture to faces – Adding shadows of objects – Building a camera in a program.
Visual Appearance Chapter 4 Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology.
Local Illumination and Shading
CS559: Computer Graphics Final Review Li Zhang Spring 2010.
OpenGL Shading. 2 Objectives Learn to shade objects so their images appear three-dimensional Introduce the types of light-material interactions Build.
Computer Graphics Ken-Yi Lee National Taiwan University (the slides are adapted from Bing-Yi Chen and Yung-Yu Chuang)
Texturing CMSC 435/ What is Texturing? 2 Texture Mapping Definition: mapping a function onto a surface; function can be: – 1, 2, or 3D – sampled.
1 Geometry for Game. Geometry Geometry –Position / vertex normals / vertex colors / texture coordinates Topology Topology –Primitive »Lines / triangles.
Chapter 10: Computer Graphics
University of New Mexico
Buffers and texture mapping
Photorealistic Rendering vs. Interactive 3D Graphics
Chapter 10 Computer Graphics
Visual Appearance Chapter 4
ATEC Procedural Animation
ATCM 3310 Procedural Animation
3D Graphics Rendering PPT By Ricardo Veguilla.
Chapter 10: Computer Graphics
Procedural Animation Lecture 6: Mapping
ATCM 6317 Procedural Animation
Game Programming Algorithms and Techniques
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
Introduction to Ray Tracing
Presentation transcript:

Game Programming 06 The Rendering Engine 2010년 2학기 디지털콘텐츠전공

Rendering in Video Games Depth-Buffered Triangle Rasterization Virtual Scene Virtual Camera Various Light Sources Visual Properties Solving the Rendering Equation (Shading Equation)

Rendering in Video Games Purpose of the rendering: Photorealism Stylized look (cartoon, sketch, watercolor and so on)

Describing a Scene Scene is composed of objects: Opaque (solid) object Surfaces (triangles) define its shape Don’t care about inside Transparent object

Representing object (surface) Surface: a two-dimensional sheet composed of an infinite number of points in 3D Representation Analytical form (parametric surface equation) Collection of Patches Triangle mesh

Representing object (surface) Analytical form (parametric surface equation) Ex.) Sphere equation

Representing object (surface) Collection of Patches Patch: a simple rectangular surfaces Similar to a quilting Ex.) NURBS, Bezier Surfaces, Subdivision Surface Quilt NURBS surface NURBS modeling

Representing object (surface) Triangle mesh A piece-wise linear approximation to the surface Piece-wise linear approximation to a function Piece-wise linear approximation to a surface

Representing object (surface) Triangle mesh Using a triangle because: It is the simplest type of polygon It is always planar It still remains a triangle after transformations such as affine (projective) transformation All graphics card support a hardware acceleration to draw it

Triangle Mesh Tessellation LOD (Level-of-detail) A process of dividing a surface up into a collection of triangles LOD (Level-of-detail)

Triangle Mesh Winding Order How to define the front/back face direction Counterclockwise (CCW) / Clockwise(CW) Counterclockwise winding order Computing normal direction

Triangle Mesh Representation of mesh Triangle list : 점의 좌표

Triangle Mesh Representation of mesh Indexed Triangle List : 점의 좌표 1 2 1 2 3 4 5 6 7 Vertex list: Indexed triangle list:

Triangle Mesh Other representation of mesh Triangle strip Triangle fan Vertex list: Triangle strip Triangle fan

Model space Positions of a triangle mesh’s vertices are usually specified relative to a local coordinate system. (front/left/up) left up front

World space and mesh instance Individual meshes are located in a scene (world) Mesh instance: Any one mesh might appear many times in a scene Representation: Reference mesh, and its transformation matrix red: model coord. black: world coord.

Visual properties of a surface Information needed to define a final color in the rendered image: Direction of surface normal Diffuse color Shininess/reflectivity Roughness Texture Opacity or transparency Other optical properties : How light should interact with the surface

Introduction to Light What we see is a result of complex interactions of light with matter. Four main interactions of light Absorption Reflection Transmission / refraction (bent) Diffraction

Introduction to Light Absorbed by a surface Why does red look red?

Introduction to Light Reflected by a surface

Introduction to Light Transmitted through a media Partially absorbed or refracted

Color model Color model: how to represent a color RGB (Red-Green-Blue): RGB888 (8 bit for each channel: 0~255 integer) – 24 bit RGB565 (5 bit for red, and blue, 6 bit for green) – 16 bit HSV (Hue-Saturation-Value) LDR (Low Dynamic Range) vs. HDR (High Dynamic Range) HDR: RGB in a higher precision (float value)

Color model LDR with various exposes and tone mapping

Alpha channel Representing opacity A fourth channel to RGB  RGBA or ARGB RGBA8888 – 32 bit per pixel RGBA5551 – 16 bit per pixel

Vertex Attributes Position vector (x, y, z) Vertex normal (nx, ny, nz) Diffuse color (dr, dg, db) Specular color (sr, sg, sb) Texture coordinates (u, v) Skinning weights (w1, w2, …)

Attribute interpolation Flat shading and Gouraud shading Gouraud Shading: Inside color is interpolated from the vertex colors

Texture maps To overcome the per-vertex attribute, using image to fill-in the polygons

Texture maps To overcome the per-vertex attribute, using image to fill-in the polygons + =

Texture maps Texture coordinates: 2D coordinate system defined on an image Denoted as (u,v): uv-coordinate u u v v

Types of textures Types of textures Diffuse map Bump map Normal map Gloss map Environment map

Types of textures Diffuse map describing diffuse surface color

Types of textures Bump map (similarly displacement map) Describes small perturbations in height A sphere without bump mapping (left). A bump map to be applied to the sphere (middle). The sphere with the bump map applied (right)

Types of textures Normal map: encodes normal vectors Low vs. high res. Low res. + diffuse map Low res. + diffuse + normal

Types of textures Gloss map (similarly specular map) encoding how shiny a surface should be

Types of textures Environment map containing a picture of surrounding environment for reflection

Mipmapping Different resolution of the texture with respect to the distance between an object and a camera

OGRE::Mesh in action Get the sample file at our home page Create your own cylinder mesh from scratch.