Friday, February 19, 2010

Errors in standard specular reflection functions.

가끔은 내가 여지껏 의문 없이 믿고 쓰던 것들에 대해 근본부터 의심을 해봐야 할때가 있는 것 같다. 그 중 요즘 강하게 의심하는 하나가 일반적으로 우리가 믿고 사용하고 있는 standard specular reflection functions와 intensity rate between diffuse and specular이 아닐까 한다.

지금 일반적으로 쓰고 있는 거의 모든 specular()들은 light vector, camera vector, surface normal vector를 가지고 BRDF 입각해서 cosine 커브를 이용한 수학적 트릭으로 사용이 간편하고 계산시간이 상당히 빠르기에 70년대부터 조금씩 발전되어 오면서 여지껏 잘 써왔던것 같지만 어느 부분에서는 사실적인 접근에 한계를 보이지 않았나 싶기에 다시금 근본부터 생각해 보았다.

Pixar Ratatouille에서도 방금 요리해온 촉촉한 음식의 맛을 시각으로 살리기위해 접근 했던 부분 중에 하나가 보다 사실적인 surface highlights 였던것을 보면 같은 이치라 생각 할 수 있을 것 같다.

내가 생각하는 standard 한 방식의 문제점은 내외적으로 살펴 볼 수 있겠는데, 첫째 외적인 요소로 보면 point light emitter 의 한계성에서 오는 문제로 다양한 shape과 type의 light emitter를 받쳐 주기에는 상당한 한계를 보이는 부분이 아닐 수가 없는 것 같다. (모든 lights를 point emitter로 가정하에만 계산을 하기에)

둘째로 내적인 요소에서 보면 과거 70, 80년대에 상대적으로 느렸던 하드웨어에서 쓰기위해 빠른 계산이 우선시 되었던 상황에서 수학적 트릭으로 이루어진 functions이다 보니 high frequency reflection으로 갈 수록 광원에 의한 반사관계의 정확성이 떨어졌던 것도 사실이다.

다시말해 광원에 대한 reflection인 specular 영역에서 mirror reflection에서 glossy reflection으로 갈때 가장 에러율이 높은 사각지대가 되지 않나 싶고 반면 100% diffuse reflection에서 glossy reflection으로 갈때가 가장 에러율이 낮아 사실적인 specular를 표현 할 수 있지 않나 싶다.

안타깝게도 현재 우리 주위의 물체의 surface attribute은 상당수가 이 mirror reflection과 glossy reflection사이에서 반사관계를 가지는 material들이 많다는 것이다. 여기에는  transparency를 가지고 있는 mirror reflection 성질의 코팅된 mixed media들을 포함 할 수 있겠는데 이런 물체들은 플라스틱부터 코팅된 종이, 도색된 자동차, 페인트 된 나무, 그리고 물에 젖어 있는 물체까지 우리 주위에 흔히 볼 수 있는 물건들이 포함 된다. (참고로 이런 물체들은 fresnel효과가 상당히 강하다는 것을 잊지 말기를.....)

이런 high frequency reflection성질을 가지고 있는 물체를 가지고 간단히 비교를 해 본다면, HDRI에서 얻은 광원의 specular reflection과 surface shader에서 제공하는 specular reflection을 비교 rendering시에 그 차이는 분명해 질 것이다.

뿐만아니라 현실 세계와 비요해 diffuse와 specular의 빛에 대한 반사 intensity의 수치적인 관계가 부정확하다는 것과 over-specular intensity 따르는 여러 광학적 효과부분에서도 전적으로 후반작업으로 의지하는 것보다 어느정도 책임을 져야 하지 않나 싶다.

야외 태양광 아래서 100% pure diffuse white 석고상과 mirror ball을 보면 석고상의 가장 하이라이트 부분은 (1, 1, 1)이하로 보여지지만 미러볼의 하이라이트는 눈뜨고 볼 수 없을 정도의 강도로  보여진다. 반면 3D CGI 같은 상황에서는 어떨지 생각해보면 반사 강도의 관계가 상당히 다르게 산출 된다는 것을 알 수 있을 것이다.

현 재의 specular reflection function은 20~30년 역사를 가지고 아직도 잘 쓰고 있지만은 이제 한단계 진보 해야 하지 않나 싶어서 얘기를 꺼내 보았다.


The following is part of Siggraph 2007 Course 30 / Inside Ratatouille's Kitchen.

Color: realize that the highlight is reflecting off the outer transparent liquid layer, not the underlying food. Transparent liquids generally reflect light without modifying its color (as opposed to a metallic surface in which the reflections take on the surface color). So even if the food is a deep red or green you will still get a neutral highlight from the liquid.

Intensity: If you have a really bright light then you would expect to see an equally bright highlight on the food, but not every highlight needs to be so strong. In addition to the main highlight you will see secondary highlights and reflections of the room. These subtle highlights really add shape to the food (especially in motion because they are view dependent) and they are equally important in creating a convincing wet look.

Shape: notice the shape of the highlights on food. The highlights are broad and broken-up, letting you see fine ridges and shape changes in the surface. The first inclination might be to use specular light to create these highlights, but a traditional specular highlight is often inadequate for creating wet highlights. The only real control you have over the shape of a specular highlight is the roughness parameter. Low roughness produces a sharp, focused highlight that is too small (figure 5b). To make the highlight larger you must increase the roughness. But high roughness produces a broad smooth highlight that does not adequately break up to show off surface detail; it creates a semi-shiny plastic look or waxy look but not a wet look.

Size: a small reflection texture will produce an effect similar to a tight specular reflection. A large texture with sharp edges produces a studio lighting effect or a window highlight with broad highlights that abruptly break up based on the surface angle, which is usually the best starting point for creating a wet look.

Softness: We can control the size of the reflection texture vs. the width of the falloff at its edges, and this is perhaps the most important element in controlling the overall feeling of the highlight (in contrast, a traditional specular highlight always falls off from its center – it is not possible to define a broad center to it). Very soft highlights produce a shiny, waxy appearance that is appropriate for things like an apple or the outer layer of a red onion. You can produce this using a texture with very soft edges; the effect resembles a specular reflection with high roughness. Broad, sharp reflections produce a wet look (figure 5d). By slightly blurring the edges of the reflection texture you can soften the overall look while still maintaining shape in the reflections.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home