Files
test/source/blender/gpu/shaders/material/gpu_shader_material_displacement.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

20 lines
664 B
GLSL

/* SPDX-FileCopyrightText: 2019-2022 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#pragma BLENDER_REQUIRE(gpu_shader_material_transform_utils.glsl)
void node_displacement_object(float height, float midlevel, float scale, vec3 N, out vec3 result)
{
vec3 lN;
direction_transform_world_to_object(N, lN);
vec3 l_displacement = (height - midlevel) * scale * normalize(lN);
/* Apply object scale and orientation. */
direction_transform_object_to_world(l_displacement, result);
}
void node_displacement_world(float height, float midlevel, float scale, vec3 N, out vec3 result)
{
result = (height - midlevel) * scale * normalize(N);
}