Beam Following.


120 views
Uploaded on:
Category: General / Misc
Description
Beam Following Rendering Strategies Beams for screen pictures Shadows Recursion Z-Support Rendering Articles are promptly drawn onto the screen. We utilize a "z-cradle" to monitor what is in front… Object Organizes Modelview Grid Eye facilitates Projection Network
Transcripts
Slide 1

Beam Tracing Rendering Methods Rays for screen pictures Shadows Recursion

Slide 2

Z-Buffer Rendering Objects are promptly drawn onto the screen. We utilize a “z-buffer” to stay informed concerning what is in front… Object Coordinates Modelview Matrix Eye organizes Projection Matrix Clip directions Homogenize Normalized gadget facilitates Window to Viewport arranges

Slide 3

Visible Surface Raytracing Object Coordinates Modelview Matrix Eye facilitates Intersection Data Structure Raytracing then uses this information structure to manufacture the picture.

Slide 4

Raytracing Invented by Arthur Appel in 1968 at the IBM T.J. Watson Research Center. Not considered a noteworthy achievement since it was esteemed illogical given its tremendous computational prerequisites. Grieved in lack of clarity until the late 1970’s, when PC and showcase capacities started to marginally get up to speed. SIGGRAPH’77 saw numerous noteworthy improvements, including the first takes a gander at demonstrating reflection and shadows.

Slide 5

More History A genuine recursive beam tracer was introduced surprisingly by Turner Whitted in the exemplary article “ An enhanced light model for shaded presentation ” in the June, 1980 Communications of the ACM. Note that the article is more worried with the model for enlightenment than the beam following calculation.

Slide 6

That Pinhole Camera Model After eyespace change Projection Plane at z=-d

Slide 7

What does that projection plane speak to? (right, best, znear) (left, base, znear) Pixels

Slide 8

Raytracing If we shoot a line from the focal point of projection through the focal point of a pixel and off into space… What does it hit first? On the off chance that it hits an article, process the shading for that point on the item That’s the pixel shading

Slide 9

Rays A Ray is a vector and a Point – The beginning stage of the beam Vector – The beam course This portrays a boundless line beginning at the point and going in the beam heading Starting point is once in a while called the beam birthplace

Slide 10

Simple Ray class CRay { open: CRay(const CGrPoint &o, const CGrPoint &d) {m_o=o; m_d=d;} CRay() {} CRay(const CRay &r) {m_o = r.m_o; m_d = r.m_d;} const CGrPoint &Origin() const {return m_o;} const twofold Origin(int d) const {return m_o[d];} const CGrPoint &Direction() const {return m_d;} const twofold Direction(int d) const {return m_d[d];} CRay &operator=(const CRay &r) {m_o = r.m_o; m_d = r.m_d; return *this;} private: CGrPoint m_o ; //Ray source CGrPoint m_d ; //Ray bearing };

Slide 11

Rays Ray t values A separation along the beam t=1.5

Slide 12

t values Any point along the beam with root (x s ,y s ,z s ) and direction(x d ,y d ,z d ) can be depicted utilizing t: x = x s + t x d y = y s + t y d z = z s + t z d Or: p = o + t d In vector math

Slide 13

Simple Ray class CRay { open: CRay(const CGrPoint &o, const CGrPoint &d) {m_o=o; m_d=d;} CRay() {} CRay(const CRay &r) {m_o = r.m_o; m_d = r.m_d;} const CGrPoint &Origin() const {return m_o;} const twofold Origin(int d) const {return m_o[d];} const CGrPoint &Direction() const {return m_d;} const twofold Direction(int d) const {return m_d[d];} CRay &operator=(const CRay &r) {m_o = r.m_o; m_d = r.m_d; return *this;} CGrPoint PointOnRay(double t) const {return m_o + m_d * t;} private: CGrPoint m_o; //Ray cause CGrPoint m_d; //Ray course };

Slide 14

Where will the viewplane be and how huge is it? We depict projection with: Field of perspective (point) Aspect Ratio (x/y) Or a Frustum

Slide 15

Viewplane z area y - Z area is immaterial, field of perspective is what is important. We’ll use z=-1 Could likewise utilize znear

Slide 16

Viewplane size y fov/2 fov y (in + course) - z 1 (x,y) y = tan(fov/2) tallness = 2y x = aspect*y width = 2x (- x,- y)

Slide 17

The View Plane as a Pixel Grid (x,y) (11,7) 8 tall (- x,- y) (0,0) 12 wide

Slide 18

What we need We need to shoot a beam Starting point (0,0,0) (focal point of projection) Direction through the focal point of a pixel What we need is the inside\'s directions of a pixel

Slide 19

Pixel Centers (x,y) (11,7) (4,5) 8 tall (4,5) (- x,- y) (0,0) 12 wide

Slide 20

Visible Surface Raytracing/width – Screen width, stature – Screen tallness/fov – Field of perspective in degrees, viewpoint – Aspect proportion twofold ey = tan(fov/2. * DEGTORAD); twofold ehit=2 * ey; twofold ex = ey * angle; twofold ewid = 2 * ex; for(int r=0; r<height; r++) for(int c=0; c<width; c++) { ray.start.Set(0,0,0); ray.dir.Set(- ex + ewid * (c + 0.5)/width, - ey + ehit * (r + 0.5)/stature, - 1.); ray.dir.Normalize();/Compute shading in beam heading/Save shading as picture pixel }

Slide 21

How would we make sense of what we will hit? Beam crossing point tests Reduces to illuminating for t x = x s + t x d y = y s + t y d z = z s + t z d Easiest is the circle (x-x 0 ) 2 +(y-y 0 ) 2 +(z-z 0 ) 2 =r 2 Substitute beam mathematical statement in and explain for t

Slide 22

Ray convergence with a circle Questions: Why two t values? How would we tell if there is a convergence? Which t quality do we need?

Slide 23

Intersections with a Plane mathematical statement Ax+By+Cz+D=0 (A,B,C) is the plane ordinary We can process the typical and, given a solitary point, register D Questions: Can t be negative? Zero? Why is this more troublesome than a circle?

Slide 24

Plane Intersection to Polygon Intersection Given a plane crossing point, the inquiry is: Is this point inside the polygon?

Slide 25

Polygon Interior Tests In a 2D projection: Find all edges that cover in one measurement Determine convergence of a line parallel with a hub and the covering edges what number crossing points are to one side of the point?

Slide 26

But, what projection? Venture the polygon for the greatest zone What is the biggest segment of the typical? In the event that x: Use a Y/Z projection If y: Use a X/Z projection If z: Use a X/Y projection Why?

Slide 27

Another Way… What I for the most part utilize Suppose you know the crossing point and know a typical for every edge that focuses towards within the polygon How would we figure these normals? What is the normal for focuses inside the polygon?

Slide 28

Computing the Normals Let v 1 , v 2 be two vertices (in counter clockwise request). At that point the edge typical is N x (v 2 - v 1 ) Orthogonal to the edge and the polygon surface ordinary (N). Surface Normal v 2 v 1 Edge Normal

Slide 29

Interior Test For an edge v 1 ,v 2 with edge ordinary e 1 , the convergence p is within side if (p-v 1 )e 1 is not negative.

Slide 30

Faster Intersection Tests Naã¯ve beam tracer: For every beam, test every polygon to check whether the beam hits it. On the off chance that you did this, your tasks would presumably get done with pursuing you graduate Is there a superior way? Thoughts?

Slide 31

Faster Intersection Tests Grouping articles into bouncing boxes If we don’t hit the jumping box, don’t test inside. Subdivide space into uniform boxes and walk the beam through the crates Only test what’s inside the containers Subdivide space into non-uniform boxes and walk the beam however the cases Again, just test what’s inside the cases

Slide 32

Parts of a Ray Tracing System Pixel circle Loops over the pixels and shoots the beams Ray shading calculation Determines the shading a beam hits Ray crossing point framework Determines what a beam hits

Slide 33

So, how would we do? Specular Reflection from Light Sources Specular Transmission from Light Sources Diffuse Reflection from Light Sources Specular Reflection from different surfaces Specular Transmission

Recommended
View more...