Monday, March 29, 2010

The structure of DOF & 3D motion blur comparing to RenderMan & Mental Ray (2)

(아래 쭈~욱 내려가면 전글이 있으니 먼저 읽어 보시길 바랍니다. 고등학교 화학 선생님이 노트필기 한 것 보고 "너 토끼냐!" 하는 소릴 듣던 생각이 나네요^^)

전글에는 pure ray-tracing rendering에서 DOF와 3D motion blur가 추가 됐을시에 primary visibility ray 개수가 자연 스럽게 늘어나는 실제의 physical적인 구조의 문제 때문에 생기는 비용에 대해 비평(불평)을 썼었고 이제 Renderman에서 마법같이 이 두 effects를 어떻게 트릭해 나갔는지에 대해 써나갈 차례인것 같다.

이것 역시 REYES algorithm architecture의 잇점에서 오는 축복 받은 효과라 말 할 수 있겠는데 micropolygon-based Reyes의 decoupling sampling process가 이번에도 그 이유의 중심에 있겠다고 말 할수 있겠다. 이전글들을 읽어 보면 알겠지만 거의 모든 Renderman의 주요 장점들은 micropolygon-based의 decoupling shading and sampling에서 오는 것을 눈치 챘을 것이다. 그만큼 Renderman rendering algorithm의 heart라 말 할수 있는 부분이 아닐 수 없겠다.

이는 sampling까지 도달 직전, 이전의 모든 rendering 과정에서 이 motion blur를 위해 Renderman에서 해주는 것은 단지 primitives 로 부터 받은 linear moving transformation or deformation transformation만(multi motion sampling이 필요시에는 그 motion path에 key frames도 같이) sub-divided geometry 즉 a grid of micropolygons까지 positional data로 the beginning and the ending of the moving path을 전달시켜 주고 shading 조차 open shutter frame에서 한번만 해주므로 거의 전체 rendering 과정에 부담을 주지 않는 다는 것이다. 결국 beginning and ending의 positional data, 그리고 open shutter frame 때의 Ci와 Oi 값만 한입 가득 문 각각의 모든 micopolygons에대해(그렇다고 shading후 bursted 된 각각의 micropolygons에 그 positional data of motion path를 일일이 주었다고 생각지는 않는다. 예상컨데 상위단위인 a grid 그룹별로 그 데이타를 갖게하고 존속 시켰을 것 같다.)  random time으로 sampling만 해주어 motion blur 효과를 내게 되는 것이다. 오로지 rendering에 부담을 주는 부분은 오브젝트가 움직이기에 anti-aliasing을 위한 sampling 개수의 증가와 더불어 filtering 할 범위의 증가가 요구되는 것과 moving primatives를 rendering되는 bucket block안에 포함시키기 위한 motion path 만큼 bounding box가 커지는 것  뿐이겠다.

Depth of field in Renderman 역시 같은 방식으로 접근을 하는데 다른점은 motion path에 대한 information이 빠지기에 그냥 shading까지 일반 rendering처럼 가다가 shading 끝난 직후 sampling 단계에서 기존의 pinhole 방식이 아닌 lens때문에 발생된 focal length로 인한 DOF 효과를 만들기 위해 shaded micropolygons을 움직여서 효과를 내게 되는데 이는 가상 렌즈, 즉 imaginary lens surface에서 x, y축으로 random한 방향으로 focal plane로부터의 distance에 따라 움직이는 범위가 달라지면서 sampling이 이루어지게 된다. 간단히 compositing tool에서 우리가 anti-aliasing된 z-distance 버퍼를 이용해 blur정도를 콘트롤 하여 DOF를 주는 것과 비슷하다고도 볼 수 있는데 다른 점은 renderman에서는 blur effect가 아닌 shaded micropolygons를 focal plane으로 부터의 z-distance에 따라 움직여 sampling 하여 얻는 다는 것이다.

최근 Renderman 버전에는 기존 depth of field 효과에 lens의 physical 적인 구현이 안됐었던 Bokeh effect가 추가 된것으로 알고 있는데 아직 사용해 보지 않아 뭐라 얘기 하기는 그렇지만 기존의 renderman의 depth of field계산 시간과 그리 차이 나지 않을 것이라고 예상 할수 있겠다.

사실 많은 3D studio들이 비쥬얼적으로 편리한 compositing tool에서 post-process로써 depth of field 효과를 내지 3D rendering에서 같이 쓴다고 생각지는 않는다. Pixar에서 발표한 문서중에 GPU와 연동하여 리얼 타임으로 DOF를 콘트를 하는 것을 얼핏 본 것 같은데 아마도 Pixar는 3D rendering에서 DOF 효과를 주지 않나 싶다.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home