Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2017-11-01 21:00:42 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2017-11-05 20:13:44 +0300
commit2c02a04c464c2f5c6e211ceb7b21255eaca7e087 (patch)
tree005c4b99ecf43db7513e9b5c2dfcaca56e1608a1 /intern/cycles/kernel/closure
parentcac3d4d16691d77e8e01f158be07d182e56e9755 (diff)
Code refactor: remove emission and background closures, sum directly.
Diffstat (limited to 'intern/cycles/kernel/closure')
-rw-r--r--intern/cycles/kernel/closure/emissive.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/intern/cycles/kernel/closure/emissive.h b/intern/cycles/kernel/closure/emissive.h
index c534df373bd..e709ca9a372 100644
--- a/intern/cycles/kernel/closure/emissive.h
+++ b/intern/cycles/kernel/closure/emissive.h
@@ -32,8 +32,32 @@
CCL_NAMESPACE_BEGIN
+/* BACKGROUND CLOSURE */
+
+ccl_device void background_setup(ShaderData *sd, const float3 weight)
+{
+ if(sd->flag & SD_EMISSION) {
+ sd->closure_emission_background += weight;
+ }
+ else {
+ sd->flag |= SD_EMISSION;
+ sd->closure_emission_background = weight;
+ }
+}
+
/* EMISSION CLOSURE */
+ccl_device void emission_setup(ShaderData *sd, const float3 weight)
+{
+ if(sd->flag & SD_EMISSION) {
+ sd->closure_emission_background += weight;
+ }
+ else {
+ sd->flag |= SD_EMISSION;
+ sd->closure_emission_background = weight;
+ }
+}
+
/* return the probability distribution function in the direction I,
* given the parameters and the light's surface normal. This MUST match
* the PDF computed by sample(). */