tag:blogger.com,1999:blog-43957080017760001422024-02-20T04:15:29.395-05:00Painting with Light on Chalkboardby Ian W, who is a lighting technical artist and a look/shader developer.Unknownnoreply@blogger.comBlogger75125tag:blogger.com,1999:blog-4395708001776000142.post-32358918514331482002012-01-23T19:55:00.004-05:002012-01-24T09:04:59.984-05:00Happy New(설) Year with the 2012 Resolution!아직까지 나를 대표 한다는 몇 분짜리 영상은 회사에서 셋업해준 텍크닉이 범벅되어 그들 보기 좋게 포장된 데모릴뿐이라는게 안타깝다. 내가 평가 될 때 내가 속 한 /그 /곳/이 평가 기준이 된다는 것 또한 거절 하고 싶다. 달콤한 그 알을 깨고 나와 알몸으로 스스로를 먼저 평가하는게 순서 이기에 이제 두손 모아 금간 자리를 두둘겨 볼까 한다. 새 둥지를 튼 이곳 뉴욕에서 나와 같은 생각 하는 사람들을 만났다는 것만으로도 앞으로 벌어질 일들에 흥분하기 시작했다.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhX1CZKzITdeWUNkiT2nGzAg7UyrSfAq4HmXVxW2erLJeS1owHH85gZ5aKf1Cib9wWKFFbmqC1_gkTYHYfMJemqQdyOhraLCoMzn7uWhTKs8h7uDC4gvqq6RtM4EtE7cLNCLfNqxy_erpw/s1600/518942180_e4f0a0eeac+%25281%2529.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="213" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhX1CZKzITdeWUNkiT2nGzAg7UyrSfAq4HmXVxW2erLJeS1owHH85gZ5aKf1Cib9wWKFFbmqC1_gkTYHYfMJemqQdyOhraLCoMzn7uWhTKs8h7uDC4gvqq6RtM4EtE7cLNCLfNqxy_erpw/s320/518942180_e4f0a0eeac+%25281%2529.jpg" width="320" /></a></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4395708001776000142.post-91736381316432032402011-10-05T03:54:00.002-04:002012-01-23T20:57:34.647-05:00131년 역사의 코닥131년역사의 코닥이 위태롭다고 한다. 디지탈 시대에 빠른 대응을 못 했서라고 하지만 코닥이 가진 100년된 항아리에 서식하는 곰팡이에서 깊게 우려 나온 칼라재현기술을 아직 디지탈이 대체하기에는 넘 빠르지 않나 싶다. 디지탈 칼라발전을 위해서도 늘 같이 공존하며 함께 가야 하는데 많이 많이 안타갑다.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4395708001776000142.post-7045944678420964632011-08-01T04:08:00.000-04:002011-09-25T14:56:15.578-04:00Radiance knowledge database<a href="http://www.radiance-online.org/">http://www.radiance-online.org/</a><br />
<br />
Radiance is a quantity in Physics (like voltage or length), specifying the amount of energy radiated in a given direction from a surface. Mostly used with non-ionizing, electromagnetic radiation in the visible spectrum (light), ultra-violett (UV) or infrared (IR). More precisely, it's defined as radiated power over solid angle and "projected" area, the SI unit being [Watt/(m2 sr)].<br />
<br />
Radiance is also the name of a physically based rendering package written largely by Greg Ward, initially at LBNL, EPFL, then SGI, now running Anyhere Software. It is a physically-based, image-generating, backward raytracer with very a powerful rendering engine. It is used worldwide for lighting analysis and can generate accurate values for radiance/luminance (W/sr.m²,cd/m²) and irradiance/illuminance (W/m,Lux).<br />
<br />
Radiance라는 physically-based spectral rendering으로 방식을 추구하는 renderer를 중심으로 spectral color rendering 전반에 대한 학술적인 정기모임에서 발표 했던 자료들을 정리 해 올려 논 싸이트다. 프로덕션에서 굴리기에는 아직 너무 앞선 방식이지만 멀지 않은 미래의 거의 모든 renderer들의 목표가 되는 physically-based accurate color reproduction의 구심점이 되지 않을까 한다.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4395708001776000142.post-57219055869963675892011-06-20T17:01:00.000-04:002011-07-13T03:53:04.175-04:00Two important notes for shading:'Surface Reflectance Recognition and Real-World Illumination', and 'Making Shaders More Physically Plausible<strong>Surface Reflectance Recognition and Real-World Illumination:</strong><br />
<a href="http://ssg.mit.edu/ssg_theses/ssg_theses_2000_2009/Dror_PhD_8_02.pdf">http://ssg.mit.edu/ssg_theses/ssg_theses_2000_2009/Dror_PhD_8_02.pdf</a><br />
<br />
<strong>Making Shaders More Physically Plausible:</strong><br />
<a href="http://www.tricity.wsu.edu/cs/boblewis/pdfs/1993_plausible.pdf">http://www.tricity.wsu.edu/cs/boblewis/pdfs/1993_plausible.pdf</a><br />
<br />
Illumination shading models에 관심이 있다면 위의 두 노트는 /반/드/시/ 읽어야 할 목록이 될 것이라 본다. 1993년에 쓰여진 두번째 노트는 이제서야야 ILM을 선두로 바꾸기 시작한 Physically-based shading models in terms of Energy Conservation에 대한 토대가 된 노트이다. 듣기로는 이번 RenderMan Pro Server 16.0에도 추가 된 것으로 알고 있는데 앞으로 거의 모든 Renderer들의 energy conservating shading model의 형태로 발전 되어 진다는 것에 의심의 여지가 없다고 본다. 아쉽게도 이 노트는 너무 원리 위주의 수학적 풀이로만 설명해 나서 보다 쉽게 설명한 'Crafting Physically Motivated Shading Models for Game Development' by Naty Hoffman와 같이 보는게 좋을 것 같다. 사실 기존의 phong, blinn에서의 specular BRDF 방식과 a normalization factor를 사용한 Energy Conservating shading models에서 수학적 계산의 차이는 그리 크지 않아 보인다.<br />
<br />
우리의 무지에서 못 쓰고 있었던 것이 분명한 것 같은데.... 17년전부터 Robert Lewis가 고치라고 얘길 했건만.... 이유는 아티스틱 관점의 작업 방식이 주를 이르며 만든 그럴 듯한 결과물에 만족해 왔었고 low dynamic range가 illumination 시작점부터 rendering equation을 지배 했었기 때문에 골치 아프게 쓸 필요성을 못 느끼고 있었던 것이다. 지금같이 반토막짜리이긴 하지만 HDRI를 input의 한 영역으로 쓰는 이 시대에선 아티스틱 방식으로 풀기에는 오류의 범위가 점점 커져 가기 때문에 점점 이슈가 되어가는 것이다. 당연 과학적인 접근 방식이 전적으로 필요로 한 부분이라는 것을 명심하길 바란다.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4395708001776000142.post-78489778658714092882011-06-06T13:47:00.000-04:002011-08-14T23:54:01.334-04:00Visualizing the XYZ Color Space by Sony imageworks<a href="http://www.youtube.com/watch?v=x0-qoXOCOow&feature=BFa&list=FLq3PIgs1JABA&index=19">http://www.youtube.com/watch?v=x0-qoXOCOow&feature=BFa&list=FLq3PIgs1JABA&index=19</a><br />
<br />
Color space의 standard는 RGB-based가 아니다. RGB color space는 final output for a display를 위한 것이지만 아이러니하게도 다루기 편하고 직관적이라는 이유로 지금 거의 모든 2D뿐만 아니라 3D CG imaging systems을 장악하고 있다. 게다가 사무용 컴퓨터 모니터에 맞춰 HP와 MS에 의해 표준화된 sRGB의 무서운 보급은 알게 모르게 우리가 그 좁은 color gamut에 놀아 나게 된다는 것이다. output-referred RGB color space 상황에서 작업의 최대 단점은 터치를 하면 할 수록 realistic look에서 멀어져만 간다는 것이다. 이유인즉, 이미 칼라로써 고유의 빛 성질을 잃어버려 display에 맞춰 mix 되어 버린 최종 output용 color values이기 때문이다. 다시말해 위해서 말했듯이 output-referred, 혹은 device-dependance이기 때문이다. 후반작업에 있어 아트스트들의 무모한 열정에 적절한 제한이 필요한 이유이기도 하다.<br />
<br />
예를 들면, 흔히 photoshop 혹은 typical compositing tools 같은 RGB color space based에서 contrast를 조절하는 방식이 잘 못 되어 있다면 믿을 수 있겠는가? illumination 관점에서 contrast는 light photon의 총 amount를, 즉 luminance value의 range만을 특정한 중간값을 기준으로 줄여 만들어야 하지만 RGB color space에서는 RGB values 전부를 동시에 바꾸므로 color의 saturation 까지 영향을 받게 만드는 것을 쉽게 볼 수 있다. 게다가 sRGB상태라면 숨은 gamma 값까지 영향을 끼칠 것이다.<br />
<br />
반면 CEI XYZ color space는 absolute device-independance로 color spaces의 standard라고 볼 수가 있겠는데 특히 우리 눈이 볼 수 있는 color gamut 전 영역을 표현 할 수 있고 다른 color space로 conversion이 쉽다는 장점이 있다. 특히 또한 spectral energy가 RGB color로 전환시에 생기는 negotive color values에서 자유롭고, 그리고 output-referred representations가 아닌 scene-referred라는 것. 이런 저런 이유에서 color enhancement가 요구되는 후반작업시, 특히 color grading for digital film 작업시 RGB color space 보다 효율적인 작업 환경이 아닌가 싶고 몇몇 하이엔드급 툴들과 거의 모든 digital camera의 image processing은 XYZ color space를 쓰고 있는 것으로 알고 있다.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4395708001776000142.post-83823729066748632352011-05-31T20:52:00.000-04:002011-06-22T13:04:34.096-04:00FilmLight Color Workshop<a href="http://www.youtube.com/watch?v=LuPTmpioROk&feature=related">http://www.youtube.com/watch?v=LuPTmpioROk&feature=related</a><br />
<a href="http://www.youtube.com/watch?v=jd2sawwHpQI&feature=related">http://www.youtube.com/watch?v=jd2sawwHpQI&feature=related</a><br />
<a href="http://www.youtube.com/watch?v=ONH8VrlesRA&NR=1">http://www.youtube.com/watch?v=ONH8VrlesRA&NR=1</a><br />
<br />
몇년전 인터넷 뉴스에서 위 workshop동영상 회사인 FilmLight의 truelight color management system을 ILM에서 쓰기 시작 했다는 소식을 들었다. color system은 처음 light가 spectal color를 as input으로 보내는 시작점부터 그 light photon과 wavelength가 coloring 과 imaging 그리고 color enhancement 과정을 거쳐 마지막 final output for a particular display로 손실 없이 안전하게 color gamut과 tone을 RGB values로 전환 될때까지 전체 과정을 관장해야 하는 중요한 base system중에 하나가 아닐까 한다. 아쉽게도 아시아에 있는 CG 스튜디오들이 이런 부분에 상당히 약하다는 것을 알고 있다. 뭐 여기도 큰 스튜디오 빼고는 상황이 같다고 본다. 그런 중요성을 누구보다 더 잘 알고 있는 ILM이 쓴다는 얘기는 그만큼 믿음을 주지 않을까 한다. 출처는 모르지만 그 회사에서 했던 color workshop 동영상 인것 같다. 이쪽 공부를 하면 할 수록 coloring pipelines & systems이 얼마나 중요한지를 인지 안할수가 없고 반면 3D CGI에서 그간 얼마나 무성의하게 해 왔는지도 알게 되는 것 같다.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4395708001776000142.post-60755026416098842372011-05-31T20:44:00.000-04:002011-06-06T01:28:40.455-04:00The lost thing (short film)<span style="background-color: white;"></span><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMHVH3VGKocYJnxRM9eOvEJ42f_6z4SByf5jsySfk3kKBybXkmtiNds6y-TN-jZ0oKwfADtc67vntIyua9EZaFFYzyJbp6ViIOuQws5JA_1o9b6h1u7fYbIxatvy9xRI8R9_n6vhg15bk/s1600/the-lost-thing.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320px" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMHVH3VGKocYJnxRM9eOvEJ42f_6z4SByf5jsySfk3kKBybXkmtiNds6y-TN-jZ0oKwfADtc67vntIyua9EZaFFYzyJbp6ViIOuQws5JA_1o9b6h1u7fYbIxatvy9xRI8R9_n6vhg15bk/s320/the-lost-thing.jpg" t8="true" width="320px" /></a></div><div style="text-align: center;"><a href="http://www.thelostthing.com/">http://www.thelostthing.com/</a></div><br />
한국을 떠나기 전에 마직막으로 샀던 그림 책이 이 The lost thing 이였었다. 그간 까맣게 잊고 지내다 요 며칠전 오스카 단편 부분 수상작이라기에 봤더니 그 잊고 지냈던 그림들이 움직이고 있었던 것이다. 색다른 감동이랄까? 내게 the lost thing은 한국에 두고 온 책이 아닐까 한다. <br />
<br />
애니메이션에서 정말 무엇이 중요한지를 다시금 일깨워 주는 듯 하다. 무엇보다 헐리우드의 뒷 모습만 쫓으려 하는 세계적인 추세에 우리에게 좋은 방향을 제시 해 주지 않았나 싶다.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4395708001776000142.post-18934838068856758742011-05-30T21:29:00.001-04:002011-06-15T17:18:50.147-04:00Radiometry and photometry (from light to color)Radiometry is the science of physical measurements of electro-magnetic quantities such as the energy or power of radiation. It measures the amount of light at each wavelength using the SI unit of power[watt =W] and is concerned with the flow of light through the environment.<br />
<br />
Photometry is the name for the science that deals with this psychophysical perception of light. Radiometry only deals with objective quantities which can be measured in standard SI units. On the other hand, the response of the human visual system varies strongly with the wavelength of the radiation.<br />
<br />
Because the eye has a different relative sensitivity for radiation at different frequencies, we must translate radiometric quantities to the equivalent photometric quantities. This mapping is described by the luminous efficiency function V. It translates between the radiant power measured in watt[W] and the luminous power measured in lumen[lm]. The units of the function V are therefore [lm/W].<br />
<br />
<br />
"light는 color다! color도 light다!."<br />
과거 내 머리속을 지배해 왔던 정의 중에 하나 였다. 처음 lighting을 이해하는데 도움을 줄지는 모르지만 위의 글에서도 볼 수 있듯이 오류를 유도 할 수 있는 잘못 된 정의이다. CGI 관점에서 바라 봤을때 자칫 크나큰 오류를 안고 가게 되는 것도 같다. <br />
<br />
color space와 light(illumination) space는 서로 다른 공간이며 존재하는 방식 또한 다르다. 하지만 sensors라는 conversion을 통해 연결되는데 그냥 linear하게 전환 되는 것도 아니다. 이런 미묘한 response & transfer functions in terms of human visual perception을 알아내는 것이 foundation of color science의 묘미 중에 하나가 아닐까 생각 한다.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4395708001776000142.post-20092513022208248872011-05-30T21:26:00.000-04:002011-06-15T02:47:00.749-04:00Unit Problems with tone-mapping in RenderMan<em>from 'Using procedual RenderMan shaders for global illumination'</em><br />
<br />
<br />
All color and illumination quantities are unit-less and are supposed to lie between zero and one. It makes all computations context dependent and may introduce inconsistencies when combine shaders that assume a different environment.Secondly, all specifications are relative to an implicit unit system imposed by the creator of the scene. For example, it's impossible to add a light source with a particular lighting effect to a scene without knowing the overall scale factor of the other light sources.<br />
<br />
RenderMan currently only deals with unit-less color values to describe illumination. In order to make shaders compatible with each other and with any renderer we suggest that all quantities used in the RenderMan interface are assumed to be given in international standard SI units. This means that all geometric quantities are in meters and that radiance or irradiance is used for all illumination quantities.A light source shader for a point light source must scale the light flux with the square of the distance to the receiver. The effect of the light source is now independent of the assumed scale of the scene model.<br />
<br />
<strong>For illumination quantities the photometric units luminance and illuminace would have been an alternative. However, they are a subjective measure and are simply scaled versions of the radiometric units, weighted with the spctral response function of a standard observer.</strong><br />
<br />
The current definition of the imaging pipeline of RenderMan must also be modified in order to perform post-processing on the image in physically well-defined units. These extensions are necessary to support the current state-of-the-art in physically-based image synthesis. This includes tone-mapping operators and image filtering.<br />
<br />
In the current definition of the RenderMan interface the imaging pipeline can only execute a set of standard filter algorithms. Also, image shaders currently operate on the already filtered and gamma corrected pixel values and image shaders operate on the value of a single pixel at a time. A tone reproduction step which converts the radiance values into pixel values through luminace values for display is unavoidable. For rendering scenes with physically-based light sources descriptions and reflection functions, the large dynamic range of the input distribution must be matched to the rather small dynamic range displayable by a CRT.<br />
<br />
<br />
RenderMan에서 전체 color processing을 좀 더 physical하게 접근 한 시점에서 봤을때 안고 있는 몇몇 문제점을 제시한 중요한 노트 중에 하나가 아닐까 생각한다. 제목만 보면 procedual shader와 연관된 GI에 대한 내용일거라 생각 했지만 안의 내용은 오히려 내가 원했던 부분이 한가득 들어 있었다.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4395708001776000142.post-18218674105996450772011-05-23T21:53:00.000-04:002011-05-30T14:22:08.571-04:00How bright is the sun?46,334 times brighter than “white”<br />
<br />
What do you think? Have you ever considered why we use normalized light intensity value in 3D rendering? The answer is not as simple as it seems like. This is one of my challenges these days. Good luck myself!Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4395708001776000142.post-47188940349221211542010-12-05T17:48:00.000-05:002011-07-13T03:38:23.271-04:00이해와 앎,교육에서 '무엇'과 '어떻게'의 결별은 곧 어떤 것을 '안다'는 것과 '이해한다'는 것이 분리되는 결과로 나타난다. 학생들은 이해함으로써 앎에 이르는 게 아니라 외움으로써 알게 되는 것이다. 어떤 것을 '이해'하지 못한다는 것은 그것을 실제로 '어떻게' 응용해야 할지를 모른다는 것이며 그것을 '어떻게' 다루어서 새로운 것을 만들어내야 할지를 모른다는 것이다. 그런 지식은 실로 허약하며 쓸모없고, 교육적 실패의 결과물에 불과하고 겉만 번지르르한 '학문적 성취'의 외장일 뿐이다.<br />
-출처 미상-Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4395708001776000142.post-82498777408997118082010-11-24T22:08:00.000-05:002010-11-24T22:08:58.433-05:00Photographic Optics<a href="http://toothwalker.org/optics.html">http://toothwalker.org/optics.html</a><br />
<br />
Here is a collection of illustrated articles on the chief causes of image degradation in photography. Currently available pages can be accessed via hyperlinks. The reader should keep in mind that the articles are about principles of photographic optics and not about tests of specific lenses. Also, most of the phenomena have been captured on film. Since a film acts as no more than a light-sensitive medium, the examples equally apply to a digital recorder array. In the few cases where the nature of the recording medium is important, this will be emphasized.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4395708001776000142.post-80258326747079777472010-10-25T09:09:00.000-04:002010-12-22T17:55:59.745-05:00Everything is linked.<a href="http://www.youtube.com/watch?v=jqxENMKaeCU">http://www.youtube.com/watch?v=jqxENMKaeCU</a><br />
<br />
이 시대에 사는 모든 이들이 꼭 봐야 할 영화가 아닌가 싶습니다.<br />
인간이 주인이 되어서는 안 될 우리의 /Home/ 입니다.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4395708001776000142.post-45440508285750074152010-09-15T17:41:00.000-04:002010-12-06T11:11:35.808-05:00SIGGRAPH 2010 Course: Physically Based Shading Models in Film and Game Production<a href="http://renderwonk.com/publications/s2010-shading-course/">http://renderwonk.com/publications/s2010-shading-course/</a><br />
<br />
Physically grounded shading models have been known for many years, but they have only recently started to replace the "ad-hoc" models in common use for both film and game production. Compared to "ad-hoc" models, which require laborious tweaking to produce high-quality images, physically-based, energy-conserving shading models easily create materials that hold up under a variety of lighting environments. These advantages apply to both photorealistic and stylized scenes, and to game development as well as production of CG animation and computer VFX. Surprisingly, physically based models are not more difficult to implement or evaluate than the traditional "ad-hoc" ones.<br />
<br />
특히, ILM & Sony Pictures Imageworks course notes는 현재 production rendering과 관련해 우리가 어디에 위치해 있는지와, 앞으로 어떤 길로 갈지를 가늠하는데 있어 꼭 읽어 봐야하는 필수 노트라 할 수 있겠다. Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4395708001776000142.post-29776960303245733552010-09-15T17:22:00.000-04:002010-10-25T09:07:17.416-04:00Ideal texture filtering,Ideally, computing a textured value for a pixel involved perspective projecting a filter from screen space (indexed by x and y coordinates) to obtain a warped prefilter. Since the texture data are discete samples, we also require a reconstruction filter to interpolate between texel samples. For mathematically tractable warped and reconstruction filters, we can combine the two to create a unified filter in texture space. Each texel inside the unified filter's footprint is weighted according to the unified filter's corresponding value in screen space, the weighted samples are accumulated, and the sum is divided by the filter's volume in texture space.<br />
<br />
<br />
rendering 과정의 거의 모든 부분이 point sampling process이기에 aliasing은 늘 동반되는 문제이다. 그중 texture pre-filtering 부분은 rasterizing과정인 rendering sampling process와 달리 세개의 공간을 오가며 sampling이 이루어 지는데, 즉 screen space, uv parameter space on the surface 그리고 st texture space이 되겠고 서로 다른 두개의 sampling processes인 the screen space samples and the shading samples in parameter space on the surface을 통해 얻는 모든 결과물이 texture space function에서 이루어 져야 한다는 문제점을 가지게 되겠다.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4395708001776000142.post-41365743436942144872010-08-26T14:14:00.000-04:002010-08-30T12:36:02.622-04:00故 콘 사토시 감독<a href="http://blog.esuteru.com/archives/803749.html">http://oppicul.tistory.com/1291</a><br />
<br />
일본도 열약한 애니메이션 환경의 현실에 재능 있는 애니메이터가 점점 줄어 드는 상황에서, 그나마 일본 애니메이션을 이끄는 몇몇의 재능 있는 감독중에서 한명인 그의 비보는 본적도 만난적도 없지만 그가 불어 넣은 숨결의 애니메이션을 본 것만으로도, 보면서 같은 호흡을 했다는 것 만으로도 가까운 가족의 비보를 들은 듯이 옆구리가 시려 옵니다. 그의 가족과 그를 사랑 했던 사람들과 그 슬픔을 같이 하고 싶습니다.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4395708001776000142.post-51010471779878568382010-08-22T20:01:00.000-04:002010-10-24T22:53:25.251-04:00Global Illumination in 99 lines of C++<a href="http://www.kevinbeason.com/smallpt/">http://www.kevinbeason.com/smallpt/</a><br />
<br />
<h2>Features</h2><ul><li>Global illumination via unbiased Monte Carlo path tracing </li>
<li>99 lines of 72-column (or less) open source C++ code </li>
<li>Multi-threading using OpenMP </li>
<li>Soft shadows from diffuse luminaire </li>
<li>Specular, Diffuse, and Glass BRDFs </li>
<li>Antialiasing via super-sampling with importance-sampled tent distribution, and 2x2 subpixels </li>
<li>Ray-sphere intersection </li>
<li>Modified <a href="http://www.graphics.cornell.edu/online/box/">Cornell box</a> scene description </li>
<li>Cosine importance sampling of the hemisphere for diffuse reflection </li>
<li>Russian roulette for path termination </li>
<li>Russian roulette and splitting for selecting reflection and/or refraction for glass BRDF </li>
<li>With minor changes compiles to a 4 KB binary (less than 4096 bytes) </li>
</ul><br />
사실 Ray-tracing engine기반의 renderer 만큼 straightforward 한건 없는데 path tracing을 이렇게까지 간단해 질 수 있는지는 몰랐다. 물론 불필요한 부분은 다 잘라 냈으니 그렇겠지만 위의 features에서 보듯이 필요한 중요한 부분들은 거의 있다고 볼 수 있다. 게다가 단순화된 오픈소스라 path tracing 기반의 GI renderer가 어떻게 연동 되는지 이해하는데 많은 도움이 될 것이라 생각 된다. <br />
<br />
이번 siggraph 2010, production부분에서 이미 소개 되었 듯이 path tracing 기반의 GI rendering 방식은 sony pictures를 중심으로 헐리우드 퀄러티 스튜디오에 들어와 자리를 잡았고 하드웨어의 발전에 따라 점점 확대해 나간다는 것에 대해서 의심의 여지가 없는지라 관심을 기울어야 할 필요가 있다.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4395708001776000142.post-41299988438766418932010-08-22T18:33:00.000-04:002010-08-25T15:35:31.986-04:00How interreflections can affect color appearance.Most studies of surface color appearance have ignored 3-d illumination phenomena such as shadows and interreflections. How interreflections can affect color appearance. How the lightness, hue, and chroma of the reflected color signal vary with the concavity aperture. The color appearance of a surface depends on both the spectrum of the illuminant and the spectral reflectance of the surface.<br />
<br />
개인적으로 많은 시간을 갖고 생각했던 부분이지만 이 노트는 가다 멈춘 느낌이....Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4395708001776000142.post-82687145472809265862010-05-08T14:18:00.000-04:002010-06-05T01:35:12.593-04:00Signal processing with post-filtering in RenderMan (1)<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilvRKcLUmQYD1Xyn_bdPSiPQH9VddNhNtMOdbZquvX-PtO_mbaXi6u-3ebm43KK3WAQGbtV3n6c9Xu70zjcBef6UoiRW2vul2IGgyJA3HDN5gjkukBCc_Oe8NZ4M-Ls9X7Y-Zj1OkdWcg/s1600/aniti.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilvRKcLUmQYD1Xyn_bdPSiPQH9VddNhNtMOdbZquvX-PtO_mbaXi6u-3ebm43KK3WAQGbtV3n6c9Xu70zjcBef6UoiRW2vul2IGgyJA3HDN5gjkukBCc_Oe8NZ4M-Ls9X7Y-Zj1OkdWcg/s320/aniti.jpg" /></a></div>3D Rendering algorithms에 대해 깊숙히 들어가다 보면 renderer 성격과 상관없이 어디에서나 만나게 되는 것중에 하나가 이 signal processing과 연관된 anti-aliasing이 아닐까 한다. 넓게 보면 2D, 3D를 떠난 모든 raster computer graphics 전반에 걸쳐 있을 뿐만 아니라 3D CG rendering 과정은 물론이고 연관된 여러 illumination algorithms에 있어 중요한 부분이 아닐 수가 없다. 더나가 이런 signal processing에서 파생된 spherical hamonics 원리를 이용한 여러 illumination 효과까지, 그 이해의 필요성은 말 할 것도 없을 것이다. <br />
<br />
Rasterization, 즉 The process of generating an image from a model in raster-space로 간단하게 Rendering in 3D computer graphics을 정의 할 수 있 듯이 결국 original signal with vector information in 3d space을 raster-space로 perspective projection 시키는 point sampling의 최종 목적지, 즉 the intensity of the image at some X-Y coordinate point within the pixel로 가면서 aliasing은 늘 따라 다니는 동반자가 될 수 뿐이 없게 되지만 우리 눈이 capture 할 수 없는 영역 밖으로 그 aliasing을 minimalize 시키므로 극복해 나갈 수 있게 되는 것이다. 그 중 오늘은 signal processing과 연관해서 point sampling 후 이어지는 post-filtering에 중점을 두어 얘기를 시작 하도록 하겠다.<br />
<br />
먼저 일반적인 rendering in 3D CG에서 signal precessing을 전체적으로 크게 보면 아래와 같을 것이다.<br />
<br />
<i>original signal -> pre-filtering -> point sampling -> post-filtering -> final pixel.</i><br />
<br />
Original signal을 sampling and reconstructing을 통해 aliasing 없이 최종 pixel에 도달하게 만들어야 하는데 있어 가장 중요한 목적은 low frequency signal은 손실 없이 그리고 aliasing의 주범인 high frequency signal을 aliasing and detail lose 사이에서 가장 적절하게 capture하여 pixel로 reconstructing을 하는데 있다고 볼 수 있겠다. <br />
<br />
Nyquist frequency theory (It has to be sampled at more than twice the frequency of the original signal.)에 의해 A pixel안에 다수의 samples(surper-sampling, sub-sampling 혹은 multi-sampling이라고도 함)을 capture하게 되는데 이는 up sampling으로써 high frequency data까지 capture가 가능하게 되지만 여러 aliasing errors을 피하기 위해 다시 역으로 low pass filtering을 통해 down sampling 하게 하므로 그 capture 해온 high frequency data에서 생기는 aliasing을 막는 동시에 lower frequency data는 잃지 않게 하면서 amplitude(color) reproduce를 해야한다. 그래서 rendering에서는 weighted average of samples from both inside and outside the area covered by the pixel 로 post-filtering을 해주게 되어 final pixel를 얻게 되는 것이다.<br />
<br />
여기서 위의 up sample된 sub-samples를 filter weighting function을 거쳐 가게 하는데 있어 이런 signal(data) 다루기 편한 상태로 만들어야 하는게 우선시 되겠다. signal은 읽혀지는 방식에 따라 time domain(CGI에서는 observing signals in sptial domain, like as pixels on a screen)과 frequency domain이 존재 하는데 대부분의 신호 처리는 연산량과 편리함을 위하여 fourier transform(fft)을 통하여 time(or spatial) domain을 frequency domain으로 변환 혹은 inverse Fourier transform 후 계산을 하게 된다. <br />
<br />
<i>Fourier theory states, that a periodic signal can be seen as a sum of sine waves with different ferquencies, amplitudes, and phases. More important is to understand that some operations are much easier to do in the frequency domain than in spatial domain, and vice versa.</i><br />
<br />
즉, time(spatial) domain은 가로축이 time(space)이고 frequency domain은 가로축이 주파수가 되는데 (세로축은 amplitude(color)) 따라서 spatial domain에서는 time(space)에 따라 신호가 어떻게 변하는지를 볼수 있고 frequency domain에서는 이 신호에 각각의 주파수 성분들이 얼마나 많이 들어 있는지를 볼 수 있게 된다. <br />
<br />
이는 filtering 시 그 signal은 frequency domain 안에서 쉽게 higher frequency data를 없앨수 있지만 time(sparial) domain에서는 그리 쉽지가 않다. 그래서 filter weighting function(weighted average of the signal in the area of the pixel)는 Fourier transform 통해 frequency domain로 전환후 적용을 하게 되는 것이다. Frequency domain에서 가장 이상적인 filter의 모습은 step 형태가 되겠는데 이는 간단하게 higher frequency signals을 lower frequency data의 손실 없이 제어를 하게 되겠다.<br />
<br />
<i>To perform the filtering, we need to calculate the distance from the center of the pixel being filtered, to each sample point location, and use that to get a sample weight. The data for that sample is then accumulated using the weight. When the samples have all been processed in this way, the result is divided by the total weights of all samples that contributed and this will be the final data stored on the pixel, and passed onto the exposure stage. </i><br />
<br />
다음 글에는 RenderMan과 직접적으로 연관해서 post-filtering에 대해서 한번 살펴 보도록 하겠다. <br />
계속.....Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4395708001776000142.post-44865197804660875982010-05-03T17:59:00.000-04:002010-06-08T18:17:23.208-04:00Memory considerations for speed/memory trade-offs in RenderMan우연히 모 CG싸이트에 답글을 올리다 생각난 김에 memory consumption in renderman에대해 구체적으로 정리를 해 보겠다. 구체적인 주제는 renderman에서 rendering 과정시 motion blur가 memory consumption 측면에서 어떻게 영향을 미치는지가 되겠는데 motion blur는 상황에 따라 너무 다르기에 rendering 외적인 요소는 제외하고 시작 하겠다.<br />
<br />
또 하나 일반적으로 알려져 있는 bucket size/maximum grid size를 통한 deal은 어디서나 쉽게 찾아 참조 할 수 있으니 넘어 가겠는데 참고로 하나만 얘기 하자면 bucket size는 rendering 시작부터 끝까지 전반에 걸친 기준이 되지만 grid size는 shading 과정에서 SIMD execution시 계산하는 unit이 되어 shading 속도와 밀접한 관련이 있겠다. (물론 dicing 후의 sub-geometry, 즉 a grid size와도 연관되지만 그리 shading에서의 영향력과 비교 될 정도는 아니기에....) Larger grids require larger temporary variable buffers for shading and produce large increases in the number of active micropolygons.<br />
<br />
직접적으로 motion blur와 관련된 유일한 option으로 motion factor가 있겠는데 이는 blur되는 현상에 high frequency shading rate가 그만큼 필요로 하지 않기에 motion path 길이에 따라 shading rate를 높여 shading에 드는 memory, CPU, 비용을 optimization 한 것이다. (Increases shading rate based on length of primitive blur in screen space.) shading rate를 높이면 생성해야 하는 micropolygons 개수는 줄어 들어 shading processing을 좀 더 가볍게 가겠지만 sampling processing에서 생성되는 또 하나의 memory 포식자인 visible-point lists에는 아무런 영향을 주지는 않을 것이다.<br />
<br />
무엇보다 간단히 memory consumption during rendering이 많이 이루어지는지 processing 별로 간단히 살펴 보면, 먼저 geometry processing에서는 grids and micropoygons의 개수가 가장 큰 영향을 끼칠 것이고, shading process에서는 각종 image-based caches(예:textures, shadow, etc) and point-based caches(예:point cloud, brick map, etc)와 shading code and variables이 있겠고 마지막으로 memory 포식자인 sampling & hiding 과정시에 생성되는 visible-point lists가 있겠다. 여기에서 rederman의 강력한 특징증에 하나인 Grids and micropolygons are discarded in memory as soon as processed 효과는 memory 공간을 많이 잡아 먹는 visible-point lists를 위한 공간 확보로 이어지면서 renderman만의 효율적인 memory 사용이 가능해 지게 되는 것이다.<br />
<br />
자, 그럼 motion blur가 어떻게 memory에 영향을 주는지 살펴보면 우선 shutter angle내에 움직이는 motion path만큼 geometry의 bounding box가 커지면 displacement bounding box가 커지는 것과 같은 이치로 memory를 잡아 먹게 되는데 이는 더 많은 geometry를 dicing과정에 끌어들이게 되면서 memory consumption이 오게 되는 것이다.<br />
<br />
여기서 또 하나의 renderman만의 강력한 매력이 있겠는데 shading 과정내에서는 motion blur와 상관없이 똑 같은 계산이 이루어진다는 것이다. shading processing에서 motion blur 때문에 엄청 버거워지는 pure ray-tracing based renderers와 상당히 비교되는 부분이 아닐수 없다.<br />
<br />
마지막으로 위에 언급 했던 visible-point lists의 증가가 있겠는데, 이는 motion blur을 쓰게 되면 자연스럽게 sampling rate를 감소 시키면서 samples의 개수가 늘어 나게 되는데, 늘어나는 sample 개수 마다 visible-point lists도 덩달아 늘어 나게 되면서 memory usage를 증가 시킬 것이다. 만약 그 geometry에 transparency가 많이 쓰였다면 기하 급수적인 visible-point lists의 증가는 막을 수 없을 것이다. 이런 transparency geometry가 층층히 쌓이는 대표적인 예가 hair나 fur가 있겠는데 이런 memory 소모를 막고 싶다면 opacity culling threshold로 낮게 설정해 hider에서 opacity culling을 시켜 주어야 한다. 다만 hair에 있는 transparency 효과는 줄어 들 것을 감수해야만 할 것이다. 그렇치 않으면 bucket size를 줄여 주는 수 밖에....<br />
<br />
이외에도 memory consumption을 optimization 하는 방식은 rendering 과정 밖에서도 여러가지 찾을 수 있겠는데 간단히 예를 들면 geometry 자체의 optimization, 불필요한 textures and shadow maps의 제거, mip-map과 tiling이 가능한 caching의 사용 등등등....<br />
<br />
hardware, software가 눈부시게 발전하여 rendering 시 더 많은 memory 사용이 가능한다 할지라도 지금까지 보왔듯이 날로 복잡해지는 scene과 photorealistic으로 가는 illumination 방식의 발전으로 지금이나 앞으로도 The issues of running out of memory during rendering은 모든 renderers가 늘 가지고 가야 하는 짐이라 말 할 수 있겠다. 이에 memory usage를 rendering 과정별로 이해하고 있다면 그에 따른 right solutions을 그때 그때 내릴 수 있게 될 것이라 생각한다.Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-4395708001776000142.post-9535046226066455152010-04-27T12:43:00.000-04:002010-04-29T21:16:30.210-04:00Pixar’s Ed Catmull"I don’t like hard rules at all. I think they’re all bullshit."<br />
<br />
<a href="http://www.scottberkun.com/blog/2010/inside-pixars-leadership/">http://www.scottberkun.com/blog/2010/inside-pixars-leadership/</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4395708001776000142.post-731682907693010682010-04-23T13:15:00.000-04:002010-11-23T16:17:15.083-05:0032 bit depth and super-whites as output for compositing넓은 의미의 Compositing은 3D space에서 이루어지는 models와 lights의 illumination 현상을 rendering을 통한 2D space의 image-based caches로 매체의 전환후에 이루어지는 illumination + alpha의 연장선(post-process)이라 말 할 수 있겠다. signal processing 측면에서 본다면 point sampling-based process에서 pixel imaging-based process로 매체 전환과 3D space에서 2D space의 공간 전환으로 생기는 Aliasing errors을 최소한으로 줄이며 연결 시켜야 3D rendering 부터 시작된 그 data의 저니가 compositing 후 final output 도착 할때까지 손실 없이 성공적으로 이루어 질 것이다.<br />
<br />
공간적인 측면의 전환으로 생기는 여러 aliasing errors는 3D rendering 과정 내부에서 효과적인 sampling과 reconstructing으로 최대한 최소화 시키 넘겨 주지만 point sampling-based process에서 pixel imaging-based process로 전환으로 오는 aliasing은 지금부터 얘기할 부분이 될 것 같다. <br />
<br />
우리는 최대한 3D rendering 당시의 모습 그대로의 data를 image에 담아 내야 하지만 하드웨어의 한계와 display devices에 맞춘(gamma까지!) 기존의 여러 image format방식으로는 그 data를 가지고 가공이 이루어 지기에 post-process로써 compositing에서 다루기에는 모니터에서 확인 할수 없는 여러 aliasing errors에 시달리게 될 것이다. 특히 영화 film을 최종 목적지로 달려갈때나 전체 pipeline상에서 후반 작업, 즉 compositing 과정을 많이 의지 할때는 더더욱 그럴것이다. (개인적으로는 single-pass rendering을 선호하지만...)<br />
<br />
그래서 결론적으로 우리는 3D rendering 과정안에서 가장 가깝게 접근한 환경을 가지고 있는 floating point를 기반으로 하는 high dynamic range, super-white 그리고 linear space가 지원하는 image file format 사용해야만 point-sampling based process에서 pixel-imaging based process로의 매체 전환으로 생기는 여러 aliasing errors와 현 standard image formats 자체에 기생하는 errors를 최소화 할 수 있을 것이다.<br />
<br />
먼저 32bit floating point를 3D rendering output image format으로 쓰는 장점부터 얘기를 하자면, Color 값을 high dynamic range로 저장 할 수 있다는 것 뿐만 아니라 일반 display로 확인이 안 될 뿐이지 super-white 즉, over pure white, color(1 1 1) 넘는 값도 clipping 없이 저장이 된다는 것이다. (모든 integer image format은 shading and rendering 과정을 끝낸후 얻은 floating point pixel value를 post-image processing 과정에서 integer로 converting시 tone mapping 없이 자연스럽게(?) clipping이 이루어 지게 된다. (tone mapping에 대한 옵션이 min/max로 주어졌지만 특정한 경우를 빼고는 거의 사용 안하기에, 그리고 특히 8bit integer에서는 아주 빈약한 low dynamic range로 강 비츄!)<br />
<br />
참고로 Mental Ray에서 32bit floating point tif로 저장시 위에 언급한 pixel로 전환후에 이루어지는 모든 post-image processing을 생략하기에 모든 것을 shading과정에서 해결해야만 한다. 그렇기 때문에 gamma를 조절 하기 위해서는 primary frame buffer가 아닌 mia_exposure_photographic, 혹은 mia_exposure_simple lens shaders를 사용해야만 하는 이유가 된다.<br />
<br />
다시 본론으로 돌아와서,<br />
반면 8bit와 16bit에서는 integer가 아닌 floating point로 저장을 한다고 해도 super-white는 clipping 되어 over white는 날아가 버리게 될 것이다. (예외로 오직 openEXR만이 16bit floating point에서도 저장이 가능.)<br />
<br />
pure white 넘어로 짤린 부분이 전혀 필요 없이 3D rendering이 final output for TV screen을 위한 작업이라면 상관 없겠지만 3D rendered images를 가지고 후반 작업을 진행 해야 할시에는 얘기가 달라진다. 특히 illumination 영역을 compositing까지 확장시켜 다룰때 밝은 부분의 수학적 계산을 정확하게 하기 위해서는 꼭 필요 하게 되는데, 간단한 산수 예를 들면 color( 0.8 1.2 2.0) * 0.5 = color( 0.4 0.6 1.0) 이 되지만 clipping이 이루어진 color( 0.8 1.0 1.0)를 계산할 경우에는 color( 0.8 1.0 1.0) * 0.5 = color( 0.4 0.5 0.5) 로 상당히 다른 결과를 얻게 될 것이다. 다시말해 모니터 상에서는 color( 0.8 1.2 2.0)나 color( 0.8 1.0 1.0)나 똑 같이 color( 0.8 1.0 1.0)로 보여주지만 계산후 결과는 서로 전혀 다른 color를 모니터에서도 볼 수 있게 될 것이다.<br />
<br />
또한 32 bit color depth는 3D rendering에서 보내준 color value를 tone mapping 없이 거의 그대로 가져 오기에 curve functions을 이용해 color depth range를 늘려야 할지라도 마지막 final output에 aliasing error 없이 충분한 color depth를 이어 가게 만들어 줄 것이다.<br />
<br />
약간 벗어난 예로 digital camera에서 쓰이는 raw 파일과 비유하면 raw를 지원하는 photo editing tool에서 exposure를 낮출시에 하얗게 날라가 있던 하늘이나 구름의 형태와 칼라가 다시 복원되는 예를 들 수 있을 것이다.(Typically, two f-stop increments) raw는 8bit 이상인 11, 10, 12, 14, 혹은 16 bit color depth(회사, 기종마다 다름)까지 CCD에서 받은 순수 원색을 interpolation 없이 linear color space로 camera setting information meta file과 함께 uncompressed 저장 된 파일 형태이다. post-editing 작업을 원할 경우 이 raw를 jpeg 보다 강력히 추천되는 이유는 위의 내용과 동일하다고 말할 수 있겠다. Interpolation 없다는 것은 3D rendering으로 치면 weighted filtering 된 pixel 이전 상태인 color 값을 가진 sub-samples 상태의 points가 되겠고 11bit부터 16bit까지의 color depth는 linear color space에서 two f-stops을 오가는 상황에서도 충분한 color depth를 받쳐주게 되는 것이다.<br />
<br />
이로써 linear work flow가 지원하는 photo editing tool을 사용 한다면 디지탈 카메라 안에서 계산되는 정확한 illumination과 연관된 exposure 매커니즘을 안방에 있는 모니터 앞에서 즐기게 해 줄 것이다. 참고로 photo editing tool에서 raw file을 위한 linear work flow를 지원 한다는 것은 마치 compositing tool에서 pre-multiply by alpha를 위해 거의 모든 effects or functions의 input과 output에 pre-divide, post-multiply 하는 것과 같이 gamma를 풀고 계산후 다시 gamma를 주는 방식으로 계산 될 것이라 예상 된다.<br />
<br />
반면 photo image를 jpeg로 저장하여 후반 작업을 할 경우는 위의 예와 반대로 exposure를 조절시 clipping 된 white와 gamma correction issue에 의해 조금만 건드려도 민감하게 highlight 부분이 날아가 버리겠고 쉽게 saturated 되어 버려 어느 순간부터는 비현실적인 모습을 드러 낼 것이다. (뭐 이게 스타일이라고 주장하면 할 말은 없겠지만 알고는 주장을 해야 하지 않을까 해서....) 약간 중심에서 벗어 났지만 전체적인 이해를 위해서는 좋은 예가 아닐까 한다.<br />
<br />
다시 3D world로 돌아와,<br />
3D rendering process와 마찬가지로 compositing tool 안에 있는 모든 effects의 수학적 calculation은 linear space에서 clipping 안된 상태의 floating point를 기준으로 이루어 진다. 이런 기준에 미치지 못하는 image를 input으로 쓰게 된다면 계산시 미묘한 error를 가져다 주면서 noticeable artifacts가 조금씩 쌓이면서 final output에서는 사실적인 룩과는 점점 거리가 멀어 지게 될 것이다.<br />
<br />
참고로 8bit integer image에 대해서 말하자면 8bit는 일반 모니터 상에서조차도 부족한 color depth이기에 인간의 logarithmic visual perception 원리를 이용해 과거 브라운관에 맞춘 비스므리한 gamma curve를 사용하여 풀어 나갈 수 있었던 것이다. 2.2 Gamma corrected image을 linear로 쫙 펴서 8bit image를 보면 부족한 칼라수로 인해 어두운 부분에서 banding현상이 일어날 것이다.<br />
<br />
위에서 언급 했듯이 open EXR가 인기(?)를 끌고 있는 이유 중에 하나가 유일하게 16bit(정확하게는 15 bit color depth) 이면서도 floating point in linear space를 지원 한다는 것이다. 물론 super-white에 대한 clipping 없이. 최종 아웃풋이 film인 우리에게 사실 32bit까지의 color depth가 필요하진 않다. film이 수용할수 있는 한계가 12bit color depth이기 때문이다.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4395708001776000142.post-60131203872716820442010-04-15T14:17:00.001-04:002010-04-20T09:58:44.164-04:00Light Radius vs. Light Angle as attribute of ray-tracing soft shadowMaya 혹은 Mental ray에서 Distribution Ray tracing Soft Shadow를 만들때 shadow의 softness를 조절하는 옵션으로 쓰이는 것을 자세히 보면 약간의 함점(?)이 있다고 할 수 있겠다. <br />
<br />
Point Light와 Spot Light에서는 'Light Radius' 라는 말로 쓰이지만 Directional Light에서는 'Light Angle' 이란 말로 쓰인다는 것이 어감이 비슷해 대강 넘어 갈수도 있지만 그 어원적인 차이를 이해하면 방식의 차이를 알게 될 것이라 생각 된다.<br />
<br />
모든 ray-tracing shadow 계산 방식의 시작은 제일 먼저 camera view에 들어온 objects을 골라 illuminated된 surface의 각 point P로 부터 Light Emitter쪽을 향해 역방향으로 shadow rays를 travel 시켜 그 rays가 출발지점이였던 light emitter까지 거침 없이 도달하느냐 아님 any geometry에 blocking 당하느냐에 따라 shadow 생성 여부를 판단하게 되는데 soft shadow를 위해서는 그 illuminated P점에서 역방향으로 travel 시킬때 그 P점을 중심으로 한 solid angle안에서 random하게 multi rays를 쏴 hit test 하여 최종 그 light emitter까지 도달한 ray의 개수를 총 ray 개수로 나눈 퍼센트 value가 shadow가 되는데 그 solid angle의 radius size가 shadow의 softness를 결정하게 되겠다. <br />
<br />
이 illuminated P점에서 solid angle radius를 결정하는 방법적인 차이가 light Radius와 light Angle가 나오게 된 배경이 되겠다. <br />
<br />
먼저 간단히 Parallel ray를 가진 distance light 보면 말 그대로 light Angle의 의미는 light 위치와 상관없이 어느 illuminated P점에서나 동일한 solid angle radius와 같다고 보면 된다.<br />
<br />
반면 spot light와 point light에 있는 Light Radius는 distance light와 달리 light emitter origin을 중심으로한 가상의 정원을 만들어 그 illuminated P점에서 solid angle의 중심은 light origin을 향하는 콘을 형성하는데 그 solid angle radius는 그 가상의 원을 radius 크기만큼 열리게 되어 soft shadow를 만들게 된다. 따라서 그 light emitter origin을 중심으로 한 가상의 원의 radius가 solid angle의 radius를 지배하게 된다. 그래서 여기서는 light radius라는 이름으로 쓰이게 된 것이다. <br />
<br />
여기서 간혹 문제가 생기는 것이 spot light cone에 들어 있지 않지만 그 Light emitter에 가까이 object가 있어 soft shadow 계산시 생성되는 가상의 원 radius 범위 안에 들어 왔다면 모든 shadow rays는 그 object를 shadow 영향 범위 안에 넣어 계산이 되어 전체적으로 noise를 형성되는 shadow가 생성될 것이다. <br />
<br />
shadow의 softness의 조절은 결국 shadow ray의 solid angle radius를 넓혀 주어야 하는데 distance light는 위치와 크기에 상관 없이 light angle로 고정된 solid angle radius를 주기에 무조건 light angle을 따르게 되어 있지만, spot light와 point light는 상대적으로 light emitter를 중심으로 한 가상의 원의 radius가 shadow ray의 direction and solid angle radius를 결정하기에 light emitter 위치 즉, 거리와 light radius가 light scale과 연결되어 있다면 light의 크기 값까지 영향을 받게 되어 상당히 상대적으로 조절하게 되는 것이다.Unknownnoreply@blogger.com3tag:blogger.com,1999:blog-4395708001776000142.post-50099604219014937902010-04-02T22:52:00.000-04:002010-10-13T19:08:02.585-04:00The structure of light shaders for interactive local illumination<span style="font-size: small;">RenderMan은 현재 5가지 방식의 shading을 지원하는데, 이는 다들 알고 있는 surface shading, light shading, displacement shading, volume shading, 그리고 imager shading로 (예전에는 transform shading이 하나 더 있었다고 함) 그 중 개인적으로 </span><span style="font-size: small;">가장 간단한 구조를 가지고 있다고 생각하는 local illumination에서의 Light Shading 구조에 대해 오늘 얘기를 해 볼까 한다. shading script coding 하기 나름이라고 반문 할 수도 있겠지만 내가 말하는 부분은 local illumination models and lights 관계에서 light shader의 기본적인 역할이 생각보다 간단하다는 것이다. 이에 반해 light shader에서 보낸 정보를 받아 반사해야 하는 surface shading에서의 illuminance loops 역할이 상대적으로 복잡해 진다고 말 할 수 있겠다.</span><br />
<br />
<span style="font-size: small;">RenderMan같은 Reyes algorithm renderers뿐만 아니라 Ray-tracing기반의 renderers를 포함 거의 모든 renderers에서 light shader와 surface shader의 이런 interactive illumination관계의 기본적인 구조는 쓰인 언어만 다를뿐 거의 같다고 자신 있게 말 할 수 있겠다. 물론 단순히 수학적으로 트릭 시킨 BRDF 관계가 아닌 Ray-tracing 기반의 ray traveling 방식의 illumination 계산이 필요로 할시에는 다소 복잡해지겠지만 오늘은 거기까지 가지는 않기에 이부분은 무시하고 가 보기로 하겠다.(RenderMan에서는 이 ray-tracing관련의 functions도 Op-codes로 단순화 시켜 버렸지만....)</span><br />
<br />
<span style="font-size: small;">Local illumination models and lights 관계에서 흔이들 쉽게 오해 하는 부분이 light emitters에서 빛 입자, 즉 photon을 발산하는 시뮬레이션을 하여 surface에 반사해 color값을 알아 내는 것으로 알고 있는데 사실 같은 이치를 수학적 트릭으로 계산해 거의 같은 결과를 얻어 내는 것이지 그렇다고 ray-tracing처럼 ray samples를 쏴 물리적인 reflection 시뮬레이션 같은 것을 하는것은 절대 아니다. </span><br />
<br />
<span style="font-size: small;">그럼, 다 아는 얘기겠지만 실제 local illumination에서 models and lights 계산 원리를 대강 살펴 보면 </span><br />
<span style="font-size: small;">1. light emitter origin에서는 point light emitter의(point emitting light source로만 국한시켜 보면: area emitting light source는 오늘은 접어 놓겠다.) position 값과 light color 값만 가지고, </span><br />
<span style="font-size: small;">2. camera view frame에서 결정된 계산 해야 할 object의 surface 위의 한점인 P에서 계산된 normal vector N과, </span><br />
( light distance 값과 light ray의 angle 값은 쉽게 light origin point와 surface point P를 그냥 연결시킨 vector에서 쉽게 얻을수 있겠다.)<br />
<span style="font-size: small;">3. </span><span style="font-size: small;">최종 ,그 두 light vector L과 surface normal vector N의 angles만 가지고 거의 대부분의 local illumination 계산이 이루어지게 된다고 볼 수 있겠다. 물론 specualer reflection에 가까울 수록 camera vector I와의 계산이 필요 하게 되겠지만...</span><br />
<br />
<span style="font-size: small;">BRDF(bidrectional reflection distribution function)중에 diffuse() reflection function만 보면 그 둘의 각도, 즉 light vector and surface normal vector의 cosine 값에(단위 벡터의 내적, lambert's law) 최종 light에서 보내준 color와 surface shader의 color을 multiply 하는 과정을 illuminance loops시켜 계산 하겠고, </span><span style="font-size: small;">specular reflection function을 보면 하나 더 camera 단위 vector I가 추가되어 해당 point P에서 surface normal을 중심으로 light vector가 incoming light vector(입사각)과 outgoing reflected light vector(반사각)가 같은 앵글을 그릴때 그 반사각에 camera vector I가 가까을수록 highlight가 강해지게 계산해 내 광원에 대한 specualr 효과를 표현 하게 되겠다. </span><br />
<br />
<span style="font-size: small;">정리하면 simple light shader가 output으로 surface shader에 건내 주는 것은 light emitter의 position값과 light intensity가 multiply된 최종 light color 값만 줄 뿐이다. 이 outputs를 토대로 surface shader에서 반사값을 수학적 fake로 계산해 light ray를 쏜 것 같은 시뮬레이션을 연출 하게 되는 것이다. (이거 말로만 하려니 더 복잡! shading code를 보는게 더 쉬울 것 같기도...... 나중에 RSL에 대해 얘기할때 자세히 얘기하기로 하고....)<br />
<br />
그럼 light shader가 복잡해 지는 이유는 Lighting의 cinematic control을 위한 shaping과 Distance fallofff functions이 추가 되어 있기 때문이라고 보면 된다.(Shadowing과 관련된 추가적인 부분들은 나중에 따로 얘기하기로 하고, 우선 통과!)<br />
<br />
여기서 shaping이란 light coordinate space에서 X,Y plane 위에서만 놀아나는 2D functions을 써 shaping을 제어하여 마치 projection 같은 (Z축에 변화를 주지 않기에 ,배트맨 라이트 같은 효과라고나 할까?) 효과를 주는 것을 말 한다. spot light의 penumbra 효과가 가장 대표적인 예로 spot light cone 중심에서 형성된 원의 경계를 smooth function으로 제어하는 가장 단순한 방법이고 다른 예를 들면 star-shaped function 쓴다거나 혹은 pattern generating functions과 같이 써 별무리 같은 shaping을 적용해 procedual cookies or slides 효과를 연출 한다든지 더나가 u-ber light shader에서 쓰이는 super ellipse function을 써 cinematic 연출을 위해 사각과 원의 shaping을 자유로이 넘나들수도 있게 할 수도 있겠다.<br />
<br />
X,Y plane에 대한 제어로 shaping을 했다면 이번엔 light coordinate space의 Z축을 기준으로 제어하는 Distance falloff 부분이 있겠는데 distance falloff는 Z축으로 camera origin으로부터 거리에 따라 제어 하는 부분으로 shadping 보다 훨씬 간단한 function으로 제어 할 수가 있겠다. 우리가 흔히 쓰는 빛의 거리에 따른 물리적인 기본 성질인 '거리 2제곱의 반비례'가 여기에 쓰이게 되는데 나름 원한다면 다른 여러 math curve functions을 여기에 써서 간단하게 적용 할 수도 있겠다. 참고로 우리가 Maya spot light에서 흔히 쓰는 효과 또한 Z축으로 near/far clipping을 smooth function로 각 경계면을 제어 하면 간단히 표현 할 수도 있겠다. </span><br />
<br />
<span style="font-size: small;">그럼, light coordinate space기준으로 X,Y,Z 축 전부로 3D space내에서 control이 가능 하지 않겠냐고 물어 올 수도 있겠는데 물론 가능하다. 주로 volumetric shader와 연결된 light shader에 turbulence 같은 noise-based function을 이 3D space로 흘려 보내 흐르는 안개속을 비추는 헤드라이트 같은 효과를 줄 때 사용 할 수 있겠고 더 나가 제 3의 local coordinate system을 이용해 그 좌표계 origin으로 부터 정의된 X,Y,Z 축 영역을 light coordinate space로 전환해 계산하면 결과적으로 3D world space 내에서 light intensity 변수를 local coordsys로 volumetric control이 가능해 질 수 있겠다. 눈치가 빠르다면 cinematic lighting의 꽃인 shadow blockers 얘기인지 알아챘으리라 본다. 사실 엄연히 따지면 depth map을 사용하는 shadowing 또한 여기에 속한다고 말 할 수 있겠다. 제어하는 메터리얼이 수학적 functions이 아닌(사실 이것도 가능, 예: projected shadow blockers) X,Y,Z space에 대한 정보를 이미지화 시킨, 즉 shadow camera 좌표계로 map의 가로세로가 X,Y축이 되고 pixel의 luminance value가 Z축의 depth value가 되는 엄연한 3D space 내의 light intensity 변수에 대한 projected volumetric control 인 것이다. 물론 전에도 얘기 했듯이 shadowing 계산을 위한 z-depth 대조 작업을 위해 real rendering camera 좌표계와 일치 시켜야 한다. </span><br />
<br />
위의 두 부분, shaping과 distance falloff을 빼서 light shader를 쨔면 자연 스럽게 정말 간단한 simple point Light shader가 되겠다. 여담이지만 poing light는 촛불과 같이 부드럽운 효과를 위해 쓴다는 얘기를 종종 듣게 되는데 불행하게도 그런 감성적인 차이는 우리 기분일 뿐이지 기술적으로 spot light와 아무런 차이를 주지 않는다. 그냥 한정된 지역의 shaping이 필요하거나 낭비 없는 shadowing을 쓰기 위해서 point light 대신 spot light를 쓰는 것 뿐이다.<br />
<br />
그럼 Distance (Directional) Light는? 하고 질문이 생길 수도 있겠는데, distance light는 더더욱 간단하여 light의 position 값이 필요 없이 하나로 통일된 parallel ray angle 값만으로 surface normal vector와 계산된다고 볼 수 있다. positional data가 있기는 하지만 이건 그냥 shadow camera 용으로 쓰기 위한 것일뿐 illumination계산에 아무런 영향을 주지 않는다. 이런 이유로 distance light 또한, point light shader처럼 정말 간단하게 쨔여 진다. shaping control도 distance fall off control이 아예 필요 없기 때문이다. 구지 원한다면 위에서 언급 했듯이 제 3의 local coordsys를 이용해 3D space 특정 범위 내에서 volumatric shaping을 할 수 있는 shadow blocker 기능을 쨔 넣을 수도 있겠지만.... <br />
<span style="font-size: small;"><br />
마지막으로 light attributes 중에 있는 non-diffuse, non-specular 기능에 대해 설명하자면 이것 또한 surface shader의 diffuse(), specular() functions 내에서 coding되어 illuminance loops시 light shader에서 전해준 그 파라미터의 값만 전달 받어, 즉 light shader에서 surface shader를 제어하는 Message passing 메카니즘을 구현해 계산하는 것이다. 이 Message passing은 renderman의 아주 강력한 기능 중의 하나로 서로 다른 종류의 shader들간에 variables를 교류 시킬수 있는 메카니즘이다.<br />
<br />
<span style="font-size: small;">공개된 light shaders 중 아직까지도 가장 확장된 cinematic flexibility를 가지고 있는 U-ber light shader를 예를 들면, A4 3,4 페이지가 넘는 스크립트로 아주 복잡하지만 사실 분석해 보면 각 부분의 functions이 복잡한 것이지 위의 기본 골격은 그대로 유지한다는 것을 알 수가 있을 것이다. </span><br />
<br />
아무리 복잡한 shader라도 기본 구조를 이해한 상태로 분석해 본다면 더이상 복잡해 보이지 않는 다는 것이다. 이는 light shading에만 국한 된게 아니라고 본다. </span><span style="font-size: small;">이로써 light shading이 다른 종류의 shading들보다 훨씬 간단한 기본구조를 지녔다고 말하는 이유를 이해 했으리라 믿는다. (더 복잡하게 만든건 아닌지....음)</span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4395708001776000142.post-17739193997599864792010-03-30T13:04:00.000-04:002011-06-15T17:26:52.494-04:00Galerie's short films<a href="http://www.gobelins.fr/galerie#/?year=null&display=wall&filiere=255943&project=null">http://www.gobelins.fr/galerie#/?year=null&display=wall&filiere=255943&project=null</a><br />
<br />
Galerie라는 프랑스 아트스쿨의 학생들 졸업 작품을 올려논 학교 싸이트인것 같은데 (불어라서 이거...)정말 학생들 작품이 맞는지 의심이 갈 정도로 시원시원한 아이디어와 간결하고 탄탄한 composition은 정말 할말을 잃게 만드는 것 같다. 디즈니 스타일에 너무 쩌들어서인가 내 시력이 다시 펴지는 이 느낌은???....Unknownnoreply@blogger.com0