diff options
Diffstat (limited to 'source/blender/gpu/shaders/material/gpu_shader_material_normal_map.glsl')
-rw-r--r-- | source/blender/gpu/shaders/material/gpu_shader_material_normal_map.glsl | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/gpu/shaders/material/gpu_shader_material_normal_map.glsl b/source/blender/gpu/shaders/material/gpu_shader_material_normal_map.glsl index a9be6bfa0ff..2b4a0204d97 100644 --- a/source/blender/gpu/shaders/material/gpu_shader_material_normal_map.glsl +++ b/source/blender/gpu/shaders/material/gpu_shader_material_normal_map.glsl @@ -20,3 +20,8 @@ void color_to_blender_normal_new_shading(vec3 color, out vec3 normal) { normal = vec3(2.0, -2.0, -2.0) * color - vec3(1.0); } + +void node_normal_map_mix(float strength, vec3 newnormal, vec3 oldnormal, out vec3 outnormal) +{ + outnormal = normalize(mix(oldnormal, newnormal, max(strength, 0.0))); +} |