Blender
V3.3
|
#include "BLI_linklist.h"
#include "BLI_listbase.h"
#include "BLI_math.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 86 of file lineart_intern.h.
#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 81 of file lineart_intern.h.
#define LRT_EDGE_BA_MARCHING_BEGIN | ( | fb1, | |
fb2 | |||
) |
Definition at line 88 of file lineart_intern.h.
#define LRT_EDGE_BA_MARCHING_END |
Definition at line 101 of file lineart_intern.h.
#define LRT_EDGE_BA_MARCHING_NEXT | ( | fb1, | |
fb2 | |||
) |
Definition at line 97 of file lineart_intern.h.
#define LRT_ITER_ALL_LINES_BEGIN |
Definition at line 68 of file lineart_intern.h.
#define LRT_ITER_ALL_LINES_END |
Definition at line 76 of file lineart_intern.h.
Definition at line 74 of file lineart_intern.h.
void lineart_add_edge_to_array | ( | struct LineartPendingEdges * | pe, |
struct LineartEdge * | e | ||
) |
Definition at line 1774 of file lineart_cpu.c.
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 | ( | LineartBoundingArea * | this, |
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 4732 of file lineart_cpu.c.
References LineartBoundingArea::b, usdtokens::b(), l, LineartBoundingArea::l, LISTBASE_FOREACH, MIN2, LineartBoundingArea::r, r, ratiod(), LineartBoundingArea::u, x, and y.
void lineart_count_and_print_render_buffer_memory | ( | struct LineartData * | ld | ) |
Definition at line 208 of file lineart_util.c.
References LineartData::geom, LineartData::_geom::line_buffer_pointers, LISTBASE_FOREACH, LRT_MEMORY_POOL_1MB, LineartStaticMemPool::pools, LineartData::render_data_pool, LineartData::sizeof_triangle, LineartData::_geom::triangle_buffer_pointers, and void.
Referenced by MOD_lineart_compute_feature_lines().
int lineart_count_intersection_segment_count | ( | struct LineartData * | ld | ) |
void lineart_destroy_render_data_keep_init | ( | struct LineartData * | ld | ) |
Definition at line 3477 of file lineart_cpu.c.
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, NULL, 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(), and MOD_lineart_compute_feature_lines().
void lineart_edge_cut | ( | LineartData * | ld, |
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 150 of file lineart_cpu.c.
References BLI_addtail(), BLI_insertlinkbefore(), BLI_remlink(), e, lineart_discard_segment(), lineart_give_segment(), LRT_DOUBLE_CLOSE_ENOUGH, LRT_EDGE_FLAG_LIGHT_CONTOUR, 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, MIN2, LineartEdgeSegment::next, NULL, LineartEdgeSegment::occlusion, LineartEdgeSegment::prev, LineartEdgeSegment::ratio, LineartEdgeSegment::shadow_mask_bits, t, 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 | ( | 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 4698 of file lineart_cpu.c.
References data, interp_v2_v2v2_db(), LB, lineart_get_bounding_area(), lineart_intersect_seg_seg(), r, 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 1800 of file lineart_cpu.c.
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 44 of file lineart_shadow.c.
References LineartElementLinkNode::element_count, NULL, 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 34 of file lineart_shadow.c.
References LISTBASE_FOREACH, and NULL.
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 1054 of file lineart_chain.c.
References LISTBASE_FOREACH, and NULL.
Referenced by MOD_lineart_finalize_chains().
void* lineart_list_append_pointer_pool | ( | ListBase * | h, |
struct LineartStaticMemPool * | smp, | ||
void * | data | ||
) |
Definition at line 24 of file lineart_util.c.
References BLI_addtail(), data, LinkData::data, lineart_mem_acquire(), and NULL.
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 35 of file lineart_util.c.
References BLI_addtail(), data, LinkData::data, lineart_mem_acquire(), NULL, and size().
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 60 of file lineart_util.c.
References BLI_addtail(), data, LinkData::data, lineart_mem_acquire_thread(), NULL, and size().
Referenced by lineart_geometry_object_load().
void* lineart_list_append_pointer_pool_thread | ( | ListBase * | h, |
struct LineartStaticMemPool * | smp, | ||
void * | data | ||
) |
Definition at line 49 of file lineart_util.c.
References BLI_addtail(), data, LinkData::data, lineart_mem_acquire_thread(), and NULL.
Referenced by lineart_geometry_object_load().
Definition at line 75 of file lineart_util.c.
References BLI_pophead(), LinkData::data, and NULL.
Definition at line 86 of file lineart_util.c.
References BLI_remlink().
Referenced by lineart_bounding_areas_connect_new().
void lineart_main_add_triangles | ( | LineartData * | ld | ) |
Sequentially add triangles into render buffer, intersection lines between those triangles will also be computed at the same time.
Definition at line 4663 of file lineart_cpu.c.
References BLI_task_pool_create(), BLI_task_pool_free(), BLI_task_pool_push(), BLI_task_pool_work_and_wait(), LineartData::conf, G, lineart_add_triangles_worker(), lineart_create_edges_from_isec_data(), lineart_destroy_isec_thread(), lineart_init_isec_thread(), NULL, PIL_check_seconds_timer(), TASK_PRIORITY_HIGH, LineartData::thread_count, and LineartData::_conf::use_intersections.
Referenced by lineart_main_try_generate_shadow(), and MOD_lineart_compute_feature_lines().
void lineart_main_bounding_area_make_initial | ( | struct LineartData * | ld | ) |
Definition at line 3696 of file lineart_cpu.c.
References LineartBoundingArea::b, BLI_spin_init(), col, LineartData::_qtree::count_x, LineartData::_qtree::count_y, LineartBoundingArea::cx, LineartBoundingArea::cy, double(), 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(), and MOD_lineart_compute_feature_lines().
void lineart_main_bounding_areas_connect_post | ( | struct LineartData * | ld | ) |
Definition at line 3911 of file lineart_cpu.c.
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(), and MOD_lineart_compute_feature_lines().
void lineart_main_clear_linked_edges | ( | struct LineartData * | ld | ) |
Definition at line 4271 of file lineart_cpu.c.
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 | ( | 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 1211 of file lineart_cpu.c.
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(), and MOD_lineart_compute_feature_lines().
void lineart_main_discard_out_of_frame_edges | ( | struct LineartData * | ld | ) |
Definition at line 1389 of file lineart_cpu.c.
References e, LineartData::geom, LineartData::_geom::line_buffer_pointers, LISTBASE_FOREACH, LRT_EDGE_FLAG_CHAIN_PICKED, LRT_VERT_OUT_OF_BOUND, v1, and v2.
Referenced by lineart_main_try_generate_shadow(), and MOD_lineart_compute_feature_lines().
void lineart_main_free_adjacent_data | ( | 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 1346 of file lineart_cpu.c.
References BLI_pophead(), LinkData::data, LineartData::geom, LineartTriangle::intersecting_verts, LISTBASE_FOREACH, MEM_freeN, NULL, LineartData::sizeof_triangle, LineartData::_geom::triangle_adjacent_pointers, and LineartData::_geom::triangle_buffer_pointers.
Referenced by lineart_main_try_generate_shadow(), and MOD_lineart_compute_feature_lines().
void lineart_main_get_view_vector | ( | LineartData * | ld | ) |
The calculated view vector will point towards the far-plane from the camera position.
Definition at line 3437 of file lineart_cpu.c.
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(), and MOD_lineart_compute_feature_lines().
void lineart_main_link_lines | ( | LineartData * | ld | ) |
Link lines to their respective bounding areas.
Definition at line 4284 of file lineart_cpu.c.
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(), and MOD_lineart_compute_feature_lines().
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 | ||
) |
Definition at line 2524 of file lineart_cpu.c.
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(), LineartData::_conf::cam_obmat, CAM_ORTHO, CAM_PERSP, camera, 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, depsgraph, double(), ELEM, focallength_to_fov(), G, LineartData::geom, LineartData::h, 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_uniq(), NULL, OB_CURVES_LEGACY, OB_FONT, OB_SURF, OB_VISIBLE_SELF, Object::obmat, Camera::ortho_scale, LineartData::_conf::overscan, LineartData::pending_edges, PIL_check_seconds_timer(), LineartData::render_data_pool, result, scene, 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, view, LineartData::_conf::view, LineartData::_conf::view_projection, w(), and LineartData::w.
Referenced by lineart_main_try_generate_shadow(), and MOD_lineart_compute_feature_lines().
void lineart_main_make_enclosed_shapes | ( | struct LineartData * | ld, |
struct LineartData * | shadow_ld | ||
) |
Definition at line 1352 of file lineart_shadow.c.
References LineartPendingEdges::array, 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, NULL, LineartData::pending_edges, PIL_check_seconds_timer(), LineartElementLinkNode::pointer, 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().
void lineart_main_occlusion_begin | ( | 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 464 of file lineart_cpu.c.
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, NULL, TASK_PRIORITY_HIGH, LineartData::thread_count, and LineartRenderTaskInfo::thread_id.
Referenced by lineart_main_make_enclosed_shapes(), lineart_main_try_generate_shadow(), and MOD_lineart_compute_feature_lines().
void lineart_main_perspective_division | ( | struct LineartData * | ld | ) |
Definition at line 1364 of file lineart_cpu.c.
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(), and MOD_lineart_compute_feature_lines().
void lineart_main_transform_and_add_shadow | ( | struct LineartData * | ld, |
struct LineartElementLinkNode * | veln, | ||
struct LineartElementLinkNode * | eeln | ||
) |
Definition at line 1319 of file lineart_shadow.c.
References BLI_addtail(), BLI_parallel_range_settings_defaults(), BLI_task_parallel_range(), data, LineartElementLinkNode::element_count, LineartData::geom, 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().
bool lineart_main_try_generate_shadow | ( | struct Depsgraph * | depsgraph, |
struct Scene * | scene, | ||
struct LineartData * | original_ld, | ||
struct LineartGpencilModifierData * | 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 1119 of file lineart_shadow.c.
References LineartData::_conf::allow_duplicated_types, BLI_spin_init(), 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, LineartGpencilModifierData::flags, G, LineartData::geom, LineartData::h, if(), invert_m4_m4(), LA_SUN, LineartGpencilModifierData::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_ALLOW_DUPLI_OBJECTS, LRT_TILE_RECURSIVE_ORTHO, LRT_TILE_RECURSIVE_PERSPECTIVE, LineartData::_conf::max_occlusion_level, MEM_callocN, MEM_freeN, mul_m4db_m4db_m4fl_uniq(), LineartData::_conf::near_clip, NULL, OB_LAMP, Object::obmat, PIL_check_seconds_timer(), LineartData::qtree, LineartData::_qtree::recursive_level, LineartData::render_data_pool, result, scene, LineartGpencilModifierData::shadow_camera_far, LineartGpencilModifierData::shadow_camera_near, LineartGpencilModifierData::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, view, LineartData::_conf::view, LineartData::_conf::view_projection, and LineartData::w.
Referenced by MOD_lineart_compute_feature_lines().
void lineart_matrix_ortho_44d | ( | double(*) | mProjection[4], |
double | xMin, | ||
double | xMax, | ||
double | yMin, | ||
double | yMax, | ||
double | zMin, | ||
double | zMax | ||
) |
Definition at line 189 of file lineart_util.c.
References unit_m4_db().
Referenced by lineart_main_load_geometries(), and lineart_main_try_generate_shadow().
void lineart_matrix_perspective_44d | ( | double(*) | mProjection[4], |
double | fFov_rad, | ||
double | fAspect, | ||
double | zMin, | ||
double | zMax | ||
) |
Definition at line 157 of file lineart_util.c.
References KDL::tan(), and unit_m4_db().
Referenced by lineart_main_load_geometries(), and lineart_main_try_generate_shadow().
void* lineart_mem_acquire | ( | struct LineartStaticMemPool * | smp, |
size_t | size | ||
) |
Definition at line 104 of file lineart_util.c.
References ListBase::first, lineart_mem_new_static_pool(), LineartStaticMemPool::pools, ret, size(), LineartStaticMemPoolNode::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 119 of file lineart_util.c.
References BLI_spin_lock(), BLI_spin_unlock(), ListBase::first, lineart_mem_new_static_pool(), LineartStaticMemPool::lock_mem, LineartStaticMemPool::pools, ret, size(), LineartStaticMemPoolNode::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 139 of file lineart_util.c.
References BLI_pophead(), MEM_freeN, NULL, 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().
struct LineartStaticMemPoolNode* lineart_mem_new_static_pool | ( | struct LineartStaticMemPool * | smp, |
size_t | size | ||
) |
Definition at line 91 of file lineart_util.c.
References BLI_addhead(), LRT_MEMORY_POOL_1MB, MEM_callocN, LineartStaticMemPool::pools, 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 147 of file lineart_util.c.
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 123 of file lineart_shadow.c.
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, NULL, and LineartElementLinkNode::pointer.
Referenced by MOD_lineart_compute_feature_lines().
void lineart_register_shadow_cuts | ( | struct LineartData * | ld, |
struct LineartEdge * | e, | ||
struct LineartEdge * | shadow_edge | ||
) |
Definition at line 101 of file lineart_shadow.c.
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 lineart_sort_adjacent_items | ( | struct LineartAdjacentEdge * | ai, |
int | length | ||
) |
Definition at line 22 of file lineart_cpp_bridge.cc.
References cmp_adjacent_items(), blender::math::length(), and blender::parallel_sort().
Referenced by lineart_build_edge_neighbor().
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 | ||
) |