Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics CIS 636/736 Computer Graphics.

Slides:



Advertisements
Similar presentations
Compositing and Blending Ed Angel Professor Emeritus of Computer Science University of New Mexico 1 E. Angel and D. Shreiner: Interactive Computer Graphics.
Advertisements

Polygon Rendering Flat Rendering Goraud Rendering Uses Phong Reflectance Phong Rendering.
Understanding the graphics pipeline Lecture 2 Original Slides by: Suresh Venkatasubramanian Updates by Joseph Kider.
Graphics Pipeline.
2 COEN Computer Graphics I Evening’s Goals n Discuss the fundamentals of lighting in computer graphics n Analyze OpenGL’s lighting model n Show.
Computing & Information Sciences Kansas State University CG Basics 5 of 8: OpenGL Primer 2 CIS 636/736: (Introduction to) Computer Graphics CIS 636 Introduction.
Computer Graphics(Fall 2003) COMS 4160, Lecture 7: OpenGL 3 Ravi Ramamoorthi Many slides courtesy Greg Humphreys.
Computer Graphic Creator: Mohsen Asghari Session 2 Fall 2014.
Texture Mapping. Texturing  process that modifies the appearance of each point on a surface using an image or function  any aspect of appearance can.
Shading in OpenGL CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
Foundations of Computer Graphics (Spring 2010) CS 184, Lecture 11: OpenGL 3
(conventional Cartesian reference system)
Shading in OpenGL Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
IN4151 Introduction 3D graphics 1 Introduction to 3D computer graphics part 2 Viewing pipeline Multi-processor implementation GPU architecture GPU algorithms.
OpenGL Texture Mapping
Graphics Systems I-Chen Lin’s CG slides, Doug James’s CG slides Angel, Interactive Computer Graphics, Chap 1 Introduction to Graphics Pipeline.
The Graphics Pipeline CS2150 Anthony Jones. Introduction What is this lecture about? – The graphics pipeline as a whole – With examples from the video.
OpenGL Texture Mapping Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
Computer Graphics (Spring 2008) COMS 4160, Lecture 14: OpenGL 3
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Models and Architectures Ed Angel Professor of Computer Science, Electrical and Computer.
Computing & Information Sciences Kansas State University Advanced CG 1 of 8: TexturingCIS 636/736: (Introduction to) Computer Graphics CIS 736 Computer.
REAL-TIME VOLUME GRAPHICS Christof Rezk Salama Computer Graphics and Multimedia Group, University of Siegen, Germany Eurographics 2006 Real-Time Volume.
Computing & Information Sciences Kansas State University CIS 536/636 Introduction to Computer Graphics Lecture 6 of 41 William H. Hsu Department of Computing.
Programmable Pipelines. Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
Programmable Pipelines. 2 Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
An Interactive Introduction to OpenGL Programming Ed Angel
Imaging and Raster Primitives Vicki Shreiner. 2 Jobs Andrew Giles Andrew Giles Chuck Fultz Chuck Fultz SIGGraph - SIGGraph.
CSC 461: Lecture 3 1 CSC461 Lecture 3: Models and Architectures  Objectives –Learn the basic design of a graphics system –Introduce pipeline architecture.
CS380 LAB IV OpenGL Jonghyeob Lee Reference1. [OpenGL course slides by Rasmus Stenholt] Reference2. [
OpenGL Conclusions OpenGL Programming and Reference Guides, other sources CSCI 6360/4360.
1 Introduction to Computer Graphics SEN Introduction to OpenGL Graphics Applications.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
OpenGL Texture Mapping. 2 Objectives Introduce the OpenGL texture functions and options.
CS 480/680 Computer Graphics OpenGL Texture Mapping Dr. Frederick C Harris, Jr. Fall 2011.
1Computer Graphics Lecture 4 - Models and Architectures John Shearer Culture Lab – space 2
Computing & Information Sciences Kansas State University Lecture 10 of 42CIS 636/736: (Introduction to) Computer Graphics CIS 636/736 Computer Graphics.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Programmable Pipelines Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University.
Computing & Information Sciences Kansas State University CIS 536/636 Introduction to Computer Graphics Lecture 9 of 41 William H. Hsu Department of Computing.
CG Summary: OpenGL Shading andTextures Angel, Chapters 5, 7; “Red Book” slides from AW, red book, etc. CSCI 6360/4360.
Review of OpenGL Basics
Computer Graphics Bing-Yu Chen National Taiwan University.
OpenGL Architecture Display List Polynomial Evaluator Per Vertex Operations & Primitive Assembly Rasterization Per Fragment Operations Frame Buffer Texture.
09/16/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Environment mapping Light mapping Project Goals for Stage 1.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
Shading in OpenGL Ed Angel Professor Emeritus of Computer Science University of New Mexico 1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Computer Graphics Bing-Yu Chen National Taiwan University.
Computing & Information Sciences Kansas State University Advanced CG 2 of 8: MappingsCIS 636/736: (Introduction to) Computer Graphics CIS 736 Computer.
Where We Stand So far we know how to: –Transform between spaces –Rasterize –Decide what’s in front Next –Deciding its intensity and color.
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.
Details of Texture Mapping Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Monday, December 1, 2003.
Lighting Dave Shreiner. 2 Lighting Principles Lighting simulates how objects reflect light Lighting simulates how objects reflect light material composition.
1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Models and Architectures 靜宜大學 資訊工程系 蔡奇偉 副教授 2012.
Computer Graphics Ken-Yi Lee National Taiwan University (the slides are adapted from Bing-Yi Chen and Yung-Yu Chuang)
CSC Graphics Programming Budditha Hettige Department of Statistics and Computer Science.
Chapter 5. Lighting Computer Graphics (spring, 2009) School of Computer Science University of Seoul.
CSC Graphics Programming
Programmable Pipelines
The Graphic PipeLine
Graphics Processing Unit
The Graphics Rendering Pipeline
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
3D Game Programming Texture Mapping
OpenGL Texture Mapping
3D Game Programming Texture Mapping
OpenGL Texture Mapping
Presentation transcript:

Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics CIS 636/736 Computer Graphics Lecture 12 of 42 William H. Hsu Department of Computing and Information Sciences, KSU KSOL course pages: Course web site: Instructor home page: Readings: All slides from SIGGRAPH 2000 tutorial on OpenGL, Shreiner, Angel, Shreiner: Sections 2.6, 3.1, 20.3 – 20.13, Eberly 2 e – see NeHe tutorials: 6 – 10, Article: Surface Detail 5: Pixel and Vertex Programs

Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics Lecture Outline Based in part on OpenGL Tutorials from SIGGRAPH 2000 Vicki Shreiner: Animation and Depth Buffering  Double buffering  Illumination: light positioning, light models, attenuation  Material properties  Animation basics in OpenGL Vicki Shreiner: Imaging and Raster Primitives Ed Angel: Texture Mapping Dave Shreiner: Advanced Topics  Display lists and vertex arrays  Accumulation buffer  Fog  Stencil buffering  Fragment programs (to be concluded in Tutorial 3)

Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics Lighting Dave Shreiner

Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics Lighting Principles Lighting simulates how objects reflect light  material composition of object  light’s color and position  global lighting parameters  ambient light  two sided lighting  available in both color index and RGBA mode

Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics Surface Normals Normals define how a surface reflects light glNormal3f( x, y, z )  Current normal is used to compute vertex’s color  Use unit normals for proper lighting  scaling affects a normal’s length glEnable( GL_NORMALIZE ) or glEnable( GL_RESCALE_NORMAL ) CPU DL Poly. Per Vertex Per Vertex Raster Frag FB Pixel Texture

Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics Light Properties glLightfv( light, property, value );  light specifies which light  multiple lights, starting with GL_LIGHT0 glGetIntegerv( GL_MAX_LIGHTS, &n );  properties  colors  position and type  attenuation

Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics Light Sources Light color properties  GL_AMBIENT  GL_DIFFUSE  GL_SPECULAR

Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics Turning on the Lights Flip each light’s switch glEnable( GL_LIGHT n ); Turn on power glEnable( GL_LIGHTING );

Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics Light Material Tutorial

Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics Controlling a Light’s Position Modelview matrix affects a light’s position  Different effects based on when position is specified  eye coordinates  world coordinates  model coordinates  Push and pop matrices to uniquely control a light’s position

Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics Light Position Tutorial

Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics Frame Buffer Rasterization (including Pixel Zoom) Per Fragment Operations TextureM emory Pixel-Transfer Operations (and Pixel Map) CPU Pixel Storage Modes glReadPixels(), glCopyPixels() glBitmap(), glDrawPixels() glCopyTex*Image(); Pixel Pipeline Programmable pixel storage and transfer operations CPU DL Poly. Per Vertex Per Vertex Raster Frag FB Pixel Texture

Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics Texture Mapping Ed Angel

Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics Texture Mapping CPU DL Poly. Per Vertex Per Vertex Raster Frag FB Pixel Texture Apply 1-D, 2-D, or 3-D image to geometric primitives Uses of Texturing  simulating materials  reducing geometric complexity  image warping  reflections

Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics Texture Mapping s t x y z image geometry screen

Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics Texture Mapping and OpenGL Pipeline geometry pipeline vertices pixel pipeline image rasterizer Images and geometry flow through separate pipelines that join at the rasterizer  “complex” textures do not affect geometric complexity

Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics Texture Example The texture (below) is a 256 x 256 image that has been mapped to a rectangular polygon which is viewed in perspective

Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics Three steps  specify texture  read or generate image  assign to texture  assign texture coordinates to vertices  specify texture parameters  wrapping, filtering Applying Textures [1]

Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics Applying Textures [2]  specify textures in texture objects  set texture filter  set texture function  set texture wrap mode  set optional perspective correction hint  bind texture object  enable texturing  supply texture coordinates for vertex  coordinates can also be generated

Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics Define a texture image from array of texels in CPU memory glTexImage2D( target, level, components, w, h, border, format, type, *texels );  dimensions of image must be powers of 2 Texel colors are processed by pixel pipeline  pixel scales, biases and lookups can be done Specify Texture Image CPU DL Poly. Per Vertex Per Vertex Raster Frag FB Pixel Texture

Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics Tutorial: Texture

Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics Summary OpenGL Tutorials from SIGGRAPH 2000 Vicki Shreiner: Animation and Depth Buffering  Double buffering  Illumination: light positioning, light models, attenuation  Material properties  Animation basics in OpenGL Vicki Schreiner: Imaging and Raster Primitives Ed Angel: Texture Mapping in OpenGL More in CG Basics 5: GL Primer 2 of 3

Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics Terminology Double Buffering Lighting Illumination Equation – describes light in scene  Ambient light – catch-all term for whole scene, all lights  Diffuse reflectance – omnidirectional, from matte surfaces  Specular reflectance – unidirectional, for highlights: shiny surfaces  Attenuation – how quickly light drops off as function of distance Pixel and Fragment Programs (“Pixel Shaders”) Vertex Shaders Texture Maps Other Mappings Discussed in Course  Bump aka displacement – perturb surface normal, calculate lighting  Reflection and transparency  Shadow  Environment

Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics Next: Polygons, OpenGL Tutorial 3 Dave Shreiner: Advanced Topics (concluded)  Advanced Primitives: Cubic Curves, Bicubic Surfaces  More on Shadow Stencil Buffer  Alpha, Blending, Antialiasing  Accumulation Buffer, Fog, Jitter Using the OpenGL Shading Language  More on fragment programs  Demo: color interpolation  Example: Fast Phong shading Special Effects