User:LeonardoSegovia/GSoC 2018/Reports/Week 9

= Week 9 =

Hi everyone! This is my report for the present week.

Objectives
This week, I dealt with the objectives for Weeks 10 and 11:


 * User documentation revision.
 * Developer documentation revision.

What's been done
On Monday, Brecht did a revision of the existing code. These were the comments (summarized from the soc-2018-dev mail):


 * We confused &quot;Primary Reflection Roughness&quot; with &quot;Undercoat multiplier&quot; (section 4.3 of Chiang's paper).
 * He suggested to rename the first parameter to just &quot;Coat&quot;, make it  and default to
 * We should linearize Melanin concentration into a coefficient in the range  and adjust the absorption factors accordingly.

And the encountered bugs and quirks:


 * Brecht:
 * The OSL shader is using the longitudinal roughness instead of the azimuthal roughness for the reflectance to absorption mapping.
 * Separate RGB-&gt;absorption coefficient conversion into its own function.
 * The Random socket should use  to make it clear the value is ignored if nothing is connected.
 * In the OSL shader, we should use  for local variables, only the parameters should use.
 * Before merging, any debug code like s, , and other commented out code should be removed.
 * No need to store a random value in the  and have it as a parameter in the OSL closure if we are not going to use it.
 * As an optimization, variables needed for only one of the 3 color parameterizations should be computed in the appropriate /  instead of before. So ,  , etc. should only be computed for the Melanin parameterization.
 * Update the Direct coloring parametrization to match the default color of the rest.
 * Suggest to rename &quot;Color Randomization&quot; to &quot;Random Color&quot;, sounds a little less technical and to the point. Same for &quot;Roughness Randomization&quot;.
 * In nodes.h, rename  to   and   to , these should match the socket names.
 * Leo:
 * It turns out that we computed the primary reflection roughness after it was converted to the logistic distribution's parameters, which utterly defeated its purpose.
 * The OSL shader used not only the wrong, but also the unrandomized type of roughness for the reflectance to absorption mapping.

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 ChrisWillC from BlenderArtists for better quality; however, he had to adjust them since they OOM'd my desktop. This is the agreed design for the charts:


 * Covered parameters: Melanin, Melanin Redness, Roughness, Radial Roughness, Coat, Random Roughness,Random Color
 * 5 renders per parameter, 256x256
 * 0..1 for everything except (radial) roughness, where it's 0.1..0.9
 * also would prefer dark flat background so the small isolated hairs are visible
 * 16px font size
 * no text since images are not translatable

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.

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.

These were the resulting commits in the Blender repository:


 * The usual merging commits from.
 * I'm holding off on the rest of the week's commits until I've finished rendering the charts.
 * Adjusted the upper bounds of Roughness.
 * Fixed OSL's reflectance mapping.
 * Hide Random socket's value if unused.
 * Remove random value from SVM and OSL's closures.
 * Adjusted OSL's variable naming to the specified convention.
 * Renamed the melanin variables as specified.
 * Added the requested brownish default to Direct coloring.
 * This one was done empirically, I rendered a curl of default (Melanin) brownish hair and selected the best (IMHO) RGB color.
 * Renamed X Randomization to Random X.
 * Reordered variable initialization and usage.
 * Renamed Undercoat Roughness to Coat.
 * Melanin linearization.
 * Correct Coat calculation to the Roughness value, not the variance.
 * Extra cosmetic cleanup.

In the GitHub repo:


 * Uploaded basic, initial versions of the charts (b3cfbef5a40ef2beb8aa5043a3a42a072f17206f, f23a74f482afb050d3ea57c2974647675690df65).
 * Updated them to Inkscape-based versions (70299a8a7eb610095fb57ae338f3b4e6b9849e51, 3663a7ae2d6488a421162c93ae0699cc80a944d3, 07f377c1c7021e10fdf56e89f9925436bc6d31f2).
 * Applied Brecht's requested parameter renamings and adjustments (b01c8e1ce3747ab45230029b03e9a519a5389139](https://github.com/amyspark/blender-manual/commit/b01c8e1ce3747ab45230029b03e9a519a5389139), c6e56391a6ce11ca2d38e7e587d2c0ab26c9eca4, 6951dadb2fac9d5e944e640cb86e16909f130b34, )
 * Uploaded the final version of Melanin Redness (586f3116b8561d0e6372dc429629ffeeedafdfb2), Melanin, Coat, Roughness and Radial Roughness (bcf453cb7712e1da114616267674cd2ab47b54ed](https://github.com/amyspark/blender-manual/commit/bcf453cb7712e1da114616267674cd2ab47b54ed)).

Next up

 * Finish the Randomization, Tint and Color charts

Questions
None this time!