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-10-25 22:07:44 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2017-10-25 22:46:23 +0300
commit171c4e982f7b6c93b534a48cfe8aba73dec78030 (patch)
tree5be791cde024a371a3131880b4ba4ceee55e4604 /intern/cycles/kernel
parent8988f383c1fb690bde976cc6de4438b327186203 (diff)
Cycles: use AO factor to let user adjust intensity of AO bounces.
We are already using the AO distance, so might as well offer this extra control over the intensity. Useful when an interior scene is supposed to be significantly darker than the background shader.
Diffstat (limited to 'intern/cycles/kernel')
-rw-r--r--intern/cycles/kernel/kernel_path.h6
-rw-r--r--intern/cycles/kernel/kernel_types.h3
2 files changed, 8 insertions, 1 deletions
diff --git a/intern/cycles/kernel/kernel_path.h b/intern/cycles/kernel/kernel_path.h
index 652777a77a0..e664a2e9dbd 100644
--- a/intern/cycles/kernel/kernel_path.h
+++ b/intern/cycles/kernel/kernel_path.h
@@ -145,6 +145,12 @@ ccl_device_forceinline void kernel_path_background(
return;
}
+ /* When using the ao bounces approximation, adjust background
+ * shader intensity with ao factor. */
+ if(path_state_ao_bounce(kg, state)) {
+ throughput *= kernel_data.background.ao_bounces_factor;
+ }
+
#ifdef __BACKGROUND__
/* sample background shader */
float3 L_background = indirect_background(kg, emission_sd, state, ray);
diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h
index 2ae003227dc..49ec6d97f28 100644
--- a/intern/cycles/kernel/kernel_types.h
+++ b/intern/cycles/kernel/kernel_types.h
@@ -1214,7 +1214,8 @@ typedef struct KernelBackground {
/* ambient occlusion */
float ao_factor;
float ao_distance;
- float ao_pad1, ao_pad2;
+ float ao_bounces_factor;
+ float ao_pad;
} KernelBackground;
static_assert_align(KernelBackground, 16);