CGDD 4003 THE MASSIVE FIELD OF COMPUTER GRAPHICS.

Slides:



Advertisements
Similar presentations
COMPUTER GRAPHICS SOFTWARE.
Advertisements

Technische Universität München Computer Graphics SS 2014 Graphics Effects Rüdiger Westermann Lehrstuhl für Computer Graphik und Visualisierung.
CS 352: Computer Graphics Chapter 7: The Rendering Pipeline.
Graphics Pipeline.
CS 4363/6353 BASIC RENDERING. THE GRAPHICS PIPELINE OVERVIEW Vertex Processing Coordinate transformations Compute color for each vertex Clipping and Primitive.
Computer Graphic Creator: Mohsen Asghari Session 2 Fall 2014.
3D Graphics Rendering and Terrain Modeling
Real-Time Rendering TEXTURING Lecture 02 Marina Gavrilova.
CAP4730: Computational Structures in Computer Graphics Visible Surface Determination.
Computer Graphics Visible Surface Determination. Goal of Visible Surface Determination To draw only the surfaces (triangles) that are visible, given a.
Basics. OpenGL. “Hello world” George Georgiev Telerik Corporation
CS 4363/6353 INTRODUCTION TO COMPUTER GRAPHICS. WHAT YOU’LL SEE Interactive 3D computer graphics Real-time 2D, but mostly 3D OpenGL C/C++ (if you don’t.
Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova.
HCI 530 : Seminar (HCI) Damian Schofield.
Chapter 6: Vertices to Fragments Part 2 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley Mohan Sridharan Based on Slides.
CS 4731: Computer Graphics Lecture 18: Hidden Surface Removal Emmanuel Agu.
CSCE 590E Spring 2007 Graphics I By Jijun Tang. Announcements Second presentation will be held on April 16 th and 18 th  April 16 th : Space Banditos,
Game Engine Design ITCS 4010/5010 Spring 2006 Kalpathi Subramanian Department of Computer Science UNC Charlotte.
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.
Hidden Surface Removal
Shadows Computer Graphics. Shadows Shadows Extended light sources produce penumbras In real-time, we only use point light sources –Extended light sources.
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 19 Other Graphics Considerations Review.
Basic Graphics Concepts Day One CSCI 440. Terminology object - the thing being modeled image - view of object(s) on the screen frame buffer - memory that.
University of Illinois at Chicago Electronic Visualization Laboratory (EVL) CS 426 Intro to 3D Computer Graphics © 2003, 2004, 2005 Jason Leigh Electronic.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Programmable Pipelines. Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
CSE 381 – Advanced Game Programming Basic 3D Graphics
Week 2 - Wednesday CS361.
CSCE 552 Fall D Models By Jijun Tang. Triangles Fundamental primitive of pipelines  Everything else constructed from them  (except lines and point.
C O M P U T E R G R A P H I C S Guoying Zhao 1 / 14 C O M P U T E R G R A P H I C S Guoying Zhao 1 / 14 Going-through.
CS 450: COMPUTER GRAPHICS REVIEW: INTRODUCTION TO COMPUTER GRAPHICS – PART 2 SPRING 2015 DR. MICHAEL J. REALE.
Week 2 - Friday.  What did we talk about last time?  Graphics rendering pipeline  Geometry Stage.
Advanced Computer Graphics Depth & Stencil Buffers / Rendering to Textures CO2409 Computer Graphics Week 19.
Graphics Systems and OpenGL. Business of Generating Images Images are made up of pixels.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
COMPUTER GRAPHICS CSCI 375. What do I need to know?  Familiarity with  Trigonometry  Analytic geometry  Linear algebra  Data structures  OOP.
CAP4730: Computational Structures in Computer Graphics 3D Transformations.
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
2 COEN Computer Graphics I Evening’s Goals n Discuss application bottleneck determination n Discuss various optimizations for making programs execute.
Computer Graphics 2 Lecture 7: Texture Mapping Benjamin Mora 1 University of Wales Swansea Pr. Min Chen Dr. Benjamin Mora.
Implementation II Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
Implementation II.
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.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Subject Name: Computer Graphics Subject Code: Textbook: “Computer Graphics”, C Version By Hearn and Baker Credits: 6 1.
CS559: Computer Graphics Final Review Li Zhang Spring 2010.
Computer Graphics I, Fall 2010 Implementation II.
Honours Graphics 2008 Session 5. Today’s focus Rasterization Visibility determination Coarse / fine visibility determination.
What are shaders? In the field of computer graphics, a shader is a computer program that runs on the graphics processing unit(GPU) and is used to do shading.
1 CSCE 441: Computer Graphics Hidden Surface Removal Jinxiang Chai.
The Graphics Pipeline Revisited Real Time Rendering Instructor: David Luebke.
Graphics, Modeling, and Textures Computer Game Design and Development.
Computer Graphics One of the central components of three-dimensional graphics has been a basic system that renders objects represented by a set of polygons.
Introduction to Computer Graphics
Visible Surface Detection
- Introduction - Graphics Pipeline
Intro to 3D Graphics.
3D Graphics Rendering PPT By Ricardo Veguilla.
The Graphics Rendering Pipeline
CS451Real-time Rendering Pipeline
CSCE 441: Computer Graphics Hidden Surface Removal
Graphics, Modeling, and Textures
3D Rendering Pipeline Hidden Surface Removal 3D Primitives
Computer Graphics One of the central components of three-dimensional graphics has been a basic system that renders objects represented by a set of polygons.
UMBC Graphics for Games
Lecture 13 Clipping & Scan Conversion
Computer Graphics Introduction to Shaders
Presentation transcript:

CGDD 4003 THE MASSIVE FIELD OF COMPUTER GRAPHICS

TERMINOLOGY Rendering: the entire process of drawing an image to the screen Vertex: a single 3D vector (x, y, z) Edge: a line between two vertices Face: Most often 3 vertices and their edges Triangle: why a triangle? Simple Can linearly interpolate on them (later) Can construct other objects with them

THE GRAPHICS PIPELINE OVERVIEW Objects are made of primitives, and primitives are made of vertices (i.e. geometry) Vertex Processing (no triangles yet) Coordinate transformations into clip space [-1, 1] Compute color for each vertex (not pixel) Clipping and Primitive Assembly Clipping volume culls out geometry outside the frustum, and clips geo that straddles Assemble sets of vertices into lines and polygons Rasterization Determine which pixels are inside each polygon (primitive) The output is a set of fragments for each primitive Fragment Processing Fills in the pixels in the frame buffer (what you’re seeing right now!)

COORDINATE SYSTEMS We have a bunch of them Object space (or “local” space) – the space when the object is modeled World space – the “game” space where everything happens Camera space – the view of the world from the camera Screen space – the actual screen We transform the object from one space to the next Cameras have frustum defined by Near plane – objects closer than this cannot be seen Far plane – objects further can’t be seen Aspect ratio Clip space is the area inside of the frustum

BASIC PROBLEM We need to convert our 3D models and display them on a 2D screen To do this, we use projections by defining a viewing volume These “flatten” the 3D world There are two kinds: Orthographic (aka “parallel”) All objects that have the same dimension are the same size, regardless of distance Viewing volume is rectangular Perspective Objects shrink with distance Viewing volume is shaped like a pyramid

EXAMPLE (UPPER-RIGHT IS A PERSPECTIVE VIEW)

ORTHOGRAPHIC VIEW VOLUME (YOU CAN SEE THE PARALLEL NOW…) Near clipping plane Far clipping plane

PERSPECTIVE VIEW VOLUME Near clipping plane Far clipping plane

IT ALL STARTS WITH BUFFERS Frame buffer The memory where the visible screen is stored There’s only one Drawing directly to this memory can be detected by the user Back buffer A secondary buffer that you draw to Once everything is drawn, swap the buffer (pointer) or copy it!

IT ALL STARTS WITH BUFFERS Depth buffer (aka z-buffer ) Objects in the scene have a depth, and sorting is slow (aka “The Painter’s Algorithm”) When drawing each object, only update the pixel if the object is closer Stencil buffer A buffer that can reject on a per-pixel basis Irregular shapes on the screen

ALIASING

TRANSFORMATIONS Translate Rotate Scale

TERMINOLOGY Wireframe – rendering only the edges of the model (old games)

TERMINOLOGY Hidden Surface Removal (HSR) – occluded objects can’t be seen Backface culling - drawing only the triangles that are facing the camera

BACKFACE CULLING

TERMINOLOGY Solid shading (this isn’t a definition)

TERMINOLOGY Flat Shading – simulate lighting

TERMINOLOGY A texture is an image (e.g.a jpg or procedurally generated) Texture mapping – using an image during the rasterization process

TERMINOLOGY – THE BLOCK PROGRAM Blending – mixing colors by rendering more than one thing in one spot The floor is rendered semi-transparent (yes, there are two cubes)

SHADERS AND MATERIALS No more fixed-function pipeline When you render a triangle, you run a vertex and pixel shader Shaders are small programs used to process: A vertex – translate, rotate, scale, etc… A pixel (or fragment)– determines the final color of a pixel using textures, light colors, normal of the plane, etc… Common languages: GLSL (OpenGL), Cg, HLSL (Microsoft) A material is the combination of shaders, textures, normals, colors, reflectivity that will determine the final color

GRAPHIC ORGANIZATION Rendering should be separate from game logic Hardware differs on each machine A render object is something that is renderable (duh) There is only one description of it (saving geometry) A flock of birds is still just one bird Render object instances Use a render object Save a state for each instance on the screen (e.g. location, animation state) We typically cull objects (i.e. prevent them from drawing) if: They are behind the camera Outside the frustum

CHARACTERS A mesh is a collection of triangles Can be one mesh Can be hierarchical (i.e. one object can have multiple meshes) A skeleton describes how a mesh will be deformed for animation

LIMITING WHAT WE RENDER View frustum Near and far planes and clipping outside the frustum Cull when possible (render volume partitioning) Portals (how many portals are visible? Think of windows and doors) Binary Space Partitions (BSPs) – a tree structure representing all of the game space Each node does not intersect with any other node If a node isn’t visible, neither is its child! Quad/Oct Trees – extensions of BSPs Potentially Visible Sets (PVSs) – each node has a list of other nodes

BSPS Wikipedia

QUADTREE PARTITIONING Collision detection Outdoor visibility checking Algorithm (2D): X/Y : consider bits Left shift at each level in tree When at leaf, stop

QUADTREE VISUALIZED

GRAPHIC PRIMITIVES Note: there are also point sprites for particle systems

MESH AS TRIANGLE STRIP

VERTEX AND INDEX BUFFERS How many vertices in a cube? How many faces in a cube? How many triangles in a cube? Usually twice as many triangles as vertices Typically, vertices are stored in a buffer and are numbered (0…n-1) There is a separate list for faces This list still has a type (triangle list, strip, etc…) E.g. - a triangle could be made from vertices 0, 4, 5 Called “indices” in an “index buffer”

INDEXED STRIPS First strip is 5, 0, 6, 1, 7, 2, 8, 3, 9, 4. Second is 10, 5, 11, 6, 12, 7, 13, 8, 14, 9 Also, once a vertex has been processed, it may be cached (speedup)

TEXTURE MAPPING Applying an image to geometry 2D images (rectangular) 3D images (volumetric – such as a CAT scan) Cube mapping Adds realism to the scene Vertices have additional information: A 3D position Normals (for lighting) UV coordinates (for textures)

UV COORDINATES (AKA TEXTURE COORDINATES) (0, 0)(1, 0) (1, 1)(0, 1) (1, 1)(0, 1) (0, 0)(1, 0) Polygon to be textured

UV COORDINATES (AKA TEXTURE COORDINATES) (0, 0)(1, 0) (1, 1)(0, 1) (1, 1)(0, 1) (0, 0)(1, 0) Note: there is a linear interpolation of all the in-between UV coordinates!

UV COORDINATES (AKA TEXTURE COORDINATES) (0, 0)(1, 0) (1, 1)(0, 1) (1, 1)(0, 1) (0, 0)(1, 0)

UV COORDINATES (AKA TEXTURE COORDINATES) (0, 0)(1, 0) (1, 1)(0, 1) (1, 1)(0, 1) (0, 0)(1, 0)

WHAT HAPPENS NOW? (0, 0)(1, 0) (1, 1)(0, 1) (2, 2)(0, 2) (0, 0)(2, 0) Polygon to be textured

WHAT HAPPENS NOW? (0, 0)(1, 0) (1, 1)(0, 1) (2, 2)(0, 2) (0, 0)(2, 0) Polygon to be textured

WHAT ABOUT NOW? (0, 0)(1, 0) (1, 1)(0, 1)

APPLYING TEXTURES

ADDITIONAL TEXTURING Point sampling Bilinear filtering (when magnifying) Averages 4 pixels based on distance Mipmapping Halving the size of the texture Can cause pops when switching Trilinear filtering Uses bilinear filtering Interpolates between mipmaps

LIGHTING

MODELING

MODELING (CONT)

USING NORMAL MAPS AND TEXTURES

NORMAL MAPS AND LOD

MPLE.PNG

LEVEL OF DETAIL Hardware limits number of polys rendered Use high-level models when possible Drop to low poly models (LOD) when needed

LEVEL EDITING Target fixed poly count (thought allow for flexibility and customization)

LOW-POLY COUNT MODELING

FINAL THOUGHTS Major difference in modeling and using models Art & programming & level/character design Take graphics in Spring!