This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/gpu/shaders/material/gpu_shader_material_geometry.glsl
Clément Foucault bfa1c077cb Fix T97983 EEVEE: Tangent Normal of Curves info behaves differently in Eevee
Curve tangent was correctly mistaken with curve normal.

This patch fixes the name of the output in the glsl function and make curve
attributes more explicit (with `curve_` prefix).

This also improve the normal computation by making it per pixel to match
cycles.

Also ports the changes to eevee-next.
2022-05-09 20:06:27 +02:00

33 lines
890 B
GLSL

#pragma BLENDER_REQUIRE(gpu_shader_material_tangent.glsl)
void node_geometry(vec3 orco,
out vec3 position,
out vec3 normal,
out vec3 tangent,
out vec3 true_normal,
out vec3 incoming,
out vec3 parametric,
out float backfacing,
out float pointiness,
out float random_per_island)
{
/* handle perspective/orthographic */
incoming = coordinate_incoming(g_data.P);
position = g_data.P;
normal = g_data.N;
true_normal = g_data.Ng;
if (g_data.is_strand) {
tangent = g_data.curve_T;
}
else {
tangent_orco_z(orco, orco);
node_tangent(orco, tangent);
}
parametric = vec3(g_data.barycentric_coords, 0.0);
backfacing = (FrontFacing) ? 0.0 : 1.0;
pointiness = 0.5;
random_per_island = 0.0;
}