Cameras. Camera. Digital Image Synthesis Yung-Yu Chuang 10/26/2006

Similar documents
CS 563 Advanced Topics in Computer Graphics Camera Models. by Kevin Kardian

References Photography, B. London and J. Upton Optics in Photography, R. Kingslake The Camera, The Negative, The Print, A. Adams

Reading. Distribution Ray Tracing. BRDF, revisited. Pixel anti-aliasing. ω in. Required: Shirley, section Further reading:

Distribution Ray Tracing

Physically Realistic Ray Tracing

Distribution Ray Tracing. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

Distributed Ray Tracing

Reading. 8. Distribution Ray Tracing. Required: Watt, sections 10.6,14.8. Further reading:

Realistic Camera Model

EECS 487: Interactive Computer Graphics

Anti-aliasing and Monte Carlo Path Tracing. Brian Curless CSE 457 Autumn 2017

Distribution Ray-Tracing. Programação 3D Simulação e Jogos

Distributed Ray Tracing

Computational Photography

Computer Graphics. Si Lu. Fall uter_graphics.htm 11/22/2017

Specular reflection. Lighting II. Snell s Law. Refraction at boundary of media

Anti-aliasing and Monte Carlo Path Tracing. Brian Curless CSE 557 Autumn 2017

Anti-aliasing and Monte Carlo Path Tracing

Ray Tracing. Johns Hopkins Department of Computer Science Course : Rendering Techniques, Professor: Jonathan Cohen

Global Illumination The Game of Light Transport. Jian Huang

COSC579: Scene Geometry. Jeremy Bolton, PhD Assistant Teaching Professor

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

Visual cues to 3D geometry. Light Reflection and Advanced Shading. Shading. Recognizing materials. size (perspective) occlusion shading

Measuring Light: Radiometry and Cameras

3D Rendering and Ray Casting

Models and The Viewing Pipeline. Jian Huang CS456

distribution ray tracing

Ray Tracing. Cornell CS4620/5620 Fall 2012 Lecture Kavita Bala 1 (with previous instructors James/Marschner)

Image Formation. Antonino Furnari. Image Processing Lab Dipartimento di Matematica e Informatica Università degli Studi di Catania

3D Rendering and Ray Casting

Local vs. Global Illumination & Radiosity

Projection and viewing. Computer Graphics CSE 167 Lecture 4

Ray Tracing. CPSC 453 Fall 2018 Sonny Chan

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

distribution ray-tracing

Depth of Field for Photorealistic Ray Traced Images JESSICA HO AND DUNCAN MACMICHAEL MARCH 7, 2016 CSS552: TOPICS IN RENDERING

Capturing light. Source: A. Efros

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

Sung-Eui Yoon ( 윤성의 )

Computer Graphics Project

Ray Tracing Basics I. Computer Graphics as Virtual Photography. camera (captures light) real scene. photo. Photographic print. Photography: processing

Reading on the Accumulation Buffer: Motion Blur, Anti-Aliasing, and Depth of Field

Intro to Ray-Tracing & Ray-Surface Acceleration

I have a meeting with Peter Lee and Bob Cosgrove on Wednesday to discuss the future of the cluster. Computer Graphics

INFOGR Computer Graphics. J. Bikker - April-July Lecture 10: Shading Models. Welcome!

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

Introduction to Computer Vision. Introduction CMPSCI 591A/691A CMPSCI 570/670. Image Formation

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

Modeling Light. On Simulating the Visual Experience

Chapter 36. Image Formation

ECE-161C Cameras. Nuno Vasconcelos ECE Department, UCSD

Models and Architectures

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

Introduction to Photography

Ray-Tracing. Misha Kazhdan

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

Today. Rendering pipeline. Rendering pipeline. Object vs. Image order. Rendering engine Rendering engine (jtrt) Computergrafik. Rendering pipeline

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

CS6670: Computer Vision

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

CS201 Computer Vision Lect 4 - Image Formation

CMPSCI 670: Computer Vision! Image formation. University of Massachusetts, Amherst September 8, 2014 Instructor: Subhransu Maji

Geometry: Outline. Projections. Orthographic Perspective

Ray tracing. EECS 487 March 19,

03 RENDERING PART TWO

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

Computer Vision Project-1

Monte Carlo Integration

Ray Tracing. Last Time? Reading for Today. Reading for Today

Introduction to Computer Graphics with WebGL

Robotics - Projective Geometry and Camera model. Marcello Restelli

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

CS 563 Advanced Topics in Computer Graphics. by Emmanuel Agu

Lecture 7 - Path Tracing

Photography Basics: Telling a story though the lens

Introduction Ray tracing basics Advanced topics (shading) Advanced topics (geometry) Graphics 2010/2011, 4th quarter. Lecture 11: Ray tracing

Projective Geometry and Camera Models

Ray Tracing III. Wen-Chieh (Steve) Lin National Chiao-Tung University

Computer Graphics. - Introduction to Ray Tracing - Philipp Slusallek

Digital Imaging Study Questions Chapter 8 /100 Total Points Homework Grade

Texture. Texture Maps

The 2 nd part of the photographic triangle

Lecture 8: Camera Models

Motivation. Advanced Computer Graphics (Fall 2009) CS 283, Lecture 11: Monte Carlo Integration Ravi Ramamoorthi

Monte Carlo Integration

Computer Graphics. Chapter 1 (Related to Introduction to Computer Graphics Using Java 2D and 3D)

Computer Graphics - Chapter 1 Graphics Systems and Models

Game Architecture. 2/19/16: Rasterization

Shadows. COMP 575/770 Spring 2013

Other Rendering Techniques CSE 872 Fall Intro You have seen Scanline converter (+z-buffer) Painter s algorithm Radiosity CSE 872 Fall

Movie: Geri s Game. Announcements. Ray Casting 2. Programming 2 Recap. Programming 3 Info Test data for part 1 (Lines) is available

DSLR Cameras and Lenses. Paul Fodor

CS4670: Computer Vision

The Animation Process. Lighting: Illusions of Illumination

Diploma in Photography Part I

Perspective projection. A. Mantegna, Martyrdom of St. Christopher, c. 1450

Fundamentals of Photography presented by Keith Bauer.

Computer Vision CS 776 Fall 2018

Rendering. Generate an image from geometric primitives II. Rendering III. Modeling IV. Animation. (Michael Bostock, CS426, Fall99)

MIT Monte-Carlo Ray Tracing. MIT EECS 6.837, Cutler and Durand 1

Transcription:

Camera Cameras Digital Image Synthesis Yung-Yu Chuang 10/26/2006 class Camera { public: return a weight, useful for simulating real lens virtual float GenerateRay(const Sample &sample, Ray *ray) const = 0;... Film *film; protected: sample position at the image plane corresponding normalized ray in the world space Transform WorldToCamera, CameraToWorld; float ClipHither, ClipYon; float ShutterOpen, ShutterClose; ; for simulating motion blur, not Implemented yet with slides by Pat Hanrahan and Matt Pharr hither yon z Camera space Coordinate spaces world space object space camera space (origin: camera position, z: viewing direction, y: up direction) screen space: a 3D space defined on the image plane, z ranges from 0(near) to 1(far) normalized device space (NDC): (x, y) ranges from (0,0) to (1,1) for the rendered image, z is the same as the screen space raster space: similar to NDC, but the range of (x,y) is from (0,0) to (xres, yres)

Screen space screen space screen window infinite image plane NDC raster space Projective camera models Transform a 3D scene coordinate to a 2D image coordinate by a 4x4 projective matrix class ProjectiveCamera : public Camera { public: camera to screen projection ProjectiveCamera(Transform &world2cam, Transform &proj, float Screen[4], float hither, float yon, float sopen, float sclose, float lensr, float focald, Film *film); protected: Transform CameraToScreen, WorldToScreen, RasterToCamera; Transform ScreenToRaster, RasterToScreen; float LensRadius, FocalDistance; ; Projective camera models ProjectiveCamera::ProjectiveCamera(...) :Camera(w2c, hither, yon, sopen, sclose, f) {... CameraToScreen=proj; WorldToScreen=CameraToScreen*WorldToCamera; ScreenToRaster = Scale(float(film->xResolution), float(film->yresolution), 1.f)* Scale(1.f / (Screen[1] - Screen[0]), 1.f / (Screen[2] - Screen[3]), 1.f)* Translate(Vector(-Screen[0],-Screen[3],0.f)); RasterToScreen = ScreenToRaster.GetInverse(); RasterToCamera = CameraToScreen.GetInverse() * RasterToScreen; Projective camera models orthographic perspective

Orthographic camera Transform Orthographic(float znear, float zfar) { return Scale(1.f, 1.f, 1.f/(zfar-znear)) *Translate(Vector(0.f, 0.f, -znear)); OrthoCamera::OrthoCamera(... ) : ProjectiveCamera(world2cam, Orthographic(hither, yon), Screen, hither, yon, sopen, sclose, lensr, focald, f) { OrthoCamera::GenerateRay float OrthoCamera::GenerateRay (const Sample &sample, Ray *ray) const { Point Pras(sample.imageX,sample.imageY,0); Point Pcamera; RasterToCamera(Pras, &Pcamera); ray->o = Pcamera; ray->d = Vector(0,0,1); <Modify ray for depth of field> ray->mint = 0.; ray->maxt = ClipYon - ClipHither; ray->d = Normalize(ray->d); CameraToWorld(*ray, ray); return 1.f; Perspective camera Perspective camera image plane x x x' = x / z y' = y / z z' = f ( z n) z( f n) Transform Perspective(float fov,float n,float f) { near_z far_z float inv_denom = 1.f/(f-n); Matrix4x4 *persp = new Matrix4x4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, f*inv_denom, -f*n*inv_denom, 0, 0, 1, 0); float invtanang= 1.f / tanf(radians(fov)/2.f); return Scale(invTanAng, invtanang, 1) * Transform(persp);

PerspectiveCamera::GenerateRay float PerspectiveCamera::GenerateRay (const Sample &sample, Ray *ray) const { // Generate raster and camera samples Point Pras(sample.imageX, sample.imagey, 0); Point Pcamera; RasterToCamera(Pras, &Pcamera); ray->o = Pcamera; ray->d = Vector(Pcamera.x,Pcamera.y,Pcamera.z); <Modify ray for depth of field> ray->d = Normalize(ray->d); ray->mint = 0.; ray->maxt = (ClipYon-ClipHither)/ray->d.z; CameraToWorld(*ray, ray); return 1.f; Depth of field Circle of confusion Depth of field: the range of distances from the lens at which objects appear in focus (circle of confusion roughly smaller than a pixel) scene focal distance depth of field lens film circle of confusion Depth of field Depth of field without depth of field with depth of field

Sample the lens Sample the lens pinhole virtual lens? focus point image plane image plane focal plane In GenerateRay( ) Environment camera if (LensRadius > 0.) { // Sample point on lens float lensu, lensv; ConcentricSampleDisk(sample.lensU, sample.lensv, &lensu, &lensv); lensu *= LensRadius; lensv *= LensRadius; // Compute point on plane of focus float ft = (FocalDistance - ClipHither) / ray->d.z; Point Pfocus = (*ray)(ft); // Update ray for effect of lens ray->o.x += lensu; ray->o.y += lensv; ray->d = Pfocus - ray->o; θ = 0..π φ = 0.. 2π

Environment camera EnvironmentCamera x=sinθcosψ y=sinθsinψ z=cosθ EnvironmentCamera:: EnvironmentCamera(const Transform &world2cam, float hither, float yon, float sopen, float sclose, Film *film) : Camera(world2cam, hither, yon, sopen, sclose, film) { rayorigin = CameraToWorld(Point(0,0,0)); in world space EnvironmentCamera::GenerateRay float EnvironmentCamera::GenerateRay (const Sample &sample, Ray *ray) const { ray->o = rayorigin; float theta=m_pi*sample.imagey/film->yresolution; float phi=2*m_pi*sample.imagex/film->xresolution; Vector dir(sinf(theta)*cosf(phi), cosf(theta), sinf(theta)*sinf(phi)); CameraToWorld(dir, &ray->d); ray->mint = ClipHither; ray->maxt = ClipYon; return 1.f; Distributed ray tracing SIGGRAPH 1984, by Robert L. Cook, Thomas Porter and Loren Carpenter from LucasFilm. Apply distribution-based sampling to many parts of the ray-tracing algorithm. soft shadow depth of field glossy

Distributed ray tracing Distributed ray tracing Gloss/Translucency Perturb directions reflection/transmission, with distribution based on angle from ideal ray Depth of field Perturb eye position on lens Soft shadow Perturb illumination rays across area light Motion blur Perturb eye ray samples in time DRT: Gloss/Translucency Glossy reflection Blurry reflections and refractions are produced by randomly perturbing the reflection and refraction rays from their "true" directions. 4 rays 64 rays

Translucency Depth of field 4 rays 16 rays Soft shadows Motion blur

Results Adventures of Andre & Wally B (1986) Realistic camera model Most camera models in graphics are not geometrically or radiometrically correct. Model a camera with a lens system and a film backplane. A lens system consists of a sequence of simple lens elements, stops and apertures. Why a realistic camera model? Physically-based rendering. For more accurate comparison to empirical data. Seamlessly merge CGI and real scene, for example, VFX. For vision and scientific applications. The camera metaphor is familiar to most 3d graphics system users.

Real Lens Exposure Two main parameters: Aperture (in f stop) Shutter speed (in fraction of a second) Cutaway section of a Vivitar Series 1 90mm f/2.5 lens Cover photo, Kingslake, Optics in Photography Double Gauss Ray Tracing Through Lenses Data from W. Smith, Modern Lens Design, p 312 Radius (mm) 58.950 169.660 38.550 81.540 25.500-28.990 81.540-40.770 874.130-79.460 Thick (mm) 7.520 0.240 8.050 6.550 11.410 9.000 2.360 12.130 0.380 6.440 72.228 n d 1.670 1.670 1.699 1.603 1.658 1.717 V-no 47.1 47.1 30.1 38.0 57.3 48.0 aperture 50.4 50.4 46.0 46.0 36.0 34.2 34.0 40.0 40.0 40.0 40.0 stop 200 mm telephoto 50 mm double-gauss From Kolb, Mitchell and Hanrahan (1995) 35 mm wide-angle 16 mm fisheye

Tracing rays through lens systems Whitted s method Whitted s method Heckber s method

Heckbert s method Other method Comparisons