|
Blender V4.3
|
#include "DRW_engine.hh"#include "DRW_render.hh"#include "BKE_curves.hh"#include "BKE_gpencil_geom_legacy.h"#include "BKE_gpencil_legacy.h"#include "BKE_grease_pencil.h"#include "BKE_grease_pencil.hh"#include "BKE_lib_id.hh"#include "BKE_main.hh"#include "BKE_object.hh"#include "BKE_paint.hh"#include "BKE_shader_fx.h"#include "BKE_camera.h"#include "BKE_global.hh"#include "BLI_link_utils.h"#include "BLI_listbase.h"#include "BLI_memblock.h"#include "BLI_virtual_array.hh"#include "DNA_camera_types.h"#include "DNA_gpencil_legacy_types.h"#include "DNA_screen_types.h"#include "DNA_view3d_types.h"#include "GPU_texture.hh"#include "GPU_uniform_buffer.hh"#include "gpencil_engine.h"#include "DEG_depsgraph_query.hh"#include "ED_grease_pencil.hh"#include "ED_screen.hh"#include "ED_view3d.hh"#include "UI_resources.hh"Go to the source code of this file.
Macros | |
| #define | DISABLE_BATCHING 0 |
Variables | |
| static const DrawEngineDataSize | GPENCIL_data_size = DRW_VIEWPORT_DATA_SIZE(GPENCIL_Data) |
| DrawEngineType | draw_engine_gpencil_type |
| #define DISABLE_BATCHING 0 |
Definition at line 325 of file gpencil_engine_c.cc.
| void GPENCIL_cache_finish | ( | void * | ved | ) |
Definition at line 626 of file gpencil_engine_c.cc.
References BLI_memblock_iternew(), BLI_memblock_iterstep(), GPENCIL_PrivateData::color_layer_tx, GPENCIL_PrivateData::color_object_tx, color_tx, GPENCIL_PrivateData::color_tx, GPENCIL_PrivateData::depth_tx, draw_engine_gpencil_type, DRW_texture_pool_query_2d(), DRW_viewport_size_get(), GPENCIL_Data::fbl, GPENCIL_PrivateData::first, GPENCIL_PrivateData::gp_light_pool, GPENCIL_PrivateData::gp_material_pool, GPENCIL_antialiasing_init(), GPENCIL_FramebufferList::gpencil_fb, gpencil_object_cache_sort(), GPU_DEPTH24_STENCIL8, GPU_framebuffer_ensure_config, GPU_R11F_G11F_B10F, GPU_R16, GPU_R8, GPU_RGBA16F, GPU_uniformbuf_update(), GPENCIL_PrivateData::is_render, GPENCIL_FramebufferList::layer_fb, GPENCIL_LightPool::light_data, GPENCIL_FramebufferList::mask_fb, GPENCIL_PrivateData::mask_tx, GPENCIL_FramebufferList::object_fb, GPENCIL_StorageList::pd, GPENCIL_PrivateData::reveal_layer_tx, GPENCIL_PrivateData::reveal_object_tx, GPENCIL_PrivateData::reveal_tx, GPENCIL_Data::stl, GPENCIL_PrivateData::tobjects, GPENCIL_LightPool::ubo, GPENCIL_PrivateData::use_layer_fb, GPENCIL_PrivateData::use_mask_fb, GPENCIL_PrivateData::use_object_fb, and GPENCIL_PrivateData::use_signed_fb.
Referenced by GPENCIL_render_to_image().
| void GPENCIL_cache_init | ( | void * | ved | ) |
Definition at line 179 of file gpencil_engine_c.cc.
References CameraDOFSettings::aperture_fstop, BKE_camera_object_dof_distance(), BKE_camera_sensor_size(), CAM_DOF_ENABLED, GPENCIL_PrivateData::camera, GPENCIL_PrivateData::cfra, CTX_wm_manager(), Object::data, DEG_get_ctime(), DRWContextState::depsgraph, GPENCIL_PrivateData::depth_tx, GPENCIL_PrivateData::do_fast_drawing, GPENCIL_PrivateData::do_onion, Camera::dof, GPENCIL_PrivateData::dof_params, DRW_context_state_get(), DRW_PASS_CREATE, DRW_shgroup_call_procedural_triangles(), DRW_shgroup_create(), DRW_shgroup_uniform_bool(), DRW_shgroup_uniform_texture_ref(), DRW_shgroup_uniform_vec4(), DRW_STATE_DEPTH_LESS, DRW_STATE_LOGIC_INVERT, DRW_STATE_WRITE_COLOR, DRW_STATE_WRITE_DEPTH, DRW_texture_ensure_2d(), DRW_TEXTURE_FREE_SAFE, DRW_viewport_size_get(), ED_screen_animation_playing(), DRWContextState::evil_C, fabsf, GPENCIL_PrivateData::fade_3d_object_opacity, GPENCIL_PrivateData::fade_gp_object_opacity, GPENCIL_PrivateData::fade_layer_opacity, GPENCIL_Data::fbl, GPENCIL_PrivateData::fill_batch, CameraDOFSettings::flag, View3D::flag2, View3D::gp_flag, View3DOverlay::gpencil_fade_layer, View3DOverlay::gpencil_paper_opacity, GPENCIL_shader_depth_merge_get(), GPENCIL_shader_mask_invert_get(), GPENCIL_SIMPLIFY_AA, GPENCIL_SIMPLIFY_FILL, GPENCIL_SIMPLIFY_FX, View3DOverlay::gpencil_vertex_paint_opacity, GPU_DEPTH24_STENCIL8, GPU_framebuffer_ensure_config, GPU_FRAMEBUFFER_FREE_SAFE, GPU_R11F_G11F_B10F, int, GPENCIL_PrivateData::is_render, GPENCIL_PrivateData::is_stroke_order_3d, GPENCIL_PrivateData::is_viewport, Camera::lens, GPENCIL_PassList::mask_invert_ps, GPENCIL_PassList::merge_depth_ps, OB_CAMERA, OB_RENDER, DRWContextState::obact, GPENCIL_PrivateData::obact, GPENCIL_PrivateData::object_bound_mat, View3D::overlay, GPENCIL_StorageList::pd, GPENCIL_PrivateData::playing, GPENCIL_Data::psl, DRWContextState::rv3d, GPENCIL_PrivateData::sbuffer_gpd, GPENCIL_PrivateData::sbuffer_layer, GPENCIL_PrivateData::sbuffer_stroke, DRWContextState::scene, Camera::sensor_fit, Camera::sensor_x, Camera::sensor_y, View3D::shading, GPENCIL_PrivateData::simplify_antialias, GPENCIL_PrivateData::simplify_fill, GPENCIL_PrivateData::simplify_fx, GPENCIL_PrivateData::snapshot_buffer_dirty, GPENCIL_TextureList::snapshot_color_tx, GPENCIL_TextureList::snapshot_depth_tx, GPENCIL_FramebufferList::snapshot_fb, GPENCIL_TextureList::snapshot_reveal_tx, state, GPENCIL_Data::stl, GPENCIL_PrivateData::stroke_batch, GPENCIL_Data::txl, Object::type, View3DShading::type, GPENCIL_PrivateData::use_layer_fb, GPENCIL_PrivateData::use_mask_fb, GPENCIL_PrivateData::use_object_fb, GPENCIL_PrivateData::use_signed_fb, DRWContextState::v3d, V3D_GP_FADE_NOACTIVE_GPENCIL, V3D_GP_FADE_NOACTIVE_LAYERS, V3D_GP_FADE_OBJECTS, V3D_GP_SHOW_ONION_SKIN, V3D_HIDE_OVERLAYS, GPENCIL_PrivateData::vertex_paint_opacity, and RegionView3D::viewcamtexcofac.
Referenced by GPENCIL_render_to_image().
| void GPENCIL_cache_populate | ( | void * | ved, |
| Object * | ob ) |
Definition at line 601 of file gpencil_engine_c.cc.
References Object::data, DRW_object_visibility_in_active_context(), Object::dt, ELEM, GPENCIL_PrivateData::global_light_pool, gpencil_light_pool_populate(), gpencil_vfx_cache_populate(), grease_pencil_object_cache_populate(), Object::mode, OB_GREASE_PENCIL, OB_LAMP, OB_MODE_EDIT, OB_MODE_SCULPT_GREASE_PENCIL, OB_MODE_WEIGHT_GREASE_PENCIL, OB_SOLID, OB_VISIBLE_SELF, GPENCIL_StorageList::pd, GPENCIL_Data::stl, GPENCIL_Data::txl, Object::type, and GPENCIL_PrivateData::use_lights.
Referenced by GPENCIL_render_cache().
|
static |
Definition at line 747 of file gpencil_engine_c.cc.
References BLI_BITMAP_TEST, BLI_BITMAP_TEST_BOOL, DRW_draw_pass(), DRW_stats_group_end(), DRW_stats_group_start(), GPENCIL_Data::fbl, GPENCIL_tLayer::geom_ps, GP_MAX_MASKBITS, GPU_framebuffer_bind(), GPU_framebuffer_clear_color_depth(), grease_pencil_layer_cache_get(), GPENCIL_tObject::is_drawmode3d, GPENCIL_FramebufferList::mask_fb, GPENCIL_PassList::mask_invert_ps, and GPENCIL_Data::psl.
Referenced by GPENCIL_draw_object().
|
static |
Definition at line 796 of file gpencil_engine_c.cc.
References copy_m4_m4(), DRW_draw_pass(), DRW_stats_group_end(), DRW_stats_group_start(), GPENCIL_Data::fbl, GPENCIL_tObject::first, gpencil_draw_mask(), GPENCIL_FramebufferList::gpencil_fb, GPU_framebuffer_bind(), GPU_framebuffer_clear_depth_stencil(), GPU_framebuffer_multi_clear(), GPENCIL_tObject::is_drawmode3d, GPENCIL_PrivateData::is_stroke_order_3d, GPENCIL_FramebufferList::layer_fb, GPENCIL_tObject::layers, LISTBASE_FOREACH, GPENCIL_PassList::merge_depth_ps, GPENCIL_PrivateData::object_bound_mat, GPENCIL_FramebufferList::object_fb, GPENCIL_StorageList::pd, GPENCIL_tObject::plane_mat, GPENCIL_Data::psl, GPENCIL_PrivateData::scene_fb, GPENCIL_Data::stl, and GPENCIL_tObject::vfx.
Referenced by GPENCIL_draw_scene(), and GPENCIL_fast_draw_end().
| void GPENCIL_draw_scene | ( | void * | ved | ) |
Definition at line 886 of file gpencil_engine_c.cc.
References GPENCIL_PrivateData::do_fast_drawing, GPENCIL_PrivateData::draw_depth_only, ED_view3d_background_color_get(), ELEM, GPENCIL_PrivateData::fade_3d_object_opacity, GPENCIL_Data::fbl, GPENCIL_PrivateData::first, GPENCIL_PrivateData::gp_layer_pool, GPENCIL_PrivateData::gp_maskbit_pool, GPENCIL_PrivateData::gp_object_pool, GPENCIL_PrivateData::gp_vfx_pool, GPENCIL_antialiasing_draw(), GPENCIL_draw_object(), GPENCIL_draw_scene_depth_only(), GPENCIL_fast_draw_end(), GPENCIL_fast_draw_start(), GPENCIL_FramebufferList::gpencil_fb, GPU_framebuffer_bind(), GPU_framebuffer_multi_clear(), interp_v3_v3v3(), GPENCIL_PrivateData::is_render, LISTBASE_FOREACH, mul_v4_fl(), OB_GPENCIL_LEGACY, OB_GREASE_PENCIL, GPENCIL_PrivateData::obact, GPENCIL_StorageList::pd, GPENCIL_PrivateData::sbuffer_gpd, GPENCIL_PrivateData::scene, GPENCIL_PrivateData::scene_fb, GPENCIL_Data::stl, GPENCIL_PrivateData::tobjects, Object::type, and GPENCIL_PrivateData::v3d.
Referenced by GPENCIL_render_to_image().
|
static |
Definition at line 718 of file gpencil_engine_c.cc.
References DefaultFramebufferList::default_fb, DefaultFramebufferList::depth_only_fb, DRW_draw_pass(), DRW_state_is_fbo(), DRW_viewport_framebuffer_list_get(), GPENCIL_PrivateData::gp_layer_pool, GPENCIL_PrivateData::gp_maskbit_pool, GPENCIL_PrivateData::gp_object_pool, GPENCIL_PrivateData::gp_vfx_pool, GPU_framebuffer_bind(), LISTBASE_FOREACH, GPENCIL_PrivateData::obact, GPENCIL_StorageList::pd, GPENCIL_PrivateData::sbuffer_gpd, GPENCIL_Data::stl, and GPENCIL_PrivateData::tobjects.
Referenced by GPENCIL_draw_scene().
|
static |
Definition at line 944 of file gpencil_engine_c.cc.
References GPENCIL_shader_free().
| void GPENCIL_engine_init | ( | void * | ved | ) |
Definition at line 50 of file gpencil_engine_c.cc.
References BLI_memblock_clear(), GPENCIL_PrivateData::camera, View3D::camera, GPENCIL_PrivateData::camera_pos, GPENCIL_PrivateData::camera_z_axis, GPENCIL_PrivateData::camera_z_offset, View3DShading::color_type, copy_v3_fl(), copy_v3_v3(), DefaultFramebufferList::default_fb, DefaultTextureList::depth, dot_v3v3(), GPENCIL_PrivateData::draw_depth_only, GPENCIL_PrivateData::draw_wireframe, DRW_context_state_get(), DRW_state_is_fbo(), DRW_TEX_WRAP, DRW_texture_create_2d(), DRW_view_viewmat_get(), DRW_viewport_framebuffer_list_get(), DRW_viewport_texture_list_get(), GPENCIL_TextureList::dummy_texture, GPENCIL_PrivateData::dummy_tx, GPENCIL_Data::fbl, GPENCIL_PrivateData::first, View3D::flag2, GPENCIL_PrivateData::global_light_pool, View3D::gp_flag, GPENCIL_PrivateData::gp_layer_pool, GPENCIL_ViewLayerData::gp_layer_pool, GPENCIL_PrivateData::gp_light_pool, GPENCIL_ViewLayerData::gp_light_pool, GPENCIL_PrivateData::gp_maskbit_pool, GPENCIL_ViewLayerData::gp_maskbit_pool, GPENCIL_PrivateData::gp_material_pool, GPENCIL_ViewLayerData::gp_material_pool, GPENCIL_PrivateData::gp_object_pool, GPENCIL_ViewLayerData::gp_object_pool, GPENCIL_PrivateData::gp_vfx_pool, GPENCIL_ViewLayerData::gp_vfx_pool, gpencil_light_ambient_add(), gpencil_light_pool_add(), gpencil_light_pool_free(), gpencil_material_pool_free(), GPENCIL_view_layer_data_ensure(), GPU_RGBA8, GPENCIL_PrivateData::is_render, GPENCIL_PrivateData::is_viewport, GPENCIL_PrivateData::last, GPENCIL_PrivateData::last_light_pool, GPENCIL_PrivateData::last_material_pool, MEM_callocN, Object::mode, OB_MODE_VERTEX_GREASE_PENCIL, OB_RENDER, OB_SOLID, OB_WIRE, DRWContextState::obact, GPENCIL_StorageList::pd, RegionView3D::persp, GPENCIL_TextureList::render_depth_tx, GPENCIL_FramebufferList::render_fb, DRWContextState::rv3d, RV3D_CAMOB, GPENCIL_PrivateData::sbuffer_tobjects, DRWContextState::scene, GPENCIL_PrivateData::scene, GPENCIL_PrivateData::scene_depth_tx, GPENCIL_PrivateData::scene_fb, GPENCIL_PrivateData::shadeless_light_pool, View3D::shading, View3DShading::single_color, GPENCIL_Data::stl, View3DShading::studiolight_intensity, GPENCIL_PrivateData::tobjects, GPENCIL_PrivateData::tobjects_infront, GPENCIL_Data::txl, View3DShading::type, GPENCIL_PrivateData::use_lighting, GPENCIL_PrivateData::use_lights, GPENCIL_PrivateData::use_multiedit_lines_only, DRWContextState::v3d, GPENCIL_PrivateData::v3d, GPENCIL_PrivateData::v3d_color_type, V3D_GP_SHOW_MULTIEDIT_LINES, V3D_HIDE_OVERLAYS, V3D_SHADING_VERTEX_COLOR, GPENCIL_PrivateData::v3d_single_color, V3D_USES_SCENE_LIGHTS, V3D_USES_SCENE_WORLD, DRWContextState::view_layer, GPENCIL_PrivateData::view_layer, Scene::world, XRAY_ALPHA, GPENCIL_PrivateData::xray_alpha, and XRAY_ENABLED.
Referenced by GPENCIL_render_to_image().
|
static |
Definition at line 867 of file gpencil_engine_c.cc.
References DefaultFramebufferList::default_fb, DRW_viewport_framebuffer_list_get(), GPENCIL_Data::fbl, GPENCIL_draw_object(), GPENCIL_FramebufferList::gpencil_fb, GPU_COLOR_BIT, GPU_DEPTH_BIT, GPU_framebuffer_blit(), LISTBASE_FOREACH, GPENCIL_StorageList::pd, GPENCIL_PrivateData::sbuffer_tobjects, GPENCIL_PrivateData::snapshot_buffer_dirty, GPENCIL_FramebufferList::snapshot_fb, and GPENCIL_Data::stl.
Referenced by GPENCIL_draw_scene().
|
static |
Definition at line 851 of file gpencil_engine_c.cc.
References DefaultFramebufferList::default_fb, DRW_viewport_framebuffer_list_get(), GPENCIL_Data::fbl, GPENCIL_PrivateData::first, GPENCIL_FramebufferList::gpencil_fb, GPU_COLOR_BIT, GPU_DEPTH_BIT, GPU_framebuffer_blit(), GPENCIL_PrivateData::last, GPENCIL_StorageList::pd, GPENCIL_PrivateData::snapshot_buffer_dirty, GPENCIL_FramebufferList::snapshot_fb, GPENCIL_Data::stl, and GPENCIL_PrivateData::tobjects.
Referenced by GPENCIL_draw_scene().
|
static |
Definition at line 374 of file gpencil_engine_c.cc.
References GPENCIL_tLayer::base_shgrp, BKE_gpencil_material_settings(), bounds(), GPENCIL_PrivateData::cfra, color_tx, Object::data, GPENCIL_PrivateData::do_onion, DRW_shgroup_buffer_texture(), DRW_shgroup_call_range(), DRW_shgroup_create_sub(), DRW_shgroup_uniform_block, DRW_shgroup_uniform_float_copy(), DRW_shgroup_uniform_int_copy(), DRW_shgroup_uniform_texture(), DRW_shgroup_uniform_vec2_copy(), DRW_viewport_size_get(), Object::dtx, GPENCIL_TextureList::dummy_texture, ELEM, blender::bke::CurvesGeometry::evaluated_points_by_curve(), GreasePencil::flag, MaterialGPencilStyle::flag, GPENCIL_PrivateData::global_light_pool, GP_LAYER_TREE_NODE_USE_LIGHTS, GP_MATERIAL_FILL_SHOW, GP_MATERIAL_HIDE, GP_MATERIAL_HIDE_ONIONSKIN, GP_MATERIAL_STROKE_SHOW, GP_USE_MULTI_FRAME_EDITING, ToolSettings::gpencil_flags, gpencil_material_pool_create(), gpencil_material_resources_get(), gpencil_object_cache_add(), grease_pencil_layer_cache_add(), GREASE_PENCIL_STROKE_ORDER_3D, int, GPENCIL_PrivateData::is_render, Object::mode, OB_MODE_PAINT_GREASE_PENCIL, OB_MODE_VERTEX_GREASE_PENCIL, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_GREASE_PENCIL, OB_USE_GPENCIL_LIGHTS, pos, GPENCIL_PrivateData::scene, GPENCIL_PrivateData::shadeless_light_pool, GPENCIL_PrivateData::simplify_fill, Scene::toolsettings, GPENCIL_LightPool::ubo, use_layer_in_render(), GPENCIL_PrivateData::use_lighting, GPENCIL_PrivateData::use_multiedit_lines_only, and GPENCIL_PrivateData::view_layer.
Referenced by GPENCIL_cache_populate().
|
static |
Definition at line 328 of file gpencil_engine_c.cc.
References GP_LAYER_TREE_NODE_DISABLE_MASKS_IN_VIEWLAYER, LISTBASE_FOREACH, ViewLayer::name, and STREQ.
Referenced by use_layer_in_render().
|
static |
Definition at line 354 of file gpencil_engine_c.cc.
References is_used_as_layer_mask_in_viewlayer(), ViewLayer::name, and STREQ.
Referenced by grease_pencil_object_cache_populate().
| DrawEngineType draw_engine_gpencil_type |
Definition at line 951 of file gpencil_engine_c.cc.
Referenced by DRW_draw_depth_loop(), DRW_draw_select_loop(), drw_engines_enable(), DRW_engines_register(), DRW_render_gpencil_to_image(), GPENCIL_antialiasing_init(), GPENCIL_cache_finish(), and GPENCIL_view_layer_data_ensure().
|
static |
Definition at line 949 of file gpencil_engine_c.cc.