中文摘要
渲染插件广泛应用在计算机辅助设计软件中,为模型提供最终符合用户要求的效果渲染。真实感渲染是渲染插件的最基本功能之一。
真实感图形学已经发展了很多年,其中光线跟踪算法是十分适合在造型软件中实现的真实感渲染算法,它可以实现物体表面材质的明暗、阴影、反射、折射等效果。
本文主要讲述光线跟踪算法在TiGEMS渲染插件中的实现和加速。最后做出总结并提出改进的方向。
关键词:渲染插件 真实感图形学 光线跟踪
ABSTRACT
Rendering plug-in is widely used in CAD software. it produces rending effect of the designed products. Among all of the various rendering effects, photorealistic effect is a basic one.
Realistic graphics has been developed for many years and ray tracing algorithm is suitable to implement photorealistic effects for 3D Modeling, due to its easiness to achieve shading, shadow, reflection and refraction effects.
This paper focuses on implementation and acceleration of the ray tracing algorithm in TiGEMS rendering plug-in. It also proposes some directions for future improvement.
Keywords:rendering plug-in, photorealistic, ray tracing
目 录
第1章 前言 9
1.1 渲染插件 9
1.2 真实感图形学 9
1.2.1 光照明模型 9
1.2.2 光线跟踪算法 10
1.2.3 辐射度算法 10
1.3 选择光线跟踪 11
1.4 光线跟踪算法的难点 11
1.5 光线跟踪的最新研究 11
1.6 论文的各部分内容 12
第2章 光线跟踪原理 13
2.1 光线跟踪机理 13
2.2 照相机 15
2.2.1 光线跟踪的照相机 15
2.2.2 合适的坐标系 15
2.2.3 构造光线 17
2.3 光线跟踪的过程 17
2.4 求交问题 17
2.5 明暗图 18
2.6 阴影的实现 19
2.7 反射与折射 20
2.7.1 反射 20
2.7.2 折射 21
第3章 光线跟踪的实现 23
3.1 渲染环境的搭建 23
3.1.1 设定投影范围:setShape 23
3.1.2 设定视点:setLookAt 23
3.1.3 设定OpenGL的模型矩阵:setModelViewMatrix 24
3.2 开始光线跟踪 24
3.2.1 关于像素块:blockSize 24
3.2.2 光线跟踪过程:RayTrace 24
3.2.3 获取交点颜色:Shade 25
3.3 场景的明暗效果 25
3.4 阴影效果 26
3.5 反射与透明效果 27
第4章 光线跟踪的加速 31
4.1 加速的选择 31
4.1.1 自适应深度控制 31
4.1.2 包围盒技术 31
4.1.3 三维DDA算法 32
4.1.4 空间八叉树剖分技术 32
4.2 投影范围的原理 33
4.3 投影范围的计算 34
4.4 使用联合投影范围 35
第5章 结论与建议 37
5.1 结论 37
5.2 建议 37
5.2.1 改进局部光照模型 37
5.2.2 进行反走样 38
5.2.3 支持复杂对象的透射 38
5.2.4 加速 38
插图索引 I
参考文献 III
致 谢 V
声 明 VII