Wednesday, September 23, 2009

Gamma correction issue in 3D CGI rendering

gamma correction이 issue가 된 원인을 살펴 보면 renderer내에서는 아무런 gamma correction에 대한 issue꺼리가 없다. 하지만 renderer밖에 있는 이미지 데이타(as texture or image based light)가 3D renderer로 input으로 들어 올 때와 그 데이타를 가지고 rendering 되어 final render output으로 나와서가 문제가 된다. 책임을 따지자면 먼 옛날 브라운관이 발명 될 때로 돌아가 보면 부족한 8bit color depth를 매꾸어야만 하는 상황에서 나온 나름 똑똑한 방식으로 나왔기에 책임을 물을 수는 없는 것 같다. 그냥 기술이 발전되는 과도기에서 나온 happening이라고 말 할수 있을 것 같다. 그렇다고 그냥 happening이라고 말하기에는 그간 10년 넘게 우롱 당해온 3D CG 일반유저가 가엽다고나 할까?

재밌는건 밖의 2.2gamma correct된 이미지(Textures)가 renderer안에 들어와 마지막 render pixel화 단계에서 gamma correct 안되면서 그 보이는 것보다 밝에 들어온 texture가(gamma correction 때문) 파이널 렌더링에서 모티너의 gamma때문에 감추어 진다는 것이다. 그래서 일반유저가 볼때는 아무런 문제가 없는 듯 보인다. 하지만 render내부에서 계산되어지는 rendering, shading, lighting 모든 것들이 linear로 계산되기에 잘못 된 최종 아웃풋을 렌더링 하게 되어 지는 것이다. 다시 말하면 잘못된 쉐이딩 라이팅의 값과 비슷하게 맞아 떨어진 texture값의 아웃풋이 우리가 흔히 보는 3D rendered images인 것이다. 그럼 2.2 gamma corrected texture 대신 원형 그대로인 linear space의 texture 쓰게 되면 그 문제점이 확연히 들어난다. 가까운 예를 들면 HDRI를 texture나 env map으로 사용하면 알 수 있을 것이다.


The standard image processing calculations that might be applied to an image, such as blurring, resizing, or composting, all work best if the data is "linear," that is, has no built-in gamma correction. For this reason, it is usually best for high-quality images to be stored with no gamma correction and to apply correction as the image is being loaded into a display.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home