User:LeonardoSegovia/GSoC 2018/Reports/Week 9
< User:LeonardoSegovia | GSoC 2018 | Reports
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 "Primary Reflection Roughness" with "Undercoat multiplier" (section 4.3 of Chiang's paper).
- He suggested to rename the first parameter to just "Coat", make it
(1 - primary_reflection_roughness)
and default to0.0.
- He suggested to rename the first parameter to just "Coat", make it
- We should linearize Melanin concentration into a coefficient in the range
0-1
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->absorption coefficient conversion into its own function.
- The Random socket should use
SOCK_HIDE_VALUE
to make it clear the value is ignored if nothing is connected. - In the OSL shader, we should use
lower_case_names
for local variables, only the parameters should useCamelCase
. - Before merging, any debug code like
printf
s,curve_center
, and other commented out code should be removed. - No need to store a random value in the
PrincipledHairBSDF
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
if
/case
instead of before. Sofactor_random_color
,pheomelanin
, 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 "Color Randomization" to "Random Color", sounds a little less technical and to the point. Same for "Roughness Randomization".
- In nodes.h, rename
float melanin_concentration
tofloat melanin
andfloat melanin_redness_ratio
tofloat melanin_redness
, 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
master
(rB61912874, rBaedb148e).- 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 (rB2af5f394).
- Fixed OSL's reflectance mapping (rB3279ef6c).
- Hide Random socket's value if unused (rB665c6f83).
- Remove random value from SVM and OSL's closures (rBdb694830).
- Adjusted OSL's variable naming to the specified convention (rBc25a9c19).
- Renamed the melanin variables as specified (rBc7b3abd4).
- Added the requested brownish default to Direct coloring (rB58d7bc2c).
- 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 (rB83967579).
- Reordered variable initialization and usage (rBadcc63fe).
- Renamed Undercoat Roughness to Coat (rBed27553d).
- Melanin linearization (rBeb4abf2c, rB370d7f92, rB04428920).
- Correct Coat calculation to the Roughness value, not the variance (rBd6f39657).
- Extra cosmetic cleanup (rB5652abe0).
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!