<div dir="ltr"><h1><span class="gmail-mw-headline" id="gmail-Week_9">Week 9</span></h1><p>Hi everyone! This is my report for the present week.
</p>
<h2><span class="gmail-mw-headline" id="gmail-Objectives">Objectives</span></h2><p>This week, I dealt with the objectives for Weeks 10 and 11:
</p>
<ul><li> User documentation revision.</li>
<li> Developer documentation revision.</li></ul>
<h2><span class="gmail-mw-headline" id="gmail-What.27s_been_done">What's been done</span></h2><p>On Monday, Brecht did a revision of the existing code. These were the comments (summarized from the soc-2018-dev mail):
</p>
<ul><li> We confused "Primary Reflection Roughness" with "Undercoat multiplier" (section 4.3 of Chiang's paper).
<ul><li> He suggested to rename the first parameter to just "Coat", make it <code>(1 - primary_reflection_roughness)</code> and default to <code>0.0.</code></li></ul></li>
<li> We should linearize Melanin concentration into a coefficient in the range <code>0-1</code> and adjust the absorption factors accordingly.</li></ul>
<p>And the encountered bugs and quirks:
</p>
<ul><li> Brecht:
<ul><li> The OSL shader is using the longitudinal roughness instead of 
the azimuthal roughness for the reflectance to absorption mapping.</li>
<li> Separate RGB->absorption coefficient conversion into its own function.</li>
<li> The Random socket should use <code>SOCK_HIDE_VALUE</code> to make it clear the value is ignored if nothing is connected.</li>
<li> In the OSL shader, we should use <code>lower_case_names</code> for local variables, only the parameters should use <code>CamelCase</code>.</li>
<li> Before merging, any debug code like <code>printf</code>s, <code>curve_center</code>, and other commented out code should be removed.</li>
<li> No need to store a random value in the <code>PrincipledHairBSDF</code> and have it as a parameter in the OSL closure if we are not going to use it.</li>
<li> As an optimization, variables needed for only one of the 3 color parameterizations should be computed in the appropriate <code>if</code>/<code>case</code> instead of before. So <code>factor_random_color</code>, <code>pheomelanin</code>, etc. should only be computed for the Melanin parameterization.</li>
<li> Update the Direct coloring parametrization to match the default color of the rest.</li>
<li> Suggest to rename "Color Randomization" to "Random Color", sounds a
 little less technical and to the point. Same for "Roughness 
Randomization".</li>
<li> In nodes.h, rename <code>float melanin_concentration</code> to <code>float melanin</code> and <code>float melanin_redness_ratio</code> to <code>float melanin_redness</code>, these should match the socket names.</li></ul></li>
<li> Leo:
<ul><li> It turns out that we computed the primary reflection roughness <i>after</i> it was converted to the logistic distribution's parameters, which utterly defeated its purpose.</li>
<li> The OSL shader used not only the wrong, but also the unrandomized type of roughness for the reflectance to absorption mapping.</li></ul></li></ul>
<p>After these fixes were done (commits below), I turned to designing 
the rest of the manual's charts. The initial versions turned out to be 
bulky and lacking, so Brecht advised me to use the scenes provided by <a rel="nofollow" class="external gmail-text" href="https://blenderartists.org/t/custom-hair-shader/1116458">ChrisWillC from BlenderArtists</a> for better quality; however, he had to adjust them since they OOM'd my desktop. This is the agreed design for the charts:
</p>
<ul><li> Covered parameters: Melanin, Melanin Redness, Roughness, Radial Roughness, Coat, Random Roughness,Random Color
<ul><li> 5 renders per parameter, 256x256</li>
<li> 0..1 for everything except (radial) roughness, where it's 0.1..0.9</li>
<li> also would prefer dark flat background so the small isolated hairs are visible</li>
<li> 16px font size</li>
<li> no text since images are not translatable</li></ul></li></ul>
<p>Of these, I've done all but for the Random ones. I'll also add 
examples of Tint and Direct coloring, just for the sake of completion.
</p><p>As previously, once I've finished rendering the new stuff and 
after them being approved by Brecht, I'll upload the sources to the 
Phabricator task for merging.
</p><p>These were the resulting commits in the Blender repository:
</p>
<ul><li> The usual merging commits from <code>master</code> (<a rel="nofollow" class="external gmail-text" href="http://developer.blender.org/rB61912874353846774bc4ab0f4a14b7c0257e02f1">rB61912874353846774bc4ab0f4a14b7c0257e02f1</a>, <a rel="nofollow" class="external gmail-text" href="http://developer.blender.org/rBaedb148ed4dd47d5a8491e3de0a207cdd3701e30">rBaedb148ed4dd47d5a8491e3de0a207cdd3701e30</a>).
<ul><li> I'm holding off on the rest of the week's commits until I've finished rendering the charts.</li></ul></li>
<li> Adjusted the upper bounds of Roughness (<a rel="nofollow" class="external gmail-text" href="http://developer.blender.org/rB2af5f394886cb6b33a3bf6da4ac7bda2337f8e51">rB2af5f394886cb6b33a3bf6da4ac7bda2337f8e51</a>).</li>
<li> Fixed OSL's reflectance mapping (<a rel="nofollow" class="external gmail-text" href="http://developer.blender.org/rB3279ef6cc79dcb5d10ea37d7db46f3469fa1cad8">rB3279ef6cc79dcb5d10ea37d7db46f3469fa1cad8</a>).</li>
<li> Hide Random socket's value if unused (<a rel="nofollow" class="external gmail-text" href="http://developer.blender.org/rB665c6f8333a8b9c30544e8e501f33e5c74cf3182">rB665c6f8333a8b9c30544e8e501f33e5c74cf3182</a>).</li>
<li> Remove random value from SVM and OSL's closures (<a rel="nofollow" class="external gmail-text" href="http://developer.blender.org/rBdb69483070545f914f9a604ae2a0e3394ff6b280">rBdb69483070545f914f9a604ae2a0e3394ff6b280</a>).</li>
<li> Adjusted OSL's variable naming to the specified convention (<a rel="nofollow" class="external gmail-text" href="http://developer.blender.org/rBc25a9c19f5e835c56a62acb6574b6a1b4b88bf2f">rBc25a9c19f5e835c56a62acb6574b6a1b4b88bf2f</a>).</li>
<li> Renamed the melanin variables as specified (<a rel="nofollow" class="external gmail-text" href="http://developer.blender.org/rBc7b3abd470d241cd90d22656069a2b8e69c15b66">rBc7b3abd470d241cd90d22656069a2b8e69c15b66</a>).</li>
<li> Added the requested brownish default to Direct coloring (<a rel="nofollow" class="external gmail-text" href="http://developer.blender.org/rB58d7bc2ce6435fac7b49a0abaf847e4d02e4b1df">rB58d7bc2ce6435fac7b49a0abaf847e4d02e4b1df</a>).
<ul><li> This one was done empirically, I rendered a curl of default (Melanin) brownish hair and selected the best (IMHO) RGB color.</li></ul></li>
<li> Renamed X Randomization to Random X (<a rel="nofollow" class="external gmail-text" href="http://developer.blender.org/rB839675793b09ec47ba6850c974d6ac51d9773f6d">rB839675793b09ec47ba6850c974d6ac51d9773f6d</a>).</li>
<li> Reordered variable initialization and usage (<a rel="nofollow" class="external gmail-text" href="http://developer.blender.org/rBadcc63fe83aec514d44da839e8f96671e81a6506">rBadcc63fe83aec514d44da839e8f96671e81a6506</a>).</li>
<li> Renamed Undercoat Roughness to Coat (<a rel="nofollow" class="external gmail-text" href="http://developer.blender.org/rBed27553dc0e6ed5dc6292d97f12dd3fd383cedc9">rBed27553dc0e6ed5dc6292d97f12dd3fd383cedc9</a>).</li>
<li> Melanin linearization (<a rel="nofollow" class="external gmail-text" href="http://developer.blender.org/rBeb4abf2ca7a0f38a46ebb122cfcd590f07164ed2">rBeb4abf2ca7a0f38a46ebb122cfcd590f07164ed2</a>, <a rel="nofollow" class="external gmail-text" href="http://developer.blender.org/rB370d7f920f3d68d3c959106196ccf4d7c513dc4f">rB370d7f920f3d68d3c959106196ccf4d7c513dc4f</a>, <a rel="nofollow" class="external gmail-text" href="http://developer.blender.org/rB04428920c6629a3b32eaafe209122bb0cce3f0d8">rB04428920c6629a3b32eaafe209122bb0cce3f0d8</a>).</li>
<li> Correct Coat calculation to the Roughness value, not the variance (<a rel="nofollow" class="external gmail-text" href="http://developer.blender.org/rBd6f39657a3be8c331a034065543fecc737e7ca2a">rBd6f39657a3be8c331a034065543fecc737e7ca2a</a>).</li>
<li> Extra cosmetic cleanup (<a rel="nofollow" class="external gmail-text" href="http://developer.blender.org/rB5652abe07b2dddaf800651ae2ba96082d9da4146">rB5652abe07b2dddaf800651ae2ba96082d9da4146</a>).</li></ul>
<p>In the GitHub repo:
</p>
<ul><li> Uploaded basic, initial versions of the charts (<a rel="nofollow" class="external gmail-text" href="https://github.com/amyspark/blender-manual/commit/b3cfbef5a40ef2beb8aa5043a3a42a072f17206f">b3cfbef5a40ef2beb8aa5043a3a42a072f17206f</a>, <a rel="nofollow" class="external gmail-text" href="https://github.com/amyspark/blender-manual/commit/f23a74f482afb050d3ea57c2974647675690df65">f23a74f482afb050d3ea57c2974647675690df65</a>).</li>
<li> Updated them to Inkscape-based versions (<a rel="nofollow" class="external gmail-text" href="https://github.com/amyspark/blender-manual/commit/70299a8a7eb610095fb57ae338f3b4e6b9849e51">70299a8a7eb610095fb57ae338f3b4e6b9849e51</a>, <a rel="nofollow" class="external gmail-text" href="https://github.com/amyspark/blender-manual/commit/3663a7ae2d6488a421162c93ae0699cc80a944d3">3663a7ae2d6488a421162c93ae0699cc80a944d3</a>, <a rel="nofollow" class="external gmail-text" href="https://github.com/amyspark/blender-manual/commit/07f377c1c7021e10fdf56e89f9925436bc6d31f2">07f377c1c7021e10fdf56e89f9925436bc6d31f2</a>).</li>
<li> Applied Brecht's requested parameter renamings and adjustments (b01c8e1ce3747ab45230029b03e9a519a5389139](<a rel="nofollow" class="external gmail-free" href="https://github.com/amyspark/blender-manual/commit/b01c8e1ce3747ab45230029b03e9a519a5389139">https://github.com/amyspark/blender-manual/commit/b01c8e1ce3747ab45230029b03e9a519a5389139</a>), <a rel="nofollow" class="external gmail-text" href="https://github.com/amyspark/blender-manual/commit/c6e56391a6ce11ca2d38e7e587d2c0ab26c9eca4">c6e56391a6ce11ca2d38e7e587d2c0ab26c9eca4</a>, <a rel="nofollow" class="external gmail-text" href="https://github.com/amyspark/blender-manual/commit/6951dadb2fac9d5e944e640cb86e16909f130b34">6951dadb2fac9d5e944e640cb86e16909f130b34</a>, )</li>
<li> Uploaded the final version of Melanin Redness (<a rel="nofollow" class="external gmail-text" href="https://github.com/amyspark/blender-manual/commit/586f3116b8561d0e6372dc429629ffeeedafdfb2">586f3116b8561d0e6372dc429629ffeeedafdfb2</a>), Melanin, Coat, Roughness and Radial Roughness (bcf453cb7712e1da114616267674cd2ab47b54ed](<a rel="nofollow" class="external gmail-free" href="https://github.com/amyspark/blender-manual/commit/bcf453cb7712e1da114616267674cd2ab47b54ed">https://github.com/amyspark/blender-manual/commit/bcf453cb7712e1da114616267674cd2ab47b54ed</a>)).</li></ul>
<h2><span class="gmail-mw-headline" id="gmail-Next_up">Next up</span></h2><ul><li> Finish the Randomization, Tint and Color charts</li></ul>
<h2><span class="gmail-mw-headline" id="gmail-Questions">Questions</span></h2>None this time!
<br><br>-- <br>Lic. Leonardo E. Segovia<br>Departamento de Ciencias e Ingeniería de la Computación<br>Universidad Nacional del Sur<br>San Andrés 800 - Campus Palihue, B8000 Bahía Blanca, Argentina</div>