Blender
V3.3
source
blender
draw
engines
workbench
workbench_effect_outline.c
Go to the documentation of this file.
1
/* SPDX-License-Identifier: GPL-2.0-or-later
2
* Copyright 2020 Blender Foundation. */
3
12
#include "
DRW_render.h
"
13
14
#include "
workbench_engine.h
"
15
#include "
workbench_private.h
"
16
17
void
workbench_outline_cache_init
(
WORKBENCH_Data
*
data
)
18
{
19
WORKBENCH_PassList
*psl =
data
->psl;
20
WORKBENCH_PrivateData
*wpd =
data
->stl->wpd;
21
DefaultTextureList
*dtxl =
DRW_viewport_texture_list_get
();
22
struct
GPUShader
*
sh
;
23
DRWShadingGroup
*grp;
24
25
if
(
OBJECT_OUTLINE_ENABLED
(wpd)) {
26
int
state
=
DRW_STATE_WRITE_COLOR
|
DRW_STATE_BLEND_ALPHA_PREMUL
;
27
DRW_PASS_CREATE
(psl->
outline_ps
,
state
);
28
29
sh
=
workbench_shader_outline_get
();
30
31
grp =
DRW_shgroup_create
(
sh
, psl->
outline_ps
);
32
DRW_shgroup_uniform_texture
(grp,
"objectIdBuffer"
, wpd->
object_id_tx
);
33
DRW_shgroup_uniform_texture
(grp,
"depthBuffer"
, dtxl->
depth
);
34
DRW_shgroup_uniform_block
(grp,
"world_data"
, wpd->
world_ubo
);
35
DRW_shgroup_call_procedural_triangles
(grp,
NULL
, 1);
36
}
37
else
{
38
psl->
outline_ps
=
NULL
;
39
}
40
}
DRW_render.h
DRW_STATE_WRITE_COLOR
@ DRW_STATE_WRITE_COLOR
Definition:
DRW_render.h:303
DRW_STATE_BLEND_ALPHA_PREMUL
@ DRW_STATE_BLEND_ALPHA_PREMUL
Definition:
DRW_render.h:330
DRW_PASS_CREATE
#define DRW_PASS_CREATE(pass, state)
Definition:
DRW_render.h:690
DRW_shgroup_uniform_block
#define DRW_shgroup_uniform_block(shgroup, name, ubo)
Definition:
DRW_render.h:651
GPUShader
struct GPUShader GPUShader
Definition:
GPU_shader.h:20
NULL
return NULL
Definition:
bmesh_operator_api_inline.h:205
data
data
Definition:
bmesh_operator_api_inline.h:157
DRW_viewport_texture_list_get
DefaultTextureList * DRW_viewport_texture_list_get(void)
Definition:
draw_manager.c:638
DRW_shgroup_uniform_texture
void DRW_shgroup_uniform_texture(DRWShadingGroup *shgroup, const char *name, const GPUTexture *tex)
Definition:
draw_manager_data.c:240
DRW_shgroup_call_procedural_triangles
void DRW_shgroup_call_procedural_triangles(DRWShadingGroup *shgroup, Object *ob, uint tri_count)
Definition:
draw_manager_data.c:1041
DRW_shgroup_create
DRWShadingGroup * DRW_shgroup_create(struct GPUShader *shader, DRWPass *pass)
Definition:
draw_manager_data.c:1594
state
const int state
Definition:
kernel/device/gpu/kernel.h:89
sh
ccl_gpu_kernel_postfix ccl_global float int int int int sh
Definition:
kernel/device/gpu/kernel.h:515
DRWShadingGroup
Definition:
draw_manager.h:380
DefaultTextureList
Definition:
draw_view_data.h:85
DefaultTextureList::depth
struct GPUTexture * depth
Definition:
draw_view_data.h:88
WORKBENCH_Data
Definition:
workbench_private.h:158
WORKBENCH_PassList
Definition:
workbench_private.h:119
WORKBENCH_PassList::outline_ps
struct DRWPass * outline_ps
Definition:
workbench_private.h:135
WORKBENCH_PrivateData
Definition:
workbench_private.h:224
WORKBENCH_PrivateData::world_ubo
struct GPUUniformBuf * world_ubo
Definition:
workbench_private.h:242
WORKBENCH_PrivateData::object_id_tx
struct GPUTexture * object_id_tx
Definition:
workbench_private.h:305
workbench_outline_cache_init
void workbench_outline_cache_init(WORKBENCH_Data *data)
Definition:
workbench_effect_outline.c:17
workbench_engine.h
workbench_private.h
OBJECT_OUTLINE_ENABLED
#define OBJECT_OUTLINE_ENABLED(wpd)
Definition:
workbench_private.h:54
workbench_shader_outline_get
GPUShader * workbench_shader_outline_get(void)
Definition:
workbench_shader.cc:255
Generated on Tue Oct 22 2024 13:18:25 for Blender by
doxygen
1.9.1