版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、1,真实感图形建模与绘制,王莉莉 虚拟现实技术与系统国家重点实验室 2012.9,2,课程特点,随着计算机软硬件的发展和计算机应用的深入,传统的计算机图形学的方法已不能满足用户对建模、绘制结果真实性的需求。真实感图形绘制与建模在计算机图形学研究的基础上,以用户视觉体验的沉浸感为目标,对一些新的概念、理论和算法进行深入的研究。 主要内容包括真实感光照模型,光线跟踪,辐射度方法,阴影生成与绘制,基于图像的建模与绘制,层次细节模型,碰撞检测,二维、三维、过程纹理及纹理映射,自然景物建模等方面。 体现了目前国内外相关研究的经典方法,真实感图形绘制与建模是计算机图形学领域研究的前沿领域。,3,一些有用信
2、息,先修课程: 线性代数,计算机图形学 联系邮件: 参考资料: 计算机真实感图形的算法基础,彭群生,鲍虎军,金小刚编著,出版社:科学出版社 实时计算机图形学(第二版),(Real-time Rendering),作者:Tomas Akenine-Moller,Eric Haines,翻译:普建涛,出版社:北京大学出版社 计算机图形学(第三版)(美)赫恩 等著,蔡士杰等 译 ,出版社:电子工业出版社 OpenGL 编程指南(原书第6版)作者:(美)施润尼(Shreiner,D)等著;徐波 等译,出版社:机械工业出版社,4,考核方式,课堂听讲回答问题 10% Project90% 独立完成一个真实
3、感绘制的程序 项目演讲-20分钟的讲解 提供一个范围,不局限于该范围,5,课程大致安排,共九次课,每次两个学时 第一讲 真实感光照模型(2学时) 第二讲 光线跟踪技术(2学时) 第三讲 辐射度方法(2学时) 第四讲 阴影处理方法(2学时) 第五讲 基于图像的建模与绘制(2学时) 第六讲 层次细节技术(2学时) 第七讲 相交测试与碰撞检测(2学时) 第八讲 真实感纹理映射技术(2学时) 第九讲 自然景物建模(2学时),6,计算机图形学重要内容,几何变换 二维观察 三维观察 三维对象的表示 可见面判别 光照 纹理映射,7,真实感图形建模与绘制,第一讲 真实感光照模型,8,真实感光照模型,9,真实感
4、光照模型,10,真实感光照模型,11,真实感光照模型,12,真实感光照模型,13,真实感光照模型,14,真实感光照模型,15,真实感光照模型,16,真实感光照模型,主要内容 光源 材质 简单光照模型 局部光照模型&全局光照模型 相关的面填充方法,17,光照的影响,光源发出的光照射到物体表面会出现三种情形: 1.经物体表面向外反射形成的反射光 2.若物体透明,部分入射光穿透该物体,形成的透射光 3.部分入射光被物体吸收,转化为热能 反射光和透射光可见。,入射光,透射光,反射光,18,光照的影响,反射光和透射光的光谱分布决定了物体表面呈现的颜色,强度决定物体的明暗程度; 入射光的光谱分布、强度,以
5、及物体表面对不同波长光的吸收程度决定了反射光、透射光的光谱分布和强度; 问题: 一个物体吸收除绿光外的所有波长的光 使用白光照射,它呈什么颜色? 使用红光照射,它呈什么颜色? 不能脱离入射光来讨论物体颜色。 通常假定入射光为白光。,19,光照的影响,若已知入射光在每一波长上的强弱和物体表面在各波长上对光的吸收率(入射光光谱分布,物体表面的反射率和透射率的光谱分布) 可根据环境中光源布置和物体的材料属性 计算反射光和透射光的颜色和强度。 难点:光谱采样和光谱到颜色的转换计算量过大。 简化,20,光照的影响,简化方法 假定入射光仅有R,G,B三种波长的光组成,因此只需考虑物体对这三种波长的光的反射
6、和透射; 假定入射光是白光,物体不透明,因此物体的颜色由其反射光决定; 物体反射光包括以下三个方面,21,光照的影响,环境光反射(Ambient Reflection ) 漫反射(Diffuse Reflection ) 镜面反射(Specular Reflection ),22,光照的影响,Ambient. Constant Ideal Diffuse Matte Lamberts Law Ideal Specular Mirror Reflection Law Specular Glossiness and Highlights Phong and Blinn Models,Types o
7、f Reflection Functions,23,光照的影响,Ambient Reflection 环境光也叫泛光 它模拟的是实际场景中,物体接受到从周围环境投射来得光,如房间的墙壁,天空等。环境光是一种分布光源,精确模拟计算量大,非常耗时,在简单光照模型中,我们可以用非常简单的计算方法对其效果进行模拟。,24,光照的影响,Ambient Reflection 在环境光反射中,我们首先假定光在环境中是没有方向的 物体的每一点被均匀照亮,没有明暗的区分 看起来像个物体的轮廓,跟无光不一样 在计算的时候,一般是设定一个全局的环境光强度, Ia 对于物体,需要设定一个能够反映其表面受环境光反射影响
8、的反射系数, ka. Ambient term is I = Ia.ka 在对环境光反射的模拟中, 没有遵循物理定理,只是效 果的模拟。,25,光照的影响,Diffuse Reflection 模拟光穿过物体表面,被部分吸收后,又重新发射出来的光 粗糙的表面,例如黑板,呈现出理想的漫反射特性,又叫Lambertian reflection. 观察者在任何方向观察,所观察到得漫反射光的强度都相等 对于给定表面,光照强度取决于光源和表面法线的夹角。,26,光照的影响,Matte: Ideal Diffuse Reflection Diffuse coefficient defined for ea
9、ch surface. Diffusely lit objects often look harshly lit Ambient light often added. Poor physical basis for diffuse reflection. Internal reflections inside the material etc,27,光照的影响,Mirror: Ideal Specular Surface,Law of Reflection,Calculation of the reflection vector involves mirroring L about N.,i,
10、r,r= i,28,光照的影响,Specular reflection 模拟物体表面对入射光的直接反射。镜面反射光亮度沿镜面反射的主方向最强,在该主方向的四周则逐渐衰减,形成一定的空间分布。,29,光照的影响,Specular reflection Can be observed on a shiny surface, e.g nice red apple lit with white light. Observe highlights on surface. Highlight appears as the colour of the light, rather than of the su
11、rface. Highlight appears in the direction of ideal reflection. Now view direction important.,30,光源,分类: 点光源,线光源,面光源,体光源 在计算机图形学中,常假定点光源照明 原因:容易确定到达被照射点的光能的大小,阴影计算 简单。 缺点:影响生成图形的真实性,例如阴影区域都千篇一律的具有尖锐的边界。 已有线、面光照模型的研究 T.Nishita, E.Nakamae, Half-tone representation of 3D objects illuminated by area sourc
12、e or polyhedron sources, IEEE, Proceedings of COMPSAC,1983 Poulin, J. Amanatides, Shading and shadows tieh linear light source, Proceeding of EURRGRAPHICS90,1990 H.J.Bao, Q.S.Peng,Two Shading Models for Linear and Area Light Source,Computer &Graphics,Vol. 17,No. 2,1993 etc,31,光源,点光源(Point source) Al
13、l light originates at one point. Rays hit planar surface at different incidence angles. 平行光源(Parallel source) All light rays are parallel. Rays hit a planar surface identical incidence angles. May be modeled as a point source at infinity. Also denoted as Directional source. 聚光灯(Spot source ) All lig
14、ht originates at one point. With a main direction and cut off direction.,32,光源,参数: openGL,DirectX中常见的一些光源参数 聚光灯:Sdir Scut Sexp,33,材质,第一行改变的是环境光,第二行改变的是漫反射强度, 第三行改变的是镜面反射强度,第四行改变的是镜面指数大小。,34,光照模型,Illumination& Lighting : transport of luminous flux from light sources via direct & indirect paths. compu
15、ting intensity reflected from 3D point in scene. Shading: assigning pixel colour.,Illumination Models: Empirical: simple approximations to observed phenomena. Physically-based: model actual physics of light interactions.,35,光照模型,Light Sources: Emittance spectrum (colour) Geometry (position and shape
16、) Directional attenuation Surface Properties: Reflectance spectrum (colour) Geometry (position, orientation, and micro-structure) Absorption Simplifications: Use only direct illumination from emitters to reflectors Ignore geometry of emitters, use only geometry of reflectors,Two Components of Illumi
17、nation,36,简单光照模型,Lambert漫反射模型 Matte: Ideal Diffuse Reflection.,Lambert余弦定律总结了一个理想漫反射物体在点光源照射下光的反射规律 Lambert余弦定律:一个理想漫反射物体表面上反射出得漫反射光的强度同入射光与物体表面方向之间夹角的余弦成正比。,Ip,当角度大于90度时,光源位于物体背面,因而该光源对被照射点的光亮度贡献为零,当入射角为零时,光源是垂直照射到景物表面上的,反射光的强度最大。,37,简单光照模型,Lambert漫反射模型 Matte: Ideal Diffuse Reflection.,Ip,eye,38,简单
18、光照模型,39,简单光照模型,The Phong model.,Assume specular highlight is at a maximum when = 0 , and falls off rapidly with larger values of Fall-off depends on cosn . n referred as specular exponent. For perfect reflector, n is infinite.,40,简单光照模型,The Phong model.,实际使用(N.H)代替(V.R) An alternative formulation us
19、es halfway vector, H Its direction is halfway between viewer and light source. If the surface normal was oriented at H, viewer would see brightest highlights. (为将入射光反射到观察者方向的理想镜面的法向量) Note , both formulations are approximations.,41,简单光照模型,The Phong model. Rough Surface : Microfacet distribution.,Phy
20、sical justification for Phong model is that the surface is rough and consists of microfacets which are perfect specular reflectors. Distribution of microfacets determines specular effects. Distribution of microfacets determines specular exponent.,42,局部光照模型&全局光照模型,Local vs Global illumination Local m
21、odel: Direct and local interaction of each object location with the light. Global model: Interactions and exchange of light energy between different objects.,43,局部光照模型,Ambient,Diffuse,Specular,Specular,Illumination model from slide before,44,局部光照模型,n=2,Phong model the effect of n,45,局部光照模型,Phong exa
22、mples,n小,n大,观察方向,46,局部光照模型,Extend empirical model as: (and replacing cosines),This is known as the standard LOCAL ILUMINATION MODEL,There may be a number of Point Sources,47,局部光照模型,Local Illumination Model Considers light sources and surface properties only. Approximations based on appearance. Fast
23、real-time interactive rendering. Havent considered light attenuation inverse square law but dont like exponentiation and doesnt always look right.,48,局部光照模型,Local Illumination Model Use 1/(s+k) where s relates to eye-object distance and k is some constant for scene. Can add transparency too, to give
24、 final empirical model as shown below: Note: must apply 3 times for each primary.,49,全局光照模型,Global Illumination,Extends the Local Illumination Model to include: Reflection (one object in another) Refraction (Snells Law) Transparency (better model) Shadows (at point, check each light source) Antialia
25、sing (usually means supersampling),50,面填充方法,Polygon Shading (Or surface rendering!) Up to this point we have discussed how to compute the illumination model at a point on a surface. At which point should we apply the model? Where and how often it is applied has a noticable effect on the end result.
26、Calculating the illumination model is costly, including several normalizations of vectors.,51,面填充方法,Polygon Shading Flat (constant) shading Evaluate the shading model once per polygon, use resulting color for all of its pixels. Gouraud shading Evaluate the shading model at each vertex, and linearly
27、interpolate resulting values inside the polygon Phong shading Evaluate the normal at each vertex, and linearly interpolate it inside the polygon. Having the interpolated normal at each point inside the polygon, we can use it to calculate the shading model in each point.,52,面填充方法,Flat (facet) shading
28、 Objects modelled as plane-faced polyhedra Assumptions: Source at infinity constant. Viewer at infinity constant. Polygon is not an approximation often incorrect and need smoother shading. If first two unacceptable, average . Illumination is usually calculated at the centroid of the primitive.,53,面填
29、充方法,Flat (facet) shading Works well for objects really made of flat faces. Appearance depends on number of polygons for curved surface objects. If polyhedral model is an approximation then need to smooth. 平面着色是最简单也是最快速的着色方法,每个多边形都会被指定一个单一且没有变化的颜色。这种方法虽然会产生出不真实的效果,不过它非常适用于快速成像及其它要求速度重于细致度的场合,如:生成预览动画
30、。,54,面填充方法,Mach banding. Physiological effect exaggerates difference between closely coloured polygons. Mach banding. Exaggerates intensity change at an edge with a discontinuity in magnitude. Our eyes are well adapted to seeing edges ! Using a finer mesh is surprisingly ineffective.,55,面填充方法,Find v
31、ertex normals by averaging face normals, or find analytically.,- Use vertex normals with desired lighting model, Interpolate vertex intensities along edges. Interpolate edge values across a scanline.,Ibc,Iac,A,B,C,Iac interpolated A to C, Ibc interpolated B to C.,Gouraud Shading.,56,Gouraud shading,
32、57,面填充方法,In Phong model of specular reflection, highlight falls off with cosn Gouraud shading linear interpolates makes highlight too big. Gouraud shading may well miss a highlight that occurs in the middle of the face.,Why Phong shading.,58,面填充方法,Normals are calculated for each vertex. Vectors are
33、interpolated across the face. Illumination calculated with interpolated normal vector, ie. lighting model applied each step.,Interpolated normals.,Assume polygon is approximation to curved surface.,Phong shading.,59,面填充方法,Phong example,60,面填充方法,Problems with computing vertex normals.,A,B are shared
34、by all polygons, but C is not shared by the polygon on the left. Shading information calculated to the right of C will be different from that to the left. Shading discontinuity.,Solution : introduce a ghost vertex that shares Cs values,Problems with interpolation shading.,A,61,面填充方法,Problems with computing vertex normals.,Face surface normals and averaged vertex normals shown.,Unrepresentative so add small polygon strips along edges or test angle and threshold to defeat averagin
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026排队打疫苗面试题及答案
- 2026三强争霸面试题及答案
- 2026上海广电面试题及答案
- 2026省考街道面试题及答案
- 合伙设备购买协议书
- 调解民事协议书
- 销售员签约合同范本
- 3.7 G92、G76指令讲解及应用
- 2026思维赋能面试题及答案
- 2026统筹岗位面试题目及答案
- 2026辽宁沈阳盛京金控投资集团有限公司招聘4人参考题库带答案详解AB卷
- 2026年职业技能大赛CAD机械设计技能竞赛理论考试重点试题库
- 2026暑假离校前校长在全体教职工大会上讲话:圆满收官迎暑假凝心聚力再出发
- 2026年广东省惠州市惠城区中考模拟道德与法治试题(含答案)
- 昆明空港投资开发集团有限公司2026年招聘笔试题库
- 2026年江苏省南通市如皋市初中毕业、升学模拟考试试题英语 含答案
- 汉坦病毒临床分型与诊疗方案
- 2026年江苏省南通市【中考数学】试卷 含答案
- 神经重症监护中的多学科协作护理
- 起重机控制手柄维护规程
- 2025-2026学年中图版(北京)七年级地理下学期全册(教案设计)
评论
0/150
提交评论