Files
test/source/blender/gpu/shaders/material/gpu_shader_material_glossy.glsl
Clément Foucault 71dfcf4558 EEVEE-Next: Remove common lib usage
Replaces all usage by the the gpu_shader_math
equivalent. This is because the old shader
library was quite tangled.

This avoids dependency hell trying to
mix libraries.

Changes are split into isolated commits until
I had to do mass changes because of inter-
dependencies.

Pull Request: https://projects.blender.org/blender/blender/pulls/113631
2023-10-13 17:59:46 +02:00

31 lines
992 B
GLSL

/* SPDX-FileCopyrightText: 2019-2023 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
void node_bsdf_glossy(vec4 color,
float roughness,
float anisotropy,
float rotation,
vec3 N,
vec3 T,
float weight,
const float do_multiscatter,
out Closure result)
{
N = safe_normalize(N);
vec3 V = coordinate_incoming(g_data.P);
float NV = dot(N, V);
vec2 split_sum = brdf_lut(NV, roughness);
ClosureReflection reflection_data;
reflection_data.weight = weight;
reflection_data.color = (do_multiscatter != 0.0) ?
F_brdf_multi_scatter(color.rgb, color.rgb, split_sum) :
F_brdf_single_scatter(color.rgb, color.rgb, split_sum);
reflection_data.N = N;
reflection_data.roughness = roughness;
result = closure_eval(reflection_data);
}