diff options
author | Brecht Van Lommel <brecht@blender.org> | 2021-02-17 03:47:18 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2021-02-17 18:26:24 +0300 |
commit | 68dd7617d705dd255b29b99074afa107ce38031e (patch) | |
tree | 1e253ab76b87e7f22a09db2f1137db3a1b8ecb6c /intern/cycles/kernel/kernel_subsurface.h | |
parent | 8119f0aad21c3ce88e82d68ed20cd5a8edc99703 (diff) |
Cycles: add utility functions for zero float2/float3/float4/transform
Ref D8237, T78710
Diffstat (limited to 'intern/cycles/kernel/kernel_subsurface.h')
-rw-r--r-- | intern/cycles/kernel/kernel_subsurface.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/intern/cycles/kernel/kernel_subsurface.h b/intern/cycles/kernel/kernel_subsurface.h index d8258a8336c..55bbe7f95db 100644 --- a/intern/cycles/kernel/kernel_subsurface.h +++ b/intern/cycles/kernel/kernel_subsurface.h @@ -27,7 +27,7 @@ subsurface_scatter_eval(ShaderData *sd, const ShaderClosure *sc, float disk_r, f { /* this is the veach one-sample model with balance heuristic, some pdf * factors drop out when using balance heuristic weighting */ - float3 eval_sum = make_float3(0.0f, 0.0f, 0.0f); + float3 eval_sum = zero_float3(); float pdf_sum = 0.0f; float sample_weight_inv = 0.0f; @@ -62,7 +62,7 @@ subsurface_scatter_eval(ShaderData *sd, const ShaderClosure *sc, float disk_r, f } } - return (pdf_sum > 0.0f) ? eval_sum / pdf_sum : make_float3(0.0f, 0.0f, 0.0f); + return (pdf_sum > 0.0f) ? eval_sum / pdf_sum : zero_float3(); } /* replace closures with a single diffuse bsdf closure after scatter step */ @@ -107,7 +107,7 @@ ccl_device void subsurface_scatter_setup_diffuse_bsdf( /* optionally do blurring of color and/or bump mapping, at the cost of a shader evaluation */ ccl_device float3 subsurface_color_pow(float3 color, float exponent) { - color = max(color, make_float3(0.0f, 0.0f, 0.0f)); + color = max(color, zero_float3()); if (exponent == 1.0f) { /* nothing to do */ @@ -243,7 +243,7 @@ ccl_device_inline int subsurface_scatter_disk(KernelGlobals *kg, } #endif /* __OBJECT_MOTION__ */ else { - ss_isect->weight[hit] = make_float3(0.0f, 0.0f, 0.0f); + ss_isect->weight[hit] = zero_float3(); continue; } @@ -450,7 +450,7 @@ ccl_device_noinline /* Convert subsurface to volume coefficients. * The single-scattering albedo is named alpha to avoid confusion with the surface albedo. */ float3 sigma_t, alpha; - float3 throughput = make_float3(1.0f, 1.0f, 1.0f); + float3 throughput = one_float3(); subsurface_random_walk_coefficients(sc, &sigma_t, &alpha, &throughput); float3 sigma_s = sigma_t * alpha; |