32 double current_time_ = 0.0;
35 bool any_animated_ =
false;
55 state.clipping_plane_count);
56 ps_.shader_set(res.shaders->uniform_color.get());
60 any_animated_ =
false;
73 const bool draw_surface = (ob_ref.object->dt >=
OB_WIRE) &&
74 (renderable || (ob_ref.object->dt ==
OB_WIRE));
79 const float time = current_time_ - ob_ref.object->runtime->overlay_mode_transfer_start_time;
80 const float alpha = alpha_from_time_get(time);
85 ps_.push_constant(
"ucolor",
float4(flash_color_.xyz() * alpha, alpha));
88 !
state.is_image_render;
89 if (use_sculpt_pbvh) {
90 ResourceHandle handle = manager.resource_handle_for_sculpt(ob_ref);
93 ps_.draw(
batch.batch, handle);
99 ps_.draw(geom, manager.unique_handle(ob_ref));
103 any_animated_ =
true;
113 manager.submit(ps_,
view);
122 static constexpr float flash_length = 0.55f;
123 static constexpr float flash_alpha = 0.25f;
125 static float alpha_from_time_get(
const float anim_time)
127 if (anim_time > flash_length) {
130 if (anim_time < 0.0f) {
133 return (1.0f - (anim_time / flash_length)) * flash_alpha;
bool BKE_sculptsession_use_pbvh_draw(const Object *ob, const RegionView3D *rv3d)
MINLINE void srgb_to_linearrgb_v4(float linear[4], const float srgb[4])
Platform independent time functions.
double BLI_time_now_seconds(void)
void GPU_framebuffer_bind(GPUFrameBuffer *fb)
void UI_GetThemeColor3fv(int colorid, float col[3])
void object_sync(Manager &manager, const ObjectRef &ob_ref, Resources &, const State &state) final
void begin_sync(Resources &res, const State &state) final
void draw(Framebuffer &framebuffer, Manager &manager, View &view) final
bool DRW_object_is_renderable(const Object *ob)
void DRW_viewport_request_redraw()
#define DRW_CLIPPING_UBO_SLOT
#define OVERLAY_GLOBALS_SLOT
@ DRW_STATE_DEPTH_LESS_EQUAL
struct @064345207361167251075330302113175271221317160336::@113254110077376341056327177062323111323010325277 batch
detail::Pass< command::DrawCommandBuf > PassSimple
Vector< SculptBatch > sculpt_batches_get(const Object *ob, SculptBatchFeature features)
gpu::Batch * DRW_cache_object_surface_get(Object *ob)
VecBase< float, 4 > float4