User:LeonardoSegovia/GSoC 2018/Reports/Week 1

= Week 1 =

Hi everyone! The first week's over, and here's what I've done so far.

Objectives

 * Review of Pharr’s code. Implement a dummy Cycles node. Verify exposure of shader’s parameters and test setters/getters.

Since I had Lukas's work available, I managed to extend this week's work to the next two objectives:


 * Port Pharr’s shader primitives and statistical tests. Verify they work as expected.
 * Port Pharr’s shading function.

What's been done
You may have noticed my commits were on Monday and Friday-Saturday; this was because a short postgraduate course, Topics on Logic and Artificial Intelligence in Law by Dr. Antonino Rotolo came up at my uni during this week's Tue-Wed-Thu mornings. (These were an additional 40 hours towards my degree's quota of 540.)

Anyway...




 * The infrastructure for the shader node is now in place 😄.
 * Lukas's patch included dummy license info. We (me and Brecht) asked him on IRC, and he stated the code is all his own. The license was updated accordingly


 * Reworked some naming conventions to make them follow PBRT and be clearer
 * During the weekend, I managed to figure out that (somehow) Cycles creates the shader's closure, but when sampling it, it thinks that it's a Diffuse shader instead! I plugged in a few s in ,  , and   that reveal the situation. (Ask on IRC if you want the diff)

Next up
Next week I'll revise the implementation, to figure out where and how our shader is morphed into a Diffuse one. As I need more info on Cycles's kernel's code layout to figure this out, I'll ask Brecht and Lukas if they can give me a walkthrough.

Questions
This is mostly for the sake of documentation, I'm planning to publish some time later a sort of &quot;Anatomy of a Shader&quot;:


 * What is the meaning of RNA and DNA in Cycles? I understand that it integrates the shader's parameters with the UI. I'll be revisiting this in the last weeks.
 * What is the registering flow of a shader in Cycles? I should re-read to better understand it.
 * What is the control flow of the sampling process in Cycles? This should give me a clue on where and how our closure is being Diffuse'd.