Efficient GPU Screen-Space Ray Tracing

http://jcgt.org/published/0003/04/04/paper.pdf

一个号称只有2ms的实时gpu光线追踪

screen space reflection用到了

和其他ray tracing的区别是 scene data 只用了depth buffer

setp 超过depth 就算hit

 

jitter可以补偿 间隔sample 产生的带状artifacts

 

看下来也没那么难 给了代码

核心DDA方法是这个

def drawLine(x0, y0, x1, y1):

if x1−x0>y1−y0:

  slope = y1−y0 x1 − x0

  for t = 0 to x1 −x0:

  setPixel(x0 +t,y0 +t ·slope) 

else:

  slope = x1−x0 y1 − y0

  for t = 0 to y1 −y0:

  setPixel(x0 +t ·slope, y0 +t) 

用这个可以算出3D point对应的 2D光栅化的点 

然后推了个公式出来 代码就是直接套这个公式了

Q′(x,y) = (Q·k)(x,y)/k(x, y) 

讲了很多细节

posted on 2018-08-11 21:59  minggoddess  阅读(482)  评论(0编辑  收藏  举报