Rendering and Realism I

Similar documents
Computer Applications in Textile Engineering. Computer Applications in Textile Engineering

Monash University Clayton s School of Information Technology CSE3313 Computer Graphics Sample Exam Questions 2007

Introduction to Computer Graphics

INTRODUCTION TO RENDERING TECHNIQUES

Image Processing and Computer Graphics. Rendering Pipeline. Matthias Teschner. Computer Science Department University of Freiburg

CUBE-MAP DATA STRUCTURE FOR INTERACTIVE GLOBAL ILLUMINATION COMPUTATION IN DYNAMIC DIFFUSE ENVIRONMENTS

Introduction Week 1, Lecture 1

Lezione 4: Grafica 3D*(II)

Computer Graphics. Introduction. Computer graphics. What is computer graphics? Yung-Yu Chuang

GRAFICA - A COMPUTER GRAPHICS TEACHING ASSISTANT. Andreas Savva, George Ioannou, Vasso Stylianou, and George Portides, University of Nicosia Cyprus

Course Overview. CSCI 480 Computer Graphics Lecture 1. Administrative Issues Modeling Animation Rendering OpenGL Programming [Angel Ch.

COMP175: Computer Graphics. Lecture 1 Introduction and Display Technologies

Dhiren Bhatia Carnegie Mellon University

VALLIAMMAI ENGNIEERING COLLEGE SRM Nagar, Kattankulathur

Computer Animation: Art, Science and Criticism

Last lecture... Computer Graphics:

PRODUCT LIFECYCLE MANAGEMENT COMPETENCY CENTRE RENDERING. PLMCC, JSS Academy of Technical Education, Noida Rendering 1 of 16

H.Calculating Normal Vectors

My Materials. In this tutorial, we ll examine the material settings for some simple common materials used in modeling.

Scan-Line Fill. Scan-Line Algorithm. Sort by scan line Fill each span vertex order generated by vertex list

GUI GRAPHICS AND USER INTERFACES. Welcome to GUI! Mechanics. Mihail Gaianu 26/02/2014 1

Cartoon-Looking Rendering of 3D-Scenes

IT 386: 3D Modeling and Animation. Review Sheet. Notes from Professor Nersesian s IT 386: 3D Modeling and Animation course

3D Math Overview and 3D Graphics Foundations

Geometry Chapter Point (pt) 1.1 Coplanar (1.1) 1.1 Space (1.1) 1.2 Line Segment (seg) 1.2 Measure of a Segment

Realtime 3D Computer Graphics Virtual Reality

also describes the method used to collect the data for the faces. These techniques could be used to animate other flexible surfaces.

Computer Graphics Global Illumination (2): Monte-Carlo Ray Tracing and Photon Mapping. Lecture 15 Taku Komura

REAL-TIME IMAGE BASED LIGHTING FOR OUTDOOR AUGMENTED REALITY UNDER DYNAMICALLY CHANGING ILLUMINATION CONDITIONS

Computer Graphics. Anders Hast

High Dynamic Range and other Fun Shader Tricks. Simon Green

Advanced Computer Graphics. Rendering Equation. Matthias Teschner. Computer Science Department University of Freiburg

We can display an object on a monitor screen in three different computer-model forms: Wireframe model Surface Model Solid model

Computer-Generated Photorealistic Hair

Maya 2014 Still Life Part 1 Texturing & Lighting

COMP-557: Fundamentals of Computer Graphics McGill University, Fall 2010

Instructor. Goals. Image Synthesis Examples. Applications. Computer Graphics. Why Study 3D Computer Graphics?

Chapter 23. The Reflection of Light: Mirrors

Cork Education and Training Board. Programme Module for. 3 Dimensional Computer Graphics. Leading to. Level 5 FETAC

Lighting & Rendering in Maya: Lights and Shadows

A Short Introduction to Computer Graphics

CSE168 Computer Graphics II, Rendering. Spring 2006 Matthias Zwicker

How To Draw A 3D Virtual World In 3D Space (Computer Graphics)

Abstract. These two vectors define a plane tangent to the surface at that point. Their cross product is Recent work in computer graphics has been

Cabri Geometry Application User Guide

Advanced Rendering for Engineering & Styling

B2.53-R3: COMPUTER GRAPHICS. NOTE: 1. There are TWO PARTS in this Module/Paper. PART ONE contains FOUR questions and PART TWO contains FIVE questions.

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

A technical overview of the Fuel3D system.

TEXTURE AND BUMP MAPPING

ABS 731 Lighting Design & Technology. Spring 2006

Three-Dimensional Data Recovery Using Image-Based Modeling

So, you want to make a photo-realistic rendering of the Earth from orbit, eh? And you want it to look just like what astronauts see from the shuttle

Interactive Visualization of Magnetic Fields

An introduction to Global Illumination. Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology

3D Scanner using Line Laser. 1. Introduction. 2. Theory

Using Photorealistic RenderMan for High-Quality Direct Volume Rendering

The RADIANCE Lighting Simulation and Rendering System

Rendering Area Sources D.A. Forsyth

Reflection and Refraction

L 2 : x = s + 1, y = s, z = 4s Suppose that C has coordinates (x, y, z). Then from the vector equality AC = BD, one has

Solving Simultaneous Equations and Matrices

Thea Omni Light. Thea Spot Light. Light setup & Optimization

Cortona3D Viewer. User's Guide. Copyright ParallelGraphics

Specular reflection. Dielectrics and Distribution in Ray Tracing. Snell s Law. Ray tracing dielectrics

1. Definition of the project. 2. Initial version (simplified texture) 3. Second version (full textures) 5. Modelling and inserting 3D objects

Copyright 2011 Casa Software Ltd. Centre of Mass

Path Tracing. Michael Doggett Department of Computer Science Lund university Michael Doggett

Introduction to Computer Graphics. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012

Volume Rendering on Mobile Devices. Mika Pesonen

Hi everyone, my name is Michał Iwanicki. I m an engine programmer at Naughty Dog and this talk is entitled: Lighting technology of The Last of Us,

Two Research Schools become ONE

VECTORAL IMAGING THE NEW DIRECTION IN AUTOMATED OPTICAL INSPECTION

Lighting Estimation in Indoor Environments from Low-Quality Images

Monte Carlo Path Tracing

This week. CENG 732 Computer Animation. Challenges in Human Modeling. Basic Arm Model

Computers in Film Making

BUILDING TELEPRESENCE SYSTEMS: Translating Science Fiction Ideas into Reality

Eight Tips for Optimal Machine Vision Lighting

Basic Problem: Map a 3D object to a 2D display surface. Analogy - Taking a snapshot with a camera

Digital 3D Animation

Multivariate data visualization using shadow

Photorealistic Rendering Techniques in AutoCAD 3D

SkillsUSA 2014 Contest Projects 3-D Visualization and Animation

Rally Sport Racing Game: CodeName Space Racer

Illuminating With HDRI

How To Analyze Ball Blur On A Ball Image

Making natural looking Volumetric Clouds In Blender 2.48a

Blender 3D Animation

Digitisation Disposal Policy Toolkit

Shader Model 3.0. Ashu Rege. NVIDIA Developer Technology Group

Teaching Introductory Computer Graphics Via Ray Tracing

Advanced visualization with VisNow platform Case study #2 3D scalar data visualization

Monte Carlo Path Tracing

GPU Shading and Rendering: Introduction & Graphics Hardware

Introduction to Computer Graphics

Introduction to Computer Graphics. Reading: Angel ch.1 or Hill Ch1.

The 3D rendering pipeline (our version for this class)

PCL - SURFACE RECONSTRUCTION

Transcription:

Rendering and Realism I A fundamental trade-off which occurs in computer graphics applications is image quality versus image generation speed (or frame rate). Realistic images are important for several reasons, including they just look better but also that people generally find them easier to understand. A long standing goal of computer graphics has been photorealism the production of synthetic images indistinguishable from photographs of real scenes. Hidden surface removal, illumination (lighting) and shading, texture mapping, shadows, transparency, improved synthetic cameras and better models all contribute to increasing visual realism.

Rendering and Realism II Ray tracing and radiosity are rendering techniques which approach photorealism for certain scenes. However these techniques are too slow for real-time applications. Research continues on improving advanced rendering techniques and their performance. The hidden surface removal techniques, the z-buffer in particular, and the illumination (lighting) and shading techniques, such as Phong illumination and Gouraud shading, which we typically find in today s 3D graphics libraries, such as OpenGL, were first developed in the 1970s and improved thereafter.

A Simple Illumination Model A simple lighting/illumination model can be based on three components: Ambient lighting Diffuse lighting Specular lighting

Ambient Ambient light is a uniform intensity background light which illuminates all objects in the scene equally from all directions. The ambient reflection can be modelled and calculated as A = L a M a where L a is the intensity of the ambient light and M a is the coefficient of ambient reflection of the object s material and ranges between [0, 1]. It is the proportion of ambient light reflected. The object s coefficient of ambient reflection is a material property. Objects or scenes illuminated by only ambient light have equal intensity (or brightness) everywhere.

Color Light sources and objects have color. Assume the RGB colour model is used. If the ambient light color is (L ar, L ag, L ab ) and the object s ambient color (reflectivity) is (M ar, M ag, M ab ). The ambient lighting equation A = L a M a is actually applied to each colour component A R = L ar M ar (1) A G = L ag M ag (2) A B = L ab M ab (3)

Diffuse I If there are light sources in a scene then different objects should have different intensity or brightness based on distance and orientation with respect to the light source and the viewer. Diffuse lighting is one kind of lighting which has these properties. A point on a diffuse surface appears equally bright from all viewing positions because it reflects light equally in all directions. That is, its intensity is independent of the position of the viewer. L N Surface

Diffuse II Whilst independent of the viewer, the intensity of a point on a diffuse surface does depend on the orientation of the surface with respect to the light source and the distance to the light source. A simple model for diffuse reflection is Lambertian reflection. Assuming the following geometry L θ N Surface

Diffuse III then the intensity of the diffuse reflection from a point light source is D = L d M d cosθ where L d is the intensity of the (point) light source, M d is the diffuse reflection coefficient of the object s material, and θ is the angle between the normal to the surface and the light source direction vector. If the normal vector to the surface N and the light source direction vector L are both normalised then the above equation can be simplified to D = L d M d (N.L)

Directional Light If a light source is an infinite distance from the object then L will be the same for all points on the object the light source becomes a directional light source. In this case less computation can be performed as L is a constant.

Light Source Attenuation From physics we know that the intensity of a light source reduces with distance, following an inverse square law. If we introduce a light source attenuation factor f att = 1/d 2 L then the diffuse component becomes D = f att L d M d (N.L) More generally, an attenuation function of the following form is allowed 1 f att = min( c 1 + c 2 d L + c 3 dl 2, 1)

Specular Reflection I Specular reflection occurs on hard, shiny surfaces and is seen as highlights. Specular highlights are strongly directional L N R V Surface

Specular Reflection II The approach to specular reflection in the Phong model is that the specular reflection intensity drops off as the cosine of the angle between the normal and the specular reflection direction raised to some power n which indicates the shininess of the surface. The higher the power of n the smaller and brighter the highlight. L N R θ θ α V Surface

Specular Reflection III The specular component of the illumination model may thus be given as S = f att L s M s cos n α If the direction of (specular) reflection R and the viewpoint direction V are normalised then the equation becomes S = f att L s M s (R.V) n

Full Model The full lighting model (equation) becomes C = A + D + S = L a M a + f att [L d M d (N.L) + L s M s (R.V) n ] where C is the final color.

Blinn-Phong : Halfway Vector A modification to the Phong specular lighting model proposed by Blinn is to use the halfway vector H instead of the reflection vector R using in Phong. The halfway vector is the vector which lies half-way between the view vector and the light vector. L N β Η R θ α V Surface Then N.H is used instead of R.V. The halfway vector is used primarily for computational efficiency.

Multiple Light Sources I The simplest approach to handling multiple light sources is to just add the contribution from each light source. If there are l light sources the lighting equation becomes C = L a M a + l fatt[l d M d (N.L) + L s M s (R.V) n ]] A slight elaboration is to allow each light source to contribute ambient light. This is basically the lighting model in OpenGL, except that specular lighting uses Blinn-Phong rather than Phong.

Clamping The lighting model adds ambient, diffuse and specular lighting contributions, and for multiple light sources. A problem which can occur is that the resulting intensity (colour) may be too high to display as is it simply accumulates. There are two common approaches: 1. clamp all RGB component values between [0,1] 2. compute the whole image and scale values according to the range of values in the image to fit the displayable range. The first approach is more common, and more efficient. As more and more lights are added it means objects tend to become white, i.e. (1, 1, 1) which is the maximum color which can be displayed.

Shading Illumination or lighting models determine the colour of a point on the surface of an object. A shading model determines where the lighting model is applied. can be applied per-polygon, per-vertex or per-pixel.

Per-Polygon, Per-Vertex and Per-Pixel Shading Constant or Flat The lighting model is applied only once for a whole polygon. The entire polygon is filled with the resulting colour. This is known as flat shading in OpenGL. Per-Vertex The lighting model is applied at each vertex of the polygon. The polygon is filled by bi-linear interpolation of the resulting values. This is known as smooth shading in OpenGL. Also known as Gouraud shading. Per-Pixel The lighting model is applied at every pixel covered by the polygon. In Phong shading the normal vector at each pixel is computed using bi-linear interpolation and then Phong specular lighting applied. Per-vertex (and per-pixel) shading are used to make polygonal objects which are inherently faceted appear smooth.

Per Polygon or Flat Shading Flat shading fills a polygon with a single colour computed from one lighting calculation. Flat shading is appropriate under some conditions: 1. The light source is at infinity so N.L is constant for all points on the polygon. 2. The viewer is at infinity so N.V is the same for all vertices. 3. The object is indeed faceted and not an approximation to a curved object.

Per Vertex or Gouraud Shading Gouraud shading is a form of interpolated shading. The illumination model is applied at vertices and the rest of the polygon s pixels are determined by bi-linear interpolation. If a polygonal object is an approximation of a curved object, then the normal at a vertex is usually the average of the normals of the polygons which meet at that vertex. Ν

Bi-linear Interpolation Bi-linear interpolation is performed as follows y y 3 I 3 y s I a Ip I b scan line y 2 I 2 y 1 I 1 I a = I 2 + ( y s y 2 y 3 y 2 )(I 3 I 2 ) I b = I 1 + ( y s y 1 y 3 y 1 )(I 3 I 1 ) I p = I a + ( x p x a x b x a )(I b I a )

Phong Shading I Phong shading is another interpolated technique. The normal vector is interpolated across the surface and the illumination model is applied for each pixel. N N a N b N c 0 N 1 P 0 P a P b P c P 1

Phong Shading II It is typically much slower than Gouraud shading unless a machine has dedicated hardware. Phong shading does a much better job of handling highlights than Gouraud shading. Gouraud shading for instance will miss highlights in the middle of polygons as it only applies the lighting model at the vertices. However, this can be overcome by using more polygons. Gouraud shading in practice does a reasonable job for interactive computer graphics where realism is sacrificed for interactive update.

Interpolated Shading Problems I Gouraud and Phong shading are mainly intended to make polygonal objects look curved. However there are problems and failings. Here are some problems and failings: Polygon silhoutte The silhoute edges of a polygonal model remain clearly polygonal. Perspective distortion Interpolation is performed after perspective transformation in normalised device coordinates rather than in world coordinates.

Interpolated Shading Problems II Orientation dependence The colour of a pixel may change when an object is rotated. A P D B D A P C B C Shared vertices Discontinuities can occur at shared vertices. In the diagram below the large polygon does not include vertex C. A C B

Interpolated Shading Problems III Unrepresentative normals The averaging of the polygon normals incident at a vertex may not represent the true surface orientation.

Reflection Vector I The reflection vector is needed to calculate the specular reflection contribution to lighting. The reflection vector is the direction of light reflected from the point on the surface it strikes. The reflection vector R is calculated according to the Law of Reflection: the angle of incidence is equal to the angle of reflection and the reflection vector lies in the plane of incidence. θ i = θ r N L R θ i θ r

Reflection Vector II The reflection vector may be calculated as follows: N L L-(N.L)N R (N.L)N θi θ r

Reflection Vector III The light vector L is now shown as the vector pointing to the light source instead of showing the direction of incident light from the light source. Be carefull about this! Any vector may be resolved into a projected component and a perpendicular component. The projected component of L in the direction of the normal vector is proj N L = (N.L)N The perpendicular component of L is then found by difference perp N L = L proj N L = L (N.L)N

Reflection Vector IV The reflection vector is then R = L 2perp N L = L 2[L (N.L)N] = 2(N.L)N L

Halfway Vector I The halfway vector H is the vector halfway between the view vector V and the light vector L N H L R α α θ i θr V

Halfway Vector II H = L + V ( L + V ) The halfway vector is used in the Blinn-Phong lighting model for specular reflection. It is used primarily for computational efficiency. Instead of using R.V, which involves calculating the reflection vector, N.H is used instead. This is quicker if the viewer and the light source are at infinity, in which case L and V do not change across a surface, i.e. the same for all vertices, and H is a constant. Because the R.V term involves the reflection vector, it does change across a surface even if the light source and viewer are at infinity, meaning it must be recalculated at each point where the lighting calculation is applied.