Note: This is an archived version of the Blender Developer Wiki (archived 2024). The current developer documentation is available on developer.blender.org/docs.

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 WITH_CYCLES_DEBUG on, that was the source of all the NaN noise in my side. I rebuilt Blender from the ground up; I still have RelWithDebInfo 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 (rB2af62e27).
    • Split off the azimuthal and longitudinal roughness factors to make debugging easier when needed (rB4a73f5ce).
    • Added compatibility with OpenCL. Thanks to nirved for the patches and comments! (rB9d633312, rB00d0f3c2)
    • Added OSL compatibility. I know I don't allocate the memory for the closures correctly, I'll patch it in the weekend. (rB718d730b, rB718d730b, rB4774e906, rBb7a92fa7, rBdf0ead4d, rBbf5a378c)
    • Added the final missing feature from Chiang's formulation, the R-mode roughness modifier (formally called "Primary Reflection Roughness Modifier"). It enables the user to render a shiny coat on an otherwise rough patch of fur (rB25677d77, rBc3048b5f, rBb3ebdf64).
      • I had to move the geometry data out of the main ShaderClosure 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! (rB8087cefd, rBdf1e50fa)
    • Finally found out why Blender didn't listen to RNA's default for the hair parameterization. I added the correct initialization code (rB7780d306).
    • Merged the latest master commits. Only a single conflict! (Week 2: rB82e63de2, Week 3: rBfede34a5)
    • Bonus:
      • Turned off the Diffuse override. It doesn't seem to be needed after Brecht's curve_core_intersect patch (rB718d730b).
      • Added our shader to the Glossy closure checker as well (rB25677d77).
  • Brecht:
    • Fixed the hair offset calculation by avoiding curve_core_intersect & pals altogether (rBabfca937, rBff6883fb, rBbaad410a).
    • Added a few comments wrt. hair attenuation terms and offset angles (rBfc62d5a3).
    • Fixed the range for the R-mode roughness modifier (rB3c56635d).
    • Fixed the number-of-closures issue that came with the R-mode roughness modifier (rB1fac3b7d).

Here are some images:

A R-mode-modified fur ball, also filtered with Filter Glossy. Rendered with Cuda on Win7 x64 in ~5min.
The node's current appearance and sockets.

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!