【发布时间】:2014-06-18 12:34:21
【问题描述】:
我想知道有光线追踪经验的人是否可以帮助我找出程序中的几个问题,但是我不能发布太多代码,因为这个程序是学校作业。我只是想知道我是否可以得到一些可以帮助我朝着正确方向前进的提示。所以提前谢谢!
首先)如您所见,下面我的光线追踪图像中有大量噪点。该场景由一个悬停在平面上的三角形组成。还有一个点光源。
第二)当我计算阴影光线时不会出现噪点,但是它会为阴影计算错误的颜色。
我的光线追踪算法:
for each pixel,
color c;
for each shape in the scene
send a ray through each pixel and see if it collides with a shape
if it does
color = calculate color of ray
else, color = background color
return color
To calculate color of ray...
color c = 0,0,0 // rgb
for each light source in the scene
make a new ray (shad_ray) that starts at where the original ray hit the shape...
... and ends at the light source
see if the shadow ray hits a shape on its way to the light
if it does,
calculate ambient color using ambient color of shape material and...
... ambient light intensity
if not,
calculate shading with sum of ambient/diffuse/specular components
我知道这是对算法的非常松散的描述。但如果需要,我可以提供更多信息。
【问题讨论】:
-
我想如果你知道专业的光线追踪引擎也存在严重的噪音问题,你会感觉更好:brigade.otoy.com/gtc/brigade/2014/03/28/…——观看他们的视频;他们承认这个问题,但尚不清楚他们何时/是否会找到不影响图形质量的可接受解决方案。也许他们需要 GPU 上更高位深度的浮点硬件?
标签: graphics raytracing