# 6.837 Introduction to Computer Graphics Assignment 5: OpenGL and Solid Textures Due Wednesday October 22, 2003 at 11:59pm

Save this PDF as:

Size: px
Start display at page:

Download "6.837 Introduction to Computer Graphics Assignment 5: OpenGL and Solid Textures Due Wednesday October 22, 2003 at 11:59pm"

## Transcription

3 1.2 Group Similar to the intersection method, a group implements paint by iterating over all its children and calling their paint methods. 1.3 Triangle OpenGL is based on polygons. You tell the API to render a polygon by first telling it that you start a polygon, then describing all the vertices and their properties, and finally closing the polygon. The code to specify just the positions of a single triangle looks like this: glbegin(gl_triangles); glvertex3f(x1, y1, z1); glend(); Alternatively, you can directly specify an array of floats for each vertex using glvertex3fv(float *arr). Implement the paint method for your Triangle class. 1.4 Normals and materials OpenGL can also compute local illumination. However, it cannot easily compute cast shadows. To take local illumination into account, you must provide the material and normal information for the triangle. First, you must update your Material and PhongMaterial implementation and add a virtual void Material::glSetMaterial() const member function. This function will send the appropriate OpenGL commands to specify the local shading model. Copy the code from material_additions.txt for the Phong model. For the paint method of each primitive, before sending any OpenGL geometric command, you will need to call the void Material::glSetMaterial() const member function to set up the GL material parameters. Do so in the Object3D parent class, and call Object3D::paint() at the beginning of the paint of each subclass. To set the triangle normal, use one of the following commands before specifying the vertices: glnormal3f(float x, float y, float z); glnormal3fv(float *arr); // List of floats // Array of floats Remember that you can compute the normal of a triangle using a cross product. Test your triangle paint routine with the simple test scenes provided. 3

4 1.5 Plane OpenGL does not have an infinite plane primitive. To pre-visualize planes, you will simply use very big rectangles. Project the world origin (0,0,0) onto the plane, and compute two basis vectors for the plane that are orthogonal to the normal n. The first basis vector may be obtained by taking the cross product between the normal and another vector v. Any vector v will do the trick, as long as it is not parallel to n. So you can always use v = (1, 0, 0) except when n is along the x axis, in which case you can use v = (0, 1, 0). Then the first basis vector, b 1,is v n and the second basis vector, b 2,is v b 1 Display a rectangle from (-BIG, -BIG) to (BIG, BIG) in this 2D basis (Caution: OpenGL does not like rendering points at INFINITY). In OpenGL, you may include 3n vertex positions within the glbegin and glend commands to draw n triangles: glbegin(gl_triangles); glnormal3f(nx, ny, nz); glvertex3f(x1, y1, z1); glvertex3f(x3, y3, z3); glend(); 1.6 Sphere OpenGL does not have a sphere primitive, so spheres must be transformed into triangles, a process known as tessel lation 2. You will implement the classic sphere tessellation using angular parameters θ and ϕ. The number of steps in θ and ϕ will be controlled by a command line argument -tessellation <theta> <phi>. Deduce the corresponding angle increments, and use two nested loops on the angles to generate the appropriate triangles. Note that θ should vary between 0 and 360, while ϕ must vary between 90 and 90. You can use a single glbegin(gl_triangles), glend() pair for the entire sphere: glbegin(gl_triangles); for (iphi=...; iphi<...; iphi+=...) for (int itheta=...; itheta=...; itheta+=...) { //compute appropriate coordinates //send gl vertex commands 2 Actually, glu does have a sphere primitive, but you are not allowed to use this shortcut for the assignment 4

5 } glend(); glvertex3f(x1, y1, z1); glvertex3f(x3, y3, z3); You will implement two versions of sphere normals: flat shading (visible facets) and Gouraud interpolation. For flat shading, you will use the normal of each triangle, as you would for polygon rendering. For the Gouraud interpolation version, you will use the true normal of the sphere for each vertex (set the vertex normal before specifying each vertex position). Note how this improves the appearance of the sphere and makes it smoother. OpenGL performs bilinear interpolation between the color values computed at each vertex. Note that this is not as good as the Phong interpolation described in class (which interpolates the surface normals then performs the lighting calculation per pixel). 1.7 Transformation Finally, you must handle transformations. OpenGL will do most of the work for you. You only need to specify that you want to change the current objectspace-to-world-space 4x4 matrix. To do this, you first need to save the current matrix on a matrix stack using glpushmatrix(). Then change the matrix using glmultmatrix(glfloat *fd). We have added a glget() routine to the Matrix class to construct a matrix with the appropriate structure. OpenGL matrices created with this routine should be deleted when they are no longer needed: glpushmatrix(); GLfloat *glmatrix = matrix.glget(); glmultmatrixf(glmatrix); delete[] glmatrix; Then, recursively call the paint method of the child object. After this, you must restore the previous matrix from the stack using: glpopmatrix(); If you do not save and restore the matrix, your transformation will be applied to all the following primitives! 2 Solid textures Solid textures are a simple way to obtain material variation over an object. Depending on the spatial location of the shaded point, different material properties (color, specular coefficients, etc.) are chosen. In this assignment, you will 5

7 5 Ideas for Extra Credit Perlin noise and turbulence; Wood; Marble; add matrices to solid textures; Supersampling; Texture mapping (need for parameterization); Phong normal interpolation; distribution ray tracing; subsurface scattering. 6 Other New command line arguments -tessellation ntheta, nphi (tessellation of the sphere) -gouraud (gouraud smooth shading for spheres) 7

Last Time? The Traditional Graphics Pipeline Reading for Today A Practical Model for Subsurface Light Transport, Jensen, Marschner, Levoy, & Hanrahan, SIGGRAPH 2001 Participating Media Measuring BRDFs

### Surface Graphics. 200 polys 1,000 polys 15,000 polys. an empty foot. - a mesh of spline patches:

Surface Graphics Objects are explicitely defined by a surface or boundary representation (explicit inside vs outside) This boundary representation can be given by: - a mesh of polygons: 200 polys 1,000

### CSE 690: GPGPU. Lecture 2: Understanding the Fabric - Intro to Graphics. Klaus Mueller Stony Brook University Computer Science Department

CSE 690: GPGPU Lecture 2: Understanding the Fabric - Intro to Graphics Klaus Mueller Stony Brook University Computer Science Department Klaus Mueller, Stony Brook 2005 1 Surface Graphics Objects are explicitely

### Computer Graphics 1. Chapter 7 (June 17th, 2010, 2-4pm): Shading and rendering. LMU München Medieninformatik Andreas Butz Computergraphik 1 SS2010

Computer Graphics 1 Chapter 7 (June 17th, 2010, 2-4pm): Shading and rendering 1 The 3D rendering pipeline (our version for this class) 3D models in model coordinates 3D models in world coordinates 2D Polygons

### Models and Architectures. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

Models and Architectures Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico 1 Objectives Learn the basic design of a graphics system Introduce

### Interpolation using scanline algorithm

Interpolation using scanline algorithm Idea: Exploit knowledge about already computed color values. Traverse projected triangle top-down using scanline. Compute start and end color value of each pixel

### Graphics Hardware and OpenGL

Graphics Hardware and OpenGL Ubi Soft, Prince of Persia: The Sands of Time What does graphics hardware have to do fast? Camera Views Different views of an object in the world 1 Camera Views Lines from

Fall 2017 CSCI 420: Computer Graphics 5.2 Shading in OpenGL Hao Li http://cs420.hao-li.com 1 Outline Normal Vectors in OpenGL Polygonal Shading Light Sources in OpenGL Material Properties in OpenGL Example:

### Computer Graphics and Visualization. Graphics Systems and Models

UNIT -1 Graphics Systems and Models 1.1 Applications of computer graphics: Display Of Information Design Simulation & Animation User Interfaces 1.2 Graphics systems A Graphics system has 5 main elements:

### CSE 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:

### Last Time? Ray Casting. Administrivia: Lab & Office Hours. Notes on Assignments. Ray Casting. Overview of Today

Ray Casting Last Time? Luxo Jr. Applications of Computer Graphics Overview of the semester IFS Assignment 0 due tomorrow @ 11:59pm Questions? 1 2 Notes on Assignments Make sure you turn in a linux or windows

### Lets assume each object has a defined colour. Hence our illumination model is looks unrealistic.

Shading Models There are two main types of rendering that we cover, polygon rendering ray tracing Polygon rendering is used to apply illumination models to polygons, whereas ray tracing applies to arbitrary

### OpenGL: Open Graphics Library. Introduction to OpenGL Part II. How do I render a geometric primitive? What is OpenGL

OpenGL: Open Graphics Library Introduction to OpenGL Part II CS 351-50 Graphics API ( Application Programming Interface) Software library Layer between programmer and graphics hardware (and other software

### Homework #2 and #3 Due Friday, October 12 th and Friday, October 19 th

Homework #2 and #3 Due Friday, October 12 th and Friday, October 19 th 1. a. Show that the following sequences commute: i. A rotation and a uniform scaling ii. Two rotations about the same axis iii. Two

### OpenGL refresher. Advanced Computer Graphics 2012

Advanced Computer Graphics 2012 What you will see today Outline General OpenGL introduction Setting up: GLUT and GLEW Elementary rendering Transformations in OpenGL Texture mapping Programmable shading

### Photorealism: Ray Tracing

Photorealism: Ray Tracing Reading Assignment: Chapter 13 Local vs. Global Illumination Local Illumination depends on local object and light sources only Global Illumination at a point can depend on any

### CEng 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

### Computer 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

### Orthogonal 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

### COMP 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,

### CS5620 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

### Computer Graphics. Lecture 9 Environment mapping, Mirroring

Computer Graphics Lecture 9 Environment mapping, Mirroring Today Environment Mapping Introduction Cubic mapping Sphere mapping refractive mapping Mirroring Introduction reflection first stencil buffer

### CIS 441/541: Introduction to Computer Graphics Lecture 14: OpenGL Basics

CIS 441/541: Introduction to Computer Graphics Lecture 14: OpenGL Basics Oct. 26th, 2016 Hank Childs, University of Oregon Announcements OH Hank: Weds 1-2, Thursday 11-12 Dan: Weds 4-530, Thursday 930-11

### Computer Graphics. Prof. Feng Liu. Fall /21/2016

Computer Graphics Prof. Feng Liu Fall 2016 http://www.cs.pdx.edu/~fliu/courses/cs447/ 11/21/2016 Last time Polygon Mesh and Modeling 2 Today Modeling Technologies Final Exam: 12:30-2:00, December 7, 2016

### Basic Graphics Programming

CSCI 480 Computer Graphics Lecture 2 Basic Graphics Programming January 11, 2012 Jernej Barbic University of Southern California http://www-bcf.usc.edu/~jbarbic/cs480-s12/ Graphics Pipeline OpenGL API

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ω

### Computer Graphics (Basic OpenGL)

Computer Graphics (Basic OpenGL) Thilo Kielmann Fall 2008 Vrije Universiteit, Amsterdam kielmann@cs.vu.nl http://www.cs.vu.nl/ graphics/ Computer Graphics (Basic OpenGL, Input and Interaction), ((57))

### 11/1/13. Basic Graphics Programming. Teaching Assistant. What is OpenGL. Course Producer. Where is OpenGL used. Graphics library (API)

CSCI 420 Computer Graphics Lecture 2 Basic Graphics Programming Teaching Assistant Yijing Li Office hours TBA Jernej Barbic University of Southern California Graphics Pipeline OpenGL API Primitives: Lines,

### Rasterization Overview

Rendering Overview The process of generating an image given a virtual camera objects light sources Various techniques rasterization (topic of this course) raytracing (topic of the course Advanced Computer

### CPSC 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

### graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1 graphics pipeline sequence of operations to generate an image using object-order processing primitives processed one-at-a-time

### Shaders. 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)?

### DH2323 DGI13. Lab 2 Raytracing

DH2323 DGI13 Lab 2 Raytracing In this lab you will implement a Raytracer, which draws images of 3D scenes by tracing the light rays reaching the simulated camera. The lab is divided into several steps.

### Comp 410/510 Computer Graphics. Spring Shading

Comp 410/510 Computer Graphics Spring 2017 Shading Why we need shading Suppose we build a model of a sphere using many polygons and then color it using a fixed color. We get something like But we rather

### Rendering 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

### Raycast Rendering Maya 2013

2000 2012 Michael O'Rourke Raycast Rendering Maya 2013 (See also the Intro to Lights and Rendering tutorial for an introduction to the basics of rendering an image) Concept There are several algorithms

### Fall CSCI 420: Computer Graphics. 7.1 Rasterization. Hao Li.

Fall 2015 CSCI 420: Computer Graphics 7.1 Rasterization Hao Li http://cs420.hao-li.com 1 Rendering Pipeline 2 Outline Scan Conversion for Lines Scan Conversion for Polygons Antialiasing 3 Rasterization

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

### CMSC 435/634: Introduction to Graphics

CMSC 435/634: Introduction to Graphics Final Exam December 16, 2002 Instructions: Clearly write your name on this sheet. Answer each problem in the space provided. If you need extra space, write on extra

### Three-Dimensional Graphics V. Guoying Zhao 1 / 55

Computer Graphics Three-Dimensional Graphics V Guoying Zhao 1 / 55 Shading Guoying Zhao 2 / 55 Objectives Learn to shade objects so their images appear three-dimensional Introduce the types of light-material

### Lighting and Shading Computer Graphics I Lecture 7. Light Sources Phong Illumination Model Normal Vectors [Angel, Ch

15-462 Computer Graphics I Lecture 7 Lighting and Shading February 12, 2002 Frank Pfenning Carnegie Mellon University http://www.cs.cmu.edu/~fp/courses/graphics/ Light Sources Phong Illumination Model

### Draw Guide. Chapter 7 Working with 3D Objects

Draw Guide Chapter 7 Working with 3D Objects Copyright This document is Copyright 2011 2014 by the LibreOffice Documentation Team. Contributors are listed below. You may distribute or modify it under the

### OpenGL Tutorial. Ceng 477 Introduction to Computer Graphics

OpenGL Tutorial Ceng 477 Introduction to Computer Graphics Adapted from: http://www.cs.princeton.edu/courses/archive/spr06/cos426/assn3/opengl_tutorial.ppt OpenGL IS an API OpenGL IS nothing more than

### - Rasterization. Geometry. Scan Conversion. Rasterization

Computer Graphics - The graphics pipeline - Geometry Modelview Geometry Processing Lighting Perspective Clipping Scan Conversion Texturing Fragment Tests Blending Framebuffer Fragment Processing - So far,

### CS450/550. Pipeline Architecture. Adapted From: Angel and Shreiner: Interactive Computer Graphics6E Addison-Wesley 2012

CS450/550 Pipeline Architecture Adapted From: Angel and Shreiner: Interactive Computer Graphics6E Addison-Wesley 2012 0 Objectives Learn the basic components of a graphics system Introduce the OpenGL pipeline

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 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

### OpenGL shaders and programming models that provide object persistence

OpenGL shaders and programming models that provide object persistence COSC342 Lecture 22 19 May 2016 OpenGL shaders We discussed forms of local illumination in the ray tracing lectures. We also saw that

### CS 591B Lecture 9: The OpenGL Rendering Pipeline

CS 591B Lecture 9: The OpenGL Rendering Pipeline 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination Spring 2007 Rui Wang 3D Polygon Rendering Many applications

### Photorealistic 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

### So far, we have considered only local models of illumination; they only account for incident light coming directly from the light sources.

11 11.1 Basics So far, we have considered only local models of illumination; they only account for incident light coming directly from the light sources. Global models include incident light that arrives

### 521493S Computer Graphics. Exercise 3

521493S Computer Graphics Exercise 3 Question 3.1 Most graphics systems and APIs use the simple lighting and reflection models that we introduced for polygon rendering. Describe the ways in which each

Illumination and Shading Computer Graphics COMP 770 (236) Spring 2007 Instructor: Brandon Lloyd 2/14/07 1 From last time Texture mapping overview notation wrapping Perspective-correct interpolation Texture

### Announcements. 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

### TEXTURE MAPPING. DVA338 Computer Graphics Thomas Larsson, Afshin Ameri

TEXTURE MAPPING DVA338 Computer Graphics Thomas Larsson, Afshin Ameri OVERVIEW Motivation Texture Mapping Coordinate Mapping (2D, 3D) Perspective Correct Interpolation Texture Filtering Mip-mapping Anisotropic

### Computer Graphics. - Rasterization - Philipp Slusallek

Computer Graphics - Rasterization - Philipp Slusallek Rasterization Definition Given some geometry (point, 2D line, circle, triangle, polygon, ), specify which pixels of a raster display each primitive

### Overview: Ray Tracing & The Perspective Projection Pipeline

Overview: Ray Tracing & The Perspective Projection Pipeline Lecture #2 Thursday, August 28 2014 About this Lecture! This is an overview.! Think of it as a quick tour moving fast.! Some parts, e.g. math,

### Ray Casting. Outline. Similar to glulookat derivation. Foundations of Computer Graphics

Foundations of omputer Graphics Online Lecture 10: Ray Tracing 2 Nuts and olts amera Ray asting Outline amera Ray asting (choose ray directions) Ravi Ramamoorthi Outline in ode Image Raytrace (amera cam,

### Topics. From vertices to fragments

Topics From vertices to fragments From Vertices to Fragments Assign a color to every pixel Pass every object through the system Required tasks: Modeling Geometric processing Rasterization Fragment processing

### Einführung in Visual Computing

Einführung in Visual Computing 186.822 Textures Werner Purgathofer Surface-Rendering Methods polygon rendering methods ray tracing global illumination environment mapping texture mapping bump mapping Werner

### Global Illumination. Global Illumination. Direct Illumination vs. Global Illumination. Indirect Illumination. Soft Shadows.

CSCI 480 Computer Graphics Lecture 18 Global Illumination BRDFs Raytracing and Radiosity Subsurface Scattering Photon Mapping [Ch. 13.4-13.5] March 28, 2012 Jernej Barbic University of Southern California

### Assignment 1. Simple Graphics program using OpenGL

Assignment 1 Simple Graphics program using OpenGL In this assignment we will use basic OpenGL functions to draw some basic graphical figures. Example: Consider following program to draw a point on screen.

### C P S C 314 S H A D E R S, O P E N G L, & J S RENDERING PIPELINE. Mikhail Bessmeltsev

C P S C 314 S H A D E R S, O P E N G L, & J S RENDERING PIPELINE UGRAD.CS.UBC.C A/~CS314 Mikhail Bessmeltsev 1 WHAT IS RENDERING? Generating image from a 3D scene 2 WHAT IS RENDERING? Generating image

### 4) Finish the spline here. To complete the spline, double click the last point or select the spline tool again.

1) Select the line tool 3) Move the cursor along the X direction (be careful to stay on the X axis alignment so that the line is perpendicular) and click for the second point of the line. Type 0.5 for

### SEOUL NATIONAL UNIVERSITY

Fashion Technology 5. 3D Garment CAD-1 Sungmin Kim SEOUL NATIONAL UNIVERSITY Overview Design Process Concept Design Scalable vector graphics Feature-based design Pattern Design 2D Parametric design 3D

### Transformation Pipeline

Transformation Pipeline Local (Object) Space Modeling World Space Clip Space Projection Eye Space Viewing Perspective divide NDC space Normalized l d Device Coordinatesd Viewport mapping Screen space Coordinate

### CENG 477 Introduction to Computer Graphics. Ray Tracing: Shading

CENG 477 Introduction to Computer Graphics Ray Tracing: Shading Last Week Until now we learned: How to create the primary rays from the given camera and image plane parameters How to intersect these rays

### Clipping. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

Clipping 1 Objectives Clipping lines First of implementation algorithms Clipping polygons (next lecture) Focus on pipeline plus a few classic algorithms 2 Clipping 2D against clipping window 3D against

### Hierarchical Modeling and Scene Graphs

Hierarchical Modeling and Scene Graphs Adapted from material prepared by Ed Angel Spring 2009 Objectives Examine the limitations of linear modeling Symbols and instances Introduce hierarchical models Articulated

### Supplement to Lecture 22

Supplement to Lecture 22 Programmable GPUs Programmable Pipelines Introduce programmable pipelines - Vertex shaders - Fragment shaders Introduce shading languages - Needed to describe shaders - RenderMan

### Precept 2 Aleksey Boyko February 18, 2011

Precept 2 Aleksey Boyko February 18, 2011 Getting started Initialization Drawing Transformations Cameras Animation Input Keyboard Mouse Joystick? Textures Lights Programmable pipeline elements (shaders)

### CS4621/5621 Fall Computer Graphics Practicum Intro to OpenGL/GLSL

CS4621/5621 Fall 2015 Computer Graphics Practicum Intro to OpenGL/GLSL Professor: Kavita Bala Instructor: Nicolas Savva with slides from Balazs Kovacs, Eston Schweickart, Daniel Schroeder, Jiang Huang

### Shadow Algorithms. CSE 781 Winter Han-Wei Shen

Shadow Algorithms CSE 781 Winter 2010 Han-Wei Shen Why Shadows? Makes 3D Graphics more believable Provides additional cues for the shapes and relative positions of objects in 3D What is shadow? Shadow:

### Direct Rendering of Trimmed NURBS Surfaces

Direct Rendering of Trimmed NURBS Surfaces Hardware Graphics Pipeline 2/ 81 Hardware Graphics Pipeline GPU Video Memory CPU Vertex Processor Raster Unit Fragment Processor Render Target Screen Extended

Illumination and Shading Illumination (Lighting) Model the interaction of light with surface points to determine their final color and brightness OpenGL computes illumination at vertices illumination Shading

### 5.8.3 Oblique Projections

278 Chapter 5 Viewing y (, y, ) ( p, y p, p ) Figure 537 Oblique projection P = 2 left right 0 0 left+right left right 0 2 top bottom 0 top+bottom top bottom far+near far near 0 0 far near 2 0 0 0 1 Because

### Computer Graphics, Chapt 08

Computer Graphics, Chapt 08 Creating an Image Components, parts of a scene to be displayed Trees, terrain Furniture, walls Store fronts and street scenes Atoms and molecules Stars and galaxies Describe

### 3D Viewing. CMPT 361 Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller

3D Viewing CMPT 361 Introduction to Computer Graphics Torsten Möller Reading Chapter 4 of Angel Chapter 6 of Foley, van Dam, 2 Objectives What kind of camera we use? (pinhole) What projections make sense

### Introduction to 3D Graphics

Graphics Without Polygons Volume Rendering May 11, 2010 So Far Volumetric Rendering Techniques Misc. So Far Extended the Fixed Function Pipeline with a Programmable Pipeline Programming the pipeline is

### Ulf Assarsson Department of Computer Engineering Chalmers University of Technology

Ulf Assarsson Department of Computer Engineering Chalmers University of Technology Tracing Photons One way to form an image is to follow rays of light from a point source finding which rays enter the lens

### Computer Graphics. Bing-Yu Chen National Taiwan University

Computer Graphics Bing-Yu Chen National Taiwan University Introduction to OpenGL General OpenGL Introduction An Example OpenGL Program Drawing with OpenGL Transformations Animation and Depth Buffering

### 3D 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

### Spatial Data Structures

15-462 Computer Graphics I Lecture 17 Spatial Data Structures Hierarchical Bounding Volumes Regular Grids Octrees BSP Trees Constructive Solid Geometry (CSG) April 1, 2003 [Angel 9.10] Frank Pfenning Carnegie

### Could you make the XNA functions yourself?

1 Could you make the XNA functions yourself? For the second and especially the third assignment, you need to globally understand what s going on inside the graphics hardware. You will write shaders, which

### Modeling Objects. Modeling. Symbol-Instance Table. Instance Transformation. Each appearance of the object in the model is an instance

Modeling Objects Modeling Hierarchical Transformations Hierarchical Models Scene Graphs A prototype has a default size, position, and orientation You need to perform modeling transformations to position

Last Time? Programmable GPUS Planar Shadows Projective Texture Shadows Shadow Maps Shadow Volumes frame buffer depth buffer stencil buffer Stencil Buffer Homework 4 Reading for Create some geometry "Rendering

### IMAGE-BASED RENDERING AND ANIMATION

DH2323 DGI17 INTRODUCTION TO COMPUTER GRAPHICS AND INTERACTION IMAGE-BASED RENDERING AND ANIMATION Christopher Peters CST, KTH Royal Institute of Technology, Sweden chpeters@kth.se http://kth.academia.edu/christopheredwardpeters

### CS 428: Fall Introduction to. Texture mapping and filtering. Andrew Nealen, Rutgers, /18/2010 1

CS 428: Fall 2010 Introduction to Computer Graphics Texture mapping and filtering 10/18/2010 1 Topic overview Image formation and OpenGL Transformations and viewing Polygons and polygon meshes 3D model/mesh

### An Introduction to 2D OpenGL

An Introduction to 2D OpenGL January 23, 2015 OpenGL predates the common use of object-oriented programming. It is a mode-based system in which state information, modified by various function calls as

### Computer Graphics and Image Processing Ray Tracing I

Computer Graphics and Image Processing Ray Tracing I Part 1 Lecture 9 1 Today s Outline Introduction to Ray Tracing Ray Casting Intersecting Rays with Primitives Intersecting Rays with Transformed Primitives

### CS 563 Advanced Topics in Computer Graphics Lecture 2: Bare-Bones Raytracer. by Emmanuel Agu

CS 563 Advanced Topics in Computer Graphics Lecture 2: Bare-Bones Raytracer by Emmanuel Agu Ray Casting (Appel, 1968) direct illumination Recursive ray tracing (Whitted, 1980) Pseudocode for Ray Tracer

Illumination & Shading Goals Introduce the types of light-material interactions Build a simple reflection model---the Phong model--- that can be used with real time graphics hardware Why we need Illumination

### CSE 167: Lecture #7: Color and Shading. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011

CSE 167: Introduction to Computer Graphics Lecture #7: Color and Shading Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011 Announcements Homework project #3 due this Friday,

### Scalable multi-gpu cloud raytracing with OpenGL

Scalable multi-gpu cloud raytracing with OpenGL University of Žilina Digital technologies 2014, Žilina, Slovakia Overview Goals Rendering distant details in visualizations Raytracing Multi-GPU programming

### Three Main Themes of Computer Graphics

Three Main Themes of Computer Graphics Modeling How do we represent (or model) 3-D objects? How do we construct models for specific objects? Animation How do we represent the motion of objects? How do

### CSC 8470 Computer Graphics. What is Computer Graphics?

CSC 8470 Computer Graphics What is Computer Graphics? For us, it is primarily the study of how pictures can be generated using a computer. But it also includes: software tools used to make pictures hardware