{"id":229,"date":"2019-04-21T14:59:17","date_gmt":"2019-04-21T19:59:17","guid":{"rendered":"http:\/\/www.yarnot.com\/Zach\/?p=229"},"modified":"2020-01-24T16:39:35","modified_gmt":"2020-01-24T22:39:35","slug":"faking-it","status":"publish","type":"post","link":"https:\/\/zach.yarnot.com\/index.php\/2019\/04\/21\/faking-it\/","title":{"rendered":"Faking It"},"content":{"rendered":"\n<h2>Pre-face<\/h2>\n\n\n\n<p>The use of computer graphics to\nspeed up work and\/or improve visual fidelity in animation has always been a\ngoal. Rendering has acted as the medium and the in-between for many years,\nshifting from very flat drawings to full emulations of reality. In general,\nrendering refers to any process of taking collections of data, whether polygonal,\nNURBS surfaces or another set, and converting them into the visual idea of real\nor three-dimensional objects.<\/p>\n\n\n\n<h2>Introduction to Rendering<\/h2>\n\n\n\n<p>Most often, we 3D artists see\nsystems called scanline or rasterizing renderers. This is a baseline engine\ndesigned to draw objects as simply as possible. Taking in object textures,\nborders, and order (the raw distance of an object and not its face from the\nviewer or camera), these, today, will often act as the base-line between the\nartist and the graphics software. A good example to think of this is Maya\nHardware 2.0, also called Maya Viewport Renderer. Shading generally is\nrudimentary, based more on surface quality than any existing light source.<\/p>\n\n\n\n<p>The next step up in complexity\nin terms of rendering is ray casting. This takes rasterizing a step further by\ncalculating per-face or per-normal lighting data based solely on angle of\nincidence, the angle at which a ray (light in this case) hits an object. Most\noften, this value is combined with rasterized data by multiplying the energy\nper pixel with the full blast value from the scanline or raster render. This\ngives objects more believable volume as it won\u2019t have the turntable effect,\nwhere it appears the lights are static and the object rotates, or the\nflattening effect, where objects appear flatter or paper-thin due to uncomplex\nor no shading.<\/p>\n\n\n\n<p>At this point in time, we have\nreached the final part of rendering. Ray tracing is just ray casting just\nseveral times. Rays of lights do not end once they hit an object in real-life,\nand this is the direction ray tracing takes. Instead, rays continue until the\ndrop below a certain energy level, go a certain distance from the viewer or\ncamera, or after a certain number of bounces. Ray tracing has progressed from\nsuggesting the idea of a surface to portraying near realistic volumes.<\/p>\n\n\n\n<p>An important note is most modern\nrenderers are what are called physically based renderers, where data relates\ndirectly to real-life data. Even more artistic aspects of these renderers are\ndictated by realistic data.<\/p>\n\n\n\n<h2>Comparison between Pixar\nRenderMan and Solid Angle Arnold<\/h2>\n\n\n\n<p>Because both RenderMan and\nArnold are physical based renderers, many things will appear the same to an\nuntrained eye. Other than names, attributes between their basic surface shaders\nare mostly the same. RenderMan has a few more lobes, but many of these\nproperties can be emulated within Arnold using utility nodes or utility shaders.\nHowever, one notable difference between the two is the treatment of rays.\nArnold attempts to emulate reality as closely as possible by treating each ray\nas the carrier of three kinds of data: hue, intensity, and saturation. This\nallows Arnold to create chromatic aberration banding like for a curved glass or\na carved diamond. Compared to RenderMan\u2019s three color system, it takes longer\nto render but appears much more physically accurate. As well, since Arnold is\ndesigned with current render packages in mind, it can better utilize the nodes\nwithin its supported packages.<\/p>\n\n\n\n<p>Comparing these renderers, I\npersonally prefer RenderMan due to its higher level of built-in artistic\ncontrols and improved overall performance. I do not fully understand all the\nsmaller details that effect their performance, but due to their similarities, the\nchoice of renderer is purely to the studio\u2019s preference.<\/p>\n\n\n\n<h2>Learning the lobes<\/h2>\n\n\n\n<p>Diffuse\/Base \u2013 In general, diffuse makes up the majority of the color of a dielectric (non-metallic) surface. Most often in computer graphics, materials use Lambertian diffusion, where roughness due to nanoscopic structures is consistent. This creates a soft border around the object of grey. However, another important model is the Oren-Nayar or OREN model. Instead of just a consistent nanostructure, Oren and Nayar added a microstructure of V-shaped facets to increase the roughness without greatly increasing computation time. This gives large bodies like the Moon or Mars a more static border. You can read more about these <a href=\"https:\/\/www.sciencedirect.com\/topics\/computer-science\/lambertian-model\">here (at ScienceDirect).<\/a><\/p>\n\n\n\n<p>Specularity \u2013 Compared to diffusion, specularity makes up the majority of the color of a conductive (metallic) surface. The shift to physically-based renderers has pushed out empirical models, where it is aligned with what is seen and not what happens, but I feel that the understanding of both is important.<br> The Phong model describes the rate of decay in the intensity of a specular highlight. Phong calculated that f(\u03b8,n)=cos^n (\u03b8), which states the result of the cosine of angle theta is taken to the power of n, such that the higher the value of n, the more true reflection takes place. This is similar to both index of refraction and roughness wrapped into one, as it describes visually what occurs. You can learn more about this <a href=\"https:\/\/www.siggraph.org\/education\/materials\/HyperGraph\/illumin\/specular_highlights\/phong_model_specular_reflection.htm\">here (at Siggraph).<\/a><br> In physically-based renders, commonly index of refraction and roughness are two separate attributes. Index of refraction (IOR) is the ratio of the speed of light through a vacuum to the speed of light through the medium, which affects the angle of reflection and potentially aberrates the resulting ray when changing mediums with varying values. Higher IOR will appear more chrome-like. Roughness then describes how the reflection is broken up, as its name suggests. You can learn more <a href=\"https:\/\/www.britannica.com\/science\/refractive-index\">here (at Britannica).<\/a><br> An important note is the Fresnel model, which is a related bridge between IOR and Phong Cosine Power. Fresnel Shape is directly related to, but not, IOR. One can calculate one with the other using the following math equations: R_i (f_0 )\u22451+f_0^(1\/\u03c0) and f_0 (R_i )\u2245((\u30161-R_i)\u3017^2)\/\u3016(1+R_i)\u3017^2 <\/p>\n\n\n\n<p>Coating \u2013 Similar to the specularity\nlobe, coating or clear coat describes a supsurface volume covering the surface in\nquestion. Used in conjunction with specularity, a number of materials can be\ncreated with extreme accurancy.<\/p>\n\n\n\n<p>Glass Refraction \u2013 Also similar\nto specularity, this describes light travelling through a volume similar to\nglass or water. This lobe or setting generally cannot be used with other lobes\nin a believable manner.<\/p>\n\n\n\n<p>Surface Quality Modifiers \u2013 Normal,\nbump, and displacement change the appearance of the surface in one form or\nanother. Normal maps due this by changing the angle of incidence on a surface\nto increase fidelity without significantly increasing render-times. Bump and\ndisplacement maps generally act as a height placement on the surface. Bump\nbecomes a normal-like, not modifying the actual geometry, just the point at\nwhich light hits. While with displacement, geometry is baked and expanded to\nmatch the map in question.<\/p>\n\n\n\n<h2>Using the lobes to their fullest<\/h2>\n\n\n\n<p>Eyes can be hard to reproduce, being\nboth surface and volume like. Here I used Substance Painter and RenderMan to\nreproduce an eye with only one hour of work.<\/p>\n\n\n\n<p>First, we create the geometry of\nour eye, as well as the normal map volumes we will need to bake.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" loading=\"lazy\" width=\"1920\" height=\"1207\" src=\"http:\/\/www.yarnot.com\/Zach\/wp-content\/uploads\/2019\/04\/Screen-Shot-2019-04-21-at-2.31.11-PM-1920x1207.png\" alt=\"\" class=\"wp-image-230\" srcset=\"https:\/\/zach.yarnot.com\/wp-content\/uploads\/2019\/04\/Screen-Shot-2019-04-21-at-2.31.11-PM-1920x1207.png 1920w, https:\/\/zach.yarnot.com\/wp-content\/uploads\/2019\/04\/Screen-Shot-2019-04-21-at-2.31.11-PM-512x322.png 512w, https:\/\/zach.yarnot.com\/wp-content\/uploads\/2019\/04\/Screen-Shot-2019-04-21-at-2.31.11-PM-768x483.png 768w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><figcaption>Left-to-Right: Pupil and cornea, base mesh, and lens and water<\/figcaption><\/figure>\n\n\n\n<p>Next, we create the base\nmaterial of the cornea and the pupil.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" loading=\"lazy\" width=\"1920\" height=\"1207\" src=\"http:\/\/www.yarnot.com\/Zach\/wp-content\/uploads\/2019\/04\/Screen-Shot-2019-04-21-at-2.30.00-PM-1920x1207.png\" alt=\"\" class=\"wp-image-231\" srcset=\"https:\/\/zach.yarnot.com\/wp-content\/uploads\/2019\/04\/Screen-Shot-2019-04-21-at-2.30.00-PM-1920x1207.png 1920w, https:\/\/zach.yarnot.com\/wp-content\/uploads\/2019\/04\/Screen-Shot-2019-04-21-at-2.30.00-PM-512x322.png 512w, https:\/\/zach.yarnot.com\/wp-content\/uploads\/2019\/04\/Screen-Shot-2019-04-21-at-2.30.00-PM-768x483.png 768w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><\/figure>\n\n\n\n<p>Then, we create the water\ncoating around the eye.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" loading=\"lazy\" width=\"1920\" height=\"1920\" src=\"http:\/\/www.yarnot.com\/Zach\/wp-content\/uploads\/2019\/04\/cornea_specFace-1920x1920.png\" alt=\"\" class=\"wp-image-232\" srcset=\"https:\/\/zach.yarnot.com\/wp-content\/uploads\/2019\/04\/cornea_specFace-1920x1920.png 1920w, https:\/\/zach.yarnot.com\/wp-content\/uploads\/2019\/04\/cornea_specFace-128x128.png 128w, https:\/\/zach.yarnot.com\/wp-content\/uploads\/2019\/04\/cornea_specFace-512x512.png 512w, https:\/\/zach.yarnot.com\/wp-content\/uploads\/2019\/04\/cornea_specFace-768x768.png 768w, https:\/\/zach.yarnot.com\/wp-content\/uploads\/2019\/04\/cornea_specFace-100x100.png 100w, https:\/\/zach.yarnot.com\/wp-content\/uploads\/2019\/04\/cornea_specFace.png 2048w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><\/figure>\n\n\n\n<p>Finally, we connect our files\ninto the shader as follows.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" loading=\"lazy\" width=\"1560\" height=\"1100\" src=\"http:\/\/www.yarnot.com\/Zach\/wp-content\/uploads\/2019\/04\/Screen-Shot-2019-04-21-at-2.36.18-PM.png\" alt=\"\" class=\"wp-image-233\" srcset=\"https:\/\/zach.yarnot.com\/wp-content\/uploads\/2019\/04\/Screen-Shot-2019-04-21-at-2.36.18-PM.png 1560w, https:\/\/zach.yarnot.com\/wp-content\/uploads\/2019\/04\/Screen-Shot-2019-04-21-at-2.36.18-PM-512x361.png 512w, https:\/\/zach.yarnot.com\/wp-content\/uploads\/2019\/04\/Screen-Shot-2019-04-21-at-2.36.18-PM-768x542.png 768w\" sizes=\"(max-width: 1560px) 100vw, 1560px\" \/><\/figure>\n\n\n\n<p>Now, we have our result.<\/p>\n\n\n\n<blockquote class=\"imgur-embed-pub\" lang=\"en\" data-id=\"X8Ds0aS\"><\/blockquote><script async=\"\" src=\"\/\/s.imgur.com\/min\/embed.js\" charset=\"utf-8\"><\/script>\n","protected":false},"excerpt":{"rendered":"<p>Pre-face The use of computer graphics to speed up work and\/or improve visual fidelity in animation has always been a goal. Rendering has acted as the medium and the in-between for many years, shifting from very flat drawings to full emulations of reality. In general, rendering refers to any process of taking collections of data, &hellip; <a href=\"https:\/\/zach.yarnot.com\/index.php\/2019\/04\/21\/faking-it\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Faking It<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[7,4,12,5,8,9,11],"tags":[],"_links":{"self":[{"href":"https:\/\/zach.yarnot.com\/index.php\/wp-json\/wp\/v2\/posts\/229"}],"collection":[{"href":"https:\/\/zach.yarnot.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zach.yarnot.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zach.yarnot.com\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/zach.yarnot.com\/index.php\/wp-json\/wp\/v2\/comments?post=229"}],"version-history":[{"count":3,"href":"https:\/\/zach.yarnot.com\/index.php\/wp-json\/wp\/v2\/posts\/229\/revisions"}],"predecessor-version":[{"id":236,"href":"https:\/\/zach.yarnot.com\/index.php\/wp-json\/wp\/v2\/posts\/229\/revisions\/236"}],"wp:attachment":[{"href":"https:\/\/zach.yarnot.com\/index.php\/wp-json\/wp\/v2\/media?parent=229"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zach.yarnot.com\/index.php\/wp-json\/wp\/v2\/categories?post=229"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zach.yarnot.com\/index.php\/wp-json\/wp\/v2\/tags?post=229"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}