香港大学计算机图形学课件Chapter11Ray Tracing.ppt

香港大学计算机图形学课件Chapter11Ray Tracing.ppt

香港大学计算机图形学课件Chapter11Ray Tracing

In real life, a light ray shoots out from a source, hits a surface, then is reflected, and finally entered our eyes In ray tracing, a light ray is traced backwards. Starting from the eye, we trace a ray through a pixel of the screen into the scene. Then determine the surface that the ray is reflected, and the direction of the original ray, etc. * Chapter 11 Ray Tracing Ray tracing is a rendering method that traces rays of light and their interactions with the objects in a scene Characteristics generates shadows generates mirror images removes hidden surfaces is slow in execution Main reference: /education/materials/HyperGraph/raytrace/rtrace0.htm Ray-tracing is widely used to produce high quality photo-realistic images. Light Source Screen Eye The following is a simplified example of ray tracing in 2D. Assume that there is one light source and the ambient intensity is 0 (The background is completely dark.) The primary ray (cyan) does not hit anything. Set the pixel value to 0. Case 1 The primary ray (yellow) hits a plane. A shadow ray (magenta) is cast from the point hit to the light. The ray does not hit any in-between object. That is, the point is not blocked from the light. The shading of the point due to the light is computed, say L1. Case 2 A secondary ray (green) that is a perfect reflection of the primary is cast. It does not intersect with anything. The shading contributed from reflection is then set to 0. Set the pixel value to L1. Case 2, Continued The primary ray (yellow) hits the round object. A shadow ray (right magenta) is cast. It finds out that the light source is not blocked. L1 is computed accordingly. A secondary ray (short green) reflected from the primary is traced. It hits a plane. Case 3 Another shadow ray (left magenta) is cast. It finds out that the light source is not blocked. L2 is computed accordingly. A tertiary ray (long green) reflected from the secondary is traced. It does not hit anything

文档评论(0)

1亿VIP精品文档

相关文档