From 0488b728ebec61b50351d850d8fd52bfe67a40f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Tue, 29 May 2018 12:27:34 +0200 Subject: Eevee: Add support for the Hair info node. Only the random output is not supported for the moment. --- source/blender/gpu/shaders/gpu_shader_material.glsl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'source/blender/gpu/shaders') diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl index d84ffe99a6b..795320df6b7 100644 --- a/source/blender/gpu/shaders/gpu_shader_material.glsl +++ b/source/blender/gpu/shaders/gpu_shader_material.glsl @@ -2479,6 +2479,23 @@ void node_bevel(float radius, vec3 N, out vec3 result) result = N; } +void node_hair_info(out float is_strand, out float intercept, out float thickness, out vec3 tangent, out float random) +{ +#ifdef HAIR_SHADER + is_strand = 1.0; + intercept = hairTime; + thickness = hairThickness; + tangent = normalize(worldNormal); /* TODO fix naming */ + random = 0.0; +#else + is_strand = 0.0; + intercept = 0.0; + thickness = 0.0; + tangent = vec3(1.0); + random = 0.0; +#endif +} + void node_displacement_object(float height, float midlevel, float scale, vec3 N, mat4 obmat, out vec3 result) { N = (vec4(N, 0.0) * obmat).xyz; -- cgit v1.2.3