2023-08-24 10:54:59 +10:00
|
|
|
/* SPDX-FileCopyrightText: 2019-2022 Blender Authors
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
2019-12-02 01:40:58 +01:00
|
|
|
|
2025-09-25 10:57:02 +02:00
|
|
|
#include "infos/overlay_extra_infos.hh"
|
2025-02-24 16:17:18 +01:00
|
|
|
|
2025-03-04 00:20:52 +01:00
|
|
|
VERTEX_SHADER_CREATE_INFO(overlay_particle_dot)
|
2025-02-24 16:17:18 +01:00
|
|
|
|
2025-03-04 00:20:52 +01:00
|
|
|
#include "draw_model_lib.glsl"
|
2025-02-19 17:46:04 +01:00
|
|
|
#include "draw_view_clipping_lib.glsl"
|
2025-01-23 18:06:22 +01:00
|
|
|
#include "draw_view_lib.glsl"
|
2024-10-04 15:48:22 +02:00
|
|
|
#include "select_lib.glsl"
|
2019-12-02 01:40:58 +01:00
|
|
|
|
|
|
|
|
void main()
|
|
|
|
|
{
|
2025-03-04 00:20:52 +01:00
|
|
|
select_id_set(drw_custom_id());
|
2024-08-19 15:38:55 +02:00
|
|
|
|
2023-08-29 15:09:33 +10:00
|
|
|
/* Draw-size packed in alpha. */
|
2022-09-22 17:52:44 +02:00
|
|
|
float draw_size = ucolor.a;
|
2019-12-02 01:40:58 +01:00
|
|
|
|
2025-04-14 13:46:41 +02:00
|
|
|
float3 world_pos = part_pos;
|
2019-12-02 01:40:58 +01:00
|
|
|
|
2025-01-23 18:06:22 +01:00
|
|
|
gl_Position = drw_point_world_to_homogenous(world_pos);
|
2019-12-02 01:40:58 +01:00
|
|
|
/* World sized points. */
|
2025-06-24 18:10:52 +02:00
|
|
|
gl_PointSize = draw_size * drw_view().winmat[1][1] * uniform_buf.size_viewport.y / gl_Position.w;
|
2019-12-02 01:40:58 +01:00
|
|
|
|
|
|
|
|
/* Coloring */
|
2025-04-11 18:28:45 +02:00
|
|
|
if (part_val < 0.0f) {
|
2025-04-24 12:50:45 +02:00
|
|
|
final_color = float4(ucolor.rgb, 1.0f);
|
2019-12-02 01:40:58 +01:00
|
|
|
}
|
|
|
|
|
else {
|
2025-04-24 12:50:45 +02:00
|
|
|
final_color = float4(texture(weight_tx, part_val).rgb, 1.0f);
|
2019-12-02 01:40:58 +01:00
|
|
|
}
|
|
|
|
|
|
2022-05-01 18:40:48 +02:00
|
|
|
view_clipping_distances(world_pos);
|
2019-12-02 01:40:58 +01:00
|
|
|
}
|