Digital Image Synthesis Yung-Yu Chuang 10/4/2005

Slides:



Advertisements
Similar presentations
COMP 175 | COMPUTER GRAPHICS Remco Chang1/6103b – Shapes Lecture 03b: Shapes COMP 175: Computer Graphics February 3, 2015.
Advertisements

CS 352: Computer Graphics Chapter 7: The Rendering Pipeline.
Geometry Primer Lines and rays Planes Spheres Frustums Triangles Polygon Polyhedron.
CHAPTER 12 Height Maps, Hidden Surface Removal, Clipping and Level of Detail Algorithms © 2008 Cengage Learning EMEA.
Ray Casting Ray-Surface Intersections Barycentric Coordinates Reflection and Transmission [Shirley, Ch.9] Ray Tracing Handouts Ray Casting Ray-Surface.
Implicit Surfaces Tom Ouyang January 29, Outline Properties of Implicit Surfaces Polygonization Ways of generating implicit surfaces Applications.
Curves Locus of a point moving with one degree of freedom
ENDS 375 Foundations of Visualization Geometric Representation 10/5/04.
1Notes. 2 Time integration for particles  Back to the ODE problem, either  Accuracy, stability, and ease-of- implementation are main issues  Obviously.
Cornell CS465 Fall 2004 Lecture 3© 2004 Steve Marschner 1 Ray Tracing CS 465 Lecture 3.
Cornell CS465 Fall 2004 Lecture 3© 2004 Steve Marschner 1 Ray Tracing CS 465 Lecture 3.
Vectors and the Geometry of Space
Acceleration Digital Image Synthesis Yung-Yu Chuang 10/4/2005 with slides by Mario Costa Sousa and Pat Hanrahan.
CSE 681 Ray Tracing Geometry. The Camera Model Based on a simpile pin-hole camera model –Simplest lens model –Pure geometric optics – based on similar.
Computer graphics & visualization Ray-Tracing – A Quick review.
COMP 175: Computer Graphics March 24, 2015
Geometry and Transformations Digital Image Synthesis Yung-Yu Chuang 9/28/2006 with slides by Pat Hanrahan.
CS 325 Introduction to Computer Graphics 04 / 26 / 2010 Instructor: Michael Eckmann.
Ray Intersection Acceleration
Parametric Surfaces and their Area Part II. Parametric Surfaces – Tangent Plane The line u = u 0 is mapped to the gridline C 2 =r(u 0,v) Consider the.
Materials Digital Image Synthesis Yung-Yu Chuang 11/19/2008 with slides by Robin Chen.
Shapes Digital Image Synthesis Yung-Yu Chuang with slides by Pat Hanrahan.
Minimum Distance between curved surfaces Li Yajuan Oct.25,2006.
Bump Map 1. High Field Function: H(u, v) New Normal : N’
Shapes Digital Image Synthesis Yung-Yu Chuang 10/05/2006 with slides by Pat Hanrahan.
Detector Description – Part III Ivana Hrivnacova, IPN Orsay Tatiana Nikitina, CERN Aknowledgement: Slides by: J.Apostolakis, G.Cosmo, A. Lechner.
3D Object Representations graphics scenes contain solid geometric objects trees, flowers, clouds, rocks, water representations surface ↔interior models.
In the name of God Computer Graphics. Introduction Modeling techniques modeling techniques managements Some renderings.
11.6 Surfaces in Space.
Materials Digital Image Synthesis Yung-Yu Chuang 11/08/2005 with slides by Robin Chen.
RENDERING : Global Illumination
Shapes Digital Image Synthesis Yung-Yu Chuang 10/1/2008 with slides by Pat Hanrahan.
Solid Modeling Dr. Scott Schaefer.
Ray Tracing I. Reading Hill, Chapter 14, Sections 14.1 to 14.5 Hill, Chapter 14, Sections and
CSE 681 Object Intersection. CSE 681 Object Representation Implicit forms F(x,y,z) = 0 Explicit forms Analytic form x = F(y,z) testing generating Parametric.
1 Spherical manifolds for hierarchical surface modeling Cindy Grimm.
MATHEMATICS B.A./B.Sc. (GENERAL) FIRST YEAR EXAMINATIONS,2012.
Digital Image Synthesis Yung-Yu Chuang 10/8/2009
Chapter 12 Math 181.
Copyright © Cengage Learning. All rights reserved.
Ray Tracing Forward Ray Tracing
Intersecting Simple Surfaces
Surfaces.
Digital Image Synthesis Yung-Yu Chuang 11/16/2006
3D Object Representation
Ray Tracing Geometry CSE 681.
Sign name list.
Ray Tracing Geometry CSE 681.
3D Rendering Pipeline Hidden Surface Removal 3D Primitives
Surfaces Dr. Scott Schaefer.
CMSC 635 Ray Tracing.
Digital Image Synthesis Yung-Yu Chuang 9/27/2005
Implicit Functions Some surfaces can be represented as the vanishing points of functions (defined over 3D space) Places where a function f(x,y,z)=0 Some.
Object Intersection CSE 681.
Object Intersection CSE 681.
Digital Image Synthesis Yung-Yu Chuang 10/19/2006
Digital Image Synthesis Yung-Yu Chuang 10/5/2006
Digital Image Synthesis Yung-Yu Chuang 9/28/2006
Which of the equations below is an equation of a cone?
Digital Image Synthesis Yung-Yu Chuang 10/22/2009
Geometry and Transformations
Image synthesis using classical optics
Geometry and Transformations
Congruence Transformations
Geometry and Transformations
3D Object Representation
Overview of Modeling 김성남.
Digital Image Synthesis Yung-Yu Chuang 9/24/2009
Digital Image Synthesis Yung-Yu Chuang 10/04/2007
Presentation transcript:

Digital Image Synthesis Yung-Yu Chuang 10/4/2005 Shapes Digital Image Synthesis Yung-Yu Chuang 10/4/2005 with slides by Pat Hanrahan

Shapes Shape: raw geometry properties of the primitive Primitive=Shape+Material Source code in core/shape.* and shapes/* pbrt provides the following shape plug-ins: quadrics: sphere, cone, cylinder, disk, hyperboloid, paraboloid (surface described by quadratic polynomials in x, y, z) triangle mesh height field NURBS Loop subdivision surface

Shape All shapes are defined in object coordinate space class Shape : public ReferenceCounted { public: <Shape Interface> const Transform ObjectToWorld, WorldToObject; const bool reverseOrientation, transformSwapsHandedness; }

Shape interface BBox ObjectBound(; BBox WorldBound() { (can be overridden) return ObjectToWorld(ObjectBound()); } bool CanIntersect() returns whether this shape can do intersection test; if not, the shape must provide void Refine(vector<Reference<Shape>>&refined) bool Intersect(const Ray &ray, float *tHit, DifferentialGeometry *dg) bool IntersectP(const Ray &ray)

Shape interface float Area() void GetShadingGeometry( const Transform &obj2world, const DifferentialGeometry &dg, DifferentialGeometry *dgShading) No back culling for that it doesn’t save much for ray tracing and it is not physically correct for object instancing

Surfaces Implicit: F(x,y,z)=0 you can check Explicit: (x(u,v),y(u,v),z(u,v)) you can enumerate Quadric

Sphere A sphere of radius r at the origin Implicit: x2+y2+z2-r2=0 Parametric: f(θ,ψ) x=rsinθcosψ y=rsinθsinψ z=rcosθ mapping f(u,v) over [0,1]2 ψ=uψmax θ=θmax+v(θmax-θmax)

Sphere

Sphere (construction) class Sphere: public Shape { …… private: float radius; float phiMax; float zmin, zmax; float thetaMin, thetaMax; } Sphere(const Transform &o2w, bool ro, float rad, float zmin, float zmax, float phiMax); Bounding box for sphere, only z clipping

Algebraic solution Perform in object space, WorldToObject(r, &ray) Assume that ray is normalized for a while Step 1

Algebraic solution If (B2-4AC<0) then the ray misses the sphere Step 2 If (B2-4AC<0) then the ray misses the sphere Step 3 Calculate t0 and test if t0<0 Step 4 Calculate t1 and test if t1<0

Geometric solution 1. Origin inside?

Geometric solution 2. find the closest point, t=-O‧D if t<0 and O outside return false t t

Geometric solution 3. find the distance to the origin, d2=O2-t2 if s2=r2-d2<0 return false; t s d r r O

Geometric solution 4. calculate intersection distance, if (origin outside) then t-s else t+s t t s O s r d r d O

Sphere intersection Use algebraic solution, why? Consider numeric stability

Partial sphere Have to test sphere intersection against clipping parameters Partial derivatives Area

Cylinder

Cylinder

Cylinder (intersection)

Disk

Disk

Disk (intersection) h h-Oz t Dz D

Other quadrics

Triangle mesh The most commonly used shape. In pbrt, it can be supplied by users or tessellated from other shapes.

Triangle mesh class TriangleMesh : public Shape { … int ntris, nverts; int *vertexIndex; Point *p; Normal *n; Vector *s; float *uvs; } vi[3*i] vi[3*i+1] vi[3*i+2] p x,y,z … Note that p is stored in world space to save transformations. n and s are in object space.

Triangle mesh ObjectBound and WorldBound Void TriangleMesh::Refine(vector<Reference<Shape>> &refined) { for (int i = 0; i < ntris; ++i) refined.push_back(new Triangle(ObjectToWorld, reverseOrientation, (TriangleMesh *)this, i)); }

Ray triangle intersection Intersect ray with plane Check if point is inside triangle In order to implement this algorithm we had to address these six issues.

Ray plane intersection Algebraic Method Substituting for P, we get: Solution: In order to implement this algorithm we had to address these six issues.

Ray triangle intersection I Algebraic Method For each side of triangle: In order to implement this algorithm we had to address these six issues. end

Ray triangle intersection II Parametric Method In order to implement this algorithm we had to address these six issues.

Ray triangle intersection III In order to implement this algorithm we had to address these six issues.

Fast minimum storage intersection

Fast minimum storage intersection