Files
test2/source/blender/gpu/shaders/material/gpu_shader_material_sheen.glsl
Jason Fielder 9042773d93 GPU: Resolve compilation error in Metal caused by type ambiguity
Recent change in commit 3f778150a9
caused compilation errors in Metal due to type ambiguity. Updating call to
explicitly utilise floats where appropriate.

Authored by Apple: Michael Parkin-White

Co-authored-by: Michael Parkin-White <mparkinwhite@apple.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/115301
2023-11-27 11:50:25 +01:00

20 lines
511 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;
diffuse_data.sss_id = 0u;
result = closure_eval(diffuse_data);
}