1 / 30

Computer Graphics

Lecture 4 View Projection Taku Komura. Computer Graphics. Measuring the BRDF. Measured using a device called gonioreflectometer Casting light from various directions to the object, and capturing the light reflected back. Problems with Measured BRDF. Includes a lot of error

sol
Download Presentation

Computer Graphics

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture 4 View Projection Taku Komura Computer Graphics

  2. Measuring the BRDF • Measured using a device called gonioreflectometer • Casting light from various directions to the object, and capturing the light reflected back

  3. Problems with Measured BRDF • Includes a lot of error • Huge amount of time to capture • The data size is enormous • 18 hours acquisition time, 30GB raw data according to [Ngan et al. EGSR ’05] -> Fitting the acquired data into analytical models

  4. Analytical models • Empirical models • Gouraud, Phong models or more complex models • Microfacet models • Assuming the surface is composed of a large number of micro mirrors • Each reflect light back to the specular direction

  5. Microfacet Theory • [Torrance & Sparrow 1967] • Surface modeled by tiny mirrors • Value of BRDF at • # of mirrors oriented halfway between and where is the incoming direction, is the out going direction Also considering the statistics of the shadowing/masking • Modulated by Fresnel, shadowing/masking [Shirley 97]

  6. Examples : Satin

  7. Examples : velvet

  8. Implementation of viewing. • Transform into camera coordinates. • Perform projection into view volume or screen coordinates. • Clip geometry outside the view volume. • Remove hidden surfaces (next week)

  9. Transformations Screen coordinates Local coordinates Projection matrix World to camera matrix Local to world matrix 29/08/2014

  10. Lecture 4 View Transformation (from lecture 2) • We want to know the positions in the camera coordinate system vw = Mc→wvc vc = Mc → w vw = Mw→cvw Point in the camera coordinate Camera-to-world transformation Point in the world coordinate -1

  11. View Projection • We want to create a picture of the scene viewed from the camera • Two sorts of projection • Parallel projection • Perspective projection

  12. Mathematics of Viewing • We need to generate the transformation matrices for perspective and parallel projections. • They should be 4x4 matrices to allow general concatenation. • And there’s still 3D clipping and more viewing stuff to look at.

  13. Parallel projections (Orthographic projection)‏ • Specified by a direction of projection, rather than a point. • Objects of same size appear at the same size after the projection

  14. Parallel projection. Orthographic Projection onto a plane at z = 0. xp = x , yp = y , z = 0.

  15. Perspective Projection • Specified by a center of projection and the focal distance (distance from the eye to the projection plane) • Objects far away appear smaller, closer objects appear bigger

  16. Projection Matrix • Here we will follow the projection transform method used in OpenGL • The camera facing the –z direction

  17. Perspective projection – simplest case. Centre of projection at the origin, Projection plane at z=-d. d: focal distance Projection Plane. y P(x,y,z)‏ x Pp(xp,yp,-d)‏ z d

  18. Perspective projection – simplest case. x P(x,y,z)‏ xp z d y d P(x,y,z)‏ z Pp(xp,yp,-d)‏ z yp P(x,y,z)‏ d y x

  19. Perspective projection.

  20. Perspective projection.

  21. Perspective projection. Trouble with this formulation : Centre of projection fixed at the origin.

  22. Alternative formulation. d x z P(x,y,z)‏ xp yp P(x,y,z)‏ z y d Projection plane at z = 0 Centre of projection at z = d

  23. Alternative formulation. d x z P(x,y,z)‏ xp yp P(x,y,z)‏ z y d Projection plane at z = 0, Centre of projection at z = d Now we can allow d

  24. Problem • After projection, the depth information is lost • We need to preserve the depth information for hidden surface remove during rasterization

  25. 3D View Volume • The volume in which the visible objects exist • For orthographic projection, view volume is a box. • For perspective projection, view volume is a frustum. • The surfaces outside the view volume must be clipped left Far clipping plane. Near clipping plane right Need to calculate intersection With 6 planes.

  26. Canonical View Volume • We can transform the frustum view volume into a normalized canonical view volume using the idea of perspective transformation • Much easier to clip surfaces and apply hidden surface removal

  27. Transforming the View Frustum • Let us define parameters (l,r,b,t,n,f) that determines the shape of the frustum • The view frustum starts at z=-n and ends at z=-f, with 0<n<f • The rectangle at z=-n has the minimum corner at (l,b,-n) and the maximum corner at (r,t,-n)‏

  28. Transforming View Frustum into a Canonical view-volume • The perspective canonical view-volume can be transformed to the parallel canonical view-volume with the following matrix:

  29. Final step. • Divide by W to get the 3-D coordinates • Where the perspective projection actually gets done • Now we have a ‘canonical view volume’. • Don’t flatten z due to hidden surface calculations. • 3D Clipping • The Canonical view volume is defined by: -1x1, -1 y1 , -1 z1 • Simply need to check the (x,y,z) coordinates and see if they are within the canonical view volume

  30. Reading for View Transformation • Foley et al. Chapter 6 – all of it, • Particularly section 6.5 • Introductory text, Chapter 6 – all of it, • Particularly section 6.6 • Akenine-Moller, Real-time Rendering Chapter 3.5

More Related