Blender
V5.3
source
blender
gpu
shaders
material
gpu_shader_material_subsurface_scattering.bsl.hh
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2019-2022 Blender Authors
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
5
#pragma once
6
7
#include "
gpu_shader_material_interface.bsl.hh
"
8
#include "
gpu_shader_math_vector_safe.bsl.hh
"
9
10
[[
node
]]
11
void
node_subsurface_scattering
(
float4
color,
12
float
scale
,
13
float3
radius,
14
float
ior,
15
float
/*roughness*/
,
16
float
/*anisotropy*/
,
17
float3
N
,
18
float
weight,
19
float
random_walk_radius_scale,
20
KernelGlobals
&kg,
21
ShadingData
&sd,
22
Closure
&result)
23
{
24
color =
max
(color,
float4
(0.0f));
25
ior =
max
(ior, 1e-5f);
26
/* roughness = saturate(roughness) */
27
N
=
safe_normalize
(
N
);
28
29
ClosureSubsurface sss_data;
30
sss_data.color = color.rgb * weight;
31
sss_data.N =
N
;
32
sss_data.sss_radius =
max
(radius *
scale
* random_walk_radius_scale,
float3
(0.0f));
33
34
result =
closure_eval
(kg, sd, sss_data);
35
}
max
btScalar max
Definition
btHeightfieldTerrainShape.h:79
Closure
#define Closure
Definition
eevee_nodetree_closures_lib.bsl.hh:10
closure_eval
Closure closure_eval(KernelGlobals &kg, ShadingData &sd, ClosureDiffuse diffuse)
Definition
eevee_nodetree_lib.bsl.hh:270
node
#define node
Definition
gpu_shader_cxx_attribute.hh:142
gpu_shader_material_interface.bsl.hh
node_subsurface_scattering
void node_subsurface_scattering(float4 color, float scale, float3 radius, float ior, float, float, float3 N, float weight, float random_walk_radius_scale, KernelGlobals &kg, ShadingData &sd, Closure &result)
Definition
gpu_shader_material_subsurface_scattering.bsl.hh:11
scale
float3x3 scale(float3x3 mat, float2 scale)
Definition
gpu_shader_math_matrix.bsl.hh:100
gpu_shader_math_vector_safe.bsl.hh
safe_normalize
VecT safe_normalize(VecT vector)
Definition
gpu_shader_math_vector_safe.bsl.hh:150
N
#define N
Definition
mball_tessellate.cc:278
KernelGlobals
Definition
eevee_nodetree_lib.bsl.hh:141
ShadingData
Definition
eevee_nodetree_lib.bsl.hh:56
float3
Definition
sky_math.h:135
float4
Definition
sky_math.h:224
Generated on
for Blender by
doxygen
1.18.0