Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...


Code Block
Ci = Kd * diffuse() + Ks * specular();

Code Block
Ci = Kd * diffuse() + Ks * specular();

Image Removed

To store the specular and diffuse components, along with weights, into the specular_aov and diffuse_aov output variables the code has to be changed in the following manner:


Code Block
closure diffuse_aov = Kd * diffuse();
closure specular_aov = Ks * specular();
Ci  = outputvariable("diffuse_aov", diffuse_aov) +
	outputvariable("specular_aov", specular_aov);

Image Modified


Info

Note that AOVs can be output in any node of the OSL tree.  If two different OSL nodes contribute to the specular_aov variable, 3Delight will correctly blend their contribution together in the final output and in the AOV.

...