{"id":1486,"date":"2020-04-15T12:45:02","date_gmt":"2020-04-15T12:45:02","guid":{"rendered":"http:\/\/lousodrome.net\/blog\/light\/?p=1486"},"modified":"2020-04-17T21:56:59","modified_gmt":"2020-04-17T21:56:59","slug":"implementing-a-physically-based-shading-without-locking-yourself-in","status":"publish","type":"post","link":"https:\/\/lousodrome.net\/blog\/light\/2020\/04\/15\/implementing-a-physically-based-shading-without-locking-yourself-in\/","title":{"rendered":"Implementing a Physically Based Shading without locking yourself in"},"content":{"rendered":"\n<p>Over the last few months I have been trying to push my understanding of Physically Based Shading, by actively exploring every corner and turning over every stone, to uncover any area where I lack knowledge. Although this is still an ongoing process and I still have a lot to do, I thought I could already share some of what I have learned in the process.<\/p>\n\n\n\n<p>Last weekend the Easter demoparty event <a href=\"https:\/\/2020.revision-party.net\/\">Revision<\/a> took place, as an online version due to the current pandemic situation. There, I presented a talk on Physically Based Shading, in which I went into electromagnetism, existing models, and an brief overview of a prototype I am working on.<\/p>\n\n\n\n<p>The presentation goes into a lot of detail about interaction of light with matter from a physics point of view, then builds its way up to the Cook-Torrance specular BRDF model. The diffuse BRDF and the Image Based Lighting were skipped due to time constraints. I am considering doing a Part 2 to address those topics, but I haven&#8217;t decided anything yet.<\/p>\n\n\n\n<p>In the mean time, please leave a comment or contact me if you notice any mistake or inaccuracy.<\/p>\n\n\n<h2>Abstract<\/h2>\n<blockquote>\n<p>How do you implement a Physically Based Shading for your demos yet keep the possibility to try something completely different without having to rewrite everything?<br \/>In this talk we will first get an intuitive understanding of what makes matter look the way it looks, with as much detail as we can given the time we have. We will then see how this is modeled by a BRDF (Bidirectional Reflectance Distribution Function) and review some of the available models.<br \/>We will also see what makes it challenging for design and for real-time implementation. Finally we will discuss a possible implementation that allows to experiment with different models, can work in a variety of cases, and remains compatible with size coding constraints.<\/p>\n<\/blockquote>\n<h2>Slides<\/h2>\n<p>Here are the slides, together with the text of the talk and the link to the references:<br \/><strong><a href=\"https:\/\/bit.ly\/2IZqYET\">Implementing a Physically Based Shading model without locking yourself in<\/a><\/strong>.<\/p>\n<h2>Video<\/h2>\n<p>And finally here is the recording of the talk, including a quick demonstration of the prototype:<br \/><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/E5HEynjqDcg\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<h2>Interference shader<\/h2>\n<p>Here is the shader used during the presentation to illustrate light interaction at the interface between to media:<\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/www.shadertoy.com\/embed\/tsfyRB?gui=true&amp;t=10&amp;paused=true&amp;muted=false\" width=\"640\" height=\"360\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<h2>Acknowledgements<\/h2>\n<p>Thanks again to Alan Wolfe for reviewing the text, Alkama for the motivation and questions upfront and help in the video department, Scoup and the Revision crew for organizing the seminars, Ronny and Siana for the help in the sound department, and everyone who provided feedback <a href=\"http:\/\/lousodrome.net\/blog\/light\/2020\/01\/04\/physically-based-rendering-references-at-the-end-of-2019\/\">on my previous article on Physically Based Shading<\/a>.<\/p>\n<h2>Addendum<\/h2>\n<p style=\"text-align: left;\">Following the publication of this article, <a href=\"http:\/\/reedbeta.com\/\">Nathan Reed<\/a> gave <a href=\"https:\/\/twitter.com\/Reedbeta\/status\/1250588856082038784\">several comments<\/a> on Twitter:<\/p>\n<blockquote>\n<p>FWIW &#8211; I think the model of refraction by the electromagnetic field causing electrons to oscillate is the better one. This explains not only refraction but reflection as well, and even total internal reflection. Feynman does out the wave calculations: <a href=\"https:\/\/feynmanlectures.caltech.edu\/II_33.html\">https:\/\/feynmanlectures.caltech.edu\/II_33.html<\/a><\/p>\n<p>It also explains better IMO why a light wave keeps its direction in a material. If an atom absorbs and re-emits the photon there is no reason why it should be going in the same direction as before (conservation of momentum is maintained if the atom recoils). Besides which, the lifetime of an excited atomic state is many orders of magnitude longer than the time needed for a light wave to propagate across the diameter of the atom (even at an IOR-reduced speed).<\/p>\n<\/blockquote>\n<p style=\"text-align: left;\">Moreover, in the comments of the shader above, CG researcher <a href=\"http:\/\/www-evasion.imag.fr\/Membres\/Fabrice.Neyret\/\">Fabrice Neyret<\/a> mentioned a presentation of his from 2019, which lists interactions of light with matter:<em><a href=\"https:\/\/drive.google.com\/file\/d\/185dj3saKJCHu6hAe7rtQEBgCQCNsYkyA\/view?usp=sharing\"> Colors of the universe<\/a><\/em>.<br \/>Quoting his summarized comment:<\/p>\n<blockquote>\n<p style=\"text-align: left;\">In short: the notion of photons (and their speed) in matter is a macroscopic deceiving representation, since it&#8217;s about interference between incident and reactive fields (reemitted by the dipoles, at least for dielectrics).<\/p>\n<\/blockquote>\n\n\n<p><br><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Over the last few months I have been trying to push my understanding of Physically Based Shading, by actively exploring every corner and turning over every stone, to uncover any area where I lack knowledge. Although this is still an &hellip; <a href=\"https:\/\/lousodrome.net\/blog\/light\/2020\/04\/15\/implementing-a-physically-based-shading-without-locking-yourself-in\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,17,20],"tags":[65,918,917,35,325,910,913,112,914,895,909,915,504,906,29,916,79,920,919,912,57,149,370,720],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.13 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Implementing a Physically Based Shading without locking yourself in &ndash; Light is beautiful<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/lousodrome.net\/blog\/light\/2020\/04\/15\/implementing-a-physically-based-shading-without-locking-yourself-in\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Implementing a Physically Based Shading without locking yourself in &ndash; Light is beautiful\" \/>\n<meta property=\"og:description\" content=\"Over the last few months I have been trying to push my understanding of Physically Based Shading, by actively exploring every corner and turning over every stone, to uncover any area where I lack knowledge. Although this is still an &hellip; Continue reading &rarr;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/lousodrome.net\/blog\/light\/2020\/04\/15\/implementing-a-physically-based-shading-without-locking-yourself-in\/\" \/>\n<meta property=\"og:site_name\" content=\"Light is beautiful\" \/>\n<meta property=\"article:published_time\" content=\"2020-04-15T12:45:02+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-04-17T21:56:59+00:00\" \/>\n<meta name=\"author\" content=\"Julien Guertault\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@Zavie\" \/>\n<meta name=\"twitter:site\" content=\"@Zavie\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Julien Guertault\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/lousodrome.net\/blog\/light\/2020\/04\/15\/implementing-a-physically-based-shading-without-locking-yourself-in\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/lousodrome.net\/blog\/light\/2020\/04\/15\/implementing-a-physically-based-shading-without-locking-yourself-in\/\"},\"author\":{\"name\":\"Julien Guertault\",\"@id\":\"https:\/\/lousodrome.net\/blog\/light\/#\/schema\/person\/a16a2a69d73eca763ffdf125c49eaa2f\"},\"headline\":\"Implementing a Physically Based Shading without locking yourself in\",\"datePublished\":\"2020-04-15T12:45:02+00:00\",\"dateModified\":\"2020-04-17T21:56:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/lousodrome.net\/blog\/light\/2020\/04\/15\/implementing-a-physically-based-shading-without-locking-yourself-in\/\"},\"wordCount\":650,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/lousodrome.net\/blog\/light\/#\/schema\/person\/a16a2a69d73eca763ffdf125c49eaa2f\"},\"keywords\":[\"BRDF\",\"Cook-Torrance\",\"Ctrl-Alt-Test\",\"demoscene\",\"Disney\",\"electromagnetism\",\"Filament\",\"Fresnel\",\"Frostbite\",\"GGX\",\"Maxwell\",\"MERL\",\"photon\",\"physically based shading\",\"physics\",\"prototype\",\"Revision\",\"Schlick\",\"Smith\",\"Snell\",\"specular\",\"talk\",\"talk I gave\",\"UE4\"],\"articleSection\":[\"Demoscene\",\"Rendering\",\"Science\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/lousodrome.net\/blog\/light\/2020\/04\/15\/implementing-a-physically-based-shading-without-locking-yourself-in\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/lousodrome.net\/blog\/light\/2020\/04\/15\/implementing-a-physically-based-shading-without-locking-yourself-in\/\",\"url\":\"https:\/\/lousodrome.net\/blog\/light\/2020\/04\/15\/implementing-a-physically-based-shading-without-locking-yourself-in\/\",\"name\":\"Implementing a Physically Based Shading without locking yourself in &ndash; Light is beautiful\",\"isPartOf\":{\"@id\":\"https:\/\/lousodrome.net\/blog\/light\/#website\"},\"datePublished\":\"2020-04-15T12:45:02+00:00\",\"dateModified\":\"2020-04-17T21:56:59+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/lousodrome.net\/blog\/light\/2020\/04\/15\/implementing-a-physically-based-shading-without-locking-yourself-in\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/lousodrome.net\/blog\/light\/2020\/04\/15\/implementing-a-physically-based-shading-without-locking-yourself-in\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/lousodrome.net\/blog\/light\/2020\/04\/15\/implementing-a-physically-based-shading-without-locking-yourself-in\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/lousodrome.net\/blog\/light\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Implementing a Physically Based Shading without locking yourself in\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/lousodrome.net\/blog\/light\/#website\",\"url\":\"https:\/\/lousodrome.net\/blog\/light\/\",\"name\":\"Light is beautiful\",\"description\":\"Thoughts of a graphics programmer, demoscener and spare time photographer\",\"publisher\":{\"@id\":\"https:\/\/lousodrome.net\/blog\/light\/#\/schema\/person\/a16a2a69d73eca763ffdf125c49eaa2f\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/lousodrome.net\/blog\/light\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/lousodrome.net\/blog\/light\/#\/schema\/person\/a16a2a69d73eca763ffdf125c49eaa2f\",\"name\":\"Julien Guertault\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/lousodrome.net\/blog\/light\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/2e5fc7a18e1701e1bb61a5da0ef35cf7?s=96&d=identicon&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/2e5fc7a18e1701e1bb61a5da0ef35cf7?s=96&d=identicon&r=g\",\"caption\":\"Julien Guertault\"},\"logo\":{\"@id\":\"https:\/\/lousodrome.net\/blog\/light\/#\/schema\/person\/image\/\"},\"url\":\"https:\/\/lousodrome.net\/blog\/light\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Implementing a Physically Based Shading without locking yourself in &ndash; Light is beautiful","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/lousodrome.net\/blog\/light\/2020\/04\/15\/implementing-a-physically-based-shading-without-locking-yourself-in\/","og_locale":"en_US","og_type":"article","og_title":"Implementing a Physically Based Shading without locking yourself in &ndash; Light is beautiful","og_description":"Over the last few months I have been trying to push my understanding of Physically Based Shading, by actively exploring every corner and turning over every stone, to uncover any area where I lack knowledge. Although this is still an &hellip; Continue reading &rarr;","og_url":"https:\/\/lousodrome.net\/blog\/light\/2020\/04\/15\/implementing-a-physically-based-shading-without-locking-yourself-in\/","og_site_name":"Light is beautiful","article_published_time":"2020-04-15T12:45:02+00:00","article_modified_time":"2020-04-17T21:56:59+00:00","author":"Julien Guertault","twitter_card":"summary_large_image","twitter_creator":"@Zavie","twitter_site":"@Zavie","twitter_misc":{"Written by":"Julien Guertault","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/lousodrome.net\/blog\/light\/2020\/04\/15\/implementing-a-physically-based-shading-without-locking-yourself-in\/#article","isPartOf":{"@id":"https:\/\/lousodrome.net\/blog\/light\/2020\/04\/15\/implementing-a-physically-based-shading-without-locking-yourself-in\/"},"author":{"name":"Julien Guertault","@id":"https:\/\/lousodrome.net\/blog\/light\/#\/schema\/person\/a16a2a69d73eca763ffdf125c49eaa2f"},"headline":"Implementing a Physically Based Shading without locking yourself in","datePublished":"2020-04-15T12:45:02+00:00","dateModified":"2020-04-17T21:56:59+00:00","mainEntityOfPage":{"@id":"https:\/\/lousodrome.net\/blog\/light\/2020\/04\/15\/implementing-a-physically-based-shading-without-locking-yourself-in\/"},"wordCount":650,"commentCount":0,"publisher":{"@id":"https:\/\/lousodrome.net\/blog\/light\/#\/schema\/person\/a16a2a69d73eca763ffdf125c49eaa2f"},"keywords":["BRDF","Cook-Torrance","Ctrl-Alt-Test","demoscene","Disney","electromagnetism","Filament","Fresnel","Frostbite","GGX","Maxwell","MERL","photon","physically based shading","physics","prototype","Revision","Schlick","Smith","Snell","specular","talk","talk I gave","UE4"],"articleSection":["Demoscene","Rendering","Science"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/lousodrome.net\/blog\/light\/2020\/04\/15\/implementing-a-physically-based-shading-without-locking-yourself-in\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/lousodrome.net\/blog\/light\/2020\/04\/15\/implementing-a-physically-based-shading-without-locking-yourself-in\/","url":"https:\/\/lousodrome.net\/blog\/light\/2020\/04\/15\/implementing-a-physically-based-shading-without-locking-yourself-in\/","name":"Implementing a Physically Based Shading without locking yourself in &ndash; Light is beautiful","isPartOf":{"@id":"https:\/\/lousodrome.net\/blog\/light\/#website"},"datePublished":"2020-04-15T12:45:02+00:00","dateModified":"2020-04-17T21:56:59+00:00","breadcrumb":{"@id":"https:\/\/lousodrome.net\/blog\/light\/2020\/04\/15\/implementing-a-physically-based-shading-without-locking-yourself-in\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/lousodrome.net\/blog\/light\/2020\/04\/15\/implementing-a-physically-based-shading-without-locking-yourself-in\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/lousodrome.net\/blog\/light\/2020\/04\/15\/implementing-a-physically-based-shading-without-locking-yourself-in\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/lousodrome.net\/blog\/light\/"},{"@type":"ListItem","position":2,"name":"Implementing a Physically Based Shading without locking yourself in"}]},{"@type":"WebSite","@id":"https:\/\/lousodrome.net\/blog\/light\/#website","url":"https:\/\/lousodrome.net\/blog\/light\/","name":"Light is beautiful","description":"Thoughts of a graphics programmer, demoscener and spare time photographer","publisher":{"@id":"https:\/\/lousodrome.net\/blog\/light\/#\/schema\/person\/a16a2a69d73eca763ffdf125c49eaa2f"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/lousodrome.net\/blog\/light\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/lousodrome.net\/blog\/light\/#\/schema\/person\/a16a2a69d73eca763ffdf125c49eaa2f","name":"Julien Guertault","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/lousodrome.net\/blog\/light\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/2e5fc7a18e1701e1bb61a5da0ef35cf7?s=96&d=identicon&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2e5fc7a18e1701e1bb61a5da0ef35cf7?s=96&d=identicon&r=g","caption":"Julien Guertault"},"logo":{"@id":"https:\/\/lousodrome.net\/blog\/light\/#\/schema\/person\/image\/"},"url":"https:\/\/lousodrome.net\/blog\/light\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/lousodrome.net\/blog\/light\/wp-json\/wp\/v2\/posts\/1486"}],"collection":[{"href":"https:\/\/lousodrome.net\/blog\/light\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lousodrome.net\/blog\/light\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lousodrome.net\/blog\/light\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lousodrome.net\/blog\/light\/wp-json\/wp\/v2\/comments?post=1486"}],"version-history":[{"count":18,"href":"https:\/\/lousodrome.net\/blog\/light\/wp-json\/wp\/v2\/posts\/1486\/revisions"}],"predecessor-version":[{"id":1507,"href":"https:\/\/lousodrome.net\/blog\/light\/wp-json\/wp\/v2\/posts\/1486\/revisions\/1507"}],"wp:attachment":[{"href":"https:\/\/lousodrome.net\/blog\/light\/wp-json\/wp\/v2\/media?parent=1486"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lousodrome.net\/blog\/light\/wp-json\/wp\/v2\/categories?post=1486"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lousodrome.net\/blog\/light\/wp-json\/wp\/v2\/tags?post=1486"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}