Simple Texture Mapping

Slides:



Advertisements
Similar presentations
GR2 Advanced Computer Graphics AGR
Advertisements

13.1 si31_2001 SI31 Advanced Computer Graphics AGR Lecture 13 An Introduction to Ray Tracing.
Virtual Realism TEXTURE MAPPING. The Quest for Visual Realism.
Ray tracing. New Concepts The recursive ray tracing algorithm Generating eye rays Non Real-time rendering.
Graphics Pipeline.
3D Graphics Rendering and Terrain Modeling
1 Computer Graphics Chapter 9 Rendering. [9]-2RM Rendering Three dimensional object rendering is the set of collective processes which make the object.
Illumination Model & Surface-rendering Method 박 경 와.
CS 325 Introduction to Computer Graphics 04 / 09 / 2010 Instructor: Michael Eckmann.
MC930/MO603 Ray Casting. Light is bouncing photons.
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Object-Order vs. Screen-Order Rendering April 24, 2003.
CS 376 Introduction to Computer Graphics 04 / 09 / 2007 Instructor: Michael Eckmann.
(conventional Cartesian reference system)
X86 and 3D graphics. Quick Intro to 3D Graphics Glossary: –Vertex – point in 3D space –Triangle – 3 connected vertices –Object – list of triangles that.
Ray Casting Ray-Surface Intersections Barycentric Coordinates Reflection and Transmission [Shirley, Ch.9] Ray Tracing Handouts Ray Casting Ray-Surface.
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Texture Mapping.
Global Illumination May 7, Global Effects translucent surface shadow multiple reflection.
7M836 Animation & Rendering
Lecture 8 Advanced Rendering – Ray Tracing, Radiosity & NPR.
Computer Graphics Inf4/MSc Computer Graphics Lecture 11 Texture Mapping.
Computer Graphics Panos Trahanias ΗΥ358 Spring 2009.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
CS 376 Introduction to Computer Graphics 04 / 11 / 2007 Instructor: Michael Eckmann.
COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS 1 Shading (Shading) & Smooth Shading Graphics.
-Global Illumination Techniques
Ray Tracing Chapter CAP4730: Computational Structures in Computer Graphics.
Ray Tracing Jian Huang, CS 594, Fall, 2002 This set of slides are used at Ohio State by Prof. Roger Crawfis.
University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Ray Tracing.
Rendering Overview CSE 3541 Matt Boggus. Rendering Algorithmically generating a 2D image from 3D models Raster graphics.
Basic Ray Tracing CMSC 435/634. Visibility Problem Rendering: converting a model to an image Visibility: deciding which objects (or parts) will appear.
CS 325 Introduction to Computer Graphics 03 / 24 / 2010 Instructor: Michael Eckmann.
CS 325 Introduction to Computer Graphics 03 / 29 / 2010 Instructor: Michael Eckmann.
RENDERING Introduction to Shading models – Flat and Smooth shading – Adding texture to faces – Adding shadows of objects – Building a camera in a program.
CS 325 Introduction to Computer Graphics 04 / 12 / 2010 Instructor: Michael Eckmann.
CS 376 Introduction to Computer Graphics 04 / 02 / 2007 Instructor: Michael Eckmann.
Render methods. Contents Levels of rendering Wireframe Plain shadow Gouraud Phong Comparison Gouraud-Phong.
CSE 681 Introduction to Ray Tracing. CSE 681 Ray Tracing Shoot a ray through each pixel; Find first object intersected by ray. Image plane Eye Compute.
CS 325 Introduction to Computer Graphics 04 / 07 / 2010 Instructor: Michael Eckmann.
Schedule Update GP 4 – Tesselation/Cg GDS 4 – Subdiv Surf. GP 5 – Object Modeling Lab: Mini-proj Setup GDS 5 – Maya Modeling MCG 6 – Intersections GP 6.
CS 376 Introduction to Computer Graphics 04 / 13 / 2007 Instructor: Michael Eckmann.
Computer Graphics Ken-Yi Lee National Taiwan University (the slides are adapted from Bing-Yi Chen and Yung-Yu Chuang)
Illumination and Shading. Illumination (Lighting) Model the interaction of light with surface points to determine their final color and brightness OpenGL.
Illumination and Shading Prof. Lizhuang Ma Shanghai Jiao Tong University.
Texturing Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology.
Introduction to Ray Tracing Dr. B. Raghu Professor /CSE Sri Ramanujar Engineering College.
Basic Ray Tracing CMSC 435/634.
Photorealistic Rendering vs. Interactive 3D Graphics
Rendering Process of producing “realistic” images or pictures
3D Graphics Rendering PPT By Ricardo Veguilla.
Unit-7 Lighting and Shading
RAY TRACING.
Chapter 10: Computer Graphics
© University of Wisconsin, CS559 Fall 2004
CSC461: Lecture 23 Shading Computation
Michael Tanaya , Hua ming Chen
Lecture 11: Recursive Ray Tracer
Ray Tracing.
Lighting.
Reflection and Refraction
CS5500 Computer Graphics May 29, 2006
Illumination and Shading
GR2 Advanced Computer Graphics AGR
Texture Mapping 고려대학교 컴퓨터 그래픽스 연구실.
Illumination Model 고려대학교 컴퓨터 그래픽스 연구실.
Illumination Model 고려대학교 컴퓨터 그래픽스 연구실.
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
Reflection and Refraction
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
Reflection and Refraction
Introduction to Ray Tracing
Presentation transcript:

Simple Texture Mapping and Simple Ray-Tracing

Texture Map Each pixel in a texture map is called a Texel Each Texel is associated with a (s,t) 2D texture coordinate The range of s, t is [0.0,1.0] due to normalization

Simple Mapping Texture Coordinates Projection Coordinates

Simple Mapping Texture Coordinates Projection Coordinates

Simple Mapping

Basic File Structure Add texture coordinates v1 x1 y1 z1 u1 v1

Texture Filtering Get an interpolated value from near four neighbors

Bilinear Interpolation

Perspective Correction Linear Interpolation of Texture Coordinate Corrected Interpolation

Perspective Correction Let’s assume that the viewport is located 1 unit away from the projection center

Perspective Correction Compare linear interpolation in screen space

Perspective Correction

Perspective Correction We can interpolate arbitrary parameters of a surface on the screen coordinates in the linear fashion Use s instead t ! (ex) Gouraud shading, Phong normal . . etc

Perspective Correction Further reading http://www.whisqu.se/per/docs/graphics16.htm http://p205.ezboard.com/fyabasicprogrammingfrm20.showMessage?topicID=20.topic (Perspective correction with Z-buffering) http://easyweb.easynet.co.uk/~mrmeanie/tmap/tmap.htm

Ray Tracing Concept eye view plane Binary Tree

Ray Tracing Procedure For each ray r from eye to pixel, color the pixel the value returned by the function: ray_cast(r) ray_cast(r) { s  nearest_intersected_surface(r); p  point_of_intersection(r, s); u reflect(r, s, p); v refract(r, s, p); c  phong(p, s, r) + s.kreflect  ray_cast(u) + s.krefract  ray_cast(v); return(c); }

Ray Tracing Procedure s  nearest_intersected_surface(r); Use geometric searching to find the nearest surface s intersected by the ray r p  point_of_intersection(r, s); Compute p, the point of intersection of ray r with surface s u reflect(r, s, p); v refract(r, s, p); Compute the reflected ray u and the refracted ray v using Snell’s Laws

Ray Tracing Procedure phong(p, s, r) s.kreflect  ray_cast(u) Evaluate the Phong reflection model for the ray r at point p on surface s, taking shadowing into account s.kreflect  ray_cast(u) Multiply the contribution from the reflected ray u by the specular-reflection coefficient kreflect for surface s s.krefract  ray_cast(v) Multiply the contribution from the refracted ray v by the specular-refraction coefficient krefract for surface s

Reflection and Refraction Reflected and refracted rays are computed using Snell’s Law surface normal reflected ray incident ray surface refracted ray

Shadowing If any object intersects the shadow ray between the surface and the point light source, the surface is in shadow w.r.t. that light source blocked ! u L N r

Surface Intersection Ray equation ray path

Surface Intersection For sphere, If the discriminant is negative, the ray does not intersect the sphere. Otherwise, intersection coordinates are obtained using smaller s.