Blender  V2.93
overlay_lattice.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * Copyright 2019, Blender Foundation.
17  */
18 
23 #include "DRW_render.h"
24 
25 #include "overlay_private.h"
26 
28 {
29  OVERLAY_PassList *psl = vedata->psl;
30  OVERLAY_PrivateData *pd = vedata->stl->pd;
31  struct GPUShader *sh;
32  DRWShadingGroup *grp;
33 
34  {
37 
40  DRW_shgroup_uniform_block(grp, "globalsBlock", G_draw.block_ubo);
42 
45  DRW_shgroup_uniform_block(grp, "globalsBlock", G_draw.block_ubo);
46  }
47 }
48 
50 {
51  OVERLAY_PrivateData *pd = vedata->stl->pd;
52  struct GPUBatch *geom;
53 
54  geom = DRW_cache_lattice_wire_get(ob, true);
56 
59 }
60 
62 {
64  const DRWContextState *draw_ctx = DRW_context_state_get();
65 
66  float *color;
67  DRW_object_wire_theme_get(ob, draw_ctx->view_layer, &color);
68 
69  struct GPUBatch *geom = DRW_cache_lattice_wire_get(ob, false);
70  OVERLAY_extra_wire(cb, geom, ob->obmat, color);
71 }
72 
74 {
75  OVERLAY_PassList *psl = vedata->psl;
76  OVERLAY_FramebufferList *fbl = vedata->fbl;
77 
78  if (DRW_state_is_fbo()) {
80  }
81 
83 }
DRWState
Definition: DRW_render.h:312
@ DRW_STATE_WRITE_DEPTH
Definition: DRW_render.h:314
@ DRW_STATE_WRITE_COLOR
Definition: DRW_render.h:315
@ DRW_STATE_DEPTH_LESS_EQUAL
Definition: DRW_render.h:323
#define DRW_PASS_CREATE(pass, state)
Definition: DRW_render.h:593
#define DRW_shgroup_call(shgroup, geom, ob)
Definition: DRW_render.h:420
GPUBatch
Definition: GPU_batch.h:93
void GPU_framebuffer_bind(GPUFrameBuffer *fb)
struct GPUShader GPUShader
Definition: GPU_shader.h:33
GPUBatch * DRW_cache_lattice_vert_overlay_get(Object *ob)
Definition: draw_cache.c:3284
GPUBatch * DRW_cache_lattice_wire_get(Object *ob, bool use_weight)
Definition: draw_cache.c:3270
int DRW_object_wire_theme_get(Object *ob, ViewLayer *view_layer, float **r_color)
Definition: draw_common.c:299
struct DRW_Global G_draw
Definition: draw_common.c:45
bool DRW_state_is_fbo(void)
const DRWContextState * DRW_context_state_get(void)
void DRW_shgroup_uniform_block(DRWShadingGroup *shgroup, const char *name, const GPUUniformBuf *ubo)
void DRW_shgroup_uniform_texture(DRWShadingGroup *shgroup, const char *name, const GPUTexture *tex)
DRWShadingGroup * DRW_shgroup_create(struct GPUShader *shader, DRWPass *pass)
void DRW_draw_pass(DRWPass *pass)
static ulong state[N]
OVERLAY_ExtraCallBuffers * OVERLAY_extra_call_buffer_get(OVERLAY_Data *vedata, Object *ob)
void OVERLAY_extra_wire(OVERLAY_ExtraCallBuffers *cb, struct GPUBatch *geom, const float mat[4][4], const float color[4])
void OVERLAY_lattice_cache_populate(OVERLAY_Data *vedata, Object *ob)
void OVERLAY_edit_lattice_draw(OVERLAY_Data *vedata)
void OVERLAY_edit_lattice_cache_init(OVERLAY_Data *vedata)
void OVERLAY_edit_lattice_cache_populate(OVERLAY_Data *vedata, Object *ob)
GPUShader * OVERLAY_shader_edit_lattice_wire(void)
GPUShader * OVERLAY_shader_edit_lattice_point(void)
struct ViewLayer * view_layer
Definition: DRW_render.h:746
struct GPUUniformBuf * block_ubo
Definition: draw_common.h:210
struct GPUTexture * weight_ramp
Definition: draw_common.h:213
OVERLAY_PassList * psl
OVERLAY_StorageList * stl
OVERLAY_FramebufferList * fbl
struct GPUFrameBuffer * overlay_default_fb
DRWPass * edit_lattice_ps
DRWShadingGroup * edit_lattice_wires_grp
DRWShadingGroup * edit_lattice_points_grp
struct OVERLAY_PrivateData * pd
float obmat[4][4]