2023-08-24 10:54:59 +10:00
|
|
|
/* SPDX-FileCopyrightText: 2020-2023 Blender Authors
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
|
|
2025-09-25 10:57:02 +02:00
|
|
|
#include "infos/gpu_shader_3D_polyline_infos.hh"
|
2024-11-12 18:53:34 +01:00
|
|
|
|
2024-10-04 15:48:22 +02:00
|
|
|
#include "gpu_shader_colorspace_lib.glsl"
|
2020-04-23 23:05:39 +02:00
|
|
|
|
2024-11-12 18:53:34 +01:00
|
|
|
FRAGMENT_SHADER_CREATE_INFO(gpu_shader_3D_polyline_uniform_color)
|
|
|
|
|
|
2020-04-23 23:05:39 +02:00
|
|
|
void main()
|
|
|
|
|
{
|
|
|
|
|
#ifdef CLIP
|
2025-04-11 18:28:45 +02:00
|
|
|
if (clip < 0.0f) {
|
2025-05-05 09:59:00 +02:00
|
|
|
gpu_discard_fragment();
|
2020-04-23 23:05:39 +02:00
|
|
|
}
|
|
|
|
|
#endif
|
2024-11-27 17:37:04 +01:00
|
|
|
fragColor = final_color;
|
2020-11-17 01:28:33 +01:00
|
|
|
if (lineSmooth) {
|
2025-04-11 18:28:45 +02:00
|
|
|
fragColor.a *= clamp((lineWidth + SMOOTH_WIDTH) * 0.5f - abs(smoothline), 0.0f, 1.0f);
|
2020-11-17 01:28:33 +01:00
|
|
|
}
|
2020-04-23 23:05:39 +02:00
|
|
|
fragColor = blender_srgb_to_framebuffer_space(fragColor);
|
|
|
|
|
}
|