Eevee: Volumetrics: Add Volume Absorption node.
This commit is contained in:
parent
d5448eac6c
commit
f8aab24fb5
|
@ -2955,6 +2955,15 @@ void node_volume_scatter(vec4 color, float density, float anisotropy, out Closur
|
|||
#endif
|
||||
}
|
||||
|
||||
void node_volume_absorption(vec4 color, float density, out Closure result)
|
||||
{
|
||||
#ifdef VOLUMETRICS
|
||||
result = Closure((1.0 - color.rgb) * density, vec3(0.0), vec3(0.0), 0.0);
|
||||
#else
|
||||
result = CLOSURE_DEFAULT;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* closures */
|
||||
|
||||
void node_mix_shader(float fac, Closure shader1, Closure shader2, out Closure shader)
|
||||
|
|
|
@ -40,9 +40,9 @@ static bNodeSocketTemplate sh_node_volume_absorption_out[] = {
|
|||
{ -1, 0, "" }
|
||||
};
|
||||
|
||||
static int node_shader_gpu_volume_absorption(GPUMaterial *UNUSED(mat), bNode *UNUSED(node), bNodeExecData *UNUSED(execdata), GPUNodeStack *UNUSED(in), GPUNodeStack *UNUSED(out))
|
||||
static int node_shader_gpu_volume_absorption(GPUMaterial *mat, bNode *UNUSED(node), bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out)
|
||||
{
|
||||
return false;
|
||||
return GPU_stack_link(mat, "node_volume_absorption", in, out);
|
||||
}
|
||||
|
||||
/* node type definition */
|
||||
|
|
Loading…
Reference in New Issue