User:LeonardoSegovia/GSoC 2018/Reports/Week 3

= Week 3 =

Hi everyone! Yet another week's now gone. This is my report.

Objectives
We're still in Weeks 4-5:


 * Test shader functionality. If working, release test build.
 * Evaluate received feedback. Start bug fixes.

What's been done
This week's been MUCH better!


 * It turns out that I had  on, that was the source of all the   noise in my side. I rebuilt Blender from the ground up; I still have   on.
 * Thanks to Lukas, bzztploink and artok, we could get test builds for all platforms! This enabled us to find some issues regarding:
 * Linux compilation
 * Missing initialization code
 * Some stuff I didn't know about Cycles's innards

In terms of commits,


 * Me:
 * Ronan Ducluzeau's noisy renders were caused by an mistake in Lukas's optimization of the trimmed logistic distribution. It's now fixed.
 * Split off the azimuthal and longitudinal roughness factors to make debugging easier when needed.
 * Added compatibility with OpenCL. Thanks to nirved for the patches and comments!
 * Added OSL compatibility. I know I don't allocate the memory for the closures correctly, I'll patch it in the weekend.
 * Added the final missing feature from Chiang's formulation, the R-mode roughness modifier (formally called &quot;Primary Reflection Roughness Modifier&quot;). It enables the user to render a shiny coat on an otherwise rough patch of fur.
 * I had to move the geometry data out of the main  to make space for this. I didn't know that I had to tell Blender how many closures I was using 😅, so all Final Renders returned black hair. This was found by YAFU on BlenderArtists and fixed by Brecht.
 * Enabled Filter Glossy for the roughness coefficients. Brecht reports a ~75% improvement in render quality!
 * Finally found out why Blender didn't listen to RNA's default for the hair parameterization. I added the correct initialization code.
 * Merged the latest  commits. Only a single conflict! (Week 2:, Week 3: )
 * Bonus:
 * Turned off the Diffuse override. It doesn't seem to be needed after Brecht's  patch.
 * Added our shader to the Glossy closure checker as well.
 * Brecht:
 * Fixed the hair offset calculation by avoiding  &amp; pals altogether.
 * Added a few comments wrt. hair attenuation terms and offset angles.
 * Fixed the range for the R-mode roughness modifier.
 * Fixed the number-of-closures issue that came with the R-mode roughness modifier.

Here are some images:





Next up
Apart from finally settling the memory allocation flow for the OSL shader, the original shader is mostly done. I could address some of the proposed features in the BlenderArtists thread:


 * Define separately the eumelanin/pheomelanin coefficients, à la Arnold's Standard Hair
 * Perhaps add more features, such as tinting? Again, following Arnold's shader features.

If no more bugs arise, I may start with the rest of the objectives too.

Questions
None this time!