Blender V5.3
overlay_mode_transfer.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2025 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
10
11#include "BLI_math_color_c.hh"
12
13#include "ED_object.hh"
14
15namespace blender::draw::overlay {
16
18{
20
21 enabled_ = state.is_space_v3d() && !res.is_selection() && !object_factors_.is_empty();
22
23 if (!enabled_) {
24 /* Not used. But release the data. */
25 ps_.init();
26 return;
27 }
28
30 srgb_to_linearrgb_v4(flash_color_, flash_color_);
31
32 ps_.init();
34 state.clipping_plane_count);
35 ps_.shader_set(res.shaders->uniform_color.get());
36 ps_.bind_ubo(OVERLAY_GLOBALS_SLOT, &res.globals_buf);
37 ps_.bind_ubo(DRW_CLIPPING_UBO_SLOT, &res.clip_planes_buf);
38}
39
40} // namespace blender::draw::overlay
void begin_sync(Resources &res, const State &state) final
#define DRW_CLIPPING_UBO_SLOT
#define OVERLAY_GLOBALS_SLOT
const int state
Map< std::string, float, 1 > mode_transfer_overlay_current_state()
void get_color_3fv(int colorid, float col[3])
MINLINE void srgb_to_linearrgb_v4(float linear[4], const float srgb[4])
@ TH_VERTEX_SELECT
@ DRW_STATE_WRITE_COLOR
Definition draw_state.hh:32
@ DRW_STATE_WRITE_DEPTH
Definition draw_state.hh:31
@ DRW_STATE_DEPTH_LESS_EQUAL
Definition draw_state.hh:40
draw::UniformArrayBuffer< float4, 6 > clip_planes_buf
draw::UniformBuffer< UniformData > globals_buf