Files
test/source/blender/gpu/shaders/material/gpu_shader_material_refraction.glsl
Clément Foucault bb8e987904 GPU: Simplify matrix lib to reduce dead code
This greatly reduce shader compilation time on some systems.

Pull Request: https://projects.blender.org/blender/blender/pulls/146100
2025-09-15 12:07:26 +02:00

25 lines
687 B
GLSL

/* SPDX-FileCopyrightText: 2019-2022 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "gpu_shader_math_vector_safe_lib.glsl"
#include "gpu_shader_utildefines_lib.glsl"
void node_bsdf_refraction(
float4 color, float roughness, float ior, float3 N, float weight, out Closure result)
{
color = max(color, float4(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);
}