<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Julius Ihle &#187; Julius</title>
	<atom:link href="http://julius-ihle.de/?author=1&#038;feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://julius-ihle.de</link>
	<description>LookDev/Lighting TD &#124; Compositor</description>
	<lastBuildDate>Sun, 18 Jun 2023 07:39:58 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.41</generator>
	<item>
		<title>Playing with OSL #7: Text Node</title>
		<link>http://julius-ihle.de/?p=2849</link>
		<comments>http://julius-ihle.de/?p=2849#comments</comments>
		<pubDate>Sun, 23 Apr 2023 19:21:06 +0000</pubDate>
		<dc:creator><![CDATA[Julius]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://julius-ihle.de/?p=2849</guid>
		<description><![CDATA[Having text live in your shaders can be a great way to add decals, burn-ins, etc. to your renders. I&#8217;ve gone on a bit of&#8230;<p><a href="http://julius-ihle.de/?p=2849" class="more-link post-excerpt-readmore"><span class="more-link-inner">Read more</span><span class="more-link-brd"></span></a></p>]]></description>
				<content:encoded><![CDATA[<p><a href="http://julius-ihle.de/?p=2849"><img class="lazyload alignleft wp-image-2852 size-full" data-original="http://julius-ihle.de/wp-content/uploads/2023/04/osl_text.jpg" alt="osl_text" width="1280" height="533" /></a></p>
<p>Having text live in your shaders can be a great way to add decals, burn-ins, etc. to your renders. I&#8217;ve gone on a bit of an adventure to implement an OSL shader which can be used to display arbitrary text right in your shader.</p>
<p><span id="more-2849"></span></p>
<p>Unfortunately implementing a .ttf reader is way above my head, so I had to resort to a more primitive solution. I&#8217;m using a library of images of all the common characters found on an english keyboard layout. These are read back into the shader based on the text input. Having special characters (such as ~#!$?&amp;) in file-names however is a big nono, so I resorted to unicode character naming conversion, where a single integer represents a given character. <a title="ascii characters" href="https://www.cs.cmu.edu/~pattis/15-1XX/common/handouts/ascii.html" target="_blank">ASCII characters</a> are the most important ones, which I have included in the package in a few common fonts. If you would like to use a font other than the ones provided in the package, I&#8217;m also supplying an example Nuke script in which you can just change the font and output in the required manner for the shader to read it properly:</p>
<div style="width: 984px; " class="wp-video"><!--[if lt IE 9]><script>document.createElement('video');</script><![endif]-->
<video class="wp-video-shortcode" id="video-2849-1" width="984" height="1084" loop="1" preload="metadata" controls="controls"><source type="video/mp4" src="http://julius-ihle.de/wp-content/uploads/2023/04/osl_text_nuke-2023-04-23_19.56.39.mp4?_=1" /><a href="http://julius-ihle.de/wp-content/uploads/2023/04/osl_text_nuke-2023-04-23_19.56.39.mp4">http://julius-ihle.de/wp-content/uploads/2023/04/osl_text_nuke-2023-04-23_19.56.39.mp4</a></video></div>
<p>&nbsp;</p>
<p>The idea is to supply the shader with the rendered image sequence of the unicode characters in the <code>font_source</code> parameter replacing the unicode numbers with a hash, like so:<br />
<code>/home/julius/shaders/util/unicode_characters/Arial/#.tx</code><br />
Note that some DCC&#8217;s convert the <code>#</code> to the current frame number, which can be avoided by escaping it, eg by prepending a backslash: <code>\#</code><br />
If the input font path is not valid, you will get a warning in the terminal and the shader will output the color specified in the <code>false_color</code> parameter.</p>
<p>The text to render can be anything you like, provided you have a corresponding unicode character rendered. New lines can be added via <code>\n</code> (some DCC&#8217;s might need <code>\\n</code>).<br />
<a href="http://julius-ihle.de/wp-content/uploads/2023/04/osl_text_img1.png"><img class="lazyload alignleft wp-image-2851 size-full" data-original="http://julius-ihle.de/wp-content/uploads/2023/04/osl_text_img1.png" alt="osl_text_img1" width="920" height="412" /></a></p>
<p>&nbsp;</p>
<p>Apart from that you have a couple of options for placing it on the UV&#8217;s and general text editing stuff (alignment, leading, kerning, etc).</p>
<p>One thing I find this particularly useful for is pipeline automation&#8230; automated burnins on slates, etc. The assets from example turntable setup in the demo below is from the awesome team at <a title="CAVE Academy" href="https://caveacademy.com/" target="_blank">CAVE Academy</a>. Make sure you check them out!</p>
<p>You can download it <a title="download jiText" href="https://github.com/julsVFX/osl/tree/main/jiText" target="_blank">HERE</a></p>
<p>Demo can be seen here:<br />
<iframe src="https://player.vimeo.com/video/820321839?h=a9bd7fb8d5" width="640" height="400" frameborder="0" allowfullscreen="allowfullscreen"></iframe></p>
<p><a href="https://vimeo.com/820321839">OSL Text Shader</a> from <a href="https://vimeo.com/julsvfx">Julius Ihle</a> on <a href="https://vimeo.com">Vimeo</a>.</p>
<p>&nbsp;</p>
<p><span style="color: #808080;">_________________________________________________</span><br />
<span style="color: #808080;"><span style="font-size: small;"> If this post has helped you in any way you can express your gratefulness by using the <em>Donate </em>Button below to buy me a coffee! :)</span></span><br />
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=VH5RW3YDWDJSQ" target="_blank" rel="nofollow"><img class="lazyload" data-original="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" alt="" /></a></p>
<div class="moz-text-html" lang="x-unicode">
<div><span style="font-size: small;"><span style="color: #808080;">3M5xNSV7g2NzVpHMqzYKhgoKJZ8CWa644m</span></span><br />
<img class="lazyload alignleft size-full wp-image-2576" data-original="http://julius-ihle.de/wp-content/uploads/2018/03/bc_ldgr_qrcode.png" alt="bc_ldgr_qrcode" width="128" height="128" /></div>
<div></div>
</div>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://julius-ihle.de/?feed=rss2&#038;p=2849</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://julius-ihle.de/wp-content/uploads/2023/04/osl_text_nuke-2023-04-23_19.56.39.mp4" length="1184096" type="video/mp4" />
		</item>
		<item>
		<title>Light-Linking Light Filters in Arnold</title>
		<link>http://julius-ihle.de/?p=2839</link>
		<comments>http://julius-ihle.de/?p=2839#comments</comments>
		<pubDate>Sat, 11 Mar 2023 19:41:57 +0000</pubDate>
		<dc:creator><![CDATA[Julius]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://julius-ihle.de/?p=2839</guid>
		<description><![CDATA[A very artist-friendly and powerful feature of RenderMan is the ability to light-link light filters to specific objects. In certain scenarios this can become quite&#8230;<p><a href="http://julius-ihle.de/?p=2839" class="more-link post-excerpt-readmore"><span class="more-link-inner">Read more</span><span class="more-link-brd"></span></a></p>]]></description>
				<content:encoded><![CDATA[<p><a href="http://julius-ihle.de/?p=2839"><img class="lazyload aligncenter wp-image-2841 size-large" data-original="http://julius-ihle.de/wp-content/uploads/2023/03/multfilter_arnold-1024x426.jpg" alt="multfilter_arnold" width="1000" height="416" /></a></p>
<p>A very artist-friendly and powerful feature of RenderMan is the ability to light-link light filters to specific objects. In certain scenarios this can become quite useful to make detailed tweaks. In Arnold this is unfortunately not possible to my knowledge, but luckily there are ways to do something similar&#8230;</p>
<p><span id="more-2839"></span></p>
<p>&#8230;through the use of userdata (primvars)! Specifically what I wanted to replicate was <a title="MultFilter" href="https://rmanwiki.pixar.com/display/REN23/PxrIntMultLightFilter">RenderMan&#8217;s MultFilter</a>. The idea is pretty simple, but combined with the ability to light-link it to specific objects it can be extremely useful for adjusting small details of a given scene.</p>
<p>It also was a great starting point to get my hands dirty with C++. I&#8217;m still mostly lost for anything that is more complex than multiplying a few values together, but also happy that I got something out that at least seems to work reasonably well :)</p>
<p>The controls are relatively straight forward. To make use of the userdata inputs, make sure you tag your objects with an Arnold-compliant float userdata and a value between 0 and 1 to drive the amount.</p>
<div style="width: 1000px; " class="wp-video"><video class="wp-video-shortcode" id="video-2839-2" width="1000" height="340" preload="metadata" controls="controls"><source type="video/mp4" src="http://julius-ihle.de/wp-content/uploads/2023/03/multfilter_demo_short.mp4?_=2" /><a href="http://julius-ihle.de/wp-content/uploads/2023/03/multfilter_demo_short.mp4">http://julius-ihle.de/wp-content/uploads/2023/03/multfilter_demo_short.mp4</a></video></div>
<p>&nbsp;</p>
<p>For Katana specifically I&#8217;m also providing a setup that is meant to serve as an example of using it with the built-in light-linking features. The way I&#8217;ve been approach it is the following:<br />
1) Resolve the light linking information (which lights are linked to which geo)<br />
2) Tag light-linked filters with the hierarchy location of the lightfilter as the userdata name and set the default depending on the <code>initialState</code>:<br />
<a href="http://julius-ihle.de/wp-content/uploads/2023/03/lf1.png"><img class="lazyload  size-full wp-image-2842 aligncenter" data-original="http://julius-ihle.de/wp-content/uploads/2023/03/lf1.png" alt="lf1" width="529" height="284" /></a></p>
<p>3) Tag linked objects with the userdata name of the lightfilter location</p>
<p><a href="http://julius-ihle.de/wp-content/uploads/2023/03/lf2.png"><img class="lazyload  size-full wp-image-2843 aligncenter" data-original="http://julius-ihle.de/wp-content/uploads/2023/03/lf2.png" alt="lf2" width="575" height="235" /></a></p>
<p>This is a more artist-friendly and direct way of setting up using known workflows. It&#8217;s probably recreatable to a degree in other DCC&#8217;s as well. A Katana example file that includes this setup can be found <a title="multfilter katana demo scene" href="https://github.com/julsVFX/katana/blob/main/multfilter_demo.katana" target="_blank">HERE</a><br />
&nbsp;</p>
<p>Also here&#8217;s a bit more guided walkthrough available on Vimeo:</p>
<div style="padding: 75% 0 0 0; position: relative;"><iframe style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;" title="multfilter_demo_long.mp4" src="https://player.vimeo.com/video/807112525?h=d7d03e9d4e&amp;badge=0&amp;autopause=0&amp;player_id=0&amp;app_id=58479" width="300" height="150" frameborder="0" allowfullscreen="allowfullscreen"></iframe></div>
<p><script src="https://player.vimeo.com/api/player.js"></script></p>
<p>&#8230; and you can grab it from <a title="Download MultFilter" href="https://github.com/julsVFX/arnold" target="_blank">HERE</a> (source + precompiled for Linux, MacOS and Windows)</p>
<p>&nbsp;</p>
<p><span style="color: #808080;">_________________________________________________</span><br />
<span style="color: #808080;"><span style="font-size: small;"> If this post has helped you in any way you can express your gratefulness by using the <em>Donate </em>Button below to buy me a coffee! :)</span></span><br />
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=VH5RW3YDWDJSQ" target="_blank" rel="nofollow"><img class="lazyload" data-original="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" alt="" /></a></p>
<div class="moz-text-html" lang="x-unicode">
<div><span style="font-size: small;"><span style="color: #808080;">3M5xNSV7g2NzVpHMqzYKhgoKJZ8CWa644m</span></span><br />
<img class="lazyload alignleft size-full wp-image-2576" data-original="http://julius-ihle.de/wp-content/uploads/2018/03/bc_ldgr_qrcode.png" alt="bc_ldgr_qrcode" width="128" height="128" /></div>
<div></div>
</div>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://julius-ihle.de/?feed=rss2&#038;p=2839</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://julius-ihle.de/wp-content/uploads/2023/03/multfilter_demo_short.mp4" length="5113860" type="video/mp4" />
		</item>
		<item>
		<title>Playing with OSL #6: Fake Refraction Parallax</title>
		<link>http://julius-ihle.de/?p=2829</link>
		<comments>http://julius-ihle.de/?p=2829#comments</comments>
		<pubDate>Thu, 29 Dec 2022 12:12:08 +0000</pubDate>
		<dc:creator><![CDATA[Julius]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://julius-ihle.de/?p=2829</guid>
		<description><![CDATA[&#160; Sometimes getting complex refactive behavior through surfaces can be a tricky challenge. If you&#8217;re trying to recreate something like cracks inside of ice it&#8230;<p><a href="http://julius-ihle.de/?p=2829" class="more-link post-excerpt-readmore"><span class="more-link-inner">Read more</span><span class="more-link-brd"></span></a></p>]]></description>
				<content:encoded><![CDATA[<p><a href="http://julius-ihle.de/?p=2829"><img class="lazyload aligncenter wp-image-2830 size-large" data-original="http://julius-ihle.de/wp-content/uploads/2022/12/osl_fake_parallax-1024x426.jpg" alt="osl_fake_parallax" width="1000" height="416" /></a></p>
<p>&nbsp;</p>
<p>Sometimes getting complex refactive behavior through surfaces can be a tricky challenge. If you&#8217;re trying to recreate something like cracks inside of ice it can be a challenge to get this behavior as it can involve a lot of iterations in on the internal geometry and shader adjustments. Often it will also take a long while to render if you&#8217;re doing actual refractions. If you need something simpler tough there are ways to do that in the shader directly</p>
<p><span id="more-2829"></span></p>
<p>I got the initial idea for this from <a title="unreal ice shader" href="https://www.youtube.com/watch?v=X5WASspig3g" target="_blank">Ben Cloward&#8217;s ice shader test</a> in Unreal. It&#8217;s a very smart approach in which you get the appearance of the surface texture extending into the volume of the geometry that you are applying the shader to. Given this approach I wrote an OSL shader that does the same thing. I mainly created it for the purpose of shading ice-like internal structures but it can potentially be extended for other use cases as well.</p>
<p><a href="http://julius-ihle.de/wp-content/uploads/2022/12/ui.png"><img class="lazyload aligncenter size-full wp-image-2831" data-original="http://julius-ihle.de/wp-content/uploads/2022/12/ui.png" alt="ui" width="409" height="245" /></a></p>
<p>You can supply a texture file into the <code>filename</code> parameter. The texture will be applied to the surface UV&#8217;s with periodic tiling. With the default values it creates a duplicate of the supplied texture &#8220;inside&#8221; the objects that the shader is applied to at the specified <code>depth</code>. The <code>invert_depth</code> parameter will drastically change the look. Depending on the source texture you are using it can give the appearance of occluded cracks vs a &#8220;see through&#8221; repetition of the surface texture. A <code>roughness</code> parameter is also available which you can use to simulate the texture getting more murky the deeper it goes &#8220;into&#8221; the object. This is not a physical parameter but just a simple texture blur. If you want a smoother appearance of continuous streaks as the texture goes into the surface you can increase the number of <code>steps</code>. This can simulate continuous from the surface down to the specified depth. Keep in mind that this is the number of texture calls, so having high values here can potentially make it quite slow.<br />
Unfortunately this time it won&#8217;t work with Blender as I couldn&#8217;t find a proper way to get the derivatives &amp; UV&#8217;s to work as expected :( If anyone has the time to look into it please feel free to do so!</p>
<p>As always having a visual demo is probably a good idea, so here it comes:<br />
<iframe src="https://player.vimeo.com/video/784975059?h=25178ea7fe" width="640" height="360" frameborder="0" allowfullscreen="allowfullscreen"></iframe></p>
<p><a href="https://vimeo.com/784975059">OSL Fake Parallax Shader</a> from <a href="https://vimeo.com/julsvfx">Julius Ihle</a> on <a href="https://vimeo.com">Vimeo</a>.</p>
<p>&nbsp;</p>
<p>You can download it from <a title="Download" href="https://github.com/julsVFX/osl" target="_blank">HERE</a>.</p>
<p>&nbsp;</p>
<p><span style="color: #808080;">_________________________________________________</span><br />
<span style="color: #808080;"><span style="font-size: small;"> If this post has helped you in any way you can express your gratefulness by using the <em>Donate </em>Button below to buy me a coffee! :)</span></span><br />
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=VH5RW3YDWDJSQ" target="_blank" rel="nofollow"><img class="lazyload" data-original="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" alt="" /></a></p>
<div class="moz-text-html" lang="x-unicode">
<div><span style="font-size: small;"><span style="color: #808080;">3M5xNSV7g2NzVpHMqzYKhgoKJZ8CWa644m</span></span><br />
<img class="lazyload alignleft size-full wp-image-2576" data-original="http://julius-ihle.de/wp-content/uploads/2018/03/bc_ldgr_qrcode.png" alt="bc_ldgr_qrcode" width="128" height="128" /></div>
<div></div>
</div>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://julius-ihle.de/?feed=rss2&#038;p=2829</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Playing with OSL #5: Arnold Reflection Alpha + Utilities</title>
		<link>http://julius-ihle.de/?p=2788</link>
		<comments>http://julius-ihle.de/?p=2788#comments</comments>
		<pubDate>Wed, 15 Sep 2021 19:42:58 +0000</pubDate>
		<dc:creator><![CDATA[Julius]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://julius-ihle.de/?p=2788</guid>
		<description><![CDATA[When trying to integrate CG renders into real life footage one common hurdle is to treat reflections properly. Often times in your plate you will&#8230;<p><a href="http://julius-ihle.de/?p=2788" class="more-link post-excerpt-readmore"><span class="more-link-inner">Read more</span><span class="more-link-brd"></span></a></p>]]></description>
				<content:encoded><![CDATA[<p><a href="http://julius-ihle.de/?p=2788"><img class="lazyload aligncenter wp-image-2789 size-large" data-original="http://julius-ihle.de/wp-content/uploads/2021/09/arnold_refl_aovs-1024x426.jpg" alt="arnold_refl_aovs" width="1000" height="416" /></a></p>
<p>When trying to integrate CG renders into real life footage one common hurdle is to treat reflections properly. Often times in your plate you will have elements that have bright reflections (eg windows, plastic chairs, shiny tables, etc) in which your CG elements need to reflect. Rendering a simple reflection pass however often times does not really cut it</p>
<p><span id="more-2788"></span></p>
<p>See the example below. If you were to add a usual reflection pass to it the result does not really make sense:</p>
<p><a href="http://julius-ihle.de/wp-content/uploads/2021/09/03_renderrefl.jpg"><img class="lazyload aligncenter size-full wp-image-2790" data-original="http://julius-ihle.de/wp-content/uploads/2021/09/03_renderrefl.jpg" alt="03_renderrefl" width="458" height="512" /></a></p>
<p>This is because the reflection is simply added in this case. While adding reflections is technically correct, the problem is that we already have reflections in the plate. The window behind the table has a large contribution to the specular reflection on the table. If you look at the cup on the right what is happening is that the cups reflection is blocking the highlights from the window. As the cup is neither emissive nor very bright it&#8217;s reflection is a lot darker.</p>
<p>We&#8217;d need to do something similar to the reflection of the CG render. A common trick is to render a separate reflection of the same element but with a constant white shader. This has several drawbacks tough:<br />
Most renderers don&#8217;t support arbitrary utility outputs in traced results. This means the render would need to be a separate layer<br />
&#8211;&gt; more render layers to manage for the Lighting TD<br />
&#8211;&gt; longer rendering times<br />
&#8211;&gt; Comp has to deal with more separate renders<br />
&#8211;&gt; even more layers to manage if additional utility passes are requested (reflected Position, Normals, userdata, etc.)</p>
<p>Ideally you would have the alpha and any additional arbitrary outputs as an AOV instead of a separate render to remedy all of the drawbacks mentioned above.</p>
<p>&nbsp;</p>
<p>I therefore wrote a simple OSL shader. This however probably only works reliably in more recent versions of Arnold. You can assign it to your set geometry and anything that will reflect in it will sample whichever shading component you specify. This supports OSL builtins (eg <code>P</code> and <code>N</code>) as well as arbitrary userdata (eg <code>Pref</code>). If you use <code>dist</code> or <code>distance</code> as a special keyword for the trace_component it will output the distance of the reflection from the current shading point, which can be used in comp to fake roughness. If the given component is not found it will reflect the <code>trace_color</code> (eg to be used as an alpha for reflections).<br />
If your set geometry contains multiple shapes you can add them to a trace set and specify that same trace set in the shader and untick <code>inclusive</code>. This will allow only reflections from your anything other than the set geometry.<br />
<a href="http://julius-ihle.de/wp-content/uploads/2021/09/07UIv002.png"><img class="lazyload aligncenter wp-image-2798 size-full" data-original="http://julius-ihle.de/wp-content/uploads/2021/09/07UIv002.png" alt="" width="464" height="167" /></a></p>
<p>The shader will output rgb data which means you can pipe it into custom AOVs for example with the help of <code>aov_write</code> shading nodes:<br />
<a href="http://julius-ihle.de/wp-content/uploads/2021/09/08_mayav002.png"><img class="lazyload aligncenter wp-image-2799 size-large" data-original="http://julius-ihle.de/wp-content/uploads/2021/09/08_mayav002-1024x610.png" alt="" width="1000" height="596" /></a></p>
<p>With a little bit of comp love you can get quite promising results:<br />
<a href="http://julius-ihle.de/wp-content/uploads/2021/09/comp.png"><img class="lazyload aligncenter size-full wp-image-2802" data-original="http://julius-ihle.de/wp-content/uploads/2021/09/comp.png" alt="comp" width="458" height="512" /></a></p>
<p>You can give it a whirl by downloading the jiTraceAOVs shader from my <a title="github" href="https://github.com/julsVFX/osl">github</a></p>
<p>Here&#8217;s a bit more indepth demo + a simple comp example:<br />
<iframe src="https://player.vimeo.com/video/605842818" width="640" height="360" frameborder="0" allowfullscreen="allowfullscreen"></iframe></p>
<p><span style="color: #808080;">_________________________________________________</span><br />
<span style="color: #808080;"><span style="font-size: small;"> If this post has helped you in any way you can express your gratefulness by using the <em>Donate </em>Button below to buy me a coffee! :)</span></span><br />
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=VH5RW3YDWDJSQ" target="_blank" rel="nofollow"><img class="lazyload" data-original="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" alt="" /></a></p>
<div class="moz-text-html" lang="x-unicode">
<div><span style="font-size: small;"><span style="color: #808080;">3M5xNSV7g2NzVpHMqzYKhgoKJZ8CWa644m</span></span><br />
<img class="lazyload alignleft size-full wp-image-2576" data-original="http://julius-ihle.de/wp-content/uploads/2018/03/bc_ldgr_qrcode.png" alt="bc_ldgr_qrcode" width="128" height="128" /></div>
<div></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://julius-ihle.de/?feed=rss2&#038;p=2788</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Playing with OSL #4: UDIM Mask</title>
		<link>http://julius-ihle.de/?p=2755</link>
		<comments>http://julius-ihle.de/?p=2755#comments</comments>
		<pubDate>Tue, 05 Jan 2021 15:48:55 +0000</pubDate>
		<dc:creator><![CDATA[Julius]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://julius-ihle.de/?p=2755</guid>
		<description><![CDATA[It&#8217;s been a while&#8230; Busy days :) Occasionally there might be the need for LookDev Artists to adjust areas of a shader based on different&#8230;<p><a href="http://julius-ihle.de/?p=2755" class="more-link post-excerpt-readmore"><span class="more-link-inner">Read more</span><span class="more-link-brd"></span></a></p>]]></description>
				<content:encoded><![CDATA[<p><a href="http://julius-ihle.de/?p=2755"><img class="lazyload aligncenter size-large wp-image-2756" data-original="http://julius-ihle.de/wp-content/uploads/2021/01/b_udimmask-1024x426.png" alt="b_udimmask" width="1000" height="416" /></a><br />
It&#8217;s been a while&#8230; Busy days :)</p>
<p>Occasionally there might be the need for LookDev Artists to adjust areas of a shader based on different UDIMs. If an asset has a continuous mesh that is only separated by UDIMs (eg nails on a character or decorative parts of clothing) it can be useful to create masks for specific UDIMs in the shading network to isolate areas of interest.<br />
<span id="more-2755"></span></p>
<p>It is relatively straight forward to get the integer values of each UDIM in a shader by just creating a Nodegraph that resembles the UDIM formula:<br />
<code><strong><em>1000+(floor(u)+1)+(floor(v)*10)</em></strong></code></p>
<p>You can output the result into a compare node in your renderer of choice and check whether it matches against a certain UDIM. While this is fine for 1 or 2 UDIMs it gets quite cumbersome with many UDIMs.</p>
<p>As I like playing with OSL I put together a version that allows you to create masks from a specified list of UDIMs. It expects a comma-separated list of UDIM tiles. You can also specify ranges. Eg <strong><em>1001,1003-1006,1015,125</em></strong> will select the following UDIMs: 1001,1003,1004,1005,1006,1015,1025.<br />
You can also just output the raw UDIM tiles integers if you want to create more complex masks downstream.</p>
<p>There are just a few caveats:<br />
1) The input is a string, so internally it&#8217;s checking against a regex to see if the passed input is a valid list of UDIMs. This can potentially be expensive in larger shading networks.<br />
2) At the moment there&#8217;s a hard-coded maximum of 10 entries that are allowed for performance reasons (note that ranges such as 1001-1005 count as 1 entry). You can edit the <code>#define MAX_TILES 10</code> in the supplied .osl file if you need more.<br />
3) At the moment I could only test it with Arnold. Not sure if Blender supports UDIMs properly in this way. RenderMan should work as well.</p>
<p>You can download it <a title="Download" href="https://github.com/julsVFX/osl">HERE</a> from github.</p>
<p>Here&#8217;s a quick demo:<br />
<iframe src="https://player.vimeo.com/video/497299703" width="640" height="360" frameborder="0" allowfullscreen="allowfullscreen"></iframe></p>
<p><a href="https://vimeo.com/497299703">OSL UDIM Mask</a> from <a href="https://vimeo.com/julsvfx">Julius Ihle</a> on <a href="https://vimeo.com">Vimeo</a>.</p>
<p><span style="color: #808080;">_________________________________________________</span><br />
<span style="color: #808080;"><span style="font-size: small;"> If this post has helped you in any way you can express your gratefulness by using the <em>Donate </em>Button below to buy me a coffee! :)</span></span><br />
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=VH5RW3YDWDJSQ" target="_blank" rel="nofollow"><img class="lazyload" data-original="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" alt="" /></a></p>
<div class="moz-text-html" lang="x-unicode">
<div><span style="font-size: small;"><span style="color: #808080;">3M5xNSV7g2NzVpHMqzYKhgoKJZ8CWa644m</span></span><br />
<img class="lazyload alignleft size-full wp-image-2576" data-original="http://julius-ihle.de/wp-content/uploads/2018/03/bc_ldgr_qrcode.png" alt="bc_ldgr_qrcode" width="128" height="128" /></div>
<div></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://julius-ihle.de/?feed=rss2&#038;p=2755</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making Image Magic(k)</title>
		<link>http://julius-ihle.de/?p=2690</link>
		<comments>http://julius-ihle.de/?p=2690#comments</comments>
		<pubDate>Sun, 10 Mar 2019 13:58:17 +0000</pubDate>
		<dc:creator><![CDATA[Julius]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://julius-ihle.de/?p=2690</guid>
		<description><![CDATA[One of the things I found myself having to do more and more recently was creating contactsheets. This is mainly to keep an overview for&#8230;<p><a href="http://julius-ihle.de/?p=2690" class="more-link post-excerpt-readmore"><span class="more-link-inner">Read more</span><span class="more-link-brd"></span></a></p>]]></description>
				<content:encoded><![CDATA[<p><a href="http://julius-ihle.de/?p=2690"><img class="lazyload  size-large wp-image-2691 aligncenter" data-original="http://julius-ihle.de/wp-content/uploads/2019/03/imagemagick-1024x426.png" alt="imagemagick" width="1000" height="416" /></a></p>
<p>One of the things I found myself having to do more and more recently was creating contactsheets. This is mainly to keep an overview for myself over all the shots in every sequence for example. It usually saves me a lot of time, especially at the beginning of a show when I wasn&#8217;t neccesserely familiar yet with all the shots we had to work on.<br />
Creating the contactsheets themselves however proved to be rather tedious as my workflow consisted of doing it all in Nuke. Adding, shuffling or annotating shots wasn&#8217;t really easy without some serious Python trickery. Luckily I found a great alternative.<span id="more-2690"></span></p>
<p>So what&#8217;s the fancy title all about? The tool that I&#8217;m going to be using is an open source command line image-editing utility called <a title="ImageMagick official website" href="https://imagemagick.org" target="_blank">Image Magick</a>. The beauty of it is that it can be used to batch-process a ton of images. It can seem quite overwhelming at first as it ships with a lot of utilities and options but this is what also makes it so powerful. A lot details and examples can be found in the v6 documentation <a href="https://imagemagick.org/Usage" target="_blank">HERE</a>.</p>
<p>I should preface this write-up by saying that I only touched the tip of the iceberg and am still discovering new things day by day.</p>
<p>What I did know was the main purpose I wanted to use it for: Stitching thumbnails of all relevant shots from our database so that I would have a one-stop quick overview for the shots. Alongside this I wanted to have the following information displayed for each shot:<br />
-annotate each thumbnail with the shotname<br />
-show some info from the database about the status from relevant departments<br />
-annotate each thumbnail with assigned artist</p>
<p>Goal is set, so here&#8217;s a quick rundown on my humble tests. I have been using the following 3 utilities that ship with ImageMagick:<br />
<strong><em>convert</em></strong><br />
<strong><em>montage</em></strong><br />
<strong><em>identify</em></strong></p>
<p><em>convert</em> is pretty straight forward. It&#8217;s main purpose is to do all sort of image manipulation. Transforms, filters, color corrections, annotations &#8211; you name it.<br />
<em>montage</em> is very useful for stitching multiple images together to create a collage.<br />
<em>identify</em> is a useful tool for getting information about an image such as resolution, color space, etc.</p>
<p>I set up a testproject with some thumbnails based on a sort-of famous movie&#8230; I made up sequence- and shot names. Alltogether I have 7 sequences, each with a couple of shots inside them. The directory structure is split up so we have <em>$PROJ/$SEQ/$SHOT/thumbnail.png</em>:<br />
.<br />
├── testproj<br />
│   ├── FS<br />
│   │   ├── 0310<br />
│   │   │   ├── test.png<br />
│   │   │   └── thumbnail.png<br />
│   │   ├── 0320<br />
│   │   │   └── thumbnail.png<br />
│   │   ├── 0330<br />
│   │   │   └── thumbnail.png<br />
│   │   ├── 0360<br />
│   │   │   └── thumbnail.png<br />
│   │   ├── 0370<br />
│   │   │   └── thumbnail.png<br />
│   │   └── 0390<br />
│   │       └── thumbnail.png<br />
│   ├── GR<br />
│   │   ├── 0040<br />
│   │   │   └── thumbnail.png<br />
│   │   ├── 0050<br />
│   │   │   └── thumbnail.png<br />
│   │   ├── 0060<br />
│   │   │   └── thumbnail.png<br />
│   │   ├── 0070<br />
│   │   │   └── thumbnail.png</p>
<p>etc&#8230;</p>
<p>The general syntax for using the image magick tools is<br />
<em>magick tool inputImage [-options] outputImage</em><br />
example:</p>
<div class="my-syntax-highlighter">
<pre><textarea id="mshighlighter" class="mshighlighter" language="shell" name="mshighlighter" >magick convert thumbnail.png -resize 50% test.jpg</textarea></pre>
</div>
<p>This will shrink the input image thumbnail.png by 50% and save the output as test.jpg. Easy enough&#8230;<br />
(Note that the <em>magick</em> prefix has only been introduced from ImageMagick v7 onwards.)</p>
<p>However my thumbnails are not really thumbnails at the moment. They are massive as they are just screenshots from the BluRay. I want to resize them down from their original size of 1920&#215;1040 to 640&#215;480. 640&#215;480 is a different aspect ratio however and the default for resizing an image using <em>convert</em> is to resize the image to the specified width and keep the aspect ratio from the original image. I could use <em>-extent</em> in the following way to force the output resolution:</p>
<div class="my-syntax-highlighter">
<pre><textarea id="mshighlighter" class="mshighlighter" language="shell" name="mshighlighter" >magick convert thumbnail.png -resize 640x480 -background black -gravity center -extent 640x480 test.png</textarea></pre>
</div>
<p>This will resize the original image to 640&#215;347 (due to the different aspect ratio), extend the resolution to 640&#215;480 afterwards and fill the empty areas with black while keeping the image centered.</p>
<p><a href="http://julius-ihle.de/wp-content/uploads/2019/03/im_01.png"><img class="lazyload  size-large wp-image-2694 aligncenter" data-original="http://julius-ihle.de/wp-content/uploads/2019/03/im_01-1024x392.png" alt="im_01" width="1000" height="383" /></a></p>
<p>&nbsp;</p>
<p>There are multiple ways to add text to an image. You can use <em>-draw</em> to place text exactly where you want. Preceding options can define the style and positioning of the text. This example will create white text saying &#8216;test&#8217;, outlined with black and a size of 250 in the center of the image:</p>
<div class="my-syntax-highlighter">
<pre><textarea id="mshighlighter" class="mshighlighter" language="shell" name="mshighlighter" >magick convert thumbnail.png \
  -font DejaVu-Sans \
  -pointsize 250 \
  -fill white \
  -stroke black \
  -strokewidth 5 \
  -gravity center \
  -draw "text 0,0 'test'" test.png</textarea></pre>
</div>
<p><a href="http://julius-ihle.de/wp-content/uploads/2019/03/im_02.png"><img class="lazyload  size-medium wp-image-2695 aligncenter" data-original="http://julius-ihle.de/wp-content/uploads/2019/03/im_02-300x163.png" alt="im_02" width="300" height="163" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>ImageMagick&#8217;s main benefit lies in batch processing a multitude of images. I could shrink all my images and annotate them with the shot name in the same way as outlined above (in this case using bash):</p>
<div class="my-syntax-highlighter">
<pre><textarea id="mshighlighter" class="mshighlighter" language="shell" name="mshighlighter" >for sequence in testproj/*; do
#get the sequence name from folder
seqName=$(basename ${sequence})
#create directory of current sequence inside seqSheets dir
mkdir -p seqSheets/${seqName};
#create annotated thumbnail and export to seqSheets directory
for thumb in ${sequence}/*/thumbnail.png; do
  shotName=$(basename $(dirname ${thumb}))
  magick convert $thumb \
    -resize 640x480 \
    -background black \
    -gravity center \
    -extent 640x480 \
    -font DejaVu-Sans-Bold \
    -pointsize 150 \
    -fill rgba\(255,255,255,0.30\) \
    -stroke black \
    -strokewidth 5 \
    -gravity center \
    -draw "text 0,0 '${shotName}'" \
    "seqSheets/${seqName}/${shotName}.png";
  done;
done</textarea></pre>
</div>
<p>This way I have a small annotated version of each thumbnail inside a newly created seqSheets folder as well:<br />
.<br />
├── seqSheets<br />
│   ├── FS<br />
│   │   ├── 0310.png<br />
│   │   ├── 0320.png<br />
│   │   ├── 0330.png<br />
│   │   ├── 0360.png<br />
│   │   ├── 0370.png<br />
│   │   └── 0390.png<br />
│   ├── GR<br />
│   │   ├── 0040.png<br />
│   │   ├── 0050.png<br />
│   │   ├── 0060.png<br />
│   │   ├── 0070.png</p>
<p>Now that I have each shot annotated with its name I can use <em>montage</em> to stack them on top of each other. I would like to do that in a specific way tough. Preferably I would like my contact sheet to be aligned at the top so I have the sequence names in one row and the shots for each sequence stacked beneath them:<br />
<a href="http://julius-ihle.de/wp-content/uploads/2019/03/im_03_seqsheetexample.png"><img class="lazyload  size-medium wp-image-2696 aligncenter" data-original="http://julius-ihle.de/wp-content/uploads/2019/03/im_03_seqsheetexample-300x292.png" alt="im_03_seqsheetexample" width="300" height="292" /></a></p>
<p><em>montage</em> is a great utility for aligning images as it features a lot of options. To be able to easily update things on a per-sequence level I decided to do an individual sheet per sequence first.<br />
If <em>montage</em> is not being given any options it will try to align images in a more-or-less smart manner itself:</p>
<div class="my-syntax-highlighter">
<pre><textarea id="mshighlighter" class="mshighlighter" language="shell" name="mshighlighter" >magick montage seqSheets/FS/*png test.png</textarea></pre>
</div>
<p><a href="http://julius-ihle.de/wp-content/uploads/2019/03/im_04montage_no_options.png"><img class="lazyload aligncenter wp-image-2697 size-full" data-original="http://julius-ihle.de/wp-content/uploads/2019/03/im_04montage_no_options.png" alt="im_04montage_no_options" width="384" height="252" /></a></p>
<p>There are a number of ways how you can set your alignment in montage. You can use the<em> -tile AxB</em> option to define how many rows and column your montage should have (where <em>A</em> are the columns and <em>B</em> the rows). As with a lot of options on the ImageMagick toolset it&#8217;s possible to leave out either rows or columns and montage will just force one column for example independent of how many images you have.</p>
<div class="my-syntax-highlighter">
<pre><textarea id="mshighlighter" class="mshighlighter" language="shell" name="mshighlighter" >montage seqSheets/FS/*png -tile 1x test.png</textarea></pre>
</div>
<p><a href="http://julius-ihle.de/wp-content/uploads/2019/03/im_05_montage_base.png"><img class="lazyload aligncenter wp-image-2698 size-full" data-original="http://julius-ihle.de/wp-content/uploads/2019/03/im_05_montage_base.png" alt="im_05_montage_base" width="128" height="756" /></a></p>
<p>My goal is to put all the individual sequence sheets next to each other afterwards. For this to be more straight forward I want to force each sequence sheet to have the same number of rows. I will therefore just grab the sequence with the most number of shots and set every sheet to have this number of rows:</p>
<div class="my-syntax-highlighter">
<pre><textarea id="mshighlighter" class="mshighlighter" language="shell" name="mshighlighter" >#grab the maximum number of shots per sequence

maxShots=$(find testproj/ | rev | cut -d "/" -f2- | rev | sort | uniq -c | sort -k1n,1 | tail -n1 | sed 's/^\s*//' | cut -d " " -f1)
for sequence in $(ls -d seqSheets/*/); do
  seqName=$(basename ${sequence})
  magick montage ${sequence}/* \
    -background black \
    -fill white \
    -pointsize 18 \
    -font DejaVu-Sans-Bold \
    -title $seqName \
    -tile "1x${maxShots}" \
    "seqSheets/${seqName}.png"
done</textarea></pre>
</div>
<p>The resulting sheets will consequently all have the same dimensions so stitching them together afterwards will be pretty easy:<br />
<a href="http://julius-ihle.de/wp-content/uploads/2019/03/im_06FS.png"><img class="lazyload  size-large wp-image-2699 alignleft" data-original="http://julius-ihle.de/wp-content/uploads/2019/03/im_06FS-100x1024.png" alt="im_06FS" width="100" height="1024" /></a> <a href="http://julius-ihle.de/wp-content/uploads/2019/03/im_06GR.png"><img class="lazyload  size-large wp-image-2700 alignleft" data-original="http://julius-ihle.de/wp-content/uploads/2019/03/im_06GR-100x1024.png" alt="im_06GR" width="100" height="1024" /></a> <a href="http://julius-ihle.de/wp-content/uploads/2019/03/im_06MFB.png"><img class="lazyload  size-large wp-image-2701 alignleft" data-original="http://julius-ihle.de/wp-content/uploads/2019/03/im_06MFB-100x1024.png" alt="im_06MFB" width="100" height="1024" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>I will use <em>convert</em> this time instead of <em>montage</em> to simply append all of the images together. Reason being is that it will just keep the input formats and it&#8217;s a bit easier to control spacing using the <em>-border</em> option. <em>+append</em> stacks the images horizontally, <em>-append</em> would stack them vertically:</p>
<div class="my-syntax-highlighter">
<pre><textarea id="mshighlighter" class="mshighlighter" language="shell" name="mshighlighter" >convert seqSheets/*png \
  -background black \
  -bordercolor black \
  -border 25x \
  +append \
  final_contactsheet.png \</textarea></pre>
</div>
<p><a href="http://julius-ihle.de/wp-content/uploads/2019/03/im_07finalcontactsheet.png"><img class="lazyload aligncenter size-large wp-image-2702" data-original="http://julius-ihle.de/wp-content/uploads/2019/03/im_07finalcontactsheet-974x1024.png" alt="im_07finalcontactsheet" width="974" height="1024" /></a></p>
<p>Taking this further one could grab additional information from the project database. If there&#8217;s a way to access it via a Python API for example one could annotate each shot with their respective department status, assigned user, etc. This way it can provide lot&#8217;s of very useful information at a glance. I just made up something here but I hope it shows the point:<br />
<a href="http://julius-ihle.de/wp-content/uploads/2019/03/im_08final_contactsheet_extraInfo.png"><img class="lazyload aligncenter size-large wp-image-2703" data-original="http://julius-ihle.de/wp-content/uploads/2019/03/im_08final_contactsheet_extraInfo-974x1024.png" alt="im_08final_contactsheet_extraInfo" width="974" height="1024" /></a><br />
<span style="color: #808080;">_________________________________________________</span><br />
<span style="color: #808080;"><span style="font-size: small;"> If this post has helped you in any way you can express your gratefulness by using the <em>Donate </em>Button below to buy me a coffee! :)</span></span><br />
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=VH5RW3YDWDJSQ" target="_blank" rel="nofollow"><img class="lazyload" data-original="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" alt="" /></a></p>
<div class="moz-text-html" lang="x-unicode">
<div><span style="font-size: small;"><span style="color: #808080;">3M5xNSV7g2NzVpHMqzYKhgoKJZ8CWa644m</span></span><br />
<img class="lazyload alignleft size-full wp-image-2576" data-original="http://julius-ihle.de/wp-content/uploads/2018/03/bc_ldgr_qrcode.png" alt="bc_ldgr_qrcode" width="128" height="128" /></div>
<div></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://julius-ihle.de/?feed=rss2&#038;p=2690</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Problem with Specular Maps&#8230;</title>
		<link>http://julius-ihle.de/?p=2653</link>
		<comments>http://julius-ihle.de/?p=2653#comments</comments>
		<pubDate>Mon, 15 Oct 2018 20:42:32 +0000</pubDate>
		<dc:creator><![CDATA[Julius]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://julius-ihle.de/?p=2653</guid>
		<description><![CDATA[Getting Reflections and Speculars to look right is one of the most essential parts to creating realistic-looking CGI. At the same time it is also&#8230;<p><a href="http://julius-ihle.de/?p=2653" class="more-link post-excerpt-readmore"><span class="more-link-inner">Read more</span><span class="more-link-brd"></span></a></p>]]></description>
				<content:encoded><![CDATA[<p><a href="http://julius-ihle.de/?p=2653"><img class="lazyload aligncenter wp-image-2662 size-full" data-original="http://julius-ihle.de/wp-content/uploads/2018/10/spec2IOR.png" alt="spec2IOR" width="1280" height="533" /></a></p>
<p>Getting Reflections and Speculars to look right is one of the most essential parts to creating realistic-looking CGI. At the same time it is also one of the hardest things to get right. This is just a personal opinion on how I think varying specular behavior across a surface can be handled nicer than using traditional ways.<span id="more-2653"></span></p>
<p>The main thing that gives you a nice specular variance across a surface is using roughness variations. Another technique that is well established alongside that is the use of specular-color/specmaps to modulate the intensity of specular highlights and reflections across a surface. Does it look good? Yep, usually! Is it accurate? Not really&#8230;</p>
<p>With the way most shaders are structured in VFX having a specular map to break up the intensity of specular reflections is not accurate. The specular color and specular gain of all shaders should always be white (RGB: 1,1,1). Wait, what? Let me explain&#8230;</p>
<p>If you look for example on <a title="refractiveindex.info" href="https://refractiveindex.info/?shelf=3d&amp;book=plastics&amp;page=pmma" target="_blank">refractiveindex.info</a> you will notice that no matter what material you look at, they have one thing in common: The specular reflectance at the glancing angle is always 1, which means that if you were to look at any material at a potential angle of 90 degrees they would reflect all incoming light. Furthermore for dielectrics the specular component of the surface maintains its incoming polarization and is consequently not tinting the outgoing reflection. Changing the wavelength of light hitting dielectrics will not have a (perceivable) impact on the amount of light that is reflected so the specular or reflection color should stay white.</p>
<p>Where they all differ is how much light they reflect when looking directly at them at a 0 degree angle (often reffered to as F0, R0, spec0 or something along those lines). This is caused by the different indecies of refraction for the materials:<br />
<a href="http://julius-ihle.de/wp-content/uploads/2018/10/fresnelgraph.jpg"><img class="lazyload  size-full wp-image-2655 aligncenter" data-original="http://julius-ihle.de/wp-content/uploads/2018/10/fresnelgraph.jpg" alt="fresnelgraph" width="1094" height="612" /></a></p>
<p>&nbsp;</p>
<p>Also as you can see in the Fresnel graphs the amount of light that is reflected does not really change that much from 0 to about 45 degrees. If you were to take a sphere and visualize the areas that contribute the most to the overall surface appearance on screen its the range of 0-45 degrees (visualized in green) vs 45-90 degrees (visualized in red):</p>
<p><a href="http://julius-ihle.de/wp-content/uploads/2018/10/angle_visualization2.jpg"><img class="lazyload  size-full wp-image-2656 aligncenter" data-original="http://julius-ihle.de/wp-content/uploads/2018/10/angle_visualization2.jpg" alt="angle_visualization2" width="256" height="256" /></a></p>
<p>&nbsp;</p>
<p>Now back to the point why I said the specular albedo should always be 1 is because the way shaders in most offline-renderers work. They calculate the total surface specular reflectance with Specular Color * Specular Gain which is then attenuated by the IOR depending on the angle you are looking at it. So if you were to change the specular color to anything less than 1 you would never potentially reach full reflectance at a 90° angle.<br />
Consequently if your goal is to be technically accurate you would vary the index of refraction across a surface instead of the specular-color or -gain to achieve different levels in specular reflectance:</p>
<p><a href="http://julius-ihle.de/wp-content/uploads/2018/10/varyingSpecIOR8.jpg"><img class="lazyload alignleft wp-image-2660" data-original="http://julius-ihle.de/wp-content/uploads/2018/10/varyingSpecIOR8.jpg" alt="varying specColor / roughness 0.1" width="389" height="219" /></a></p>
<p><a href="http://julius-ihle.de/wp-content/uploads/2018/10/varyingSpecIOR9.jpg"><img class="lazyload alignright wp-image-2659" data-original="http://julius-ihle.de/wp-content/uploads/2018/10/varyingSpecIOR9.jpg" alt="varying specIOR / roughness 0.1" width="390" height="219" /></a></p>
<p><a href="http://julius-ihle.de/wp-content/uploads/2018/10/varyingSpecIOR18.jpg"><img class="lazyload alignleft wp-image-2658" data-original="http://julius-ihle.de/wp-content/uploads/2018/10/varyingSpecIOR18.jpg" alt="varying specColor / roughness 1" width="390" height="219" /></a></p>
<p><a href="http://julius-ihle.de/wp-content/uploads/2018/10/varyingSpecIOR16.jpg"><img class="lazyload alignright wp-image-2657" data-original="http://julius-ihle.de/wp-content/uploads/2018/10/varyingSpecIOR16.jpg" alt="varying specIOR / roughness 1" width="390" height="219" /></a></p>
<p>With varying the specular IOR instead of the color you are making sure you retain enough edge reflectance to create a more plausible surface appearance.</p>
<p>&nbsp;</p>
<p>The IOR range for most dielectrics is about 1.3-1.8. I will ignore metals on purpose as they come with their own special sauce. These values however are not very artist friendly to work with as they are outside the 0-1 range.<br />
Personally what I like doing is to first remap my spec map in a 0-1 range so I get the contrast ratio I want and then remap the result to the desired IOR range (using the out_min and out_max of a remap/range node for example).<br />
<a href="http://julius-ihle.de/wp-content/uploads/2018/10/nodegraph.jpg"><img class="lazyload aligncenter size-large wp-image-2661" data-original="http://julius-ihle.de/wp-content/uploads/2018/10/nodegraph-1024x600.jpg" alt="nodegraph" width="1000" height="586" /></a><a href="http://julius-ihle.de/wp-content/uploads/2018/10/nodegraph.jpg"><br />
</a></p>
<p>Having a nicely varying specular roughness (alongside potentially anisotropy) across the surface will give most of the realism in most circumstances with a bit of IOR variation to round the whole thing off.</p>
<p>Even tough almost everything these days is path traced at the end of the day rendering is still a hack to imitate the reel world with our limited computing resources. So while this technique in theory should be more &#8220;physically accurate&#8221; it&#8217;s definitely not a solution that will always look best.</p>
<p>At the end of the day whatever makes an asset or a shot look great is usually the right way to go regardless of the technique in my opinion :)</p>
<p><span style="color: #808080;">_________________________________________________</span><br />
<span style="color: #808080;"><span style="font-size: small;"> If this post has helped you in any way you can express your gratefulness by using the <em>Donate </em>Button below to buy me a coffee! :)</span></span><br />
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=VH5RW3YDWDJSQ" target="_blank" rel="nofollow"><img class="lazyload" data-original="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" alt="" /></a></p>
<div class="moz-text-html" lang="x-unicode">
<div><span style="font-size: small;"><span style="color: #808080;">3M5xNSV7g2NzVpHMqzYKhgoKJZ8CWa644m</span></span><br />
<img class="lazyload alignleft size-full wp-image-2576" data-original="http://julius-ihle.de/wp-content/uploads/2018/03/bc_ldgr_qrcode.png" alt="bc_ldgr_qrcode" width="128" height="128" /></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://julius-ihle.de/?feed=rss2&#038;p=2653</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>LPE Quick Tip #1: Light Path Splitting for Transmission</title>
		<link>http://julius-ihle.de/?p=2619</link>
		<comments>http://julius-ihle.de/?p=2619#comments</comments>
		<pubDate>Sat, 21 Jul 2018 19:21:46 +0000</pubDate>
		<dc:creator><![CDATA[Julius]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://julius-ihle.de/?p=2619</guid>
		<description><![CDATA[This will be a quick one. Light Path Expressions offer a lot of flexibility over the AOV&#8217;s you would like to pass off to Compositing. Most&#8230;<p><a href="http://julius-ihle.de/?p=2619" class="more-link post-excerpt-readmore"><span class="more-link-inner">Read more</span><span class="more-link-brd"></span></a></p>]]></description>
				<content:encoded><![CDATA[<p><a href="http://julius-ihle.de/?p=2619"><img class="lazyload alignleft wp-image-2620 size-full" data-original="http://julius-ihle.de/wp-content/uploads/2018/07/lpe01.png" alt="lpe01" width="1280" height="533" /></a></p>
<p>This will be a quick one. Light Path Expressions offer a lot of flexibility over the AOV&#8217;s you would like to pass off to Compositing. Most modern path tracing render engines like Arnold, RenderMan, Blender&#8217;s Cycles, VRay, etc. have support for it by now. With LPE&#8217;s you can split pretty much any light path you desire, which brings me to the solution to this first problem.</p>
<p><span id="more-2619"></span></p>
<p>Usually when you have a refractive object in your scene everything that is being refracted lands in 1 single AOV (usually called refraction, transmission, or something along those lines).<br />
So if I have a scene like this&#8230;</p>
<p><a href="http://julius-ihle.de/wp-content/uploads/2018/07/01beauty0000.png"><img class="lazyload alignleft size-full wp-image-2621" data-original="http://julius-ihle.de/wp-content/uploads/2018/07/01beauty0000.png" alt="01beauty0000" width="946" height="526" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>My transmission AOV will usually look like this:<br />
<a href="http://julius-ihle.de/wp-content/uploads/2018/07/03refr0000.png"><img class="lazyload alignleft size-full wp-image-2623" data-original="http://julius-ihle.de/wp-content/uploads/2018/07/03refr0000.png" alt="03refr0000" width="946" height="526" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&#8230;and my diffuse like this:</p>
<p><a href="http://julius-ihle.de/wp-content/uploads/2018/07/02diff0000.png"><img class="lazyload alignleft size-full wp-image-2628" data-original="http://julius-ihle.de/wp-content/uploads/2018/07/02diff0000.png" alt="02diff0000" width="946" height="526" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>As you can imagine tweaking the diffuse in comp will be a bit of a cumbersome task as the color of the teapot for example is in 2 different AOVs. Luckily what you can do is to modify the default LPE&#8217;s a bit to include transmissive paths in other AOVs like diffuse, specular, subsurface scattering, etc.</p>
<p>I won&#8217;t go into too much details of how it works. If you want a proper overview on LPE&#8217;s you can read up on them <a title="LPE Documentation" href="https://github.com/imageworks/OpenShadingLanguage/wiki/OSL-Light-Path-Expressions" target="_blank">HERE</a>.<br />
The default diffuse_direct looks like this usually:<br />
C&lt;RD&gt;[&lt;L.&gt;O]<br />
Which simply means the lightpath Camera (C) -&gt; Diffuse Reflection event (&lt;RD&gt;) -&gt; Light Source / Emissive Object ([&lt;L.&gt;O])</p>
<p>To make all the light paths include refraction events as well you can tell the light paths to look for zero or more transmissive specular events before evaluating the rest of the light path.<br />
So if you modify the diffuse_direct like this:<br />
C&lt;TS&gt;*&lt;RD&gt;[&lt;L.&gt;O]</p>
<p>&#8230; then the diffuse will be a lot more useful for tweaking in Compositing:<br />
<a href="http://julius-ihle.de/wp-content/uploads/2018/07/04newdiff0000.png"><img class="lazyload alignleft size-full wp-image-2624" data-original="http://julius-ihle.de/wp-content/uploads/2018/07/04newdiff0000.png" alt="04newdiff0000" width="946" height="526" /></a><br />
&nbsp;<br />
&nbsp;</p>
<p>Likewise to make sure everything adds back together nicely you can modify the refraction pass to only include pure transmissive events:<br />
C&lt;TS&gt;+[&lt;L.&gt;O]<br />
<a href="http://julius-ihle.de/wp-content/uploads/2018/07/05newrefr.png"><img class="lazyload alignleft size-full wp-image-2623" data-original="http://julius-ihle.de/wp-content/uploads/2018/07/05newrefr.png" alt="05newrefr" width="946" height="526" /></a><br />
&nbsp;</p>
<p>&nbsp;</p>
<p>As a TL;DR here is the stuff I personally like using:<br />
diffuse_direct: lpe:C&lt;TS&gt;*&lt;RD&gt;[&lt;L.&gt;O]<br />
diffuse_indirect: lpe:C&lt;TS&gt;*&lt;RD&gt;[DS]+[&lt;L.&gt;O]<br />
diffuse_albedo: lpe:C&lt;TS&gt;*&lt;RD&gt;A<br />
specular_direct: lpe:C&lt;TS&gt;*&lt;RS&gt;[&lt;L.&gt;O]<br />
specular_indirect: lpe:C&lt;TS&gt;*&lt;RS&gt;[DS]+[&lt;L.&gt;O]<br />
refraction: lpe:C&lt;TS&gt;+[&lt;L.&gt;O]<br />
sss: lpe:C&lt;TS&gt;*&lt;TD&gt;[DS]*[&lt;L.&gt;O]<br />
&nbsp;<br />
&nbsp;</p>
<p><span style="color: #808080;">_________________________________________________</span><br />
<span style="color: #808080;"><span style="font-size: small;"> If this post has helped you in any way you can express your gratefulness by using the <em>Donate </em>Button below to buy me a coffee! :)</span></span><br />
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=VH5RW3YDWDJSQ" target="_blank" rel="nofollow"><img class="lazyload" data-original="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" alt="" /></a></p>
<div class="moz-text-html" lang="x-unicode">
<div><span style="font-size: small;"><span style="color: #808080;">3M5xNSV7g2NzVpHMqzYKhgoKJZ8CWa644m</span></span><br />
<img class="lazyload alignleft size-full wp-image-2576" data-original="http://julius-ihle.de/wp-content/uploads/2018/03/bc_ldgr_qrcode.png" alt="bc_ldgr_qrcode" width="128" height="128" /></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://julius-ihle.de/?feed=rss2&#038;p=2619</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Katana Interactive RenderPanel</title>
		<link>http://julius-ihle.de/?p=2554</link>
		<comments>http://julius-ihle.de/?p=2554#comments</comments>
		<pubDate>Wed, 21 Mar 2018 22:30:24 +0000</pubDate>
		<dc:creator><![CDATA[Julius]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://julius-ihle.de/?p=2554</guid>
		<description><![CDATA[Working in larger Katana scripts I always find it a bit cumbersome to switch between Nodes that I&#8217;d like to view and/or launch a Render&#8230;<p><a href="http://julius-ihle.de/?p=2554" class="more-link post-excerpt-readmore"><span class="more-link-inner">Read more</span><span class="more-link-brd"></span></a></p>]]></description>
				<content:encoded><![CDATA[<p><a href="http://julius-ihle.de/?p=2554"><img class="lazyload alignleft size-full wp-image-2561" data-original="http://julius-ihle.de/wp-content/uploads/2018/03/katirp1.png" alt="katirp" width="1280" height="533" /></a>Working in larger Katana scripts I always find it a bit cumbersome to switch between Nodes that I&#8217;d like to view and/or launch a Render from. I recently started getting my hands dirty with PySide/PyQt and I wanted to put it to use. My goal was to build a simple dynamic UI that would allow the user to quickly switch the view flag of a selection of Nodes in Katana and trigger a render.</p>
<p><span id="more-2554"></span></p>
<p>If you have a lot of different passes in your Katana script it can become a bit draining to constantly switch your view flag. The separate Viewer Node in Nuke for example makes it easy to quickly switch between outputs by pressing 1,2,3,&#8230;9 as it can accept multiple inputs. In Katana you have to navigate through your script to the desired node to change the view-flag or launch a render.</p>
<p>Being overly lazy I hacked together this simple UI which lets&#8217;s you quickly change the view flag and launch live <em>[L]</em> and preview<em> [P]</em> renders. It&#8217;s not very aesthetic but it get&#8217;s the job done:</p>
<p><a href="http://julius-ihle.de/wp-content/uploads/2018/03/katirpbase1.png"><img class="lazyload alignleft size-full wp-image-2559" data-original="http://julius-ihle.de/wp-content/uploads/2018/03/katirpbase1.png" alt="katirpbase" width="404" height="474" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>To add the buttons to the UI you can set it to get nodes by Type, Name or based on your current selection in the Nodegraph. It should be worth noting that the text input is CaseSensitve. If you don&#8217;t have the <em>add</em> option checked it will replace your current set of buttons.</p>
<p><iframe src="https://player.vimeo.com/video/261218602" width="640" height="357" frameborder="0" allowfullscreen="allowfullscreen"></iframe></p>
<p><a href="https://vimeo.com/261218602">Katana Interactive RenderPanel</a> from <a href="https://vimeo.com/julsvfx">Julius Ihle</a> on <a href="https://vimeo.com">Vimeo</a>.</p>
<p>&nbsp;</p>
<p>There are a lot of things there that&#8217;d be nice to have&#8230; A simple option to delete button groups, save bookmarks, etc&#8230; Maybe&#8230; Some day&#8230; :)</p>
<p>&nbsp;</p>
<p>If you&#8217;re feeling adventurous you can give it a try <a title="DOWNLOAD" href="http://53035544.de.strato-hosting.eu/data/InteractiveRenderPanel.pyc" target="_blank">HERE</a>.<br />
To use it put the .pyc file in a sub-directory called <em>Tabs</em> that&#8217;s part of your <em>$KATANA_RESOURCES</em>.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;<br />
<span style="color: #808080;">_________________________________________________</span><br />
<span style="color: #808080;"><span style="font-size: small;"> If this post has helped you in any way you can express your gratefulness by using the <em>Donate </em>Button below to buy me a coffee! :)</span></span><br />
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=VH5RW3YDWDJSQ" target="_blank" rel="nofollow"><img class="lazyload" data-original="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" alt="" /></a></p>
<div class="moz-text-html" lang="x-unicode">
<div><span style="font-size: small;"><span style="color: #808080;">3M5xNSV7g2NzVpHMqzYKhgoKJZ8CWa644m</span></span><br />
<img class="lazyload alignleft size-full wp-image-2576" data-original="http://julius-ihle.de/wp-content/uploads/2018/03/bc_ldgr_qrcode.png" alt="bc_ldgr_qrcode" width="128" height="128" /></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://julius-ihle.de/?feed=rss2&#038;p=2554</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Displaying Useful Information with Metadata in NUKE</title>
		<link>http://julius-ihle.de/?p=2500</link>
		<comments>http://julius-ihle.de/?p=2500#comments</comments>
		<pubDate>Sun, 17 Dec 2017 17:32:47 +0000</pubDate>
		<dc:creator><![CDATA[Julius]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://julius-ihle.de/?p=2500</guid>
		<description><![CDATA[Nuke makes it really easy to access metadata from incoming images. You can easily access information from pictures that you shot with your camera or&#8230;<p><a href="http://julius-ihle.de/?p=2500" class="more-link post-excerpt-readmore"><span class="more-link-inner">Read more</span><span class="more-link-brd"></span></a></p>]]></description>
				<content:encoded><![CDATA[<p><a href="http://julius-ihle.de/?p=2500"><img class="lazyload alignleft wp-image-2501 size-full" data-original="http://julius-ihle.de/wp-content/uploads/2017/12/arnoldstats.jpg" alt="arnoldstats" width="1280" height="533" /></a></p>
<p>Nuke makes it really easy to access metadata from incoming images. You can easily access information from pictures that you shot with your camera or access render stats from CG renderings. This can prove to be really useful in a production environment where you want to make sure that your frames are rendering in a reasonable time without consuming too much memory. This example shows how to access and display that information in Nuke with renderings from Arnold.</p>
<p><span id="more-2500"></span><br />
Here&#8217;s an example of Displaying useful information from a render :</p>
<div style="width: 960px; " class="wp-video"><video class="wp-video-shortcode" id="video-2500-3" width="960" height="540" loop="1" preload="metadata" controls="controls"><source type="video/mp4" src="http://julius-ihle.de/wp-content/uploads/2017/12/arnoldstats.mp4?_=3" /><a href="http://julius-ihle.de/wp-content/uploads/2017/12/arnoldstats.mp4">http://julius-ihle.de/wp-content/uploads/2017/12/arnoldstats.mp4</a></video></div>
<p>(yes, you are doing something wrong, if it renders that long and takes this much RAM :))<br />
&nbsp;</p>
<p>&nbsp;<br />
You can see the metadata of an image with the ViewMetaData node. This node displays all available metadata from your input.<br />
Here&#8217;s an example of what a default Arnold EXR render comes with:<br />
<a href="http://julius-ihle.de/wp-content/uploads/2017/12/01viewmetadata.jpg"><img class="lazyload alignleft size-full wp-image-2503" data-original="http://julius-ihle.de/wp-content/uploads/2017/12/01viewmetadata.jpg" alt="01viewmetadata" width="676" height="441" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Quite a lot of stuff&#8230;<br />
Metadata information is accessible in Nuke through TCL expressions which you can use in a Text Node for example. For a full list of what you can do with TCL you can refer to the <a title="Nuke TCL doc" href="http://www.nukepedia.com/reference/Tcl/" target="_blank">documentation</a>.</p>
<p>TCL expressions are evaluated in square brackets. You can access metadata with<em> [metadata name/of/metadata]</em>. If I want to get the average rays per pixel for example I could use<em> [metadata exr/arnold/stats/rays/all/pixel]</em> rays/pixel:</p>
<p><a href="http://julius-ihle.de/wp-content/uploads/2017/12/02metadatatotext.jpg"><img class="lazyload alignleft size-full wp-image-2504" data-original="http://julius-ihle.de/wp-content/uploads/2017/12/02metadatatotext.jpg" alt="02metadatatotext" width="1004" height="383" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>As this is averaging the rays of all the pixels it outputs a floating point number. We can convert it to an integer with int(). Note that whenever you want to manipulate numbers you have to enclose your mathematical operation in <em>[expr ]</em>:<br />
<em>[expr int([metadata exr/arnold/stats/rays/all/pixel])] rays/pixels</em></p>
<p><a href="http://julius-ihle.de/wp-content/uploads/2017/12/03expr.jpg"><img class="lazyload alignleft size-full wp-image-2505" data-original="http://julius-ihle.de/wp-content/uploads/2017/12/03expr.jpg" alt="03expr" width="1004" height="383" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>You can do the same thing to display your RAM usage. By default Arnold displays memory usage in Megabytes&#8230; Converted to Gigabytes it might be a bit more useful:</p>
<p><em>[expr [metadata exr/arnold/stats/memory/peak]/1000]GB</em></p>
<p><a href="http://julius-ihle.de/wp-content/uploads/2017/12/04mem.jpg"><img class="lazyload alignleft size-full wp-image-2506" data-original="http://julius-ihle.de/wp-content/uploads/2017/12/04mem.jpg" alt="04mem" width="1103" height="375" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Just a few too many decimal places for my taste&#8230; You can use <em>[format]</em> similar to how it&#8217;s used in Python to change it to 2 decimal places for example:</p>
<p><em>[format &#8220;%0.2f&#8221; [expr [metadata exr/arnold/stats/memory/peak]/1000]]GB</em><br />
<a href="http://julius-ihle.de/wp-content/uploads/2017/12/05memformat.jpg"><img class="lazyload alignleft size-full wp-image-2507" data-original="http://julius-ihle.de/wp-content/uploads/2017/12/05memformat.jpg" alt="05memformat" width="1161" height="375" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>The metadata for the render time comes in seconds with Arnold. If you&#8217;re a math genious or have very optimized renders this might work for you. Unfortunately neither applies to me, so a display in hh:mm:ss seems a bit easier to decipher :)</p>
<p>I&#8217;m using <em>expr</em> to convert the seconds to integers and display them in hours, minutes and seconds separately:<br />
<em>[expr int([metadata exr/arnold/stats/time/render]/3600)] [expr int(fmod([metadata exr/arnold/stats/time/render]/60,60))] [expr int(fmod([metadata exr/arnold/stats/time/render],60))]</em><br />
<a href="http://julius-ihle.de/wp-content/uploads/2017/12/06hhmmss.jpg"><img class="lazyload alignleft size-full wp-image-2508" data-original="http://julius-ihle.de/wp-content/uploads/2017/12/06hhmmss.jpg" alt="06hhmmss" width="557" height="384" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&#8230;and use <em>[format]</em> similar to the above example to make it nice and tidy:<br />
<em>[format &#8220;%02d:%02d:%02d&#8221; [expr int([metadata exr/arnold/stats/time/render]/3600)] [expr int(fmod([metadata exr/arnold/stats/time/render]/60,60))] [expr int(fmod([metadata exr/arnold/stats/time/render],60))]]</em><br />
<a href="http://julius-ihle.de/wp-content/uploads/2017/12/07hhmmssformat.jpg"><img class="lazyload alignleft size-full wp-image-2509" data-original="http://julius-ihle.de/wp-content/uploads/2017/12/07hhmmssformat.jpg" alt="07hhmmssformat" width="604" height="393" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Another thing that I find useful to colorize the output. If you just have numbers whooshing by when you play an animation it&#8217;s hard to spot potential problematic frames. If you just want a simple heatmap from green to red one way you could do it is to just shift the hue of your text. Looking at a Hue ramp red has a hue of 0 and green has a hue of 0.3333:<br />
<a href="http://julius-ihle.de/wp-content/uploads/2017/12/08hue.jpg"><img class="lazyload alignleft size-full wp-image-2510" data-original="http://julius-ihle.de/wp-content/uploads/2017/12/08hue.jpg" alt="08hue" width="404" height="282" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>So you could put your text in HSV space and offset the red channel to shift your Hue (the hue shift in Nuke does not work properly &#8211; see <a title="LookDev'ing Iridescence in NUKE" href="%20http://julius-ihle.de/?p=581" target="_blank">HERE</a>) and make sure you have your saturation at 1:<br />
<a href="http://julius-ihle.de/wp-content/uploads/2017/12/09huetext.jpg"><img class="lazyload alignleft size-full wp-image-2511" data-original="http://julius-ihle.de/wp-content/uploads/2017/12/09huetext.jpg" alt="09huetext" width="883" height="389" /></a><br />
&nbsp;</p>
<p>&nbsp;<br />
So all that&#8217;s left to do is to remap the numbers from whichever range you like to 0 as a maximum (red) and 0.3333 as a minimum (green). Remapping numbers can be achieved like this:<br />
<em>outputMin + (value &#8211; inputMin) * (outputMax &#8211; outputMin) / (inputMax &#8211; inputMin)</em><br />
So if I for example would like to remap the hue of my render time in seconds to display everything with a time below 2minutes (120 seconds) in green and everything above 10 minutes (600 seconds) in red I can use:<br />
<em>(1/3) + ([metadata exr/arnold/stats/time/render] &#8211; 120) * (0 &#8211; (1/3)) / (600 &#8211; 120)</em><br />
Just make sure you clamp the whole thing to 0 and 0.3333 so the values outside of this range don&#8217;t shift to another hue:<br />
<a href="http://julius-ihle.de/wp-content/uploads/2017/12/10huetextexpr.jpg"><img class="lazyload alignleft size-full wp-image-2512" data-original="http://julius-ihle.de/wp-content/uploads/2017/12/10huetextexpr.jpg" alt="10huetextexpr" width="1088" height="425" /></a><br />
&nbsp;</p>
<p>&nbsp;<br />
Wrap the whole thing up into a Gizmo and you are good to go&#8230; The <em>min</em> values specify up to which point the text will stay green and the <em>max</em> values specify at which point it will be completely red:<br />
<a href="http://julius-ihle.de/wp-content/uploads/2017/12/11gizmo.jpg"><img class="lazyload alignleft size-full wp-image-2513" data-original="http://julius-ihle.de/wp-content/uploads/2017/12/11gizmo.jpg" alt="11gizmo" width="596" height="329" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>You can grab the Gizmo from this example <strong><span style="text-decoration: underline;"><a title="DOWNLOAD ARNOLDSTATS GIZMO" href="http://53035544.de.strato-hosting.eu/data/ArnoldStats.gizmo" target="_blank">HERE</a></span></strong>.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;<br />
<span style="color: #808080;">_________________________________________________</span><br />
<span style="color: #808080;"><span style="font-size: small;"> If this post has helped you in any way you can express your gratefulness by using the <em>Donate </em>Button below to buy me a coffee! :)</span></span><br />
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=VH5RW3YDWDJSQ" target="_blank" rel="nofollow"><img class="lazyload" data-original="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" alt="" /></a></p>
<div class="moz-text-html" lang="x-unicode">
<div><span style="font-size: small;"><span style="color: #808080;">3M5xNSV7g2NzVpHMqzYKhgoKJZ8CWa644m</span></span><br />
<img class="lazyload alignleft size-full wp-image-2576" data-original="http://julius-ihle.de/wp-content/uploads/2018/03/bc_ldgr_qrcode.png" alt="bc_ldgr_qrcode" width="128" height="128" /></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://julius-ihle.de/?feed=rss2&#038;p=2500</wfw:commentRss>
		<slash:comments>1</slash:comments>
<enclosure url="http://julius-ihle.de/wp-content/uploads/2017/12/arnoldstats.mp4" length="100103" type="video/mp4" />
		</item>
	</channel>
</rss>
