Ray Tracing.pptVIP

  • 21
  • 0
  • 约 16页
  • 2016-08-22 发布于河南
  • 举报
Ray Tracing

Ray Tracing 射线追踪 关于射线追踪的简介 主要内容 射线追踪是什么 其原理及导出公式 其用途(代码,参数,物理意义) 什么是射线追踪?? 基本定义 射线追踪技术是光学的射线技术在电磁计算领域中的应用,能够准确的考虑到电磁波传播的各种传播途径,包括直射、反射、绕射、透射等,能够考虑到影响电波传播的各种因素,从而针对不同的具体场景做准确的预测。 射线追踪的原理 射线追踪技术的基本原理基于电磁波的高频假设,即认为在频率较高的情况下,电磁波可简化为射线,从而使光的理论比如反射定律、折射定律、光程定律等研究电磁传播特性。同时,在障碍物的边缘,引入绕射理论对电磁波的绕射情况进行分析,常用的是一致性绕射理论(UTD)。射线追踪技术采用特定的算法计算射线的轨迹,常用的两类算法是镜像法和发射射线法。 镜像法和发射射线法 2.two 发射射线法就是把发射场简化为离散的射线,然后计算每一条射线的轨迹。 关于镜像法和发射射线法 镜像法具有较高的计算精度,但是发射射线法则具有较快的计算速度。 在得到到达接收点的每条射线的轨迹之后,就可以计算出它们的 幅相 和 时延特性,将这些场分量叠加,就得到接收点的场。 注: 由于计算高阶射线需要耗费更多的时间和内存资源,因此射线追踪算法还要在计算精度和计算时间之间做出均衡,取舍合理的截断次数。通常反射线的截断次数取4-7阶,绕射线的截断次数取1-3阶。 单晶绕射 Basic ray tracing The simplest kind of ray tracing, nonrecursive ray tracing, involves casting rays of light from the view position throug pixel positions. A local lighting model is used to calculate the illumination of the surface intersected by the ray. Here is the main program for basic recursive ray tracing: RayTraceMain(){ //Let x be the position of the viewer. //Let maxDepth be a positive integer. For each pixel p in theviewport,do{ Set u= unit vector in the direction from x to p. Call RayTrace(x,u,maxDepth); Assign pixel p the color teturned by RayTrace. } } The recursive ray tracing is given next. RayTrace(s,u,depth){ //s is the starting position of the ray. //u is unit vector in the direction of the ray. //depth is the trace depth. //Return value is a 3-tuple of color values(R,G,B). //Part 1-Nonrecursive computations Check the ray with starting position s and direction u against the surfaces normal at the intersection on point. If no point was intersected { Return the background color. } Forr each light{ Generate a shadow feeler from z to the light. Check if the shadow feeler intersects any object. Set δi and δ appropriately. } Set color = Ilocal ; // Use equation IX.7 // Part II - Recursive computations If ( depth==0 ) { Return color;

文档评论(0)

1亿VIP精品文档

相关文档