32struct GpencilBatchCache;
39#define GPENCIL_PIXEL_FACTOR 2000.0f
42#define GPENCIL_VBO_BLOCK_SIZE 128
44#define GP_MAX_MASKBITS 256
46#define GPENCIL_SIMPLIFY(scene) \
47 ((scene->r.mode & R_SIMPLIFY) && (scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_ENABLE))
48#define GPENCIL_SIMPLIFY_ONPLAY(playing) \
49 (((playing == true) && (scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_ON_PLAY)) || \
50 ((scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_ON_PLAY) == 0))
51#define GPENCIL_SIMPLIFY_FILL(scene, playing) \
52 ((GPENCIL_SIMPLIFY_ONPLAY(playing) && GPENCIL_SIMPLIFY(scene) && \
53 (scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_FILL)))
54#define GPENCIL_SIMPLIFY_FX(scene, playing) \
55 ((GPENCIL_SIMPLIFY_ONPLAY(playing) && GPENCIL_SIMPLIFY(scene) && \
56 (scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_FX)))
57#define GPENCIL_SIMPLIFY_TINT(scene) \
58 (GPENCIL_SIMPLIFY(scene) && (scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_TINT))
59#define GPENCIL_SIMPLIFY_AA(scene) \
60 (GPENCIL_SIMPLIFY(scene) && (scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_AA))
62namespace draw::gpencil {
91 ::std::unique_ptr<PassSimple>
vfx_ps = ::std::make_unique<PassSimple>(
"vfx");
343 return "Grease Pencil";
370 bool &r_is_used_as_mask);
375 void antialiasing_init();
376 void antialiasing_draw(
Manager &manager);
378 struct VfxFramebufferRef {
403 void vfx_sync(
Object *ob, tObject *tgp_ob);
405 static void material_pool_free(
void *
storage)
407 MaterialPool *matpool =
static_cast<MaterialPool *
>(
storage);
411 static void light_pool_free(
void *
storage)
413 LightPool *lightpool =
static_cast<LightPool *
>(
storage);
430 bool is_stroke_order_3d,
440 bool is_used_as_mask,
450 bool is_vertex_mode);
Low-level operations for grease pencil.
#define BLI_BITMAP_SIZE(_num)
#define BLI_memblock_create(elem_size)
#define GPENCIL_MATERIAL_BUFFER_LEN
#define GPENCIL_LIGHT_BUFFER_LEN
#define storage(slot, qualifiers)
void gpencil_light_ambient_add(LightPool *lightpool, const float color[3])
void gpencil_object_cache_sort(Instance *inst)
void gpencil_light_pool_populate(LightPool *lightpool, Object *ob)
LightPool * gpencil_light_pool_add(Instance *inst)
tLayer * grease_pencil_layer_cache_add(Instance *inst, const Object *ob, const bke::greasepencil::Layer &layer, const int onion_id, const bool is_used_as_mask, tObject *tgp_ob)
void gpencil_material_resources_get(MaterialPool *first_pool, int mat_id, gpu::Texture **r_tex_stroke, gpu::Texture **r_tex_fill, gpu::UniformBuf **r_ubo_mat)
struct GpencilBatchCache * gpencil_batch_cache_get(struct Object *ob, int cfra)
tLayer * grease_pencil_layer_cache_get(tObject *tgp_ob, int layer_id, const bool skip_onion)
LightPool * gpencil_light_pool_create(Instance *inst, Object *)
MaterialPool * gpencil_material_pool_create(Instance *inst, Object *ob, int *ofs, const bool is_vertex_mode)
tObject * gpencil_object_cache_add(Instance *inst, Object *ob, const bool is_stroke_order_3d, const Bounds< float3 > bounds)
detail::Pass< command::DrawCommandBuf > PassSimple
BLI_INLINE float fb(float length, float L)
MatBase< float, 4, 4 > float4x4
VecBase< float, 2 > float2
void BLI_memblock_destroy(BLI_memblock *mblk, MemblockValFreeFP free_callback) ATTR_NONNULL(1)
VecBase< float, 3 > float3
static constexpr GPUSamplerState internal_sampler()
struct Instance * instance
TextureFromPool smaa_edge_tx
StringRefNull name_get() final
bool do_onion_only_active_object
bool snapshot_buffer_dirty
LightPool * shadeless_light_pool
Framebuffer gpencil_pass_fb
Framebuffer combined_pass_fb
bool need_grease_pencil_pass
gpu::Batch * stroke_batch
LightPool * last_light_pool
PassSimple smaa_resolve_ps
Framebuffer smaa_weight_fb
Texture snapshot_depth_tx
PassSimple smaa_weight_ps
PassSimple merge_depth_pass_ps
struct BLI_memblock * gp_object_pool
gpu::Texture * depth_pass_img
TextureFromPool color_object_tx
tLayer_Pool * gp_layer_pool
float vertex_paint_opacity
draw::detail::SubPassVector< tLayer > tLayer_Pool
TextureFromPool mask_color_tx
struct blender::draw::gpencil::Instance::@250045130013031054234100054276160145124267353263 tobjects_infront
struct ViewLayer * view_layer
float fade_3d_object_opacity
bool force_stroke_order_3d
gpu::FrameBuffer * scene_fb
struct BLI_memblock * gp_material_pool
const DRWContext * draw_ctx
PassSimple mask_invert_ps
float fade_gp_object_opacity
TextureFromPool mask_depth_tx
bool use_multiedit_lines_only
Texture snapshot_reveal_tx
TextureFromPool color_layer_tx
float4x4 object_bound_mat
MaterialPool * last_material_pool
static float2 antialiasing_sample_get(int sample_index, int sample_count)
float v3d_single_color[3]
Texture snapshot_color_tx
void object_sync(ObjectRef &ob_ref, Manager &manager) final
TextureFromPool reveal_layer_tx
struct blender::draw::gpencil::Instance::@250045130013031054234100054276160145124267353263 tobjects
TextureFromPool reveal_tx
TextureFromPool reveal_object_tx
gpu::Texture * scene_depth_tx
draw::detail::SubPassVector< tVfx > tVfx_Pool
LightPool * global_light_pool
TextureFromPool smaa_weight_tx
Framebuffer accumulation_fb
PassSimple merge_depth_ps
struct BLI_memblock * gp_maskbit_pool
struct BLI_memblock * gp_light_pool
struct blender::draw::gpencil::Instance::@270103242060374244001011226234131367140002277206 sbuffer_tobjects
void antialiasing_accumulate(Manager &manager, float alpha)
gpLight light_data[GPENCIL_LIGHT_BUFFER_LEN]
gpu::Texture * tex_fill[GPENCIL_MATERIAL_BUFFER_LEN]
gpu::Texture * tex_stroke[GPENCIL_MATERIAL_BUFFER_LEN]
gpMaterial mat_data[GPENCIL_MATERIAL_BUFFER_LEN]
::std::unique_ptr< PassSimple > blend_ps
::std::unique_ptr< PassSimple > geom_ps
BLI_bitmap * mask_invert_bits
struct blender::draw::gpencil::tObject::@156157250037170237043104125276354377130037130163 layers
struct blender::draw::gpencil::tObject::@332241055010322366143177356242222270031034105156 vfx
gpu::FrameBuffer ** target_fb
::std::unique_ptr< PassSimple > vfx_ps