Files
test/source/blender/gpu/shaders/material/gpu_shader_material_refraction.glsl
Clément Foucault bb52754652 GPU: Use f suffix for float literals
They are actually already some literals with the `f` suffix
that are in our shader codebase and we never had problem in
the past 5 years (or even 8 years).

So I think it is safe to do and improves convergence of codestyles.

Pull Request: https://projects.blender.org/blender/blender/pulls/137352
2025-04-11 18:28:45 +02:00

22 lines
589 B
GLSL

/* SPDX-FileCopyrightText: 2019-2022 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
void node_bsdf_refraction(
vec4 color, float roughness, float ior, vec3 N, float weight, out Closure result)
{
color = max(color, vec4(0.0f));
roughness = saturate(roughness);
ior = max(ior, 1e-5f);
N = safe_normalize(N);
ClosureRefraction refraction_data;
refraction_data.weight = weight;
refraction_data.color = color.rgb;
refraction_data.N = N;
refraction_data.roughness = roughness;
refraction_data.ior = ior;
result = closure_eval(refraction_data);
}