Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/gpencil/gpencil_engine.c
| Show First 20 Lines • Show All 85 Lines • ▼ Show 20 Lines | void GPENCIL_engine_init(void *ved) | ||||
| BLI_memblock_clear(vldata->gp_maskbit_pool, NULL); | BLI_memblock_clear(vldata->gp_maskbit_pool, NULL); | ||||
| stl->pd->gp_light_pool = vldata->gp_light_pool; | stl->pd->gp_light_pool = vldata->gp_light_pool; | ||||
| stl->pd->gp_material_pool = vldata->gp_material_pool; | stl->pd->gp_material_pool = vldata->gp_material_pool; | ||||
| stl->pd->gp_maskbit_pool = vldata->gp_maskbit_pool; | stl->pd->gp_maskbit_pool = vldata->gp_maskbit_pool; | ||||
| stl->pd->gp_object_pool = vldata->gp_object_pool; | stl->pd->gp_object_pool = vldata->gp_object_pool; | ||||
| stl->pd->gp_layer_pool = vldata->gp_layer_pool; | stl->pd->gp_layer_pool = vldata->gp_layer_pool; | ||||
| stl->pd->gp_vfx_pool = vldata->gp_vfx_pool; | stl->pd->gp_vfx_pool = vldata->gp_vfx_pool; | ||||
| stl->pd->depsgraph = ctx->depsgraph; | |||||
| stl->pd->scene = ctx->scene; | stl->pd->scene = ctx->scene; | ||||
| stl->pd->v3d = ctx->v3d; | stl->pd->v3d = ctx->v3d; | ||||
| stl->pd->last_light_pool = NULL; | stl->pd->last_light_pool = NULL; | ||||
| stl->pd->last_material_pool = NULL; | stl->pd->last_material_pool = NULL; | ||||
| stl->pd->tobjects.first = NULL; | stl->pd->tobjects.first = NULL; | ||||
| stl->pd->tobjects.last = NULL; | stl->pd->tobjects.last = NULL; | ||||
| stl->pd->tobjects_infront.first = NULL; | stl->pd->tobjects_infront.first = NULL; | ||||
| stl->pd->tobjects_infront.last = NULL; | stl->pd->tobjects_infront.last = NULL; | ||||
| ▲ Show 20 Lines • Show All 491 Lines • ▼ Show 20 Lines | static void gp_sbuffer_cache_populate_fast(GPENCIL_Data *vedata, gpIterPopulateData *iter) | ||||
| iter->pd->scene_depth_tx = depth_texture; | iter->pd->scene_depth_tx = depth_texture; | ||||
| } | } | ||||
| void GPENCIL_cache_populate(void *ved, Object *ob) | void GPENCIL_cache_populate(void *ved, Object *ob) | ||||
| { | { | ||||
| GPENCIL_Data *vedata = (GPENCIL_Data *)ved; | GPENCIL_Data *vedata = (GPENCIL_Data *)ved; | ||||
| GPENCIL_PrivateData *pd = vedata->stl->pd; | GPENCIL_PrivateData *pd = vedata->stl->pd; | ||||
| GPENCIL_TextureList *txl = vedata->txl; | GPENCIL_TextureList *txl = vedata->txl; | ||||
| const bool is_final_render = DRW_state_is_image_render(); | |||||
| /* object must be visible */ | /* object must be visible */ | ||||
| if (!(DRW_object_visibility_in_active_context(ob) & OB_VISIBLE_SELF)) { | if (!(DRW_object_visibility_in_active_context(ob) & OB_VISIBLE_SELF)) { | ||||
| return; | return; | ||||
| } | } | ||||
| if (ob->data && (ob->type == OB_GPENCIL) && (ob->dt >= OB_SOLID)) { | if (ob->data && (ob->type == OB_GPENCIL) && (ob->dt >= OB_SOLID)) { | ||||
| gpIterPopulateData iter = {0}; | gpIterPopulateData iter = {0}; | ||||
| iter.ob = ob; | iter.ob = ob; | ||||
| iter.pd = pd; | iter.pd = pd; | ||||
| iter.tgp_ob = gpencil_object_cache_add(pd, ob); | iter.tgp_ob = gpencil_object_cache_add(pd, ob); | ||||
| iter.matpool = gpencil_material_pool_create(pd, ob, &iter.mat_ofs); | iter.matpool = gpencil_material_pool_create(pd, ob, &iter.mat_ofs); | ||||
| iter.tex_fill = txl->dummy_texture; | iter.tex_fill = txl->dummy_texture; | ||||
| iter.tex_stroke = txl->dummy_texture; | iter.tex_stroke = txl->dummy_texture; | ||||
| /* Special case for rendering onion skin. */ | /* Special case for rendering onion skin. */ | ||||
| bGPdata *gpd = (bGPdata *)ob->data; | bGPdata *gpd = (bGPdata *)ob->data; | ||||
| bool do_onion = (!pd->is_render) ? pd->do_onion : (gpd->onion_flag & GP_ONION_GHOST_ALWAYS); | bool do_onion = (!pd->is_render) ? pd->do_onion : (gpd->onion_flag & GP_ONION_GHOST_ALWAYS); | ||||
| BKE_gpencil_visible_stroke_iter(ob, | BKE_gpencil_visible_stroke_iter(is_final_render ? pd->depsgraph : NULL, | ||||
| ob, | |||||
| gpencil_layer_cache_populate, | gpencil_layer_cache_populate, | ||||
| gpencil_stroke_cache_populate, | gpencil_stroke_cache_populate, | ||||
| &iter, | &iter, | ||||
| do_onion, | do_onion, | ||||
| pd->cfra); | pd->cfra); | ||||
| gpencil_drawcall_flush(&iter); | gpencil_drawcall_flush(&iter); | ||||
| ▲ Show 20 Lines • Show All 350 Lines • Show Last 20 Lines | |||||