Sunday, August 22, 2010

Global Illumination in 99 lines of C++

http://www.kevinbeason.com/smallpt/

Features

  • Global illumination via unbiased Monte Carlo path tracing
  • 99 lines of 72-column (or less) open source C++ code
  • Multi-threading using OpenMP
  • Soft shadows from diffuse luminaire
  • Specular, Diffuse, and Glass BRDFs
  • Antialiasing via super-sampling with importance-sampled tent distribution, and 2x2 subpixels
  • Ray-sphere intersection
  • Modified Cornell box scene description
  • Cosine importance sampling of the hemisphere for diffuse reflection
  • Russian roulette for path termination
  • Russian roulette and splitting for selecting reflection and/or refraction for glass BRDF
  • With minor changes compiles to a 4 KB binary (less than 4096 bytes)

사실 Ray-tracing engine기반의 renderer 만큼 straightforward 한건 없는데 path tracing을 이렇게까지 간단해 질 수 있는지는 몰랐다. 물론 불필요한 부분은 다 잘라 냈으니 그렇겠지만 위의 features에서 보듯이 필요한 중요한 부분들은 거의 있다고 볼 수 있다. 게다가 단순화된 오픈소스라 path tracing 기반의 GI renderer가 어떻게 연동 되는지 이해하는데 많은 도움이 될 것이라 생각 된다.

이번 siggraph 2010, production부분에서 이미 소개 되었 듯이 path tracing 기반의 GI rendering 방식은 sony pictures를 중심으로 헐리우드 퀄러티 스튜디오에 들어와 자리를 잡았고 하드웨어의 발전에 따라 점점 확대해 나간다는 것에 대해서 의심의 여지가 없는지라 관심을 기울어야 할 필요가 있다.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home