14 - Additional Topics
|
|
- Dwain Davis
- 5 years ago
- Views:
Transcription
1 CSc 165 Computer Game Architecture Game-Loop Approaches Tightly-Coupled Fixed frame rate Variable-timestep update() Gameloop-managed update timing Fixed logic rate Renderer frame interpolation Multi-threading 2 Review: Game Structure Tightly-Coupled Approach Start initsystem() initgame() mainloop() shutdown() while (!gameover) handleinput() logicupdate() render() One iteration = 1 Frame Difficulties : Different machine speeds produce different game flow effects Changes to game logic (e.g. AI) can slow down presentation (frame rate) Problem source: The two steps have different inherent frequencies o logicupdate() frequency should be fixed; o render() frequency should optimize hardware use Exit Tightly-coupled game loop Conclusion: Need to somehow decouple the steps 3 4 Fixed frame rate Constant frame and update rate (one update per frame) Variable-timestep updating update() is responsible for accounting for time variation desiredframeduration = (1/desiredFPS)* ; //nsec handleinput() update() render() compute sleeptime sleep() while (!gameover) { framestarttime = System.nanoTime(); handleinput(); update(); render(); frameendtime = System.nanoTime(); frameduration = frameendtime framestarttime; while (frameduration < desiredframeduration) { sleeptimemsec = (desiredframeduration frameduration) / ; sleep (sleeptimemsec); frameduration = System.nanoTime() framestarttime; yield(); //in case we never sleep Compute Elapsed time handleinput() update(time) render() lastupdatetime = System.nanoTime(); while (!gameover) { timenow = System.nanoTime(); elapsedtime = timenow lastupdatetime; lastupdatetime = timenow; handleinput(); update(elapsedtime); render(); 5 6
2 Time Since Last Update Too Long? Yes handleinput() update() render() Gameloop-Managed Timed update Game-loop accounts for time variation No 7 desiredupdateperiod = (1/desiredUPS)* ; lastupdatetime = System.nanoTime(); while (!gameover) { curtime = System.nanoTime(); timesincelastupdate = curtime lastupdatetime; if (timesincelastupdate > desiredupdateperiod) { handleinput(); update(); lastupdatetime = System.nanoTime(); render(); More updates needed & allowed? Yes handleinput() update() render() Fixed logic rate Multiple logic updates between renders as necessary to maintain a fixed logic rate (i.e., to catch up ) No updateperiod = (1/desiredUPS)* ; starttime = System.nanoTime(); while (!gameover) { currenttime = System.nanoTime(); timesincelastupdate = currenttime-starttime; loopcount = 0; while (updateratetoolow() && loopcount<max ) { handleinput(); update(); starttime += updateperiod; timesincelastupdate = currenttime-starttime; loopcount ++ ; render(); boolean updateratetoolow() { if (timesincelastupdate > updateperiod) return true ; else return false ; 8 Interpolated frames desiredupdateperiod = (1/desiredUPS)* ; starttime = System.nanoTime(); while (!gameover) { currenttime = System.nanoTime(); timesincelastupdate = currenttime-starttime; o render() assists in accounting for time variation (e.g. by smoothing animations) More updates? Yes No Multi-threaded Approach Separate threads for Update() and Render() Control handleinput() Yes //...loop here to do multiple updates as before... update() Compute update fraction //check if update loop hit MAX if ( updateratetoolow()) { //yes, loop hit MAX; advance start time to // within period of current time starttime = currenttime desiredupdateperiod; percentwithinupdateperiod = min ( 1.0, ((currenttime starttime)/desiredupdateperiod)); Logic Update loop: - Runs at controlled (platform-independent) speed - Performs world state update, AI calculations, etc. Logic Update Start Threads World Data Render Presentation loop: - Runs as fast as possible - Draws visible world - Makes maximum use of hardware capabilities render(fraction) render(percentwithinupdateperiod); 9 10 Game Engine Timing Support AbstractGame BaseGame... # mainloop() Lighting Real world lights have a frequency spectrum o White light: all (visible) frequencies o Colored light: restricted frequency distribution Simplified model: VariableFrameRateGame # final mainloop() + final setmaxframerate(int) + final getframespersec():float FixedLogicRateGame # final mainloop() + final setdesiredupdaterate(int) + final getupdatespersec():float Light characteristics o Ambient, Diffuse, Specular reflection characteristics o Red, Green, Blue intensities Light type UserGame o Positional, Directional, update() render()
3 The ADS lighting model The ADS lighting model Ambient reflection simulates a low-level illumination that equally affects everything in the scene. Diffuse reflection brightens objects to various degree depending on the light s angle of incidence. Specular reflection conveys the shininess of an object by strategically placing a highlight of appropriate size on the object s surface where light is reflected most directly towards our eyes. specular highlights Using an ADS lighting model requires specifying contributions due to lighting on a pixel s RGBA output value. Factors include: The type of light source, and its ambient, diffuse, and specular characteristics The object s material s ambient, diffuse, and specular characteristics The object s material s specified shininess The angle at which the light hits the object The angle from which the scene is being viewed ambient diffuse Point source o Location, intensity Light Types Positional (or point ) light May include an optional attenuation factor. For example: 1 attenuationfactor = k c +k l d+k q d 2 Directional ( distant ) Spot o Direction, intensity o Location, direction, intensity, coneangle, falloffrate 15 θ Ф Spot light D = spotlight direction V = direction to vertex θ = cutoff angle φ = light off-axis angle intensityfactor = cos exp (φ) Combines elements of positional and directional lights. Iconic since Pixar s animated short Luxo, Jr. in D V φ θ RAGE Light Classes Materials <<interface>> SceneObject <<interface>> Entity <<interface>> ManualObject <<interface>> Light name : String Type : light.type ambient : [r g b a] diffuse : [r g b a] specular : [r g b a] Range : float falloffexponent : float etc. <<interface>> Tessellation <<interface>> SkeletalEntity Models the reflectance characteristics of surfaces. Usually modeled in ADS with four components: Ambient, Diffuse, and Specular Shininess (to determine size of specular highlights) GenericLight 17
4 some common materials OBJ example # File: cube.obj # This file uses OBJ format to define a cube which has a # different material applied to each of its faces. # Define 8 cube vertices v v v v v v v v # Specify the file (library) containing materials mtllib cube.mtl Barradeu, N., #continued OBJ example (cont.) OBJ Material Files (.mtl) # file cube.obj (cont.) # Define a group (g) and material for each face (f) g front usemtl red f g back usemtl blue f g right usemtl green f g top usemtl yellow f g left usemtl magenta f g bottom usemtl cyan f #end of cube.obj 21 #File: cube.mtl #Defines the named materials used in rendering the Cube newmtl red Kd // diffuse reflection coefficients newmtl green Kd newmtl blue Kd newmtl yellow Kd newmtl cyan Kd newmtl magenta Kd More Complex Materials newmtl flatwhite Ka Kd illum 1 newmtl shinyred Ka Kd Ks illum 2 Ns newmtl clearblue Ka Kd illum 1 Tr // material name // coeffs of amb refl // coeffs of diff refl // flat (no Ks) // coeffs of spec refl // specular material // shininess // transparency ADS lighting computations I observed = I ambient + I diffuse + I specular Ambient computation is the simplest: I ambient = Light ambient Material ambient Note that each item has R, G, and B components. So the computations actually are as follows: red I ambient green I ambient blue I ambient red red = Light ambient Material ambient green green = Light ambient Material ambient blue blue = Light ambient Material ambient 23
5 Diffuse computation depends on the angle of incidence between the light and the surface: light source L pixel θ N (Lambert s cosine law [1760] ) Specular computation depends on the angle of reflection of the light on the surface, and the viewing angle of the eye. light source I diffuse = Light diffuse Material diffuse cos(θ) Rightmost term determined simply using dot product: I diffuse = Light diffuse Material diffuse (N L) Only include this term if the surface is exposed to the light: I diffuse = Light diffuse Material diffuse max ( N L, 0) L pixel θ N θ ϕ R V Shininess modeled with a falloff function. Expresses how quickly the specular contribution reduces to zero as the angle ϕ grows. cos(ϕ) cos 2 (ϕ) cos 3 (ϕ) combining light and textures Color = texturecolor * ( ambientlight + diffuselight ) + specularlight or Color = texturecolor * ( ambientlight + diffuselight + specularlight ) or Color = (amblight * ambmaterial) + (difflight * diffmaterial) + speclight fragcolor = 0.5 * texturecolor * lightcolor cos 50 (ϕ) I spec = Light spec Material spec max(0, R V n ) Normal Mapping Example normal maps: The (X,Y,Z) values of the normal can be stored as (R,G,B) values in an image file called a normal map. Converting normal ( ) to RGB (0...1) is easy: R = (N X + 1)/2 G = (N Y + 1)/2 B = (N Z + 1)/2 The normal map can then be stored in a texture! Values in normal maps are usually stored as offsets from vertical relative to the plane tangent to the surface, with the Z (or B) coordinate set to 1.0. This is why normal maps appear bluish. The surface tangent plane is defined by mutually-perpendicular tangent and bi-tangent vectors (both perpendicular to the normal).
6 Moon example: Normal map lighting effects on moon: Sphere with moon texture map: Sphere textured with corresponding normal map: Note the changes in specular highlights at the indicated locations. Combining texture map and lighting with normal map -- effect on moon: Height Mapping Using a texture image to perturb the vertex locations. Use a grayscale image, where: White == high Black == low Small variation in height Large variation in height
7 Example: height map Edge-on view Height map image (height interpretation) standard texture Result when applied to a 100x100 rectangular grid height map Texture-Mapped Fonts standard texture Create a texture map image containing font characters: texture map each desired character to a single polygon Build output image strings from texture-mapped polygons 1,1 normal map Result when applied to a sphere 0,0 40 (1,1) Texture-Mapped Fonts (cont.) Y (100,100) t (0,0) s Texture Space Texture Space x4, y4 x3, y3 s4, t4 s3, t3 H x1, y1 x2, y2 s1, t1 s2, t2 e l l o (100,100 ) Drawbacks: Requires an external application to create the font texture Scaling can affect font appearance Difficult to implement proportionally-spaced fonts Uses up a texture unit World Window (0,0) QUADS see the Wikibook Modern OpenGL Tutorial Text Rendering
8 Basic approach: Billboards o Replace a complex 3D model with a 2D image o Maintain image orientation toward camera Works well when 3D model World background o Model is sufficiently far away o Model tends to have axial symmetry 2D image approximation Transparent background Basic steps: o Create flat object with 2D texture-mapped image o Translate object to tree location in world o Rotate object so that it points to the camera θ Y U X N Camera X = {1,0,0 N = Camera Loc Y = V = {0,1,0 U = V N Θ = X U Atmospheric Effects - Fog A useful effect: blend pixel color with another color (e.g. gray) based on distance from eye. Fog is not just for simulating fog, but also for enhancing the sense of 3D depth for the viewer. Fog (simple approach) Pixel color based (mostly) on object Fog color (contribution varies with distance from eye) There are simple models, as well as sophisticated models that include light scattering effects. Pixel color based (mostly) on fog color a more comprehensive model: Extinction rate of decay from image color to black Inscattering rate of change from image color to fog color f e = e -zx f i = e -zs z = distance from eye to object, x = extinction coefficient, s = inscattering coefficient 47 48
9 Atmospheric Effects Environment Mapping OpenGL cubemap = a single texture object with six 2D faces Texture coords (s,t,r) = vector from the cube center +Y +Z +Y Texel Environment Mapping Useful technique for rendering mirror objects Create texture cube map describing the environment Shade object points by following reflection of eye vector (to surface normal) into the map Environment +X -X +X -Z +Z Vector (s,t,r) Shiny Object Environment Map -Y using OpenGL cubemaps makes environment mapping easier Eye Texel used for shade Point to be shaded D Textures 2D Texture Images are painted on and sometimes they look like it Desired: make it look like an object is made out of some material 51 Image source: ACM SIGGRAPH Education Slide Set, R. Wolfe, DePaul Univ. 52 3D Texture Example: Wood-grain Wood grain is caused by tree rings wood-grain example (cont.) Computing cylindrical location for (x,y,z) object point Y Top View Concentric growth ring cylinders Top View R (x,y,z) z x X Object to be carved from wood Object point (x,y,z) Needed: a function f(x,y,z) mapping an object location into the wood space i.e. obtaining the wood color Z 2 2 R x z tan z 1 x H y Z Y X 53 54
10 wood-grain sample results Variations in ring density Perlin Noise Ken Perlin (NYU), 1985 o Classic Noise (1985) Gradient noise using cubic Hermite interpolation o Improved Noise (2001) Gradient noise using quintic interpolation and precomputed gradients o Simplex Noise (2005) Hardware implementation Image source: ACM SIGGRAPH Education Slide Set, R. Wolfe, DePaul Univ. Variations in Ring Width Computer Graphics V19 No.3, July 1989 AMPAS Oscar, Randomness is important in many 3D textures: o Natural materials (wood, marble, granite ) o Man-made materials (stucco, asphalt, cement ) o Natural phenomena (clouds, fire, smoke, wind effects ) o Model imperfections (rust, dirt, smudges, dents ) o Pattern and motion imperfections (bumps, wobbles, jitters ) 57 Image source: ACM SIGGRAPH Education Slide Set, R. Wolfe, DePaul Univ. 58 Example Jade Atmospheric Effects - Clouds Clouds are complex: scatter and reflect light in diverse ways drift and morph over time There are simple models, as well as sophisticated models that include light scattering effects. Simple models often use 3D textures and Perlin noise
11 Atmospheric Effects - Clouds Mixing 3D noise at different levels of precision: Atmospheric Effects - Clouds 3D texture allows efficient morphing by slowly changing the Z parameter when accessing texture map: Immediate-Mode Graphics The PROGRAMMABLE Graphics Pipeline CPU transfers RAM data over main bus o Time consuming o Bus Contention glbegin(gl_triangles); glcolor3f (1.0, 0.0, 0.0); glvertex3f(0.0, 0.0, 0.0); glcolor3f (0.0, 1.0, 0.0); glvertex3f(1.0, 0.0, 0.0); glcolor3f (0.0, 0.0, 1.0); glvertex3f(1.0, 1.0, 0.0); glend(); CPU GPU RAM Video Memory State Variables Application Program Shader Source Code Vertex Processor Vertex Program Compiler Linker Assembly Projection Clipping/Culling Persp. Divide MapToViewport Graphics card Rasterizer Fragment Processor Fragment Program Fragment Testing (HSR, etc.) Frame Buffer Programmable Shaders: Vertex shader Tessellation Control Tessellation Evaluation Tessellator (grid) Hardware ( Shader ) Programming High-level languages: o HLSL ( High-Level Shading Language ) Proprietary (Microsoft) Powerful Specific to DirectX o Cg ( C for graphics ) Proprietary (nvidia) Supports both DirectX and OpenGL APIs (more complex) Fragment Shader Geometry Shader o GLSL ( OpenGL Shading Language ) Open standard Compiles to all common vendor chips Can run on top of DirectX, or directly on hardware 65 66
12 Vertex array pointer Texture Coord pointer Vertex Arrays 67 x y z x y z x y z x y z x y z... Vertex Texture Coordinates s t s t s t s t s t... Steps to use Vertex Arrays: Vertex Geometry Array Enable use of each array type (geometry, tex, etc.) Point to each array to be used Load each array with data (geometry, tex, etc.) Specify what to draw, and from where, in the arrays Index (pointer) array Vertex array Color array Indexed Vertex Arrays Face 0 Face 1... x y z x y z x y z x y z x y z x y z... s t s t s t s t s t s t Vertex Buffer Objects (VBOs) Map an application buffer directly to highspeed video memory (such as DRAM) Buffers can include vertex arrays Methods like gldrawarrays() operate on video memory data see CSc
16 - Other Topics. The Stencil Buffer. Erosion. Fragment Discarding. Multi-Texturing + +
CSc 155 Advanced Computer Graphics 16- Other Topics The Stencil Buffer An additional per-pixel buffer typically used to direct OpenGL to behave differently depending on what is in the buffer Useful for
More informationIllumination and Shading
Illumination and Shading Illumination (Lighting)! Model the interaction of light with surface points to determine their final color and brightness! The illumination can be computed either at vertices or
More informationMethodology for Lecture. Importance of Lighting. Outline. Shading Models. Brief primer on Color. Foundations of Computer Graphics (Spring 2010)
Foundations of Computer Graphics (Spring 2010) CS 184, Lecture 11: OpenGL 3 http://inst.eecs.berkeley.edu/~cs184 Methodology for Lecture Lecture deals with lighting (teapot shaded as in HW1) Some Nate
More information3D Programming. 3D Programming Concepts. Outline. 3D Concepts. 3D Concepts -- Coordinate Systems. 3D Concepts Displaying 3D Models
3D Programming Concepts Outline 3D Concepts Displaying 3D Models 3D Programming CS 4390 3D Computer 1 2 3D Concepts 3D Model is a 3D simulation of an object. Coordinate Systems 3D Models 3D Shapes 3D Concepts
More informationECS 175 COMPUTER GRAPHICS. Ken Joy.! Winter 2014
ECS 175 COMPUTER GRAPHICS Ken Joy Winter 2014 Shading To be able to model shading, we simplify Uniform Media no scattering of light Opaque Objects No Interreflection Point Light Sources RGB Color (eliminating
More informationCSE 167: Lecture #8: Lighting. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011
CSE 167: Introduction to Computer Graphics Lecture #8: Lighting Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011 Announcements Homework project #4 due Friday, October 28 Introduction:
More informationLecture 17: Shading in OpenGL. CITS3003 Graphics & Animation
Lecture 17: Shading in OpenGL CITS3003 Graphics & Animation E. Angel and D. Shreiner: Interactive Computer Graphics 6E Addison-Wesley 2012 Objectives Introduce the OpenGL shading methods - per vertex shading
More informationToday. Global illumination. Shading. Interactive applications. Rendering pipeline. Computergrafik. Shading Introduction Local shading models
Computergrafik Thomas Buchberger, Matthias Zwicker Universität Bern Herbst 2008 Today Introduction Local shading models Light sources strategies Compute interaction of light with surfaces Requires simulation
More informationCS 381 Computer Graphics, Fall 2008 Midterm Exam Solutions. The Midterm Exam was given in class on Thursday, October 23, 2008.
CS 381 Computer Graphics, Fall 2008 Midterm Exam Solutions The Midterm Exam was given in class on Thursday, October 23, 2008. 1. [4 pts] Drawing Where? Your instructor says that objects should always be
More informationDeferred Rendering Due: Wednesday November 15 at 10pm
CMSC 23700 Autumn 2017 Introduction to Computer Graphics Project 4 November 2, 2017 Deferred Rendering Due: Wednesday November 15 at 10pm 1 Summary This assignment uses the same application architecture
More informationGraphics for VEs. Ruth Aylett
Graphics for VEs Ruth Aylett Overview VE Software Graphics for VEs The graphics pipeline Projections Lighting Shading Runtime VR systems Two major parts: initialisation and update loop. Initialisation
More informationThe Rasterization Pipeline
Lecture 5: The Rasterization Pipeline Computer Graphics and Imaging UC Berkeley CS184/284A, Spring 2016 What We ve Covered So Far z x y z x y (0, 0) (w, h) Position objects and the camera in the world
More informationToday. Global illumination. Shading. Interactive applications. Rendering pipeline. Computergrafik. Shading Introduction Local shading models
Computergrafik Matthias Zwicker Universität Bern Herbst 2009 Today Introduction Local shading models Light sources strategies Compute interaction of light with surfaces Requires simulation of physics Global
More informationCSE 167: Introduction to Computer Graphics Lecture #7: Lights. Jürgen P. Schulze, Ph.D. University of California, San Diego Spring Quarter 2015
CSE 167: Introduction to Computer Graphics Lecture #7: Lights Jürgen P. Schulze, Ph.D. University of California, San Diego Spring Quarter 2015 Announcements Thursday in-class: Midterm Can include material
More informationGraphics for VEs. Ruth Aylett
Graphics for VEs Ruth Aylett Overview VE Software Graphics for VEs The graphics pipeline Projections Lighting Shading VR software Two main types of software used: off-line authoring or modelling packages
More informationGraphics Hardware. Instructor Stephen J. Guy
Instructor Stephen J. Guy Overview What is a GPU Evolution of GPU GPU Design Modern Features Programmability! Programming Examples Overview What is a GPU Evolution of GPU GPU Design Modern Features Programmability!
More informationShaders. Slide credit to Prof. Zwicker
Shaders Slide credit to Prof. Zwicker 2 Today Shader programming 3 Complete model Blinn model with several light sources i diffuse specular ambient How is this implemented on the graphics processor (GPU)?
More informationOpenGl Pipeline. triangles, lines, points, images. Per-vertex ops. Primitive assembly. Texturing. Rasterization. Per-fragment ops.
OpenGl Pipeline Individual Vertices Transformed Vertices Commands Processor Per-vertex ops Primitive assembly triangles, lines, points, images Primitives Fragments Rasterization Texturing Per-fragment
More informationIllumination & Shading I
CS 543: Computer Graphics Illumination & Shading I Robert W. Lindeman Associate Professor Interactive Media & Game Development Department of Computer Science Worcester Polytechnic Institute gogo@wpi.edu
More informationCMSC427 Advanced shading getting global illumination by local methods. Credit: slides Prof. Zwicker
CMSC427 Advanced shading getting global illumination by local methods Credit: slides Prof. Zwicker Topics Shadows Environment maps Reflection mapping Irradiance environment maps Ambient occlusion Reflection
More informationCSE 167: Introduction to Computer Graphics Lecture #6: Lights. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2014
CSE 167: Introduction to Computer Graphics Lecture #6: Lights Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2014 Announcements Project 2 due Friday, Oct. 24 th Midterm Exam
More informationCSE 167: Lecture #8: GLSL. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012
CSE 167: Introduction to Computer Graphics Lecture #8: GLSL Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012 Announcements Homework project #4 due Friday, November 2 nd Introduction:
More informationCSE 167: Introduction to Computer Graphics Lecture #6: Lights. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2016
CSE 167: Introduction to Computer Graphics Lecture #6: Lights Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2016 Announcements Thursday in class: midterm #1 Closed book Material
More informationObjectives Shading in OpenGL. Front and Back Faces. OpenGL shading. Introduce the OpenGL shading methods. Discuss polygonal shading
Objectives Shading in OpenGL Introduce the OpenGL shading methods - per vertex shading vs per fragment shading - Where to carry out Discuss polygonal shading - Flat - Smooth - Gouraud CITS3003 Graphics
More informationComputer Graphics. Illumination Models and Surface-Rendering Methods. Somsak Walairacht, Computer Engineering, KMITL
Computer Graphics Chapter 10 llumination Models and Surface-Rendering Methods Somsak Walairacht, Computer Engineering, KMTL Outline Light Sources Surface Lighting Effects Basic llumination Models Polygon
More informationIntroduction to Visualization and Computer Graphics
Introduction to Visualization and Computer Graphics DH2320, Fall 2015 Prof. Dr. Tino Weinkauf Introduction to Visualization and Computer Graphics Visibility Shading 3D Rendering Geometric Model Color Perspective
More informationComputer Graphics (CS 4731) Lecture 16: Lighting, Shading and Materials (Part 1)
Computer Graphics (CS 4731) Lecture 16: Lighting, Shading and Materials (Part 1) Prof Emmanuel Agu Computer Science Dept. Worcester Polytechnic Institute (WPI) Why do we need Lighting & shading? Sphere
More informationComputer Graphics (CS 543) Lecture 7b: Intro to lighting, Shading and Materials + Phong Lighting Model
Computer Graphics (CS 543) Lecture 7b: Intro to lighting, Shading and Materials + Phong Lighting Model Prof Emmanuel Agu Computer Science Dept. Worcester Polytechnic Institute (WPI) Why do we need Lighting
More informationAnnouncements. Written Assignment 2 is out see the web page. Computer Graphics
Announcements Written Assignment 2 is out see the web page 1 Texture and other Mappings Shadows Texture Mapping Bump Mapping Displacement Mapping Environment Mapping Watt Chapter 8 COMPUTER GRAPHICS 15-462
More informationTexture and other Mappings
Texture and other Mappings Texture Mapping Bump Mapping Displacement Mapping Environment Mapping Example: Checkerboard Particularly severe problems in regular textures 1 The Beginnings of a Solution: Mipmapping
More informationCPSC 314 LIGHTING AND SHADING
CPSC 314 LIGHTING AND SHADING UGRAD.CS.UBC.CA/~CS314 slide credits: Mikhail Bessmeltsev et al 1 THE RENDERING PIPELINE Vertices and attributes Vertex Shader Modelview transform Per-vertex attributes Vertex
More informationVisualisatie BMT. Rendering. Arjan Kok
Visualisatie BMT Rendering Arjan Kok a.j.f.kok@tue.nl 1 Lecture overview Color Rendering Illumination 2 Visualization pipeline Raw Data Data Enrichment/Enhancement Derived Data Visualization Mapping Abstract
More informationComputer Graphics I Lecture 11
15-462 Computer Graphics I Lecture 11 Midterm Review Assignment 3 Movie Midterm Review Midterm Preview February 26, 2002 Frank Pfenning Carnegie Mellon University http://www.cs.cmu.edu/~fp/courses/graphics/
More informationChapter 10. Surface-Rendering Methods. Somsak Walairacht, Computer Engineering, KMITL
Computer Graphics Chapter 10 llumination Models and Surface-Rendering Methods Somsak Walairacht, Computer Engineering, KMTL 1 Outline Light Sources Surface Lighting Effects Basic llumination Models Polygon
More informationCS451Real-time Rendering Pipeline
1 CS451Real-time Rendering Pipeline JYH-MING LIEN DEPARTMENT OF COMPUTER SCIENCE GEORGE MASON UNIVERSITY Based on Tomas Akenine-Möller s lecture note You say that you render a 3D 2 scene, but what does
More informationHardware-Assisted Relief Texture Mapping
EUROGRAPHICS 0x / N.N. and N.N. Short Presentations Hardware-Assisted Relief Texture Mapping Masahiro Fujita and Takashi Kanai Keio University Shonan-Fujisawa Campus, Fujisawa, Kanagawa, Japan Abstract
More informationCS 354R: Computer Game Technology
CS 354R: Computer Game Technology Texture and Environment Maps Fall 2018 Texture Mapping Problem: colors, normals, etc. are only specified at vertices How do we add detail between vertices without incurring
More informationReal-Time Rendering (Echtzeitgraphik) Michael Wimmer
Real-Time Rendering (Echtzeitgraphik) Michael Wimmer wimmer@cg.tuwien.ac.at Walking down the graphics pipeline Application Geometry Rasterizer What for? Understanding the rendering pipeline is the key
More informationModels and Architectures
Models and Architectures Objectives Learn the basic design of a graphics system Introduce graphics pipeline architecture Examine software components for an interactive graphics system 1 Image Formation
More informationCHAPTER 1 Graphics Systems and Models 3
?????? 1 CHAPTER 1 Graphics Systems and Models 3 1.1 Applications of Computer Graphics 4 1.1.1 Display of Information............. 4 1.1.2 Design.................... 5 1.1.3 Simulation and Animation...........
More informationPhong Lighting & Materials. Some slides modified from: David Kabala Others from: Andries Van Damm, Brown Univ.
Phong Lighting & Materials Some slides modified from: David Kabala Others from: Andries Van Damm, Brown Univ. Lighting and Shading Lighting, or illumination, is the process of computing the intensity and
More informationComputer Graphics. Illumination and Shading
() Illumination and Shading Dr. Ayman Eldeib Lighting So given a 3-D triangle and a 3-D viewpoint, we can set the right pixels But what color should those pixels be? If we re attempting to create a realistic
More informationTutorial on GPU Programming #2. Joong-Youn Lee Supercomputing Center, KISTI
Tutorial on GPU Programming #2 Joong-Youn Lee Supercomputing Center, KISTI Contents Graphics Pipeline Vertex Programming Fragment Programming Introduction to Cg Language Graphics Pipeline The process to
More informationShading and Illumination
Shading and Illumination OpenGL Shading Without Shading With Shading Physics Bidirectional Reflectance Distribution Function (BRDF) f r (ω i,ω ) = dl(ω ) L(ω i )cosθ i dω i = dl(ω ) L(ω i )( ω i n)dω
More informationComputer Graphics (CS 543) Lecture 10: Soft Shadows (Maps and Volumes), Normal and Bump Mapping
Computer Graphics (CS 543) Lecture 10: Soft Shadows (Maps and Volumes), Normal and Bump Mapping Prof Emmanuel Agu Computer Science Dept. Worcester Polytechnic Institute (WPI) Shadow Buffer Theory Observation:
More informationTexture Mapping. Images from 3D Creative Magazine
Texture Mapping Images from 3D Creative Magazine Contents Introduction Definitions Light And Colour Surface Attributes Surface Attributes: Colour Surface Attributes: Shininess Surface Attributes: Specularity
More informationComputergrafik. Matthias Zwicker Universität Bern Herbst 2016
Computergrafik Matthias Zwicker Universität Bern Herbst 2016 2 Today Basic shader for texture mapping Texture coordinate assignment Antialiasing Fancy textures 3 Texture mapping Glue textures (images)
More informationCS Computer Graphics: Illumination and Shading I
CS 543 - Computer Graphics: Illumination and Shading I by Robert W. Lindeman gogo@wpi.edu (with help from Emmanuel Agu ;-) Illumination and Shading Problem: Model light/surface point interactions to determine
More informationCS Computer Graphics: Illumination and Shading I
CS 543 - Computer Graphics: Illumination and Shading I by Robert W. Lindeman gogo@wpi.edu (with help from Emmanuel Agu ;-) Illumination and Shading Problem: Model light/surface point interactions to determine
More informationCS5620 Intro to Computer Graphics
So Far wireframe hidden surfaces Next step 1 2 Light! Need to understand: How lighting works Types of lights Types of surfaces How shading works Shading algorithms What s Missing? Lighting vs. Shading
More informationAdvanced Lighting Techniques Due: Monday November 2 at 10pm
CMSC 23700 Autumn 2015 Introduction to Computer Graphics Project 3 October 20, 2015 Advanced Lighting Techniques Due: Monday November 2 at 10pm 1 Introduction This assignment is the third and final part
More informationRendering Algorithms: Real-time indirect illumination. Spring 2010 Matthias Zwicker
Rendering Algorithms: Real-time indirect illumination Spring 2010 Matthias Zwicker Today Real-time indirect illumination Ray tracing vs. Rasterization Screen space techniques Visibility & shadows Instant
More informationThe Rasterizer Stage. Texturing, Lighting, Testing and Blending
1 The Rasterizer Stage Texturing, Lighting, Testing and Blending 2 Triangle Setup, Triangle Traversal and Back Face Culling From Primitives To Fragments Post Clipping 3 In the last stages of the geometry
More informationTSBK03 Screen-Space Ambient Occlusion
TSBK03 Screen-Space Ambient Occlusion Joakim Gebart, Jimmy Liikala December 15, 2013 Contents 1 Abstract 1 2 History 2 2.1 Crysis method..................................... 2 3 Chosen method 2 3.1 Algorithm
More informationVirtual Reality for Human Computer Interaction
Virtual Reality for Human Computer Interaction Appearance: Lighting Representation of Light and Color Do we need to represent all I! to represent a color C(I)? No we can approximate using a three-color
More information2.11 Particle Systems
2.11 Particle Systems 320491: Advanced Graphics - Chapter 2 152 Particle Systems Lagrangian method not mesh-based set of particles to model time-dependent phenomena such as snow fire smoke 320491: Advanced
More informationZeyang Li Carnegie Mellon University
Zeyang Li Carnegie Mellon University Recap: Texture Mapping Programmable Graphics Pipeline Bump Mapping Displacement Mapping Environment Mapping GLSL Overview Perlin Noise GPGPU Map reflectance over a
More informationTopics and things to know about them:
Practice Final CMSC 427 Distributed Tuesday, December 11, 2007 Review Session, Monday, December 17, 5:00pm, 4424 AV Williams Final: 10:30 AM Wednesday, December 19, 2007 General Guidelines: The final will
More informationOrthogonal Projection Matrices. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015
Orthogonal Projection Matrices 1 Objectives Derive the projection matrices used for standard orthogonal projections Introduce oblique projections Introduce projection normalization 2 Normalization Rather
More informationRendering. Illumination Model. Wireframe rendering simple, ambiguous Color filling flat without any 3D information
llumination Model Wireframe rendering simple, ambiguous Color filling flat without any 3D information Requires modeling interaction of light with the object/surface to have a different color (shade in
More informationAGDC Per-Pixel Shading. Sim Dietrich
AGDC Per-Pixel Shading Sim Dietrich Goal Of This Talk The new features of Dx8 and the next generation of HW make huge strides in the area of Per-Pixel Shading Most developers have yet to adopt Per-Pixel
More informationComputer Graphics. Illumination and Shading
Rendering Pipeline modelling of geometry transformation into world coordinates placement of cameras and light sources transformation into camera coordinates backface culling projection clipping w.r.t.
More informationX. GPU Programming. Jacobs University Visualization and Computer Graphics Lab : Advanced Graphics - Chapter X 1
X. GPU Programming 320491: Advanced Graphics - Chapter X 1 X.1 GPU Architecture 320491: Advanced Graphics - Chapter X 2 GPU Graphics Processing Unit Parallelized SIMD Architecture 112 processing cores
More informationPipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11
Pipeline Operations CS 4620 Lecture 11 1 Pipeline you are here APPLICATION COMMAND STREAM 3D transformations; shading VERTEX PROCESSING TRANSFORMED GEOMETRY conversion of primitives to pixels RASTERIZATION
More informationRendering Objects. Need to transform all geometry then
Intro to OpenGL Rendering Objects Object has internal geometry (Model) Object relative to other objects (World) Object relative to camera (View) Object relative to screen (Projection) Need to transform
More informationLecture 15: Shading-I. CITS3003 Graphics & Animation
Lecture 15: Shading-I CITS3003 Graphics & Animation E. Angel and D. Shreiner: Interactive Computer Graphics 6E Addison-Wesley 2012 Objectives Learn that with appropriate shading so objects appear as threedimensional
More informationShading I Computer Graphics I, Fall 2008
Shading I 1 Objectives Learn to shade objects ==> images appear threedimensional Introduce types of light-material interactions Build simple reflection model Phong model Can be used with real time graphics
More informationSimple Lighting/Illumination Models
Simple Lighting/Illumination Models Scene rendered using direct lighting only Photograph Scene rendered using a physically-based global illumination model with manual tuning of colors (Frederic Drago and
More informationIllumination & Shading: Part 1
Illumination & Shading: Part 1 Light Sources Empirical Illumination Shading Local vs Global Illumination Lecture 10 Comp 236 Spring 2005 Computer Graphics Jargon: Illumination Models Illumination - the
More informationMattan Erez. The University of Texas at Austin
EE382V: Principles in Computer Architecture Parallelism and Locality Fall 2008 Lecture 10 The Graphics Processing Unit Mattan Erez The University of Texas at Austin Outline What is a GPU? Why should we
More informationTSBK 07! Computer Graphics! Ingemar Ragnemalm, ISY
1(84) Information Coding / Computer Graphics, ISY, LiTH TSBK 07 Computer Graphics Ingemar Ragnemalm, ISY 1(84) Lecture 5 3D graphics part 3 Illumination Illumination applied: Shading Surface detail: Mappings
More informationMore Texture Mapping. Texture Mapping 1/46
More Texture Mapping Texture Mapping 1/46 Perturbing Normals Texture Mapping 2/46 Perturbing Normals Instead of fetching a texture for color, fetch a new perturbed normal vector Creates the appearance
More informationCOMP environment mapping Mar. 12, r = 2n(n v) v
Rendering mirror surfaces The next texture mapping method assumes we have a mirror surface, or at least a reflectance function that contains a mirror component. Examples might be a car window or hood,
More informationTexture mapping. Computer Graphics CSE 167 Lecture 9
Texture mapping Computer Graphics CSE 167 Lecture 9 CSE 167: Computer Graphics Texture Mapping Overview Interpolation Wrapping Texture coordinates Anti aliasing Mipmaps Other mappings Including bump mapping
More informationI have a meeting with Peter Lee and Bob Cosgrove on Wednesday to discuss the future of the cluster. Computer Graphics
Announcements Assignment 4 will be out later today Problem Set 3 is due today or tomorrow by 9am in my mail box (4 th floor NSH) How are the machines working out? I have a meeting with Peter Lee and Bob
More informationShading. Shading = find color values at pixels of screen (when rendering a virtual 3D scene).
Light Shading Shading Shading = find color values at pixels of screen (when rendering a virtual 3D scene). Shading Shading = find color values at pixels of screen (when rendering a virtual 3D scene). Same
More informationw Foley, Section16.1 Reading
Shading w Foley, Section16.1 Reading Introduction So far, we ve talked exclusively about geometry. w What is the shape of an object? w How do I place it in a virtual 3D space? w How do I know which pixels
More informationAnnouncements. Written Assignment 2 out (due March 8) Computer Graphics
Announcements Written Assignment 2 out (due March 8) 1 Advanced Ray Tracing (Recursive) Ray Tracing Antialiasing Motion Blur Distribution Ray Tracing Ray Tracing and Radiosity Assumptions Simple shading
More information6.837 Introduction to Computer Graphics Assignment 5: OpenGL and Solid Textures Due Wednesday October 22, 2003 at 11:59pm
6.837 Introduction to Computer Graphics Assignment 5: OpenGL and Solid Textures Due Wednesday October 22, 2003 at 11:59pm In this assignment, you will add an interactive preview of the scene and solid
More informationVirtual Reality for Human Computer Interaction
Virtual Reality for Human Computer Interaction Appearance: Lighting Representation of Light and Color Representation of Light and Color Do we need to represent all I! to represent a color C(I)? Representation
More informationPipeline Operations. CS 4620 Lecture 14
Pipeline Operations CS 4620 Lecture 14 2014 Steve Marschner 1 Pipeline you are here APPLICATION COMMAND STREAM 3D transformations; shading VERTEX PROCESSING TRANSFORMED GEOMETRY conversion of primitives
More informationCPSC / Texture Mapping
CPSC 599.64 / 601.64 Introduction and Motivation so far: detail through polygons & materials example: brick wall problem: many polygons & materials needed for detailed structures inefficient for memory
More informationPhotorealistic 3D Rendering for VW in Mobile Devices
Abstract University of Arkansas CSCE Department Advanced Virtual Worlds Spring 2013 Photorealistic 3D Rendering for VW in Mobile Devices Rafael Aroxa In the past few years, the demand for high performance
More informationINF3320 Computer Graphics and Discrete Geometry
INF3320 Computer Graphics and Discrete Geometry Visual appearance Christopher Dyken and Martin Reimers 23.09.2009 Page 1 Visual appearance Real Time Rendering: Chapter 5 Light Sources and materials Shading
More informationCPSC / Illumination and Shading
CPSC 599.64 / 601.64 Rendering Pipeline usually in one step modelling of geometry transformation into world coordinate system placement of cameras and light sources transformation into camera coordinate
More informationLessons Learned from HW4. Shading. Objectives. Why we need shading. Shading. Scattering
Lessons Learned from HW Shading CS Interactive Computer Graphics Prof. David E. Breen Department of Computer Science Only have an idle() function if something is animated Set idle function to NULL, when
More informationCS452/552; EE465/505. Lighting & Shading
CS452/552; EE465/505 Lighting & Shading 2-17 15 Outline! More on Lighting and Shading Read: Angel Chapter 6 Lab2: due tonight use ASDW to move a 2D shape around; 1 to center Local Illumination! Approximate
More informationComputer Graphics. - Texturing Methods -
Computer Graphics - Texturing Methods - Overview Last time BRDFs Shading Today Texturing Texture parameterization Procedural methods Procedural textures Fractal landscapes Next lecture Texture filtering
More informationCEng 477 Introduction to Computer Graphics Fall
Illumination Models and Surface-Rendering Methods CEng 477 Introduction to Computer Graphics Fall 2007 2008 Illumination Models and Surface Rendering Methods In order to achieve realism in computer generated
More informationIllumination Models. To calculate the color of an illuminated position on the
llumination Models 5 th Week, 2008 Sun-Jeong Kim Realistic Scene in CG Perspective projection of objects + natural lighting effects to the visible surface Light reflections, transparency, surface texture,
More informationProgramming Graphics Hardware
Tutorial 5 Programming Graphics Hardware Randy Fernando, Mark Harris, Matthias Wloka, Cyril Zeller Overview of the Tutorial: Morning 8:30 9:30 10:15 10:45 Introduction to the Hardware Graphics Pipeline
More informationPerformance OpenGL Programming (for whatever reason)
Performance OpenGL Programming (for whatever reason) Mike Bailey Oregon State University Performance Bottlenecks In general there are four places a graphics system can become bottlenecked: 1. The computer
More informationToday we will start to look at illumination models in computer graphics
1 llumination Today we will start to look at illumination models in computer graphics Why do we need illumination models? Different kinds lights Different kinds reflections Basic lighting model 2 Why Lighting?
More informationTexture. Texture Mapping. Texture Mapping. CS 475 / CS 675 Computer Graphics. Lecture 11 : Texture
Texture CS 475 / CS 675 Computer Graphics Add surface detail Paste a photograph over a surface to provide detail. Texture can change surface colour or modulate surface colour. Lecture 11 : Texture http://en.wikipedia.org/wiki/uv_mapping
More informationCS 475 / CS 675 Computer Graphics. Lecture 11 : Texture
CS 475 / CS 675 Computer Graphics Lecture 11 : Texture Texture Add surface detail Paste a photograph over a surface to provide detail. Texture can change surface colour or modulate surface colour. http://en.wikipedia.org/wiki/uv_mapping
More informationCS 130 Final. Fall 2015
CS 130 Final Fall 2015 Name Student ID Signature You may not ask any questions during the test. If you believe that there is something wrong with a question, write down what you think the question is trying
More informationShading. Flat shading Gouraud shading Phong shading
Shading Flat shading Gouraud shading Phong shading Flat Shading and Perception Lateral inhibition: exaggerates perceived intensity Mach bands: perceived stripes along edges Icosahedron with Sphere Normals
More informationChapter 1 Introduction. Marc Olano
Chapter 1 Introduction Marc Olano 1 About This Course Or, why do we want to do real-time shading, and why offer a course on it? Over the years of graphics hardware development, there have been obvious
More informationLocal Illumination. CMPT 361 Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller
Local Illumination CMPT 361 Introduction to Computer Graphics Torsten Möller Graphics Pipeline Hardware Modelling Transform Visibility Illumination + Shading Perception, Interaction Color Texture/ Realism
More informationHardware Accelerated Volume Visualization. Leonid I. Dimitrov & Milos Sramek GMI Austrian Academy of Sciences
Hardware Accelerated Volume Visualization Leonid I. Dimitrov & Milos Sramek GMI Austrian Academy of Sciences A Real-Time VR System Real-Time: 25-30 frames per second 4D visualization: real time input of
More information