CGT521 Introduction to

Similar documents
Illumination Algorithms

Early History of APIs. PHIGS and X. SGI and GL. Programming with OpenGL Part 1: Background. Objectives

Programming with OpenGL Part 1: Background

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

Classic Rendering Pipeline

Computer Graphics. Chapter 3 Computer Graphics Software

COMP 4801 Final Year Project. Ray Tracing for Computer Graphics. Final Project Report FYP Runjing Liu. Advised by. Dr. L.Y.

Intro to Ray-Tracing & Ray-Surface Acceleration

to OpenGL Introduction Pipeline Graphics pipeline OpenGL pipeline OpenGL syntax Modeling Arrays Conclusion 1 Introduction Introduction to OpenGL

Computer Graphics. Bing-Yu Chen National Taiwan University

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

Chapter 11 Global Illumination. Part 1 Ray Tracing. Reading: Angel s Interactive Computer Graphics (6 th ed.) Sections 11.1, 11.2, 11.

Lecture 2 CISC440/640 Spring Department of Computer and Information Science

Lecture 10: Ray tracing

Computer Graphics. - Ray Tracing I - Marcus Magnor Philipp Slusallek. Computer Graphics WS05/06 Ray Tracing I

LECTURE 02 OPENGL API

CS 450: COMPUTER GRAPHICS REVIEW: INTRODUCTION TO COMPUTER GRAPHICS SPRING 2016 DR. MICHAEL J. REALE

2: Introducing image synthesis. Some orientation how did we get here? Graphics system architecture Overview of OpenGL / GLU / GLUT

Ray Tracing. Kjetil Babington

OpenGL and GLUT. COMP413 Computer Graphics. School of Computer Sci. & Eng. Kyungpook National University, Korea. Spring Semester, 2016

Photorealistic 3D Rendering for VW in Mobile Devices

Introduction to OpenGL Week 1

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

Some Resources. What won t I learn? What will I learn? Topics

cs123 Lab 3 OpenGL Part One 1 Introduction 2 OpenGL Basics 2.2 The Rendering Pipeline 2.1 The CPU and the GPU 2.3 Basic Syntax of OpenGL commands

Introduction to OpenGL

Motivation. Sampling and Reconstruction of Visual Appearance. Effects needed for Realism. Ray Tracing. Outline

Enhancing Traditional Rasterization Graphics with Ray Tracing. October 2015

Chapter 7 - Light, Materials, Appearance

Rendering Part I (Basics & Ray tracing) Lecture 25 December 1, 2015

Information Coding / Computer Graphics, ISY, LiTH. OpenGL! ! where it fits!! what it contains!! how you work with it 11(40)

Lighting. To do. Course Outline. This Lecture. Continue to work on ray programming assignment Start thinking about final project

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

Computer Graphics (CS 543) Lecture 13b Ray Tracing (Part 1) Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Next Generation OpenGL Neil Trevett Khronos President NVIDIA VP Mobile Copyright Khronos Group Page 1

Rendering: Reality. Eye acts as pinhole camera. Photons from light hit objects

Real - Time Rendering. Graphics pipeline. Michal Červeňanský Juraj Starinský

Lecture 13: OpenGL Shading Language (GLSL)

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

Exercise 1 Introduction to OpenGL

COMP371 COMPUTER GRAPHICS

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

Enabling immersive gaming experiences Intro to Ray Tracing

Computer Graphics. Lecture 13. Global Illumination 1: Ray Tracing and Radiosity. Taku Komura

Raytracing CS148 AS3. Due :59pm PDT

Real-Time Ray Tracing Using Nvidia Optix Holger Ludvigsen & Anne C. Elster 2010

Ray Tracing. CS334 Fall Daniel G. Aliaga Department of Computer Science Purdue University

Ray Tracing. CSCI 420 Computer Graphics Lecture 15. Ray Casting Shadow Rays Reflection and Transmission [Ch ]

Recursion and Data Structures in Computer Graphics. Ray Tracing

Computer Graphics. Lecture 10. Global Illumination 1: Ray Tracing and Radiosity. Taku Komura 12/03/15

Grafica Computazionale: Lezione 30. Grafica Computazionale. Hiding complexity... ;) Introduction to OpenGL. lezione30 Introduction to OpenGL

Radeon ProRender and Radeon Rays in a Gaming Rendering Workflow. Takahiro Harada, AMD 2017/3

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

NVIDIA Case Studies:

CGT520 Lighting. Lighting. T-vertices. Normal vector. Color of an object can be specified 1) Explicitly as a color buffer

Ray-Tracing. Misha Kazhdan

CSC Graphics Programming. Budditha Hettige Department of Statistics and Computer Science

03 RENDERING PART TWO

Movie: For The Birds. Announcements. Ray Tracing 1. Programming 2 Recap. Programming 3 Info Test data for part 1 (Lines) is available

Lighting and Shading

A Brief Overview of. Global Illumination. Thomas Larsson, Afshin Ameri Mälardalen University

INFOGR Computer Graphics. J. Bikker - April-July Lecture 10: Ground Truth. Welcome!

CS354 Computer Graphics Ray Tracing. Qixing Huang Januray 24th 2017

CPSC GLOBAL ILLUMINATION

Computer Graphics. - Introduction to Ray Tracing - Philipp Slusallek

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

Lecture 17: Recursive Ray Tracing. Where is the way where light dwelleth? Job 38:19

Hardware Accelerated Volume Visualization. Leonid I. Dimitrov & Milos Sramek GMI Austrian Academy of Sciences

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

Shadows. COMP 575/770 Spring 2013

Lecture 2 5 Aug 2004

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

Computer Graphics. Lecture 02 Graphics Pipeline. Edirlei Soares de Lima.

CS GPU and GPGPU Programming Lecture 2: Introduction; GPU Architecture 1. Markus Hadwiger, KAUST

Shaders. Slide credit to Prof. Zwicker

Programmable GPUS. Last Time? Reading for Today. Homework 4. Planar Shadows Projective Texture Shadows Shadow Maps Shadow Volumes

COMPLETION OF Z-buffer Graphics Pipeline

CS427 Multicore Architecture and Parallel Computing

Computer Graphics (Basic OpenGL)

CS 381 Computer Graphics, Fall 2008 Midterm Exam Solutions. The Midterm Exam was given in class on Thursday, October 23, 2008.

Mobile Graphics Ecosystem. Tom Olson OpenGL ES working group chair

Lectures OpenGL Introduction

CS 428: Fall Introduction to. Raytracing. Andrew Nealen, Rutgers, /18/2009 1

Announcements. Written Assignment 2 out (due March 8) Computer Graphics

Lecture 15: Shading-I. CITS3003 Graphics & Animation

Review for Ray-tracing Algorithm and Hardware

CS 543 Lecture 1 (Part 3) Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Assignment 2 Ray Tracing

OpenGL Basics I. Seoul National University Graphics & Media Lab

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

Ray tracing. EECS 487 March 19,

SOURCES AND URLS BIBLIOGRAPHY AND REFERENCES

Sung-Eui Yoon ( 윤성의 )

The Traditional Graphics Pipeline

CS580: Ray Tracing. Sung-Eui Yoon ( 윤성의 ) Course URL:

Photorealism: Ray Tracing

Supplement to Lecture 16

Shaders CSCI 4239/5239 Advanced Computer Graphics Spring 2014

Introduction to OpenGL Transformations, Viewing and Lighting. Ali Bigdelou

12.2 Programmable Graphics Hardware

Transcription:

CGT521 Introduction to Bedrich Benes, Ph.D. Purdue University Department of Computer Graphics Rendering We have a virtual scene (a model in the memory of computer) and we want to display it What is the color of a pixel? Rendering Physics-based method: Ray tracing, Mote-Carlo Path Tracing, Photon maps, Metropolis light transport Use physics to calculate the light path based on ideas of Dürer and da Vinci (dated back to the early Renaissance) introduced by Whitted in 1980 Appel 1981 the first implementation today de facto standard in global illumination it is a recursive algorithm 4

real world but many rays do not reach the eye! simulation is very expensive let's trace ONLY the rays that go to eye 5 6 Principle for each pixel of the image do: trace the ray into the scene get the first hit object //visibility evaluate its illumination cast shadow rays //shadows trace the reflected ray (if any) trace the refracted ray (if any) accumulate the results also called the Whitted illumination model primary ray shadow rays 7 8

RT simulates specular to specular reflection mirrors are perfect ("quick fixies") RT is an image space algorithm i.e., it is driven by the viewport Contribution 1 k spec =0.5 1/16 RT is recursive as long as specular to specular reflection occurs tracing terminates if no specular surface is hit (specular to diffuse) contribution is too small too deep recursion ray out of the scene ½ ¼ 1/8 9 10 main CalculateRay the main procedure for (i=0;i<resx;i++) for (j=0;j<resy;j++){ ray=calculateray(); //get the primary ray color=traceray(ray,maxdepth); SetPixel(i,j)=color; //set the color of the pixel } the CalculateRay procedure camera concept (luv vectors) Given: lookat and eye (points) up vector up Gramm Schmidt u orthonormalization l=(lookat eye)/ lookateye eye v=(lxup)/ lxup l u=vxl v 11 lookat 12

CalculateRay we can put lens in front of the camera to get fish eye camera objective ShadowRay ShadowRay returns all visible lights it is easier than intersections we just need to know if there is some obstacle we do not care about intersection and normal we can exploit coherency and use the light buffer (see the next lecture) 13 14 Ray Casting Special case: Trace(ray,0) Ray Casting is called RayCasting the primary rays are cast through the pixels the local illumination is calculated for the visible lights it calculates shadows it does not calculate reflections This is NOT z buffer 15 16

MAXDEPTH=1 MAXDEPTH=3 MAXDEPTH=2 MAXDEPTH=4 17 18 MAXDEPTH=10 Intersections 80 90% of time is consumed for the intersections calculations improving efficiency focuses intersections MAXDEPTH=100 19 20

Open Graphics Library is an API (application programming interface) a software interface to graphics hardware a layer between the programmer and the graphics hardware Graphics Assembly Language Introduction to OpenGL 1980 Iris GL (Silicon Graphics), more than 2000 apps on SGI computers (Industrial Light Magic, Ford, Boeing, Alias Wavefront, etc.) 1992 OpenGL 1.0 hardware independent 15.8.2001 OpenGL 1.3 standard under Windows, X-Window (UNIX), Mac OS, Palms, etc. Introduction to OpenGL Capabilities: 1.x - Fixed pipeline 2.x - Programmable pipeline (GLSL) 3.x - Geometry shader 4.x Tesselation shader, double precission Introduction to OpenGL (contd.) September 2016 OpenGL 4.5 Today: Managed by the Khronos Group http://www.khronos.org/

Who makes OpenGL? Library definition Who makes OpenGL? Library programming Architecture Review Board (ARB) ARB is a part of Khronos Group Leading HW and SW companies OpenGL is a trademark of SGI A company develops a HW component NVIDIA, AMD, Intel They need to pass the OpenGL Performance Characterization Committee benchmarks http://www.spec.org/gwpg/gpc.static/index.html Who makes OpenGL? Application programming Whoever develops app using OpenGL App developers do not need to register OpenGL or pay fees OpenGL is for free for the users OpenGL A most widely adopted graphics standard High quality visual performance Stable, reliable, portable, and scalable Reflects latest advanced in development Easy to use Well documented Available everywhere

Hardware Requirements Must be pixel-oriented (OpenGL does not work on plotters) graphics acceleration is NOT required...but is desirable the graphics accelerators are called GPUs Full CPU implementations of OpenGL exist (http://www.mesa3d.org/) A side note OpenGL is not pixel exact Two implementations can vary in the result Speed is more important than precision OpenGL and Other Libraries API Hierarchy OpenGL is minimal Everything else is put into OpenGL Utility Library or GLU many additional libraries Some of them is Free Graphics Library Utility Toolkit GLUT (more later) OpenGL cannot open a window www.opengl.org

How does OpenGL work? Files the OpenGL API is gl.h the other libraries are glu.h and glut.h typically located in include/gl/ OpenGL drivers under Windows are in windows/system32/opengl32.dll www.opengl.org as well as glu32.dll and glut32.dll Command syntax Command syntax (contd.) type prefix example procedure call gl glfogf() constant GL_ GL_FOG_COLOR data type GL GLfloat example: prefix gluniform1f(1.f) command arguments Suffix Data type typical C OpenGL definition b 8bit integer signed char GLbyte s 16bit integer short GLshort i 32bit integer int GLint,GLsizei ub 8bit uns.int unsigned char GLubyte,GLboolean us 16bit uns.int unsigned short GLushort ui 32bit uns.int unsigned long GLuint,GLenum,GLbitfield f 32bit float float GLfloat,GLclampf d 64bit float double GLdouble,GLclampd

Command syntax (contd.) The v syntax some commands end with v the argument is a pointer to a vector GLfloat r=1.f, g=1.f, b=1.f; GLfloat x[]={1.f,1.f,1.f}; glcolor3f(r,g,b); glcolor3fv(x); Both have the same effect The wildcard agreement Commands with the same effect and different arguments, for example glvertex3i(x,y,z) glvertex4f(a,b,c,d) glvertex2ub(ub1,ub2) glvertex3dv(dv) Will be called glvertex*() Reading Jackie Neider, Tom Davis, Mason Woo OpenGL Programming Guide, Addison-Wesley Publication Company Edward Engel Interactive Computer Graphics: A Top-Down Approach with Shader-Based OpenGL (6th Edition) www.opengl.org