Files
test2/source/blender/gpu/shaders/material/gpu_shader_material_sheen.glsl
Clément Foucault ea989ebf94 EEVEE/EEVEE-Next: Split Diffuse and Subsurface closure
Even if related, they don't have the same performance
impact.

To avoid any performance hit, we replace the Diffuse
by a Subsurface Closure for legacy EEVEE and
use the subsurface closure only where needed for
EEVEE-Next leveraging the random sampling.

This increases the compatibility with cycles that
doesn't modulate the radius of the subsurface anymore.
This change is only present in EEVEE-Next.

This commit changes the principled BSDF code so that
it is easier to follow the flow of data.

For legacy EEVEE, the SSS switch is moved to a
`radius == -1` check.
2024-01-09 16:39:17 +13:00

19 lines
483 B
GLSL

/* SPDX-FileCopyrightText: 2019-2023 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
void node_bsdf_sheen(vec4 color, float roughness, vec3 N, float weight, out Closure result)
{
color = max(color, vec4(0.0));
roughness = saturate(roughness);
N = safe_normalize(N);
/* Fallback to diffuse. */
ClosureDiffuse diffuse_data;
diffuse_data.weight = weight;
diffuse_data.color = color.rgb;
diffuse_data.N = N;
result = closure_eval(diffuse_data);
}