120 likes | 349 Views
What is Ray Tracing?. “In computer graphics , an advanced technique for adding realism to an image by including variations in shade, color intensity, and shadows that would be produced by having one or more light sources.” [ Webopedia ]
E N D
What is Ray Tracing? • “In computer graphics, an advanced technique for adding realism to an image by including variations in shade, color intensity, and shadows that would be produced by having one or more light sources.” [Webopedia] • “A rendering method that simulates light reflections, refractions and shadows. It follows a light path from a specific source and computes each pixel in the image to simulate the effect of the light. It is a very process-intensive operation.” [PCmag Encyclopedia]
What is raytracing? • It’s a graphics technique for rendering very realistic scenes. • And a method of creating highly unreal scenes that look plausible, too. • Each pixel’s colour is calculated from a reasonably accurate physics model. • The path of a notional “light ray” is traced from the screen out into the scene.
Tracing the path of a ray... • The colour of a pixel is calculated by tracing the ray from the viewpoint, through the pixel until an intersection is found. • Further rays may be generated and they are traced, and so on. • Dull, opaque objects tend to stop a ray, but shiny objects reflect and transparent objects can generate extra rays.
Tracing the path of a ray... 15 7 6 14 11 4 9 13 8 5 10 12 3 2 1
Limitations • Perfect parallel mirrors are an obvious problem - most raytracers have a fixed “cut-off” depth. • Some ray tracers add a “glow” to all objects to help simulate ambient lighting. • Complex scenes may require a lot of memory and an enormous amount of time to process.
Performance • In a scene of 100 primitive objects, rendered at a resolution of 640 by 480 pixels, the minimum number of intersection tests (using the simplest ray tracing algorithm) is in excess of 30 million. • In practice, objects are bound by spheres or boxes to simplify intersection tests. Only if the ray intersects with the bounding shape is it worth testing the “complex” shape.
Constructive Solid Geometry • Primitive shapes (spheres, boxes, cones, cylinders) are not terribly useful on their own. • CSG gives us a way to build complicated shapes by merging, joining and subtracting primitives. • You can weld shapes together or use one shape to take a chunk out of another with CSG.
CSG types • union (and merge)objects “glued” together - may overlap. Merging loses the edges inside the composite object. • intersectionthe new object exists only where all the original shapes overlapped. • differenceremoves a shape from another.
Boolean Set Operators • Union -edges maintained • Merge -edges lost
Boolean Set Operators • Intersection • Difference
Practicalities • Difference is often implemented by complement and Intersection • Ray tracing procedures have to be modified to determine the surfaces of the CSG objects • Surfaces are generated for a CSG object by using the texture of the primitive that formed that surface
References/Links • Ray Tracing, G. Scott Owen, SIGgraphhttp://www.siggraph.org/education/materials/HyperGraph/raytrace/rtrace0.htm • The Internet Raytracing Competitionhttp://www.irtc.org/ • Google search “define:Ray tracing”http://www.google.co.uk/search?hl=en&lr=&oi=defmore&defl=en&q=define:Ray+tracing