Introduction to Computer Graphics with WebGL

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

Models and Architectures

OUTLINE. Learn the basic design of a graphics system Introduce pipeline architecture Examine software components for a graphics system

CSE4030 Introduction to Computer Graphics

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

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

Computer Graphics and Visualization. Graphics Systems and Models

INTRODUCTION. Slides modified from Angel book 6e

Introduction to Computer Graphics with WebGL

Models and Architectures. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

Introduction to OpenGL Week 1

Objectives. Image Formation Revisited. Physical Approaches. The Programmer s Interface. Practical Approach. Introduction to OpenGL Week 1

Image Formation. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

Rendering. Converting a 3D scene to a 2D image. Camera. Light. Rendering. View Plane

Rasterization Overview

Today s Agenda. Basic design of a graphics system. Introduction to OpenGL

3D graphics, raster and colors CS312 Fall 2010

CHAPTER 1 Graphics Systems and Models 3

VTU QUESTION PAPER SOLUTION UNIT -1 INTRODUCTION

CS452/552; EE465/505. Image Formation

Introduction to Computer Graphics with WebGL

Pipeline Operations. CS 4620 Lecture 10

Interactive Computer Graphics A TOP-DOWN APPROACH WITH SHADER-BASED OPENGL

Graphics Systems and Models

Pipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11

Orthogonal Projection Matrices. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

Pipeline Operations. CS 4620 Lecture 14

Introduction to OpenGL

Advanced Computer Graphics (CS & SE )

GLOBAL EDITION. Interactive Computer Graphics. A Top-Down Approach with WebGL SEVENTH EDITION. Edward Angel Dave Shreiner

CS451Real-time Rendering Pipeline

Module Contact: Dr Stephen Laycock, CMP Copyright of the University of East Anglia Version 1

Ulf Assarsson Department of Computer Engineering Chalmers University of Technology

3D Polygon Rendering. Many applications use rendering of 3D polygons with direct illumination

Ulf Assarsson Department of Computer Engineering Chalmers University of Technology

CS452/552; EE465/505. Intro to Lighting

Real-Time Rendering (Echtzeitgraphik) Michael Wimmer

CS230 : Computer Graphics Lecture 4. Tamar Shinar Computer Science & Engineering UC Riverside

The Viewing Pipeline Coordinate Systems

One or more objects A viewer with a projection surface Projectors that go from the object(s) to the projection surface

03 RENDERING PART TWO

Graphics Hardware. Instructor Stephen J. Guy

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

Computer Graphics - Chapter 1 Graphics Systems and Models

Computer Graphics: Programming, Problem Solving, and Visual Communication

Lecturer Athanasios Nikolaidis

The Graphics Pipeline

Three Main Themes of Computer Graphics

The Traditional Graphics Pipeline

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

CS 498 VR. Lecture 18-4/4/18. go.illinois.edu/vrlect18

CS 591B Lecture 9: The OpenGL Rendering Pipeline

Chapter 2 A top-down approach - How to make shaded images?

Computer Graphics. Bing-Yu Chen National Taiwan University

CS 4620 Program 3: Pipeline

Computer Graphics. Shadows

CS452/552; EE465/505. Clipping & Scan Conversion

Lecture 1. Computer Graphics and Systems. Tuesday, January 15, 13

The Traditional Graphics Pipeline

The Traditional Graphics Pipeline

Survey in Computer Graphics Computer Graphics and Visualization

CSE 167: Introduction to Computer Graphics Lecture #5: Rasterization. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2015

Computer Graphics 10 - Shadows

Overview: Ray Tracing & The Perspective Projection Pipeline

Graphics Hardware and OpenGL

Rendering Objects. Need to transform all geometry then

Global Rendering. Ingela Nyström 1. Effects needed for realism. The Rendering Equation. Local vs global rendering. Light-material interaction

Real-Time Shadows. Last Time? Today. Why are Shadows Important? Shadows as a Depth Cue. For Intuition about Scene Lighting

Computer Graphics. Bing-Yu Chen National Taiwan University The University of Tokyo

Computer Graphics. Lecture 9 Environment mapping, Mirroring

Classical and Computer Viewing. Adapted From: Ed Angel Professor of Emeritus of Computer Science University of New Mexico

Projections and Hardware Rendering. Brian Curless CSE 557 Fall 2014

Visualisatie BMT. Rendering. Arjan Kok

API Background. Prof. George Wolberg Dept. of Computer Science City College of New York

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

Lecture 2. Shaders, GLSL and GPGPU

CIS 581 Interactive Computer Graphics

Real-Time Shadows. Last Time? Schedule. Questions? Today. Why are Shadows Important?

CS 112 The Rendering Pipeline. Slide 1

Advanced Rendering Techniques

Recall: Indexing into Cube Map

3D Graphics and OpenGl. First Steps

Graphics Pipeline. CS535 Fall Daniel G. Aliaga Department of Computer Science Purdue University

Graphics Pipeline & APIs

Real-Time Shadows. MIT EECS 6.837, Durand and Cutler

Graphics Pipeline & APIs

Real-Time Shadows. Last Time? Textures can Alias. Schedule. Questions? Quiz 1: Tuesday October 26 th, in class (1 week from today!

Level of Details in Computer Rendering

RASTERISED RENDERING

Computer Graphics. Illumination and Shading

Introduction to Computer Graphics 7. Shading

Principles of Computer Graphics. Lecture 3 1

Computer Graphics I Lecture 11

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

PROFESSIONAL. WebGL Programming DEVELOPING 3D GRAPHICS FOR THE WEB. Andreas Anyuru WILEY. John Wiley & Sons, Ltd.

CPSC / Illumination and Shading

Chapter 1 Introduction

CS 464 Review. Review of Computer Graphics for Final Exam

CS130 : Computer Graphics. Tamar Shinar Computer Science & Engineering UC Riverside

Ciril Bohak. - INTRODUCTION TO WEBGL

Transcription:

Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science Laboratory University of New Mexico

Models and Architectures 2

Objectives Learn the basic design of a graphics system Introduce pipeline architecture Examine software components for an interactive graphics system 3

Image Formation Revisited Can we mimic the synthetic camera model to design graphics hardware software? Application Programmer Interface (API) - Need only specify Objects Materials Viewer Lights But how is the API implemented? 4

Physical Approaches Ray tracing: follow rays of light from center of projection until they either are absorbed by objects or go off to infinity - Can handle global effects Multiple reflections Translucent objects - Slow - Must have whole data base available at all times Radiosity: Energy based approach - Very slow 5

Practical Approach Process objects one at a time in the order they are generated by the application - Can consider only local lighting Pipeline architecture application program display All steps can be implemented in hardware on the graphics card 6

Vertex Processing Much of the work in the pipeline is in converting object representations from one coordinate system to another - Object coordinates - Camera (eye) coordinates - Screen coordinates Every change of coordinates is equivalent to a matrix transformation Vertex processor also computes vertex colors 7

Projection Projection is the process that combines the 3D viewer with the 3D objects to produce the 2D image - Perspective projections: all projectors meet at the center of projection - Parallel projection: projectors are parallel, center of projection is replaced by a direction of projection 8

Primitive Assembly Vertices must be collected into geometric objects before clipping and rasterization can take place - Line segments - Polygons - Curves and surfaces 9

Clipping Just as a real camera cannot see the whole world, the virtual camera can only see part of the world or object space - Objects that are not within this volume are said to be clipped out of the scene 0

Rasterization If an object is not clipped out, the appropriate pixels in the frame buffer must be assigned colors Rasterizer produces a set of fragments for each object Fragments are potential pixels - Have a location in frame bufffer - Color and depth attributes Vertex attributes are interpolated over objects by the rasterizer

Fragment Processing Fragments are processed to determine the color of the corresponding pixel in the frame buffer Colors can be determined by texture mapping or interpolation of vertex colors Fragments may be blocked by other fragments closer to the camera - Hidden-surface removal 2

The Programmer s Interface Programmer sees the graphics system through a software interface: the Application Programmer Interface (API) 3

API Contents Functions that specify what we need to form an image - Objects - Viewer - Light Source(s) - Materials Other information - Input from devices such as mouse and keyboard - Capabilities of system 4

Object Specification Most APIs support a limited set of primitives including - Points (0D object) - Line segments (D objects) - Polygons (2D objects) - Some curves and surfaces Quadrics Parametric polynomials All are defined through locations in space or vertices 5

Example (old style) type of object glbegin(gl_polygon) glvertex3f(0.0, 0.0, 0.0); glvertex3f(0.0,.0, 0.0); glvertex3f(0.0, 0.0,.0); glend( ); location of vertex end of object definition 6

Example (GPU based) Put geometric data in an array var points = [ vec3(0.0, 0.0, 0.0), vec3(0.0,.0, 0.0), vec3(0.0, 0.0,.0), ]; Send array to GPU Tell GPU to render as triangle 7

Camera Specification Six degrees of freedom - Position of center of lens - Orientation Lens Film size Orientation of film plane 8

Lights and Materials Types of lights - Point sources vs distributed sources - Spot lights - Near and far sources - Color properties Material properties - Absorption: color properties - Scattering Diffuse Specular 9