|
Blender V4.3
|
#include "BLI_linklist.h"#include "BLI_listbase.h"#include "BLI_threads.h"#include "DNA_lineart_types.h"#include <math.h>#include <string.h>Go to the source code of this file.
Macros | |
| #define | LRT_ITER_ALL_LINES_BEGIN |
| #define | LRT_ITER_ALL_LINES_NEXT ; /* Doesn't do anything now with new array setup. */ |
| #define | LRT_ITER_ALL_LINES_END |
| #define | LRT_BOUND_AREA_CROSSES(b1, b2) ((b1)[0] < (b2)[1] && (b1)[1] > (b2)[0] && (b1)[3] < (b2)[2] && (b1)[2] > (b2)[3]) |
| #define | LRT_BA_ROWS 10 |
| #define | LRT_EDGE_BA_MARCHING_BEGIN(fb1, fb2) |
| #define | LRT_EDGE_BA_MARCHING_NEXT(fb1, fb2) |
| #define | LRT_EDGE_BA_MARCHING_END |
| #define LRT_BA_ROWS 10 |
Definition at line 91 of file lineart_intern.hh.
Referenced by lineart_main_bounding_area_make_initial().
| #define LRT_BOUND_AREA_CROSSES | ( | b1, | |
| b2 ) ((b1)[0] < (b2)[1] && (b1)[1] > (b2)[0] && (b1)[3] < (b2)[2] && (b1)[2] > (b2)[3]) |
Definition at line 86 of file lineart_intern.hh.
Referenced by lineart_bounding_area_link_triangle(), and lineart_bounding_area_split().
| #define LRT_EDGE_BA_MARCHING_BEGIN | ( | fb1, | |
| fb2 ) |
Definition at line 93 of file lineart_intern.hh.
Referenced by lineart_occlusion_single_line(), and lineart_shadow_cast().
| #define LRT_EDGE_BA_MARCHING_END |
Definition at line 106 of file lineart_intern.hh.
Referenced by lineart_occlusion_single_line(), and lineart_shadow_cast().
| #define LRT_EDGE_BA_MARCHING_NEXT | ( | fb1, | |
| fb2 ) |
Definition at line 102 of file lineart_intern.hh.
Referenced by lineart_occlusion_single_line(), and lineart_shadow_cast().
| #define LRT_ITER_ALL_LINES_BEGIN |
Definition at line 73 of file lineart_intern.hh.
Referenced by lineart_main_link_lines(), lineart_shadow_create_shadow_edge_array(), and MOD_lineart_chain_feature_lines().
| #define LRT_ITER_ALL_LINES_END |
Definition at line 81 of file lineart_intern.hh.
Referenced by lineart_main_link_lines(), lineart_shadow_create_shadow_edge_array(), and MOD_lineart_chain_feature_lines().
Definition at line 79 of file lineart_intern.hh.
Referenced by MOD_lineart_chain_feature_lines().
| void lineart_add_edge_to_array | ( | struct LineartPendingEdges * | pe, |
| struct LineartEdge * | e ) |
Definition at line 1746 of file lineart_cpu.cc.
References LineartPendingEdges::array, e, LIKELY, LineartPendingEdges::max, MEM_freeN(), MEM_mallocN, and LineartPendingEdges::next.
Referenced by lineart_add_edge_to_array_thread(), lineart_create_edges_from_isec_data(), lineart_main_make_enclosed_shapes(), lineart_main_transform_and_add_shadow(), and lineart_triangle_cull_single().
| LineartBoundingArea * lineart_bounding_area_next | ( | struct LineartBoundingArea * | self, |
| double * | fbcoord1, | ||
| double * | fbcoord2, | ||
| double | x, | ||
| double | y, | ||
| double | k, | ||
| int | positive_x, | ||
| int | positive_y, | ||
| double * | next_x, | ||
| double * | next_y ) |
This march along one render line in image space and get the next bounding area the line is crossing.
Definition at line 4805 of file lineart_cpu.cc.
References LineartBoundingArea::b, LineartBoundingArea::l, LISTBASE_FOREACH, LineartBoundingArea::r, ratiod(), self, LineartBoundingArea::u, x, and y.
| void lineart_count_and_print_render_buffer_memory | ( | struct LineartData * | ld | ) |
Definition at line 211 of file lineart_util.cc.
References LineartData::geom, LineartData::_geom::line_buffer_pointers, LISTBASE_FOREACH, LRT_MEMORY_POOL_1MB, LineartStaticMemPool::pools, printf, LineartData::render_data_pool, LineartData::sizeof_triangle, and LineartData::_geom::triangle_buffer_pointers.
Referenced by MOD_lineart_compute_feature_lines_v3().
| int lineart_count_intersection_segment_count | ( | struct LineartData * | ld | ) |
| void lineart_destroy_render_data_keep_init | ( | struct LineartData * | ld | ) |
Definition at line 3523 of file lineart_cpu.cc.
References LineartPendingEdges::array, BLI_listbase_clear(), LineartData::chains, LineartData::geom, LineartData::_qtree::initial_tile_count, LineartData::_qtree::initials, LineartData::_geom::line_buffer_pointers, lineart_end_bounding_area_recursive(), lineart_free_bounding_area_memories(), lineart_mem_destroy(), MEM_freeN(), LineartData::pending_edges, LineartData::qtree, LineartData::render_data_pool, LineartData::_geom::triangle_buffer_pointers, LineartData::_geom::vertex_buffer_pointers, and LineartData::wasted_cuts.
Referenced by lineart_destroy_render_data(), lineart_main_try_generate_shadow_v3(), and MOD_lineart_compute_feature_lines_v3().
| void lineart_edge_cut | ( | struct LineartData * | ld, |
| struct LineartEdge * | e, | ||
| double | start, | ||
| double | end, | ||
| uchar | material_mask_bits, | ||
| uchar | mat_occlusion, | ||
| uint32_t | shadow_bits ) |
Cuts the edge in image space and mark occlusion level for each segment.
Definition at line 168 of file lineart_cpu.cc.
References BLI_addtail(), BLI_insertlinkbefore(), BLI_remlink(), e, lineart_discard_segment(), lineart_give_segment(), LISTBASE_FOREACH, LISTBASE_FOREACH_MUTABLE, LRT_DOUBLE_CLOSE_ENOUGH, LRT_SHADOW_MASK_ENCLOSED_SHAPE, LRT_SHADOW_MASK_ILLUMINATED, LRT_SHADOW_MASK_ILLUMINATED_SHAPE, LRT_SHADOW_MASK_INHIBITED, LRT_SHADOW_MASK_SHADED, LineartEdgeSegment::material_mask_bits, MOD_LINEART_EDGE_FLAG_LIGHT_CONTOUR, LineartEdgeSegment::next, LineartEdgeSegment::occlusion, LineartEdgeSegment::prev, LineartEdgeSegment::ratio, LineartEdgeSegment::shadow_mask_bits, and UNLIKELY.
Referenced by lineart_occlusion_single_line(), lineart_register_shadow_cuts(), lineart_shadow_cast_generate_edges(), lineart_shadow_register_enclosed_shapes(), and lineart_shadow_register_silhouette().
| LineartBoundingArea * lineart_edge_first_bounding_area | ( | struct LineartData * | ld, |
| double * | fbcoord1, | ||
| double * | fbcoord2 ) |
This function gets the tile for the point e->v1, and later use lineart_bounding_area_next() to get next along the way.
Definition at line 4775 of file lineart_cpu.cc.
References interp_v2_v2v2_db(), LB, lineart_get_bounding_area(), lineart_intersect_seg_seg(), and RB.
| bool lineart_edge_from_triangle | ( | const struct LineartTriangle * | tri, |
| const struct LineartEdge * | e, | ||
| bool | allow_overlapping_edges ) |
| void lineart_finalize_object_edge_array_reserve | ( | struct LineartPendingEdges * | pe, |
| int | count ) |
Definition at line 1770 of file lineart_cpu.cc.
References LineartPendingEdges::array, count, LineartPendingEdges::max, and MEM_mallocN.
Referenced by lineart_main_load_geometries(), and lineart_main_make_enclosed_shapes().
| LineartEdge * lineart_find_matching_edge | ( | struct LineartElementLinkNode * | shadow_eln, |
| uint64_t | edge_identifier ) |
Definition at line 40 of file lineart_shadow.cc.
References LineartElementLinkNode::element_count, and LineartElementLinkNode::pointer.
Referenced by lineart_geometry_object_load(), and lineart_register_intersection_shadow_cuts().
| LineartElementLinkNode * lineart_find_matching_eln | ( | struct ListBase * | shadow_elns, |
| int | obindex ) |
Definition at line 30 of file lineart_shadow.cc.
References LISTBASE_FOREACH.
Referenced by lineart_create_edges_from_isec_data(), lineart_geometry_object_load(), lineart_shadow_finalize_shadow_edges_task(), and MOD_lineart_chain_find_silhouette_backdrop_objects().
| LineartElementLinkNode * lineart_find_matching_eln_obj | ( | struct ListBase * | elns, |
| struct Object * | ob ) |
Definition at line 1087 of file lineart_chain.cc.
References LISTBASE_FOREACH.
Referenced by MOD_lineart_finalize_chains().
| void * lineart_list_append_pointer_pool | ( | ListBase * | h, |
| struct LineartStaticMemPool * | smp, | ||
| void * | data ) |
Definition at line 25 of file lineart_util.cc.
References BLI_addtail(), data, LinkData::data, and lineart_mem_acquire().
Referenced by lineart_bounding_areas_connect_new(), and lineart_main_bounding_areas_connect_post().
| void * lineart_list_append_pointer_pool_sized | ( | ListBase * | h, |
| struct LineartStaticMemPool * | smp, | ||
| void * | data, | ||
| int | size ) |
Definition at line 36 of file lineart_util.cc.
References BLI_addtail(), data, LinkData::data, and lineart_mem_acquire().
Referenced by lineart_bounding_area_link_point_recursive(), lineart_memory_get_edge_space(), lineart_memory_get_triangle_space(), and lineart_memory_get_vert_space().
| void * lineart_list_append_pointer_pool_sized_thread | ( | ListBase * | h, |
| LineartStaticMemPool * | smp, | ||
| void * | data, | ||
| int | size ) |
Definition at line 61 of file lineart_util.cc.
References BLI_addtail(), data, LinkData::data, and lineart_mem_acquire_thread().
Referenced by lineart_geometry_object_load().
| void * lineart_list_append_pointer_pool_thread | ( | ListBase * | h, |
| struct LineartStaticMemPool * | smp, | ||
| void * | data ) |
Definition at line 50 of file lineart_util.cc.
References BLI_addtail(), data, LinkData::data, and lineart_mem_acquire_thread().
Referenced by lineart_geometry_object_load().
| void * lineart_list_pop_pointer_no_free | ( | ListBase * | h | ) |
Definition at line 76 of file lineart_util.cc.
References BLI_pophead(), and LinkData::data.
Definition at line 87 of file lineart_util.cc.
References BLI_remlink().
Referenced by lineart_bounding_areas_connect_new().
| void lineart_main_add_triangles | ( | struct LineartData * | ld | ) |
Sequentially add triangles into render buffer, intersection lines between those triangles will also be computed at the same time.
Definition at line 4743 of file lineart_cpu.cc.
References BLI_task_pool_create(), BLI_task_pool_free(), BLI_task_pool_push(), BLI_task_pool_work_and_wait(), BLI_time_now_seconds(), LineartData::conf, G, lineart_add_triangles_worker(), lineart_create_edges_from_isec_data(), lineart_destroy_isec_thread(), lineart_init_isec_thread(), printf, TASK_PRIORITY_HIGH, LineartData::thread_count, LineartIsecData::threads, and LineartData::_conf::use_intersections.
Referenced by lineart_main_try_generate_shadow_v3(), and MOD_lineart_compute_feature_lines_v3().
| void lineart_main_bounding_area_make_initial | ( | struct LineartData * | ld | ) |
Definition at line 3752 of file lineart_cpu.cc.
References LineartBoundingArea::b, BLI_spin_init(), col, LineartData::_qtree::count_x, LineartData::_qtree::count_y, LineartBoundingArea::cx, LineartBoundingArea::cy, LineartData::h, LineartData::_qtree::initial_tile_count, LineartData::_qtree::initials, LineartBoundingArea::l, lineart_mem_acquire(), LineartBoundingArea::linked_lines, LineartBoundingArea::linked_triangles, LineartBoundingArea::lock, LRT_BA_ROWS, LRT_TILE_EDGE_COUNT_INITIAL, LRT_TILE_SPLITTING_TRIANGLE_LIMIT, LineartBoundingArea::max_line_count, LineartBoundingArea::max_triangle_count, MEM_callocN, LineartData::qtree, LineartBoundingArea::r, LineartData::render_data_pool, LineartData::_qtree::tile_height, LineartData::_qtree::tile_width, LineartBoundingArea::u, and LineartData::w.
Referenced by lineart_main_try_generate_shadow_v3(), and MOD_lineart_compute_feature_lines_v3().
| void lineart_main_bounding_areas_connect_post | ( | struct LineartData * | ld | ) |
Definition at line 3975 of file lineart_cpu.cc.
References LineartBoundingArea::bp, col, LineartData::_qtree::count_x, LineartData::_qtree::count_y, LineartData::_qtree::initials, lineart_bounding_areas_connect_recursive(), lineart_list_append_pointer_pool(), LineartBoundingArea::lp, LineartData::qtree, LineartData::render_data_pool, LineartBoundingArea::rp, and LineartBoundingArea::up.
Referenced by lineart_main_try_generate_shadow_v3(), and MOD_lineart_compute_feature_lines_v3().
| void lineart_main_clear_linked_edges | ( | struct LineartData * | ld | ) |
Definition at line 4348 of file lineart_cpu.cc.
References LineartData::_qtree::count_x, LineartData::_qtree::count_y, LineartData::_qtree::initials, lineart_clear_linked_edges_recursive(), and LineartData::qtree.
Referenced by lineart_main_make_enclosed_shapes().
| void lineart_main_cull_triangles | ( | struct LineartData * | ld, |
| bool | clip_far ) |
This function cuts triangles with near- or far-plane. Setting clip_far = true for cutting with far-plane. For triangles that's crossing the plane, it will generate new 1 or 2 triangles with new topology that represents the trimmed triangle. (which then became a triangle or a square formed by two triangles)
Definition at line 1225 of file lineart_cpu.cc.
References add_v3_v3_db(), LineartData::_conf::allow_boundaries, LineartData::_conf::cam_is_persp, LineartData::_conf::camera_pos, LineartData::conf, copy_v3_v3_db(), double(), LineartElementLinkNode::element_count, LineartData::_conf::far_clip, LineartTriangle::flags, LineartData::geom, lineart_memory_get_edge_space(), lineart_memory_get_triangle_space(), lineart_memory_get_vert_space(), lineart_triangle_cull_single(), LISTBASE_FOREACH, LRT_CULL_DECIDE_INSIDE, LRT_CULL_DISCARD, LRT_CULL_ENSURE_MEMORY, LRT_ELEMENT_IS_ADDITIONAL, mul_v3db_db(), LineartData::_conf::near_clip, LineartData::sizeof_triangle, LineartData::_geom::triangle_buffer_pointers, LineartData::_conf::view_projection, and LineartData::_conf::view_vector.
Referenced by lineart_main_try_generate_shadow_v3(), and MOD_lineart_compute_feature_lines_v3().
| void lineart_main_discard_out_of_frame_edges | ( | struct LineartData * | ld | ) |
Definition at line 1398 of file lineart_cpu.cc.
References bounds(), e, LineartData::geom, ISECT_LINE_LINE_NONE, isect_seg_seg_v2(), LineartData::_geom::line_buffer_pointers, LISTBASE_FOREACH, LRT_VERT_OUT_OF_BOUND, MOD_LINEART_EDGE_FLAG_CHAIN_PICKED, and v2.
Referenced by lineart_main_try_generate_shadow_v3(), and MOD_lineart_compute_feature_lines_v3().
| void lineart_main_free_adjacent_data | ( | struct LineartData * | ld | ) |
Adjacent data is only used during the initial stages of computing. So we can free it using this function when it is not needed anymore.
Definition at line 1357 of file lineart_cpu.cc.
References BLI_pophead(), LineartData::geom, LineartTriangle::intersecting_verts, LISTBASE_FOREACH, MEM_freeN(), LineartData::sizeof_triangle, LineartData::_geom::triangle_adjacent_pointers, and LineartData::_geom::triangle_buffer_pointers.
Referenced by lineart_main_try_generate_shadow_v3(), and MOD_lineart_compute_feature_lines_v3().
| void lineart_main_get_view_vector | ( | struct LineartData * | ld | ) |
The calculated view vector will point towards the far-plane from the camera position.
Definition at line 3483 of file lineart_cpu.cc.
References LineartData::_conf::cam_obmat, LineartData::_conf::cam_obmat_secondary, LineartData::conf, copy_m4_m4(), copy_v3db_v3fl(), invert_m4_m4(), LineartData::_conf::light_reference_available, mul_v3_mat3_m4v3(), normalize_v3(), transpose_m4(), LineartData::_conf::view_vector, and LineartData::_conf::view_vector_secondary.
Referenced by lineart_main_try_generate_shadow_v3(), and MOD_lineart_compute_feature_lines_v3().
| void lineart_main_link_lines | ( | struct LineartData * | ld | ) |
Link lines to their respective bounding areas.
Definition at line 4358 of file lineart_cpu.cc.
References col, LineartData::_qtree::count_x, e, LineartData::_qtree::initials, lineart_bounding_area_link_edge(), lineart_get_edge_bounding_areas(), LRT_ITER_ALL_LINES_BEGIN, LRT_ITER_ALL_LINES_END, and LineartData::qtree.
Referenced by lineart_main_make_enclosed_shapes(), lineart_main_try_generate_shadow_v3(), and MOD_lineart_compute_feature_lines_v3().
| void lineart_main_load_geometries | ( | struct Depsgraph * | depsgraph, |
| struct Scene * | scene, | ||
| struct Object * | camera, | ||
| struct LineartData * | ld, | ||
| bool | allow_duplicates, | ||
| bool | do_shadow_casting, | ||
| struct ListBase * | shadow_elns, | ||
| blender::Set< const Object * > * | included_objects ) |
Definition at line 2548 of file lineart_cpu.cc.
References BKE_camera_sensor_fit(), BKE_camera_sensor_size(), BKE_object_visibility(), BLI_listbase_clear(), BLI_task_pool_create(), BLI_task_pool_free(), BLI_task_pool_push(), BLI_task_pool_work_and_wait(), BLI_time_now_seconds(), LineartData::_conf::cam_obmat, CAM_ORTHO, CAM_PERSP, CAMERA_SENSOR_FIT_HOR, CAMERA_SENSOR_FIT_VERT, Camera::clip_end, Camera::clip_start, LineartData::conf, copy_m4_m4_db(), DAG_EVAL_RENDER, DEG_get_evaluated_object(), DEG_get_mode(), DEG_ITER_OBJECT_FLAG_DUPLI, DEG_ITER_OBJECT_FLAG_LINKED_DIRECTLY, DEG_ITER_OBJECT_FLAG_LINKED_VIA_SET, DEG_ITER_OBJECT_FLAG_VISIBLE, DEG_OBJECT_ITER_BEGIN, DEG_OBJECT_ITER_END, DEGObjectIterSettings::depsgraph, depsgraph, double(), ELEM, DEGObjectIterSettings::flags, focallength_to_fov(), G, LineartData::geom, LineartData::h, DEGObjectIterSettings::included_objects, invert_m4_m4(), LineartObjectLoadTaskInfo::ld, Camera::lens, lineart_finalize_object_edge_array(), lineart_finalize_object_edge_array_reserve(), lineart_matrix_ortho_44d(), lineart_matrix_perspective_44d(), lineart_mem_acquire(), lineart_object_load_single_instance(), lineart_object_load_worker(), mul_m4db_m4db_m4fl(), OB_CURVES_LEGACY, OB_FONT, OB_SURF, OB_VISIBLE_SELF, Camera::ortho_scale, LineartData::_conf::overscan, LineartData::pending_edges, printf, LineartData::render_data_pool, Camera::sensor_fit, Camera::sensor_x, Camera::sensor_y, LineartObjectLoadTaskInfo::shadow_elns, TASK_PRIORITY_HIGH, LineartData::thread_count, LineartObjectLoadTaskInfo::thread_id, LineartData::_geom::triangle_buffer_pointers, Camera::type, unit_m4_db(), v, LineartData::_geom::vertex_buffer_pointers, LineartData::_conf::view, LineartData::_conf::view_projection, LineartData::w, and w().
Referenced by lineart_main_try_generate_shadow_v3(), and MOD_lineart_compute_feature_lines_v3().
| void lineart_main_make_enclosed_shapes | ( | struct LineartData * | ld, |
| struct LineartData * | shadow_ld ) |
Does the 3rd stage reprojection, will not re-load objects because #shadow_ld is not deleted. Only re-projects view camera edges and check visibility in light camera, then we can determine whether an edge landed on a lit or shaded area.
Definition at line 1413 of file lineart_shadow.cc.
References LineartPendingEdges::array, BLI_time_now_seconds(), LineartData::_conf::cam_is_persp, LineartData::conf, LineartElementLinkNode::element_count, G, lineart_add_edge_to_array(), lineart_finalize_object_edge_array_reserve(), lineart_main_clear_linked_edges(), lineart_main_link_lines(), lineart_main_occlusion_begin(), lineart_shadow_cast(), lineart_shadow_cast_generate_edges(), lineart_shadow_register_enclosed_shapes(), lineart_shadow_register_silhouette(), LineartPendingEdges::max, MEM_freeN(), mul_v3db_db(), mul_v4_m4v3_db(), LineartPendingEdges::next, LineartData::pending_edges, LineartElementLinkNode::pointer, printf, LineartData::render_data_pool, LineartData::scheduled_count, LineartData::shadow_data_pool, LineartData::_conf::shadow_use_silhouette, v, and LineartData::_conf::view_projection.
Referenced by MOD_lineart_compute_feature_lines_v3().
| void lineart_main_occlusion_begin | ( | struct LineartData * | ld | ) |
All internal functions starting with lineart_main_ is called inside #MOD_lineart_compute_feature_lines function. This function handles all occlusion calculation.
Definition at line 480 of file lineart_cpu.cc.
References BLI_task_pool_create(), BLI_task_pool_free(), BLI_task_pool_push(), BLI_task_pool_work_and_wait(), LineartRenderTaskInfo::ld, lineart_occlusion_worker(), MEM_callocN, MEM_freeN(), TASK_PRIORITY_HIGH, LineartData::thread_count, and LineartRenderTaskInfo::thread_id.
Referenced by lineart_main_make_enclosed_shapes(), lineart_main_try_generate_shadow_v3(), and MOD_lineart_compute_feature_lines_v3().
| void lineart_main_perspective_division | ( | struct LineartData * | ld | ) |
Definition at line 1376 of file lineart_cpu.cc.
References LineartData::_conf::cam_is_persp, LineartData::conf, LineartVert::fbcoord, LineartData::geom, LISTBASE_FOREACH, LineartData::_conf::shift_x, LineartData::_conf::shift_y, and LineartData::_geom::vertex_buffer_pointers.
Referenced by lineart_main_try_generate_shadow_v3(), and MOD_lineart_compute_feature_lines_v3().
| void lineart_main_transform_and_add_shadow | ( | struct LineartData * | ld, |
| struct LineartElementLinkNode * | veln, | ||
| struct LineartElementLinkNode * | eeln ) |
Shadow segments needs to be transformed to view-camera space, just like any other objects.
Definition at line 1383 of file lineart_shadow.cc.
References BLI_addtail(), BLI_parallel_range_settings_defaults(), BLI_task_parallel_range(), LineartElementLinkNode::element_count, LineartData::geom, LineartShadowFinalizeData::ld, LineartData::_geom::line_buffer_pointers, lineart_add_edge_to_array(), lineart_shadow_finalize_shadow_edges_task(), lineart_shadow_transform_task(), TaskParallelSettings::min_iter_per_thread, LineartData::pending_edges, LineartElementLinkNode::pointer, and LineartData::_geom::vertex_buffer_pointers.
Referenced by MOD_lineart_compute_feature_lines_v3().
| bool lineart_main_try_generate_shadow | ( | struct Depsgraph * | depsgraph, |
| struct Scene * | scene, | ||
| struct LineartData * | original_ld, | ||
| struct LineartGpencilModifierData * | lmd_legacy, | ||
| struct LineartStaticMemPool * | shadow_data_pool, | ||
| struct LineartElementLinkNode ** | r_veln, | ||
| struct LineartElementLinkNode ** | r_eeln, | ||
| struct ListBase * | r_calculated_edges_eln_list, | ||
| struct LineartData ** | r_shadow_ld_if_reproject ) |
This call would internally duplicate #original_ld, override necessary configurations for shadow computations. It will return:
1) Generated shadow edges in format of LineartElementLinkNode which can be directly loaded into later main view camera occlusion stage. 2) Shadow render buffer if 3rd stage reprojection is need for silhouette/lit/shaded region selection. Otherwise the shadow render buffer is deleted before this function returns.
Definition at line 1314 of file lineart_shadow.cc.
References depsgraph, lineart_main_try_generate_shadow_v3(), blender::bke::greasepencil::convert::lineart_unwrap_v3(), blender::bke::greasepencil::convert::lineart_wrap_v3(), and ret.
| bool lineart_main_try_generate_shadow_v3 | ( | struct Depsgraph * | depsgraph, |
| struct Scene * | scene, | ||
| struct LineartData * | original_ld, | ||
| struct GreasePencilLineartModifierData * | lmd, | ||
| struct LineartStaticMemPool * | shadow_data_pool, | ||
| struct LineartElementLinkNode ** | r_veln, | ||
| struct LineartElementLinkNode ** | r_eeln, | ||
| struct ListBase * | r_calculated_edges_eln_list, | ||
| struct LineartData ** | r_shadow_ld_if_reproject ) |
Definition at line 1146 of file lineart_shadow.cc.
References LineartData::_conf::allow_duplicated_types, BLI_spin_init(), BLI_time_now_seconds(), LineartData::_conf::cam_is_persp, LineartData::_conf::cam_is_persp_secondary, LineartData::_conf::cam_obmat, LineartData::_conf::cam_obmat_secondary, LineartData::_conf::camera_pos, LineartData::_conf::camera_pos_secondary, LineartData::conf, copy_m4_m4(), copy_m4_m4_db(), copy_v3_v3_db(), copy_v3db_v3fl(), Object::data, DEG2RAD, depsgraph, LineartData::_conf::do_shadow_cast, LineartData::edge_data_pool, LineartData::_conf::far_clip, ListBase::first, GreasePencilLineartModifierData::flags, G, LineartData::geom, LineartData::h, invert_m4_m4(), LA_SUN, GreasePencilLineartModifierData::light_contour_object, LineartData::_geom::line_buffer_pointers, lineart_destroy_render_data_keep_init(), lineart_main_add_triangles(), lineart_main_bounding_area_make_initial(), lineart_main_bounding_areas_connect_post(), lineart_main_cull_triangles(), lineart_main_discard_out_of_frame_edges(), lineart_main_free_adjacent_data(), lineart_main_get_view_vector(), lineart_main_link_lines(), lineart_main_load_geometries(), lineart_main_occlusion_begin(), lineart_main_perspective_division(), lineart_matrix_ortho_44d(), lineart_matrix_perspective_44d(), lineart_shadow_cast(), lineart_shadow_cast_generate_edges(), LineartData::lock_cuts, LineartStaticMemPool::lock_mem, LineartData::lock_task, LRT_TILE_RECURSIVE_ORTHO, LRT_TILE_RECURSIVE_PERSPECTIVE, LineartData::_conf::max_occlusion_level, MEM_freeN(), MEM_mallocN, MOD_LINEART_ALLOW_DUPLI_OBJECTS, mul_m4db_m4db_m4fl(), LineartData::_conf::near_clip, OB_LAMP, LineartModifierRuntime::object_dependencies, printf, LineartData::qtree, LineartData::_qtree::recursive_level, LineartData::render_data_pool, GreasePencilLineartModifierData::runtime, GreasePencilLineartModifierData::shadow_camera_far, GreasePencilLineartModifierData::shadow_camera_near, GreasePencilLineartModifierData::shadow_camera_size, LineartData::shadow_data_pool, LineartData::_conf::shadow_enclose_shapes, LineartData::_conf::shadow_selection, Light::type, Object::type, unit_m4_db(), LineartData::_conf::use_back_face_culling, LineartData::_conf::use_contour, LineartData::_conf::use_contour_secondary, LineartData::_conf::use_crease, LineartData::_conf::use_edge_marks, LineartData::_conf::use_intersections, LineartData::_conf::use_light_contour, LineartData::_conf::use_loose, LineartData::_conf::use_material, LineartData::_conf::use_shadow, LineartData::_geom::vertex_buffer_pointers, LineartData::_conf::view, LineartData::_conf::view_projection, and LineartData::w.
Referenced by lineart_main_try_generate_shadow(), and MOD_lineart_compute_feature_lines_v3().
| void lineart_matrix_ortho_44d | ( | double(*) | mProjection[4], |
| double | xMin, | ||
| double | xMax, | ||
| double | yMin, | ||
| double | yMax, | ||
| double | zMin, | ||
| double | zMax ) |
Definition at line 192 of file lineart_util.cc.
References unit_m4_db().
Referenced by lineart_main_load_geometries(), and lineart_main_try_generate_shadow_v3().
| void lineart_matrix_perspective_44d | ( | double(*) | mProjection[4], |
| double | fFov_rad, | ||
| double | fAspect, | ||
| double | zMin, | ||
| double | zMax ) |
Definition at line 160 of file lineart_util.cc.
References unit_m4_db().
Referenced by lineart_main_load_geometries(), and lineart_main_try_generate_shadow_v3().
| void * lineart_mem_acquire | ( | struct LineartStaticMemPool * | smp, |
| size_t | size ) |
Definition at line 106 of file lineart_util.cc.
References ListBase::first, lineart_mem_new_static_pool(), LineartStaticMemPool::pools, ret, LineartStaticMemPoolNode::size, size(), and LineartStaticMemPoolNode::used_byte.
Referenced by lineart_chain_append_point(), lineart_chain_create(), lineart_chain_create_crossing_point(), lineart_chain_prepend_point(), lineart_create_edges_from_isec_data(), lineart_list_append_pointer_pool(), lineart_list_append_pointer_pool_sized(), lineart_main_bounding_area_make_initial(), lineart_main_load_geometries(), lineart_memory_get_edge_space(), lineart_memory_get_triangle_space(), lineart_memory_get_vert_space(), lineart_object_load_single_instance(), lineart_shadow_cast_generate_edges(), lineart_shadow_create_shadow_edge_array(), and MOD_lineart_chain_clip_at_border().
| void * lineart_mem_acquire_thread | ( | struct LineartStaticMemPool * | smp, |
| size_t | size ) |
Definition at line 121 of file lineart_util.cc.
References BLI_spin_lock(), BLI_spin_unlock(), ListBase::first, lineart_mem_new_static_pool(), LineartStaticMemPool::lock_mem, LineartStaticMemPool::pools, ret, LineartStaticMemPoolNode::size, size(), and LineartStaticMemPoolNode::used_byte.
Referenced by lineart_bounding_area_split(), lineart_geometry_object_load(), lineart_give_segment(), lineart_give_shadow_segment(), lineart_list_append_pointer_pool_sized_thread(), lineart_list_append_pointer_pool_thread(), and lineart_prepend_pool().
| void lineart_mem_destroy | ( | struct LineartStaticMemPool * | smp | ) |
Definition at line 141 of file lineart_util.cc.
References BLI_pophead(), MEM_freeN(), and LineartStaticMemPool::pools.
Referenced by lineart_destroy_render_data(), lineart_destroy_render_data_keep_init(), MOD_lineart_clear_cache(), and MOD_lineart_compute_feature_lines_v3().
| struct LineartStaticMemPoolNode * lineart_mem_new_static_pool | ( | struct LineartStaticMemPool * | smp, |
| size_t | size ) |
Definition at line 92 of file lineart_util.cc.
References BLI_addhead(), LRT_MEMORY_POOL_1MB, MEM_callocN, LineartStaticMemPool::pools, LineartStaticMemPoolNode::size, and size().
Referenced by lineart_mem_acquire(), and lineart_mem_acquire_thread().
| void lineart_prepend_pool | ( | LinkNode ** | first, |
| struct LineartStaticMemPool * | smp, | ||
| void * | link ) |
Definition at line 150 of file lineart_util.cc.
References lineart_mem_acquire_thread(), LinkNode::link, and LinkNode::next.
| void lineart_register_intersection_shadow_cuts | ( | struct LineartData * | ld, |
| struct ListBase * | shadow_elns ) |
Definition at line 118 of file lineart_shadow.cc.
References e, LineartElementLinkNode::element_count, LineartData::geom, LineartData::_geom::line_buffer_pointers, lineart_find_matching_edge(), lineart_register_shadow_cuts(), LISTBASE_FOREACH, LRT_ELEMENT_INTERSECTION_DATA, and LineartElementLinkNode::pointer.
Referenced by MOD_lineart_compute_feature_lines_v3().
| void lineart_register_shadow_cuts | ( | struct LineartData * | ld, |
| struct LineartEdge * | e, | ||
| struct LineartEdge * | shadow_edge ) |
Cuts the original edge based on the occlusion results under light-camera, if segment is occluded in light-camera, then that segment on the original edge must be shaded.
Definition at line 96 of file lineart_shadow.cc.
References e, lineart_contour_viewed_from_dark_side(), lineart_edge_cut(), LISTBASE_FOREACH, LRT_SHADOW_MASK_ILLUMINATED, LRT_SHADOW_MASK_SHADED, and LineartEdge::segments.
Referenced by lineart_geometry_object_load(), and lineart_register_intersection_shadow_cuts().
| void * list_push_pointer_static | ( | ListBase * | h, |
| struct LineartStaticMemPool * | smp, | ||
| void * | p ) |
| void * list_push_pointer_static_sized | ( | ListBase * | h, |
| struct LineartStaticMemPool * | smp, | ||
| void * | p, | ||
| int | size ) |