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-02-08 14:45:12 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-02-08 18:56:11 +0300
commitaabafece03fee807d6b9e5e6d40273f70cc4b9d8 (patch)
treef104da074a4fe085ccd8296a4a0d1826312c3ef6 /intern/cycles/kernel/kernel_subsurface.h
parent28e2bc90dd8df3032b831a502e15e3a2976eb9de (diff)
Code refactor: tweaks in SSS code to prepare for coming changes.
This also fixes a subtle bug in the split kernel branched path SSS, the volume stack update can't be shared between multiple hit points.
Diffstat (limited to 'intern/cycles/kernel/kernel_subsurface.h')
-rw-r--r--intern/cycles/kernel/kernel_subsurface.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/intern/cycles/kernel/kernel_subsurface.h b/intern/cycles/kernel/kernel_subsurface.h
index 582a20704d3..f4759b26191 100644
--- a/intern/cycles/kernel/kernel_subsurface.h
+++ b/intern/cycles/kernel/kernel_subsurface.h
@@ -135,7 +135,6 @@ ccl_device float3 subsurface_color_pow(float3 color, float exponent)
ccl_device void subsurface_color_bump_blur(KernelGlobals *kg,
ShaderData *sd,
ccl_addr_space PathState *state,
- int state_flag,
float3 *eval,
float3 *N)
{
@@ -148,7 +147,7 @@ ccl_device void subsurface_color_bump_blur(KernelGlobals *kg,
if(bump || texture_blur > 0.0f) {
/* average color and normal at incoming point */
- shader_eval_surface(kg, sd, state, state_flag, kernel_data.integrator.max_closures);
+ shader_eval_surface(kg, sd, state, state->flag, kernel_data.integrator.max_closures);
float3 in_color = shader_bssrdf_sum(sd, (bump)? N: NULL, NULL);
/* we simply divide out the average color and multiply with the average
@@ -311,9 +310,7 @@ ccl_device_noinline void subsurface_scatter_multi_setup(
int hit,
ShaderData *sd,
ccl_addr_space PathState *state,
- int state_flag,
- const ShaderClosure *sc,
- bool all)
+ const ShaderClosure *sc)
{
#ifdef __SPLIT_KERNEL__
Ray ray_object = ss_isect->ray;
@@ -333,7 +330,7 @@ ccl_device_noinline void subsurface_scatter_multi_setup(
/* Optionally blur colors and bump mapping. */
float3 weight = ss_isect->weight[hit];
float3 N = sd->N;
- subsurface_color_bump_blur(kg, sd, state, state_flag, &weight, &N);
+ subsurface_color_bump_blur(kg, sd, state, &weight, &N);
/* Setup diffuse BSDF. */
subsurface_scatter_setup_diffuse_bsdf(kg, sd, sc, weight, true, N);
@@ -341,7 +338,7 @@ ccl_device_noinline void subsurface_scatter_multi_setup(
/* subsurface scattering step, from a point on the surface to another nearby point on the same object */
ccl_device void subsurface_scatter_step(KernelGlobals *kg, ShaderData *sd, ccl_addr_space PathState *state,
- int state_flag, const ShaderClosure *sc, uint *lcg_state, float disk_u, float disk_v, bool all)
+ const ShaderClosure *sc, uint *lcg_state, float disk_u, float disk_v, bool all)
{
float3 eval = make_float3(0.0f, 0.0f, 0.0f);
@@ -430,7 +427,7 @@ ccl_device void subsurface_scatter_step(KernelGlobals *kg, ShaderData *sd, ccl_a
/* optionally blur colors and bump mapping */
float3 N = sd->N;
- subsurface_color_bump_blur(kg, sd, state, state_flag, &eval, &N);
+ subsurface_color_bump_blur(kg, sd, state, &eval, &N);
/* setup diffuse bsdf */
subsurface_scatter_setup_diffuse_bsdf(kg, sd, sc, eval, (ss_isect.num_hits > 0), N);