下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、Ray Tracing1Angel: Interactive Computer Graphics 5E Addison-Wesley 2009原著Ed AngelProfessor of Computer Science, Electrical and Computer Engineering, and Media ArtsUniversity of New Mexico编辑 武汉大学计算机学院图形学课程组2Angel: Interactive Computer Graphics 5E Addison-Wesley 2009IntroductionOpenGL is based on a pi
2、peline model in which primitives are rendered one at timeNo shadows (except by tricks or multiple renderings)No multiple reflectionsGlobal approachesRendering equationRay tracingRadiosity3Angel: Interactive Computer Graphics 5E Addison-Wesley 2009Ray TracingFollow rays of light from a point sourceCa
3、n account for reflection and transmission4Angel: Interactive Computer Graphics 5E Addison-Wesley 2009ComputationShould be able to handle all physical interactionsRay tracing paradigm is not computationalMost rays do not affect what we seeScattering produces many (infinite) additional raysAlternative
4、: ray casting5Angel: Interactive Computer Graphics 5E Addison-Wesley 2009Ray CastingOnly rays that reach the eye matterReverse direction and cast raysNeed at least one ray per pixel6Angel: Interactive Computer Graphics 5E Addison-Wesley 2009Ray Casting QuadricsRay casting has e the standard way to v
5、isualize quadrics which are implicit surfaces in CSG systemsConstructive Solid GeometryPrimitives are solidsBuild objects with set operationsUnion, intersection, set difference7Angel: Interactive Computer Graphics 5E Addison-Wesley 2009Ray Casting a SphereRay is parametricSphere is quadricResulting
6、equation is a scalar quadratic equation which gives entry and exit points of ray (or no solution if ray misses)8Angel: Interactive Computer Graphics 5E Addison-Wesley 2009Shadow RaysEven if a point is visible, it will not be lit unless we can see a light source from that pointCast shadow or feeler r
7、ays9Angel: Interactive Computer Graphics 5E Addison-Wesley 2009ReflectionMust follow shadow rays off reflecting or transmitting surfacesProcess is recursive10Angel: Interactive Computer Graphics 5E Addison-Wesley 2009Reflection and Transmission11Angel: Interactive Computer Graphics 5E Addison-Wesley
8、 2009Ray Trees12Angel: Interactive Computer Graphics 5E Addison-Wesley 2009Ray Tree13Angel: Interactive Computer Graphics 5E Addison-Wesley 2009Diffuse SurfacesTheoretically the scattering at each point of intersection generates an infinite number of new rays that should be tracedIn practice, we onl
9、y trace the transmitted and reflected rays but use the Phong model to compute shade at point of intersectionRadiosity works best for perfectly diffuse (Lambertian) surfaces14Angel: Interactive Computer Graphics 5E Addison-Wesley 2009Building a Ray TracerBest expressed recursivelyCan remove recursion
10、 laterImage based approachFor each ray .Find intersection with closest surfaceNeed whole object database availableComplexity of calculation limits object typesCompute lighting at surfaceTrace reflected and transmitted rays15Angel: Interactive Computer Graphics 5E Addison-Wesley 2009When to stopSome
11、light will be absorbed at each intersectionTrack amount leftIgnore rays that go off to infinityPut large sphere around problemCount steps16Angel: Interactive Computer Graphics 5E Addison-Wesley 2009Recursive Ray Tracercolor c = trace(point p, vector d, int step) color local, reflected, transmitted;
12、point q; normal n; if(step max) return(background_color);17Angel: Interactive Computer Graphics 5E Addison-Wesley 2009Recursive Ray Tracerq = intersect(p, d, status);if(status=light_source) return(light_source_color);if(status=no_intersection) return(background_color);n = normal(q);r = reflect(q, n)
13、;t = transmit(q,n);18Angel: Interactive Computer Graphics 5E Addison-Wesley 2009Recursive Ray Tracerlocal = phong(q, n, r);reflected = trace(q, r, step+1);transmitted = trace(q,t, step+1);return(local+reflected+transmitted);19Angel: Interactive Computer Graphics 5E Addison-Wesley 2009Computing Inter
14、sectionsImplicit ObjectsQuadricsPlanesPolyhedraParametric Surfaces20Angel: Interactive Computer Graphics 5E Addison-Wesley 2009Implicit SurfacesRay from p0 in direction d p(t) = p0 +t dGeneral implicit surfacef(p) = 0Solve scalar equation f(p(t) = 0General case requires numerical methods21Angel: Int
15、eractive Computer Graphics 5E Addison-Wesley 2009QuadricsGeneral quadric can be written aspTAp + bTp +c = 0Substitute equation of ray p(t) = p0 +t dto get quadratic equation22Angel: Interactive Computer Graphics 5E Addison-Wesley 2009Sphere(p pc) (p pc) r2 = 0p(t) = p0 +t dp0 p0 t2+ 2 p0 (d p0) t +
16、(d p0) (d p0) r2 = 023Angel: Interactive Computer Graphics 5E Addison-Wesley 2009Planesp n + c = 0p(t) = p0 +t dt = -(p0 n + c)/ d n 24Angel: Interactive Computer Graphics 5E Addison-Wesley 2009PolyhedraGenerally we want to intersect with closed objects such as polygons and polyhedra rather than pla
17、nesHence we have to worry about inside/outside testingFor convex objects such as polyhedra there are some fast tests25Angel: Interactive Computer Graphics 5E Addison-Wesley 2009Ray Tracing PolyhedraIf ray enters an object, it must enter a front facing polygon and leave a back facing polygonPolyhedron is formed by intersection of planesRay enters at furthest intersection with front facing planesRay leaves at closest intersection with back facing planesIf entry is further away than ex
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 沧州医学高等专科学校2026年度高层次人才选聘的备考题库及答案详解(新)
- 2026年某银行无锡市分行外包岗招聘备考题库及一套完整答案详解
- 东莞市公安局沙田分局2025年公开招聘警务辅助人员备考题库(第8期)参考答案详解
- 2026年兴国县卫生健康总院公开招聘编制外卫生专业技术人员的备考题库及答案详解(考点梳理)
- 合同能源管理项目2025年合作协议
- 三角洲卖号合同2025年版本更新解读
- 2026年南平武夷矿产资源发展有限公司闽运加油站劳务派遣员工一次社会招聘备考题库有答案详解
- 2026年海南省公安机关人民警察特警职位特殊招录备考题库(含答案详解)
- 梧州市中医医院2026年人才招聘备考题库及1套参考答案详解
- 小朋友们眼中的春姑娘写物作文(10篇)
- NB-T+10131-2019水电工程水库区工程地质勘察规程
- 管理大略与领导小言智慧树知到期末考试答案章节答案2024年山东大学
- GJB9001C质量保证大纲
- 成品综合支吊架深化设计及施工技术专项方案
- 小班科学《瓶子和盖子》教案
- 解码国家安全智慧树知到期末考试答案2024年
- 草地生态系统的地上与地下相互作用
- 配电网故障及其特征
- 特种设备检验检测行业商业计划书
- 门禁卡使用权限申请单
- 拆除玻璃施工方案
评论
0/150
提交评论