Presentation is loading. Please wait.

Presentation is loading. Please wait.

What is Computer Graphics and Image Processing? lAll visual computer output depends on computer graphics and image processing. l3D computer graphics is.

Similar presentations


Presentation on theme: "What is Computer Graphics and Image Processing? lAll visual computer output depends on computer graphics and image processing. l3D computer graphics is."— Presentation transcript:

1

2 What is Computer Graphics and Image Processing? lAll visual computer output depends on computer graphics and image processing. l3D computer graphics is used in visualisation, simulation, CAD and entertainment.

3 Course Structure lRendering: producing a ‘realistic’ image from a scene description lModelling: defining scene objects mathematically. lAnimation: controlling the evolution of objects over time. lLectures: Rendering (4), Modelling (5), Animation (1) lSeminars: Guest Postgrads (2) Honours Groups (6)

4 Aims of Rendering lCriteria for Rendering: Speed: Some applications (e.g. flight simulation) require interactive (> 10 Hz) rendering updates. Aesthetics: A subjective value attached by the viewer to the image. Difficult to measure. Visual Realism: An image that captures the effects of light interacting with objects (‘photorealism’). Information: How effectively the image conveys the required information. lThese criteria are often in conflict.

5 Ray Tracing lA powerful alternative to polygon scan-conversion techniques. lGiven a set of 3D objects, shoot a ray from the eye through the centre of every pixel and see what it hits. lEnables: reflection, shadows, refraction, transparency.

6 Ray Tracing Example lFrom the Computer Animated Short Film “Tin Toy” (© Pixar)

7 Ray Tracing Algorithm Select an eye point and a screen plane FOR every pixel in the screen plane [num. pixels depends on image resolution] determine the ray from the eye through the pixel’s centre FOR every object in the scene [num. objects depends on scene size] IF the object is intersected by the ray THEN IF the intersection is the closest (so far) to the eye THEN record the intersection point and object ENDIF ENDFOR set pixel’s colour to that of the object at the closest intersection point ENDFOR

8 Intersection of a ray with a sphere lSphere  Ray (parametric):  Sphere (implicit):  Trick: substitute a parametric ray equation into an implicit sphere equation.  Derivation:  Result: real – two intersections, imaginary – no intersection, – one intersection lCylinder, cone, torus are treated similarly

9 Intersection of a ray with a polygon lPlane:  Ray:  Plane:  Derivation:  Does fall inside the polygon (check by clipping against its edges. lBox, polygon, polyhedron are treated as a set of bounded planes.

10 Other implicit objects suited to Ray Tracing lQuadrics: or  Useful quadrics are the ellipsoid (sphere is a special case), infinite cylinder and infinite cone.  Various hyperbloids and parabloids are also defined by these equations but they tend to be less useful. lSuperquadrics:  Super-ellipsoids are the only ones used in practice.  acts as a ‘pointiness’ parameter: more pointy, more rounded (closer to a box), is octahedral.

11 Ray Tracing: shading lOnce, the intersection point of ray with the closest object has been found it is possible to: 1.Find the object’s surface normal at 2.Shoot rays from to all light sources 3.Calculate the diffuse and specular lighting at. Along with ambient illumination this gives the colour of the object at.

12 Ray Tracing: shadows lIf an object blocks the ray from the intersection point to a light source then it is casting a shadow over that point. lAlso need to watch out for self-shadowing.

13 Recursive Ray Tracing: reflection lBy spawning secondary (recursive) rays from a point of intersection reflection, transparency and refraction can be simulated. lA new ray aligned with the angle of reflection enables perfect (mirror) reflection. lEach new ray provides a scaled (distance attenuated) contribution to the pixel colour.

14 Recursive Ray Tracing: refraction lObjects can be totally or partially transparent  This allows objects behind the current one to be seen through it.  Light rays which intersect transparent objects can have their contribution scaled. lTransparent objects can have refractive indices  Bending the rays as they pass through the objects. lSupporting transparency and reflection requires that a ray be split into two parts.

15 Sampling in Ray Tracing lSingle Point  Shoot a single ray through the pixel’s centre. Prone to aliasing problems. lSuper-sampling for anti-aliasing  Shoot multiple rays through the pixel and average the results.  Can use a regular grid, random, jittered or Poisson disc distribution of rays. lAdaptive super-sampling  Shoot a few rays through the pixel, check the variance of the resulting values. If sufficiently similar then stop. Otherwise, shoot some more rays. lTrade-off the objectionable artefacts of aliasing for the less objectionable artefacts of noise.

16 Distributed Ray Tracing lSuper-sampling (and anti-aliasing) is only one reason for taking multiple samples per pixel.  Many effects can be achieved by distributing multiple ray samples over some range.  Called distributed ray tracing. The term distributed refers to the stochastic distribution of rays. lExamples of distributed ray tracing: 1.Distribute the rays from a light source over an area. Allows area light sources and produces soft shadows with penumbrae. 2.Distribute the camera position over an area. Allows simulation of a camera with a finite aperture lens and produces depth of field effects. 3.Distribute the samples in time. Produces motion blur effects on moving objects. 4.Distribute reflected rays over a range of directions. Can simulate imperfect specular reflection.

17 Distributed Ray Tracing: area lights lLight rays coming from an area light source are distributed. lIf some are blocked then the point is in a penumbrae. lIf all are blocked then the point is in umbrae. lAllows area light sources, in addition to point and directional light.

18 Improving Efficiency lRay tracing (especially when distributed or recursive) is computationally costly.  Naively, require a minimum of intersection tests. lA small proportion of objects are intersected by a given ray. So, quickly identifying non-intersected objects is important. lSpeedups:  Intersect bounding boxes or spheres first. Only need to test the full object if the bounding sphere is intersected.  Spatial subdivision. Group objects into cells. If a ray does not pass through a particular cell it cannot intersect the objects belonging to that cell.  Use Visibility pre-processing to cull out all objects and polygons invisible along a particular viewing direction.

19 Exercise: Recursive Ray Tracing lAssuming all objects are perfect reflectors and have ambient, diffuse and specular (Phong model) lighting, show all rays and vectors needed to calculate the shading at P.

20 Solution: Recursive Ray Tracing [A] Primary Intersection [B] Secondary Intersection


Download ppt "What is Computer Graphics and Image Processing? lAll visual computer output depends on computer graphics and image processing. l3D computer graphics is."

Similar presentations


Ads by Google