DOC PREVIEW
UCSD CSE 168 - Ray Tracing

This preview shows page 1-2-3-4-5-6 out of 18 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 18 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 18 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 18 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 18 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 18 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 18 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 18 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Contents1 Ray Tracing 31.1 Overview of Ray Tracing . . . . . . . . . . . . . . . . . . . . . . . 31.2 The Ray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.3 View Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.4 Intersection Computations . . . . . . . . . . . . . . . . . . . . . . 51.4.1 Ray-Plane Intersection . . . . . . . . . . . . . . . . . . . . 61.4.2 Ray-Sphere Intersection . . . . . . . . . . . . . . . . . . . 61.4.3 Ray-Triangle Intersection . . . . . . . . . . . . . . . . . . 91.4.4 Ray-Box Intersection . . . . . . . . . . . . . . . . . . . . . 101.4.5 Triangle-Box Intersection . . . . . . . . . . . . . . . . . . 111.5 Advanced Geometry . . . . . . . . . . . . . . . . . . . . . . . . . 131.5.1 Transformed Geometry . . . . . . . . . . . . . . . . . . . 131.5.2 Sub division Surfaces . . . . . . . . . . . . . . . . . . . . . 131.5.3 Bicubic Patches . . . . . . . . . . . . . . . . . . . . . . . . 131.5.4 NURBS . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131.6 Acceleration Structures . . . . . . . . . . . . . . . . . . . . . . . 131.6.1 Bounding Box Hierarchies . . . . . . . . . . . . . . . . . . 141.6.2 Grids . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141.6.3 BSP Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . 141.6.4 Other Acceleration Structures . . . . . . . . . . . . . . . . 151.7 Shading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151.7.1 A Basic Shading Model . . . . . . . . . . . . . . . . . . . 161.7.2 Direct Illumination . . . . . . . . . . . . . . . . . . . . . . 161.7.3 Diffuse Reflection . . . . . . . . . . . . . . . . . . . . . . . 161.7.4 Specular Reflection . . . . . . . . . . . . . . . . . . . . . . 161.7.5 Specular Refraction . . . . . . . . . . . . . . . . . . . . . 161.7.6 Texturing . . . . . . . . . . . . . . . . . . . . . . . . . . . 161.7.7 Bump Mapping . . . . . . . . . . . . . . . . . . . . . . . . 161.7.8 Displacement Mapping . . . . . . . . . . . . . . . . . . . . 161.7.9 Environment Mapping . . . . . . . . . . . . . . . . . . . . 16Index 1812 CONTENTSChapter 1Ray TracingBy Henrik Wann Jensen, revision April 19, 2005Note that this text is work in progress. Please report errorsto [email protected] Overview of Ray TracingDiagram / flowchartCameraPrimary raysShadow raysReflected raysRefracted rays1.2 The RayA ray, ~r(t), is specified by an origin, ~o, and a direction vector,~d:~r(t) = ~o + t~d . (1.1) Figure 1.1: A ray is defined by its origin, ~o, and a direction vector,~d.34 CHAPTER 1. RAY TRACINGθ Figure 1.2: The view setup in ray tracing.The free parameter, t, defines points along the ray. The direction vector,~d,is often normalized and then t is the distance to a point along the ray to theorigin. In most situations we only care about information “in front” of the raywhen t > 0. Figure 1.1 shows a ray.1.3 View SetupThe most common viewing model in ray tracing is the pinhole camera. Thepinhole camera assumes that all light passing through an infinitesimal hole isrecorded onto a film. The pinhole camera handles perspective projection nat-urally, and one of the nice aspects of ray tracing is that the everything can behandled directly in world space without any transformations to camera space.The view setup in ray tracing is needed to generate primary rays that startat the observer (camera or eye) position, ~e, and move through a given location(pixel) in a viewing plane. This is illustrated in Figure 1.2.To generate primary rays for a given pixel location we need a number ofparameters specifying the view:Eye position, ~eThe location of the observer.Viewing direction, ~vThe direction that the observer is looking.Up vector, ~uThe orientation (up direction) of the view.Field of view, θThe angular spread of the view in the horizontal direction. Note thatFigure 1.2 illustrates the field of view ( θy) in the vertical direction.and the parameters for the image are:1.4. INTERSECTION COMPUTATIONS 5Width, wThe width in pixels of the image.Height, hThe height in pixels of the image.From these parameters we can compute the location of a virtual image plane infront of the observer as shown in Figure 1.2. This view is only used to computeray directions and it does not restrict the visibility of objects to objects in frontof the image plane. Normally, we use t > 0, which means that all objects directlyin front of the observer location will be visible. The two vectors ~cxand ~cythatspan the image plane in the horizontal respectively the vertical direction arecomputed as:~cx=~v x ~u||~v x ~u||2(1.2)~cy= ~cxx ~v . (1.3)Note, that both ~cxand ~cyare normalized. We also nee d to compute the width,cw, and the height, ch, of the image plane:cw= 2 tanθ2(1.4)ch= cw/a . (1.5)Here, a =whis the aspect ratio of the image plane. Dividing chby a is necessaryto ensure that pixels are …


View Full Document

UCSD CSE 168 - Ray Tracing

Download Ray Tracing
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Ray Tracing and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Ray Tracing 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?