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>2018-01-26 16:09:55 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-01-26 20:47:21 +0300
commitce4915cddb08860f06ccc6a8ce7a7118441674ec (patch)
treee23ea9079bfb003875d70094da32ae4f973fd8da /intern/cycles/kernel/osl
parent47a3bbcc34185684813ba21d808f124c584a93ae (diff)
Code refactor: store RGB BSSRDF in a single closure.
Previously we stored each color channel in a single closure, which was convenient for sampling a closure and channel together. But this doesn't work so well for algorithms where we want to render multiple color channels together.
Diffstat (limited to 'intern/cycles/kernel/osl')
-rw-r--r--intern/cycles/kernel/osl/osl_bssrdf.cpp32
1 files changed, 4 insertions, 28 deletions
diff --git a/intern/cycles/kernel/osl/osl_bssrdf.cpp b/intern/cycles/kernel/osl/osl_bssrdf.cpp
index 27a96720c1e..b79cef244a0 100644
--- a/intern/cycles/kernel/osl/osl_bssrdf.cpp
+++ b/intern/cycles/kernel/osl/osl_bssrdf.cpp
@@ -72,36 +72,12 @@ public:
float texture_blur = params.texture_blur;
/* create one closure per color channel */
- Bssrdf *bssrdf = bssrdf_alloc(sd, make_float3(weight.x, 0.0f, 0.0f));
+ Bssrdf *bssrdf = bssrdf_alloc(sd, weight);
if(bssrdf) {
- bssrdf->sample_weight = sample_weight;
- bssrdf->radius = radius.x;
+ bssrdf->sample_weight = sample_weight * 3.0f;
+ bssrdf->radius = radius;
+ bssrdf->albedo = albedo;
bssrdf->texture_blur = texture_blur;
- bssrdf->albedo = albedo.x;
- bssrdf->sharpness = sharpness;
- bssrdf->N = params.N;
- bssrdf->roughness = params.roughness;
- sd->flag |= bssrdf_setup(bssrdf, (ClosureType)type);
- }
-
- bssrdf = bssrdf_alloc(sd, make_float3(0.0f, weight.y, 0.0f));
- if(bssrdf) {
- bssrdf->sample_weight = sample_weight;
- bssrdf->radius = radius.y;
- bssrdf->texture_blur = texture_blur;
- bssrdf->albedo = albedo.y;
- bssrdf->sharpness = sharpness;
- bssrdf->N = params.N;
- bssrdf->roughness = params.roughness;
- sd->flag |= bssrdf_setup(bssrdf, (ClosureType)type);
- }
-
- bssrdf = bssrdf_alloc(sd, make_float3(0.0f, 0.0f, weight.z));
- if(bssrdf) {
- bssrdf->sample_weight = sample_weight;
- bssrdf->radius = radius.z;
- bssrdf->texture_blur = texture_blur;
- bssrdf->albedo = albedo.z;
bssrdf->sharpness = sharpness;
bssrdf->N = params.N;
bssrdf->roughness = params.roughness;