RTIOW-ch12:Where next

制作书籍的封面图:

cpp:

最终运行效果:

200乘100大小,每个像素点10条采集光线,运行时间2分钟:

2000乘1000大小,每个像素点100条采集光线,运行时间14小时:

虚拟世界真是有趣,再放一张没有水印的:

 

我们已经有了一个很酷的光线追踪器,接下来做些什么呢?

1. Lights. You can do this explicitly, by sending shadow rays to lights. Or it can be done implicitly by making some objects emit light,

2. biasing scattered rays toward them, and then downweighting those rays to cancel out the bias. Both work. I am in the minority in favoring the latter approach.

3. Triangles. Most cool models are in triangle form. The model I/O is the worst and almost everybody tries to get somebody else’s code to do this.

4. Surface textures. This lets you paste images on like wall paper. Pretty easy and a good thing to do.

5. Solid textures. Ken Perlin has his code online. Andrew Kensler has some very cool info at his blog.

6. Volumes and media. Cool stuff and will challenge your software architecture. I favor making volumes have the hitable interface and probabilistically have intersections based on density. Your rendering code doesn’t even have to know it has volumes with that method.

7. Parallelism. Run N copies of your code on N cores with different random seeds. Average the N runs. This averaging can also be done hierarchically where N/2 pairs can be averaged to get N/4 images, and pairs of those can be averaged. That method of parallelism should extend well into the thousands of cores with very little coding.

 

参考书籍:《Ray Tracing in One Weekend》

RTIOW系列项目地址:GitHub

RTIOW系列笔记:

RTIOW-ch1:Output an image

RTIOW-ch2:The vec3 class

RTIOW-ch3:Rays, a simple camera, and background

RTIOW-ch4:Adding a sphere

RTIOW-ch5:Surface normals and multiple objects

RTIOW-ch6:Antialiasing

RTIOW-ch7:Diffuse Materials

RTIOW-ch8:Metal

RTIOW-ch9:Dielectrics

RTIOW-ch10:Positionable camera

RTIOW-ch11:Defocus Blur

RTIOW-ch12:Where next