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/draw/intern/shaders/common_hair_refine_vert.glsl
2022-05-05 11:44:31 +02:00

31 lines
811 B
GLSL

#pragma BLENDER_REQUIRE(common_hair_lib.glsl)
#ifdef USE_TF
out vec4 finalColor;
#endif
void main(void)
{
float interp_time;
vec4 data0, data1, data2, data3;
hair_get_interp_attrs(data0, data1, data2, data3, interp_time);
vec4 weights = hair_get_weights_cardinal(interp_time);
finalColor = hair_interp_data(data0, data1, data2, data3, weights);
#if defined(TF_WORKAROUND)
int id = gl_VertexID - idOffset;
gl_Position.x = ((float(id % targetWidth) + 0.5) / float(targetWidth)) * 2.0 - 1.0;
gl_Position.y = ((float(id / targetWidth) + 0.5) / float(targetHeight)) * 2.0 - 1.0;
gl_Position.z = 0.0;
gl_Position.w = 1.0;
gl_PointSize = 1.0;
#else
# ifdef GPU_METAL
/* Metal still expects an output position for TF shaders. */
gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
# endif
#endif
}