COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 29, 2015 RENDERING RASTERIZATION RAY CASTING PROGRAMMABLE SHADERS.

Slides:



Advertisements
Similar presentations
COMPUTER GRAPHICS CS 482 – FALL 2014 NOVEMBER 10, 2014 GRAPHICS HARDWARE GRAPHICS PROCESSING UNITS PARALLELISM.
Advertisements

Ray tracing. New Concepts The recursive ray tracing algorithm Generating eye rays Non Real-time rendering.
Exploration of bump, parallax, relief and displacement mapping
Understanding the graphics pipeline Lecture 2 Original Slides by: Suresh Venkatasubramanian Updates by Joseph Kider.
Graphics Pipeline.
3D Graphics Rendering and Terrain Modeling
Rasterization and Ray Tracing in Real-Time Applications (Games) Andrew Graff.
HCI 530 : Seminar (HCI) Damian Schofield.
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Object-Order vs. Screen-Order Rendering April 24, 2003.
Computer Graphics (Fall 2005) COMS 4160, Lecture 21: Ray Tracing
(conventional Cartesian reference system)
3D Graphics Processor Architecture Victor Moya. PhD Project Research on architecture improvements for future Graphic Processor Units (GPUs). Research.
IN4151 Introduction 3D graphics 1 Introduction to 3D computer graphics part 2 Viewing pipeline Multi-processor implementation GPU architecture GPU algorithms.
Status – Week 277 Victor Moya.
Global Illumination May 7, Global Effects translucent surface shadow multiple reflection.
7M836 Animation & Rendering
Graphics Systems I-Chen Lin’s CG slides, Doug James’s CG slides Angel, Interactive Computer Graphics, Chap 1 Introduction to Graphics Pipeline.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Models and Architectures Ed Angel Professor of Computer Science, Electrical and Computer.
GPU Graphics Processing Unit. Graphics Pipeline Scene Transformations Lighting & Shading ViewingTransformations Rasterization GPUs evolved as hardware.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 19 Other Graphics Considerations Review.
COMPUTER GRAPHICS CS 482 – FALL 2014 AUGUST 27, 2014 FIXED-FUNCTION 3D GRAPHICS MESH SPECIFICATION LIGHTING SPECIFICATION REFLECTION SHADING HIERARCHICAL.
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.
Programmable Pipelines. 2 Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
Chris Kerkhoff Matthew Sullivan 10/16/2009.  Shaders are simple programs that describe the traits of either a vertex or a pixel.  Shaders replace a.
MIT EECS 6.837, Durand and Cutler Graphics Pipeline: Projective Transformations.
09/11/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Graphics Pipeline Texturing Overview Cubic Environment Mapping.
CS 450: COMPUTER GRAPHICS REVIEW: INTRODUCTION TO COMPUTER GRAPHICS – PART 2 SPRING 2015 DR. MICHAEL J. REALE.
CS447/ Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.
CSC 461: Lecture 3 1 CSC461 Lecture 3: Models and Architectures  Objectives –Learn the basic design of a graphics system –Introduce pipeline architecture.
CS 480/680 Computer Graphics Image Formation Dr. Frederick C Harris, Jr.
Rendering Overview CSE 3541 Matt Boggus. Rendering Algorithmically generating a 2D image from 3D models Raster graphics.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Stream Processing Main References: “Comparing Reyes and OpenGL on a Stream Architecture”, 2002 “Polygon Rendering on a Stream Architecture”, 2000 Department.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
1Computer Graphics Lecture 4 - Models and Architectures John Shearer Culture Lab – space 2
COMPUTER GRAPHICS CSCI 375. What do I need to know?  Familiarity with  Trigonometry  Analytic geometry  Linear algebra  Data structures  OOP.
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
Shadow Mapping Chun-Fa Chang National Taiwan Normal University.
Programmable Pipelines Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University.

1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
CS 325 Introduction to Computer Graphics 03 / 29 / 2010 Instructor: Michael Eckmann.
Global Illumination. Local Illumination  the GPU pipeline is designed for local illumination  only the surface data at the visible point is needed to.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Ray Tracing Fall, Introduction Simple idea  Forward Mapping  Natural phenomenon infinite number of rays from light source to object to viewer.
MIT EECS 6.837, Durand and Cutler The Graphics Pipeline: Projective Transformations.
1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis.
11/5/2002 (c) University of Wisconsin, CS 559 Last Time Local Shading –Diffuse term –Specular term –All together –OpenGL brief overview.
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.
RENDERING : Global Illumination
Chapter 1 Graphics Systems and Models Models and Architectures.
1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Models and Architectures 靜宜大學 資訊工程系 蔡奇偉 副教授 2012.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Photorealistic Rendering vs. Interactive 3D Graphics
Graphics Processing Unit
Deferred Lighting.
3D Graphics Rendering PPT By Ricardo Veguilla.
The Graphics Rendering Pipeline
Understanding Theory and application of 3D
Models and Architectures
Models and Architectures
Models and Architectures
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
Models and Architectures
CS5500 Computer Graphics May 29, 2006
Models and Architectures
Frame Buffer Applications
Presentation transcript:

COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 29, 2015 RENDERING RASTERIZATION RAY CASTING PROGRAMMABLE SHADERS

RASTERIZATION CS 482 – FALL 2015 TRADITIONAL RENDERING PIPELINE SEPTEMBER 29, 2015: RENDERINGPAGE 113 THE TRADITIONAL APPROACH TO RENDERING A 3D SCENE HAS BEEN TO START WITH THE OBJECTS IN OBJECT SPACE AND DETERMINE WHAT PIXELS THEY AFFECT IN IMAGE SPACE. STEP 1 START WITH A SET OF 3D PRIMITIVES (E.G., TRIANGLES) AND APPLY ALL NEEDED TRANSFORMATION S STEP 2 ILLUMINATE THE PRIMITIVE VERTICES ACCORDING TO THEIR MATERIAL PROPERTIES, THEIR NORMAL VECTORS, AND THE LIGHT SOURCES STEP 3 CONVERT FROM WORLD SPACE TO EYE SPACE BY MOVING VIEW POSITION TO ORIGIN AND VIEWING DIRECTION ALONG Z- AXIS STEP 4 CLIP AGAINST VIEW FRUSTUM TO ELIMINATE UNNECESSA RY RENDERING STEP 5 USE PERSPECTIV E PROJECTION TO PROJECT TO 2D SCREEN SPACE STEP 6 MAP ALL PRIMITIVE VERTICES TO THEIR APPROPRIAT E PIXELS STEP 7 INTERPOLATE REMAINING PRIMITIVE PIXEL VALUES (COLOR, SHADING, DEPTH, ETC.) STEP 8 LOAD FRAME BUFFER WITH CLOSEST PIXEL VALUE IN DEPTH BUFFER

RASTERIZATION CS 482 – FALL 2015 ADVANTAGES & DISADVANTAGES SEPTEMBER 29, 2015: RENDERINGPAGE 114 UNTIL RECENTLY, RASTERIZATION HAS BEEN THE STANDARD APPROACH TO RENDERING. VIRTUALLY EVERY OPERATION IN THE RASTERIZATION PIPELINE HAS BEEN IMPLEMENTED AS A FIXED-FUNCTION ON GRAPHICS CARDS. BECAUSE NONE OF THE PRIMITIVES MUST BE COMPARED IN ANY OF THE RASTERIZATION STEPS, RASTERIZATION POSSESSES A BUILT-IN EFFICIENCY. UNFORTUNATELY, SOME OF THE MOST BASIC VISUAL EFFECTS (E.G., REFLECTION, SHADOWS, GLOBAL ILLUMINATION) REQUIRE ACCESS TO THE ENTIRE SCENE. THESE EFFECTS CAN ONLY BE ROUGHLY APPROXIMATED WITH RASTERIZATION.

RAY CASTING CS 482 – FALL 2015 OVERVIEW SEPTEMBER 29, 2015: RENDERINGPAGE 115 WITH THE DEVELOPMENT OF FAST GRAPHICS PROCESSING, AN ALTERNATIVE RENDERING APPROACH HAS ARISEN. ESSENTIALLY, A RAY IS CAST THROUGH THE CENTER OF EACH PIXEL IN THE DISPLAY AND THE PIXEL IS ASSIGNED THE COLOR OF THE CLOSEST OBJECT IN THE SCENE THAT IS BLOCKING THAT RAY.

RAY CASTING CS 482 – FALL 2015 MODERN RENDERING PIPELINE SEPTEMBER 29, 2015: RENDERINGPAGE 116 USING RAY CASTING TO RENDER A 3D SCENE INVOLVES A DECEPTIVELY SHORT LIST OF STEPS. STEP 1 ONE BY ONE, SEND A RAY FROM THE VIEWPOINT THROUGH THE CENTER OF EACH PIXEL STEP 2 DETERMINE THE CLOSEST INTERSECTIO N OF EACH RAY WITH THE PRIMITIVES COMPRISING THE SCENE STEP 3 USING THE MATERIAL PROPERTIES OF THAT PRIMITIVE, AS WELL AS ITS NORMAL VECTOR AND THE POSITION OF ALL LIGHT SOURCES, DETERMINE THE SHADED COLOR OF THE PRIMITIVE AT THE INTERSECTION POINT STEP 4 COLOR THE PIXEL WITH THE CALCULATED COLOR FOR THE INTERSECTIO N POINT

RAY CASTING CS 482 – FALL 2015 DISADVANTAGES SEPTEMBER 29, 2015: RENDERINGPAGE 117 RAY CASTING’S PRIMARY PROBLEMS INVOLVE EXCESSIVE COMPUTATION TIME, WITH A WORST-CASE TIME COMPLEXITY OF THE PRODUCT OF THE NUMBER OF PIXELS AND THE NUMBER OF POLYGONS IN THE SCENE. THE TIME COMPLEXITY OF RAY CASTING CAN BE DRAMATICALLY REDUCED BY CONDUCTING THE INITIAL RAY INTERSECTION TEST WITH BOUNDING SPHERES THAT SURROUND THE OBJECTS. IF THE RAY DOESN’T INTERSECT THE BOUNDING SPHERE, THEN IT CAN’T INTERSECT THE OBJECT; ONLY WHEN THE RAY DOES INTERSECT THE BOUNDING SPHERE IS IT NECESSARY TO DO THE MORE SERIOUS INTERSECTION COMPUTATIONS WITH THE OBJECT. ANOTHER WAY OF AVOIDING UNNECESSARY CALCULATIONS IS TO USE SPATIAL SUBDIVISION. BY DETERMINING WHICH SECTORS OF SPACE INCLUDE WHICH OBJECTS, THE RAY CASTING ALGORITHM MAY AVOID CONCERNING ITSELF WITH INTERSECTIONS BETWEEN RAYS AND SECTORS THAT THE RAYS NEVER ENTER.

RAY CASTING CS 482 – FALL 2015 ADVANTAGES SEPTEMBER 29, 2015: RENDERINGPAGE 118 WHEN SECONDARY RAYS ARE COMPUTED FROM THE PRIMARY RAY’S INTERSECTION POINT, RAY CASTING IS ENHANCED TO BECOME RAY TRACING, WHICH PERMITS THE CALCULATION OF REALISTIC SHADOWS, REFLECTIONS, AND REFRACTIONS (ALBEIT AT A VERY STEEP INCREASE IN COMPUTATIONAL OVERHEAD). RAY CASTING IS PARTICULARLY VALUABLE WHEN RENDERING VOLUMETRIC DATA. EACH RAY CAST THROUGH A PIXEL IS SAMPLED AT REGULAR INTERVALS AND THE ASSOCIATED VOXEL DATA IS COMBINED TO FORM A CLEARER NOTION OF THE ENTIRE VOLUME OF THE OBJECT, NOT JUST ITS SURFACE INFORMATION.

PROGRAMMABLE SHADERS CS 482 – FALL 2015 FIXED-FUNCTION PROBLEMS SEPTEMBER 29, 2015: RENDERINGPAGE 119 THE FIXED-FUNCTION GRAPHICS PIPELINE COULD BE IMPLEMENTED IN BOTH SOFTWARE AND HARDWARE WITH PREDICTABLE RESULTS ACROSS ALL COMPUTING PLATFORMS. HOWEVER, NUMEROUS GRAPHICS OPERATIONS DO NOT LEND THEMSELVES TO THE FIXED-FUNCTION APPROACH. EYE-SPACE- DEPENDENT MODELING (E.G., RAINBOW MODELING, BASED ON WATER DROPLETS DEFINING A PARTICULAR ANGLE BETWEEN THE EYE AND THE LIGHT) ANISOTROPIC SHADING (E.G., A BRUSHED METAL EFFECT NOT ACHIEVABLE WITH TRADITIONAL AMBIENT, DIFFUSE, AND SPECULAR LIGHTING EFFECTS) SCALE-INDEPENDENT TEXTURE EFFECTS (E.G., AUTOMATICALLY ADJUSTING THE TEXTURE BEING DISPLAYED TO THE CURRENT ZOOM FACTOR) CREATING GEOMETRY (E.G., ADJUSTING THE LEVEL OF DETAIL AS NEEDED IN ORDER TO ADAPT THE DISPLAYED IMAGE TO THE CURRENT SCREEN SPACE AND PROCESSING CAPABILITIES) THE NOTION OF INSERTING PROGRAMMABLE SHADERS AT KEY PLACES IN THE RENDERING PIPELINE WAS DEVELOPED AS A MEANS TO CREATE NEW EFFECTS WITHOUT HAVING TO PERMANENTLY ALTER THE RENDERER’S CODE OR THE GPU’S ARCHITECTURE.

PROGRAMMABLE SHADERS CS 482 – FALL 2015 PIPELINE SEPTEMBER 29, 2015: RENDERINGPAGE 120 Input Assembler Stage Rasterizer Stage Output Merger Stage Vertex Shader Stage (Programmable) Geometry Shader Stage (Programmable) Fragment Shader Stage (Programmable) Stream Output Stage Memory Resourc es (Buffer, Texture, Constant Buffer) Memory Resourc es (Buffer, Texture, Constant Buffer) Tessellation Control Shader Stage (Programmable) Tessellation Primitive Generator Stage Tessellation Evaluation Shader Stage (Programmable) Fixed-Function Stages Function entry points that are directly mapped to dedicated logic for their named purpose (usually common geometry transformations and pixel- shading functions) on GPUs designed to support them. Fixed-Function Stages Function entry points that are directly mapped to dedicated logic for their named purpose (usually common geometry transformations and pixel- shading functions) on GPUs designed to support them. Programmable Shader Stages Programs that calculate customizable rendering effects on graphics hardware with a high degree of flexibility, defining algorithms and introducing external variables or textures to construct images that may be altered on the fly. Programmable Shader Stages Programs that calculate customizable rendering effects on graphics hardware with a high degree of flexibility, defining algorithms and introducing external variables or textures to construct images that may be altered on the fly.