Blender
V3.3
|
#include "MOD_gpencil_lineart.h"
#include "MOD_lineart.h"
#include "BLI_edgehash.h"
#include "BLI_linklist.h"
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BLI_task.h"
#include "BLI_utildefines.h"
#include "PIL_time.h"
#include "BKE_camera.h"
#include "BKE_collection.h"
#include "BKE_customdata.h"
#include "BKE_deform.h"
#include "BKE_duplilist.h"
#include "BKE_editmesh.h"
#include "BKE_global.h"
#include "BKE_gpencil.h"
#include "BKE_gpencil_geom.h"
#include "BKE_gpencil_modifier.h"
#include "BKE_lib_id.h"
#include "BKE_material.h"
#include "BKE_mesh.h"
#include "BKE_mesh_mapping.h"
#include "BKE_mesh_runtime.h"
#include "BKE_object.h"
#include "BKE_pointcache.h"
#include "BKE_scene.h"
#include "DEG_depsgraph_query.h"
#include "DNA_camera_types.h"
#include "DNA_collection_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_light_types.h"
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_modifier_types.h"
#include "DNA_scene_types.h"
#include "MEM_guardedalloc.h"
#include "lineart_intern.h"
Go to the source code of this file.
Classes | |
struct | LineartIsecSingle |
struct | LineartIsecThread |
struct | LineartIsecData |
struct | LineartEdgeNeighbor |
struct | VertData |
struct | EdgeFeatData |
struct | EdgeFeatReduceData |
struct | LooseEdgeData |
struct | TriData |
struct | EdgeNeighborData |
Macros | |
#define | INCREASE_EDGE |
#define | SELECT_EDGE(e_num, v1_link, v2_link, new_tri) |
#define | RELINK_EDGE(e_num, new_tri) |
#define | REMOVE_TRIANGLE_EDGE |
#define | LRT_CULL_ENSURE_MEMORY |
#define | LRT_CULL_DECIDE_INSIDE |
#define | LRT_VERT_OUT_OF_BOUND(v) (v && (v->fbcoord[0] < -1 || v->fbcoord[0] > 1 || v->fbcoord[1] < -1 || v->fbcoord[1] > 1)) |
#define | LRT_MESH_EDGE_TYPES_COUNT 6 |
#define | LRT_TRI_SAME_POINT(tri, i, pt) |
#define | INTERSECT_SORT_MIN_TO_MAX_3(ia, ib, ic, lst) |
#define | INTERSECT_JUST_GREATER(is, order, num, index) |
#define | INTERSECT_JUST_SMALLER(is, order, num, index) |
#define | LRT_ISEC(index) (index == 0 ? isec_e1 : (index == 1 ? isec_e2 : isec_e3)) |
#define | LRT_PARALLEL(index) (index == 0 ? para_e1 : (index == 1 ? para_e2 : para_e3)) |
#define | LRT_GUARD_NOT_FOUND |
#define | LRT_ISECT_TRIANGLE_PER_THREAD 4096 |
Typedefs | |
typedef struct LineartIsecSingle | LineartIsecSingle |
typedef struct LineartIsecThread | LineartIsecThread |
typedef struct LineartIsecData | LineartIsecData |
typedef struct LineartEdgeNeighbor | LineartEdgeNeighbor |
typedef struct VertData | VertData |
typedef struct EdgeFeatData | EdgeFeatData |
typedef struct EdgeFeatReduceData | EdgeFeatReduceData |
typedef struct LooseEdgeData | LooseEdgeData |
typedef struct TriData | TriData |
typedef struct EdgeNeighborData | EdgeNeighborData |
Enumerations | |
enum | LineartPointTri { LRT_OUTSIDE_TRIANGLE = 0 , LRT_ON_TRIANGLE = 1 , LRT_INSIDE_TRIANGLE = 2 } |
Variables | |
static const int | LRT_MESH_EDGE_TYPES [] |
#define INCREASE_EDGE |
Definition at line 2760 of file lineart_cpu.c.
#define INTERSECT_SORT_MIN_TO_MAX_3 | ( | ia, | |
ib, | |||
ic, | |||
lst | |||
) |
Definition at line 2750 of file lineart_cpu.c.
#define LRT_CULL_DECIDE_INSIDE |
#define LRT_CULL_ENSURE_MEMORY |
#define LRT_GUARD_NOT_FOUND |
#define LRT_ISEC | ( | index | ) | (index == 0 ? isec_e1 : (index == 1 ? isec_e2 : isec_e3)) |
Definition at line 2775 of file lineart_cpu.c.
#define LRT_ISECT_TRIANGLE_PER_THREAD 4096 |
Definition at line 3306 of file lineart_cpu.c.
#define LRT_MESH_EDGE_TYPES_COUNT 6 |
Definition at line 1443 of file lineart_cpu.c.
#define LRT_PARALLEL | ( | index | ) | (index == 0 ? para_e1 : (index == 1 ? para_e2 : para_e3)) |
Definition at line 2776 of file lineart_cpu.c.
#define LRT_TRI_SAME_POINT | ( | tri, | |
i, | |||
pt | |||
) |
#define LRT_VERT_OUT_OF_BOUND | ( | v | ) | (v && (v->fbcoord[0] < -1 || v->fbcoord[0] > 1 || v->fbcoord[1] < -1 || v->fbcoord[1] > 1)) |
#define RELINK_EDGE | ( | e_num, | |
new_tri | |||
) |
#define REMOVE_TRIANGLE_EDGE |
#define SELECT_EDGE | ( | e_num, | |
v1_link, | |||
v2_link, | |||
new_tri | |||
) |
typedef struct EdgeFeatData EdgeFeatData |
typedef struct EdgeFeatReduceData EdgeFeatReduceData |
typedef struct EdgeNeighborData EdgeNeighborData |
typedef struct LineartEdgeNeighbor LineartEdgeNeighbor |
typedef struct LineartIsecData LineartIsecData |
typedef struct LineartIsecSingle LineartIsecSingle |
typedef struct LineartIsecThread LineartIsecThread |
typedef struct LooseEdgeData LooseEdgeData |
enum LineartPointTri |
Enumerator | |
---|---|
LRT_OUTSIDE_TRIANGLE | |
LRT_ON_TRIANGLE | |
LRT_INSIDE_TRIANGLE |
Definition at line 564 of file lineart_cpu.c.
|
static |
Definition at line 1490 of file lineart_cpu.c.
References EdgeFeatReduceData::feat_edges.
Referenced by lineart_geometry_object_load().
void lineart_add_edge_to_array | ( | LineartPendingEdges * | pe, |
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().
|
static |
Definition at line 1793 of file lineart_cpu.c.
References e, lineart_add_edge_to_array(), and LineartObjectInfo::pending_edges.
Referenced by lineart_geometry_object_load().
|
static |
Definition at line 3280 of file lineart_cpu.c.
References LineartIsecThread::array, copy_v3_v3_db(), LineartIsecThread::current, LineartIsecThread::max, MEM_freeN, MEM_mallocN, SWAP, LineartTriangle::target_reference, LineartIsecSingle::tri1, LineartIsecSingle::tri2, LineartIsecSingle::v1, v1, v2, and LineartIsecSingle::v2.
Referenced by lineart_triangle_intersect_in_bounding_area().
|
static |
Definition at line 1743 of file lineart_cpu.c.
References e, lineart_loose_data_reallocate(), LooseEdgeData::loose_array, LooseEdgeData::loose_count, LooseEdgeData::loose_max, and MAX2.
Referenced by lineart_identify_loose_edges().
|
static |
Definition at line 4520 of file lineart_cpu.c.
References LineartData::_qtree::count_x, LineartTriangle::flags, LineartIsecThread::index_from, LineartIsecThread::index_to, LineartData::_qtree::initials, LineartIsecThread::ld, lineart_bounding_area_link_triangle(), lineart_get_triangle_bounding_areas(), lineart_schedule_new_triangle_task(), LRT_CULL_DISCARD, LRT_CULL_USED, LineartElementLinkNode::next, LineartIsecThread::pending_from, LineartIsecThread::pending_to, LineartData::qtree, r, LineartData::sizeof_triangle, x2, and y1.
Referenced by lineart_main_add_triangles().
|
static |
Definition at line 4023 of file lineart_cpu.c.
References LineartBoundingArea::b, Freestyle::c, l, LineartBoundingArea::l, MAX2, MIN2, LineartBoundingArea::r, r, and LineartBoundingArea::u.
Referenced by lineart_bounding_area_link_edge(), and lineart_bounding_area_triangle_intersect().
|
static |
Definition at line 359 of file lineart_cpu.c.
References e, LineartBoundingArea::line_count, LineartBoundingArea::linked_lines, LineartBoundingArea::max_line_count, MEM_freeN, and MEM_mallocN.
Referenced by lineart_bounding_area_link_edge().
|
static |
Definition at line 4229 of file lineart_cpu.c.
References LineartBoundingArea::child, e, lineart_bounding_area_edge_intersect(), lineart_bounding_area_line_add(), and NULL.
Referenced by lineart_main_link_lines().
|
static |
This function does two things:
1) Builds a quad-tree under ld->InitialBoundingAreas to achieve good geometry separation for fast overlapping test between triangles and lines. This acceleration structure makes the occlusion stage much faster.
2) Test triangles with other triangles that are previously linked into each tile (LineartBoundingArea) for intersection lines. When splitting the tile into 4 children and re-linking triangles into the child tiles, intersections are inhibited so we don't get duplicated intersection lines.
Definition at line 4115 of file lineart_cpu.c.
References usdtokens::b(), Freestyle::B1(), BLI_spin_lock(), BLI_spin_unlock(), LineartBoundingArea::child, LineartData::conf, LineartVert::fbcoord, LineartBoundingArea::insider_triangle_count, LineartBoundingArea::l, lineart_bounding_area_split(), lineart_bounding_area_triangle_intersect(), lineart_bounding_area_triangle_reallocate(), lineart_triangle_intersect_in_bounding_area(), LineartBoundingArea::linked_triangles, LineartBoundingArea::lock, LRT_BOUND_AREA_CROSSES, LRT_TILE_SPLITTING_TRIANGLE_LIMIT, MAX3, LineartBoundingArea::max_triangle_count, MIN3, LineartBoundingArea::triangle_count, LineartData::_conf::use_intersections, and LineartTriangle::v.
Referenced by lineart_add_triangles_worker(), and lineart_bounding_area_split().
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.
|
static |
Subdivide a tile after one tile contains too many triangles, then re-link triangles into all the child tiles.
Definition at line 3947 of file lineart_cpu.c.
References LineartBoundingArea::b, usdtokens::b(), BLI_spin_init(), LineartBoundingArea::child, LineartBoundingArea::cx, LineartBoundingArea::cy, LineartVert::fbcoord, l, LineartBoundingArea::l, lineart_bounding_area_link_triangle(), lineart_mem_acquire_thread(), LineartBoundingArea::linked_lines, LineartBoundingArea::linked_triangles, lock, LRT_BOUND_AREA_CROSSES, LRT_TILE_EDGE_COUNT_INITIAL, LRT_TILE_SPLITTING_TRIANGLE_LIMIT, MAX3, LineartBoundingArea::max_line_count, LineartBoundingArea::max_triangle_count, MEM_callocN, MIN3, NULL, LineartBoundingArea::r, LineartData::render_data_pool, LineartBoundingArea::triangle_count, LineartBoundingArea::u, and LineartTriangle::v.
Referenced by lineart_bounding_area_link_triangle().
|
static |
Definition at line 4064 of file lineart_cpu.c.
References LineartBoundingArea::b, fb(), LineartVert::fbcoord, LineartBoundingArea::l, lineart_bounding_area_edge_intersect(), lineart_point_inside_triangle(), LineartBoundingArea::r, LineartBoundingArea::u, and LineartTriangle::v.
Referenced by lineart_bounding_area_link_triangle().
|
static |
Definition at line 352 of file lineart_cpu.c.
References LineartBoundingArea::linked_triangles, LineartBoundingArea::max_triangle_count, and MEM_recallocN.
Referenced by lineart_bounding_area_link_triangle().
|
static |
Re-link adjacent tiles after one gets subdivided.
Definition at line 3761 of file lineart_cpu.c.
References LineartBoundingArea::b, BLI_listbase_clear(), LineartBoundingArea::bp, LineartBoundingArea::child, LinkData::data, LineartBoundingArea::l, lineart_list_append_pointer_pool(), lineart_list_remove_pointer_item_no_free(), LISTBASE_FOREACH, LineartBoundingArea::lp, LinkData::next, r, LineartData::render_data_pool, LineartBoundingArea::rp, and LineartBoundingArea::up.
Referenced by lineart_bounding_areas_connect_recursive().
|
static |
Definition at line 3901 of file lineart_cpu.c.
References LineartBoundingArea::child, and lineart_bounding_areas_connect_new().
Referenced by lineart_main_bounding_areas_connect_post().
|
static |
Definition at line 1941 of file lineart_cpu.c.
References EdgeNeighborData::adj_e, MLoopTri_Store::array, BLI_parallel_range_settings_defaults(), BLI_task_parallel_range(), LineartEdgeNeighbor::e, LineartAdjacentEdge::e, EdgeNeighborData::edge_nabr, lineart_edge_neighbor_init_task(), lineart_sort_adjacent_items(), Mesh_Runtime::looptris, MEM_freeN, MEM_mallocN, TaskParallelSettings::min_iter_per_thread, EdgeNeighborData::mloop, Mesh::mloop, EdgeNeighborData::mlooptri, Mesh::runtime, v1, and v2.
Referenced by lineart_geometry_object_load().
|
static |
Definition at line 4256 of file lineart_cpu.c.
References LineartBoundingArea::child, LineartBoundingArea::line_count, LineartBoundingArea::linked_lines, LineartBoundingArea::max_line_count, MEM_callocN, and MEM_freeN.
Referenced by lineart_main_clear_linked_edges().
|
static |
Definition at line 4552 of file lineart_cpu.c.
References LineartIsecThread::array, BLI_addhead(), BLI_addtail(), LineartData::conf, copy_v3_v3_db(), LineartIsecThread::current, e, LineartData::edge_data_pool, LineartElementLinkNode::element_count, fabs(), LineartData::_conf::far_clip, LineartElementLinkNode::flags, G, LineartData::geom, LineartTriangle::intersection_mask, LineartData::_geom::line_buffer_pointers, lineart_add_edge_to_array(), lineart_find_matching_eln(), lineart_mem_acquire(), LRT_EDGE_FLAG_INTERSECTION, LRT_ELEMENT_INTERSECTION_DATA, LRT_OBINDEX_HIGHER, mul_v3db_db(), mul_v4_m4v3_db(), LineartData::_conf::near_clip, NULL, LineartElementLinkNode::object_ref, LineartData::pending_edges, LineartElementLinkNode::pointer, LineartData::_conf::shift_x, LineartData::_conf::shift_y, LineartIsecSingle::tri1, LineartIsecSingle::tri2, v, LineartIsecSingle::v1, v1, v2, LineartIsecSingle::v2, and LineartData::_conf::view_projection.
Referenced by lineart_main_add_triangles().
|
static |
Definition at line 3549 of file lineart_cpu.c.
References LineartData::_conf::active_camera_pos, LineartCache::all_enabled_edge_types, LineartData::_conf::allow_boundaries, LineartData::_conf::allow_duplicated_types, LineartData::_conf::allow_overlapping_edges, LineartData::_conf::angle_splitting_threshold, LineartGpencilModifierData::angle_splitting_threshold, BKE_camera_sensor_fit(), BKE_render_num_threads(), BLI_spin_init(), Freestyle::c, LineartGpencilModifierData::cache, LineartGpencilModifierData::calculation_flags, LineartData::_conf::cam_is_persp, LineartData::_conf::cam_is_persp_secondary, LineartData::_conf::cam_obmat, LineartData::_conf::cam_obmat_secondary, CAM_PERSP, camera, LineartData::_conf::camera_pos, LineartData::_conf::camera_pos_secondary, CAMERA_SENSOR_FIT_HOR, CAMERA_SENSOR_FIT_VERT, LineartData::chain_data_pool, LineartCache::chain_data_pool, LineartData::_conf::chain_preserve_details, LineartData::_conf::chain_smooth_tolerance, LineartGpencilModifierData::chain_smooth_tolerance, LineartData::_conf::chaining_image_threshold, LineartGpencilModifierData::chaining_image_threshold, LineartData::conf, copy_m4_m4(), copy_v3db_v3fl(), KDL::cos(), LineartData::_conf::crease_threshold, LineartGpencilModifierData::crease_threshold, Object::data, double(), LineartData::edge_data_pool, LineartGpencilModifierData::edge_types_override, LineartData::_conf::far_clip, LineartData::_conf::filter_face_mark, LineartData::_conf::filter_face_mark_boundaries, LineartData::_conf::filter_face_mark_invert, LineartData::_conf::filter_face_mark_keep_contour, LineartData::_conf::force_crease, LineartData::_conf::fuzzy_everything, LineartData::_conf::fuzzy_intersections, LineartData::h, LineartGpencilModifierData::la_data_ptr, LA_SUN, LineartGpencilModifierData::level_end_override, LineartGpencilModifierData::light_contour_object, LineartData::_conf::light_reference_available, LineartData::lock_cuts, LineartStaticMemPool::lock_mem, LineartData::lock_task, LRT_ALLOW_CLIPPING_BOUNDARIES, LRT_ALLOW_OVERLAP_EDGE_TYPES, LRT_ALLOW_OVERLAPPING_EDGES, LRT_CHAIN_GEOMETRY_SPACE, LRT_CHAIN_LOOSE_EDGES, LRT_CHAIN_PRESERVE_DETAILS, LRT_EDGE_FLAG_CONTOUR, LRT_EDGE_FLAG_CREASE, LRT_EDGE_FLAG_EDGE_MARK, LRT_EDGE_FLAG_INTERSECTION, LRT_EDGE_FLAG_LIGHT_CONTOUR, LRT_EDGE_FLAG_LOOSE, LRT_EDGE_FLAG_MATERIAL, LRT_EDGE_FLAG_PROJECTED_SHADOW, LRT_EVERYTHING_AS_CONTOUR, LRT_FILTER_FACE_MARK, LRT_FILTER_FACE_MARK_BOUNDARIES, LRT_FILTER_FACE_MARK_INVERT, LRT_FILTER_FACE_MARK_KEEP_CONTOUR, LRT_INTERSECTION_AS_CONTOUR, LRT_LOOSE_AS_CONTOUR, LRT_SHADOW_FILTER_ILLUMINATED_ENCLOSED_SHAPES, LRT_TILE_RECURSIVE_ORTHO, LRT_TILE_RECURSIVE_PERSPECTIVE, LRT_USE_BACK_FACE_CULLING, LRT_USE_CREASE_ON_SHARP_EDGES, LRT_USE_CREASE_ON_SMOOTH_SURFACES, LRT_USE_IMAGE_BOUNDARY_TRIMMING, M_PI, LineartData::_conf::max_occlusion_level, MEM_callocN, LineartData::_conf::near_clip, normalize_v3(), NULL, OB_LAMP, Object::obmat, LineartData::_conf::overscan, LineartGpencilModifierData::overscan, LineartData::qtree, Scene::r, LineartData::_qtree::recursive_level, LineartData::render_data_pool, scene, LineartData::_conf::shadow_enclose_shapes, LineartData::_conf::shadow_selection, LineartGpencilModifierData::shadow_selection_override, LineartData::_conf::shadow_use_silhouette, LineartGpencilModifierData::shadow_use_silhouette_override, LineartData::_conf::sharp_as_crease, LineartData::_conf::shift_x, LineartData::_conf::shift_y, LineartData::thread_count, Object::type, LineartData::_conf::use_back_face_culling, LineartData::_conf::use_contour, LineartData::_conf::use_crease, LineartData::_conf::use_edge_marks, LineartData::_conf::use_geometry_space_chain, LineartData::_conf::use_image_boundary_trimming, LineartData::_conf::use_intersections, LineartData::_conf::use_light_contour, LineartData::_conf::use_loose, LineartData::_conf::use_loose_as_contour, LineartData::_conf::use_loose_edge_chain, LineartData::_conf::use_material, LineartData::_conf::use_shadow, LineartData::w, RenderData::xsch, and RenderData::ysch.
Referenced by MOD_lineart_compute_feature_lines().
|
static |
Definition at line 3370 of file lineart_cpu.c.
References LineartIsecThread::array, and MEM_freeN.
Referenced by lineart_main_add_triangles().
|
static |
Definition at line 3502 of file lineart_cpu.c.
References BLI_spin_end(), lineart_destroy_render_data_keep_init(), lineart_mem_destroy(), LineartData::lock_cuts, LineartStaticMemPool::lock_mem, LineartData::lock_task, NULL, and LineartData::render_data_pool.
Referenced by MOD_lineart_destroy_render_data().
void lineart_destroy_render_data_keep_init | ( | 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().
|
static |
Definition at line 735 of file lineart_cpu.c.
References e, LRT_EDGE_FLAG_CHAIN_PICKED, and LRT_EDGE_FLAG_NEXT_IS_DUPLICATION.
|
static |
Definition at line 116 of file lineart_cpu.c.
References BLI_addtail(), BLI_spin_lock(), BLI_spin_unlock(), LineartData::lock_cuts, and LineartData::wasted_cuts.
Referenced by lineart_edge_cut().
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 LineartTriangle * | tri, |
const LineartEdge * | e, | ||
bool | allow_overlapping_edges | ||
) |
Definition at line 2708 of file lineart_cpu.c.
References e, LRT_EDGE_FLAG_LIGHT_CONTOUR, LRT_LIGHT_CONTOUR_TARGET, LRT_TRI_SAME_POINT, LineartEdge::t1, LineartEdge::t2, and LineartTriangle::target_reference.
Referenced by lineart_shadow_cast(), and lineart_triangle_edge_image_space_occlusion().
|
static |
Definition at line 729 of file lineart_cpu.c.
References e, LineartTriangle::v, v1, and v2.
Referenced by lineart_triangle_adjacent_assign().
|
static |
Definition at line 1918 of file lineart_cpu.c.
References EdgeNeighborData::adj_e, LineartEdgeNeighbor::e, LineartAdjacentEdge::e, EdgeNeighborData::edge_nabr, LineartEdgeNeighbor::flags, EdgeNeighborData::mloop, EdgeNeighborData::mlooptri, SWAP, MLoopTri::tri, v, MLoop::v, LineartEdgeNeighbor::v1, LineartAdjacentEdge::v1, LineartEdgeNeighbor::v2, and LineartAdjacentEdge::v2.
Referenced by lineart_build_edge_neighbor().
|
static |
Definition at line 1445 of file lineart_cpu.c.
References count, LRT_MESH_EDGE_TYPES, and LRT_MESH_EDGE_TYPES_COUNT.
Referenced by lineart_identify_mlooptri_feature_edges().
|
static |
Definition at line 3467 of file lineart_cpu.c.
References BLI_spin_end(), LineartBoundingArea::child, and LineartBoundingArea::lock.
Referenced by lineart_destroy_render_data_keep_init().
|
static |
Definition at line 1812 of file lineart_cpu.c.
References LineartPendingEdges::array, MEM_freeN, LineartPendingEdges::next, and LineartObjectInfo::pending_edges.
Referenced by lineart_main_load_geometries().
void lineart_finalize_object_edge_array_reserve | ( | 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().
|
static |
Definition at line 4220 of file lineart_cpu.c.
References LineartData::_qtree::count_x, LineartData::_qtree::count_y, LineartData::_qtree::initials, lineart_free_bounding_area_memory(), and LineartData::qtree.
Referenced by lineart_destroy_render_data_keep_init().
|
static |
Definition at line 4205 of file lineart_cpu.c.
References BLI_spin_end(), LineartBoundingArea::child, LineartBoundingArea::linked_lines, LineartBoundingArea::linked_triangles, LineartBoundingArea::lock, and MEM_freeN.
Referenced by lineart_free_bounding_area_memories().
|
static |
Definition at line 2411 of file lineart_cpu.c.
References BKE_boundbox_init_from_minmax(), BKE_mesh_minmax(), copy_v3_v3_db(), copy_v3db_v3fl(), INIT_MINMAX, mul_v4_m4v3_db(), and BoundBox::vec.
Referenced by lineart_object_load_single_instance().
|
static |
Definition at line 2392 of file lineart_cpu.c.
References LineartObjectInfo::next, LineartObjectLoadTaskInfo::pending, and LineartObjectLoadTaskInfo::total_faces.
Referenced by lineart_object_load_single_instance().
|
static |
Definition at line 1978 of file lineart_cpu.c.
References LineartData::_conf::allow_duplicated_types, BKE_id_free(), BKE_mesh_runtime_looptri_ensure(), BKE_mesh_runtime_looptri_len(), BLI_addtail(), BLI_parallel_range_settings_defaults(), BLI_spin_lock(), BLI_spin_unlock(), BLI_task_parallel_range(), CD_FREESTYLE_EDGE, CD_FREESTYLE_FACE, LineartData::conf, cosf, EdgeFeatData::crease_threshold, LineartData::_conf::crease_threshold, ObjectLineArt::crease_threshold, CustomData_get_active_layer_index(), CustomData_get_layer_index(), e, LineartEdgeNeighbor::e, Mesh::edata, LineartData::edge_data_pool, LineartEdge::edge_identifier, EdgeFeatData::edge_nabr, LineartElementLinkNode::element_count, feat_data_sum_reduce(), EdgeFeatReduceData::feat_edges, Mesh::flag, LineartEdgeNeighbor::flags, LineartElementLinkNode::flags, LineartEdge::flags, ObjectLineArt::flags, LineartObjectInfo::free_use_mesh, EdgeFeatData::freestyle_edge_index, EdgeFeatData::freestyle_face_index, TaskParallelSettings::func_reduce, LineartData::geom, EdgeFeatData::ld, LineartData::_geom::line_buffer_pointers, Object::lineart, lineart_add_edge_to_array_thread(), lineart_build_edge_neighbor(), lineart_find_matching_edge(), lineart_find_matching_eln(), lineart_identify_loose_edges(), lineart_identify_mlooptri_feature_edges(), lineart_list_append_pointer_pool_sized_thread(), lineart_list_append_pointer_pool_thread(), lineart_load_tri_task(), lineart_mem_acquire_thread(), lineart_mvert_transform_task(), lineart_register_shadow_cuts(), lineart_triangle_adjacent_assign(), lineart_triangle_from_index(), TriData::lineart_triangle_size, LineartData::lock_task, LooseEdgeData::loose_array, LooseEdgeData::loose_count, loose_data_sum_reduce(), LRT_EDGE_FLAG_LOOSE, LRT_EDGE_FLAG_NEXT_IS_DUPLICATION, LRT_EDGE_IDENTIFIER, LRT_ELEMENT_BORDER_ONLY, LRT_ELEMENT_NO_INTERSECTION, LRT_MESH_EDGE_TYPES, LRT_MESH_EDGE_TYPES_COUNT, M_PI, EdgeFeatData::me, LooseEdgeData::me, ME_AUTOSMOOTH, MEM_callocN, MEM_freeN, TaskParallelSettings::min_iter_per_thread, EdgeFeatData::mlooptri, TriData::mlooptri, VertData::model_view, LineartObjectInfo::model_view, VertData::model_view_proj, LineartObjectInfo::model_view_proj, VertData::mvert, Mesh::mvert, NULL, EdgeFeatData::ob_eval, OB_FONT, TriData::ob_info, LineartElementLinkNode::obindex, LineartObjectInfo::obindex, OBJECT_LRT_FORCE_INTERSECTION, OBJECT_LRT_INCLUDE, OBJECT_LRT_INHERIT, OBJECT_LRT_NO_INTERSECTION, OBJECT_LRT_OWN_CREASE, LineartElementLinkNode::object_ref, LineartEdge::object_ref, LineartObjectInfo::original_me, LineartObjectInfo::original_ob, LineartObjectInfo::original_ob_eval, Mesh::pdata, LineartData::render_data_pool, LineartEdge::segments, LineartData::sizeof_triangle, Mesh::smoothresh, LineartEdge::t1, LineartEdge::t2, Mesh::totedge, Mesh::totvert, TriData::tri_adj, TriData::tri_arr, EdgeFeatData::tri_array, LineartData::_geom::triangle_adjacent_pointers, LineartData::_geom::triangle_buffer_pointers, Object::type, LineartObjectInfo::usage, EdgeFeatData::use_auto_smooth, EdgeFeatData::use_freestyle_edge, EdgeFeatData::use_freestyle_face, LineartData::_conf::use_loose, TaskParallelSettings::userdata_chunk, TaskParallelSettings::userdata_chunk_size, LineartEdgeNeighbor::v1, LineartEdge::v1, MEdge::v1, LineartEdgeNeighbor::v2, LineartEdge::v2, MEdge::v2, VertData::v_arr, EdgeFeatData::v_array, LineartObjectInfo::v_eln, TriData::vert_arr, and LineartData::_geom::vertex_buffer_pointers.
Referenced by lineart_object_load_worker().
|
static |
Definition at line 4470 of file lineart_cpu.c.
References Freestyle::c, LineartBoundingArea::child, LineartData::_qtree::count_x, LineartData::_qtree::count_y, LineartBoundingArea::cx, LineartBoundingArea::cy, LineartData::_qtree::initials, LineartData::qtree, r, LineartData::_qtree::tile_height, LineartData::_qtree::tile_width, x, and y.
Referenced by lineart_edge_first_bounding_area(), and MOD_lineart_get_bounding_area().
|
static |
Definition at line 4397 of file lineart_cpu.c.
References usdtokens::b(), CLAMP, LineartData::_qtree::count_x, LineartData::_qtree::count_y, e, MAX2, MIN2, LineartData::qtree, LineartData::_qtree::tile_height, and LineartData::_qtree::tile_width.
Referenced by lineart_main_link_lines().
|
static |
Definition at line 4357 of file lineart_cpu.c.
References usdtokens::b(), LineartData::_qtree::count_x, LineartData::_qtree::count_y, LineartVert::fbcoord, MAX3, MIN3, LineartData::qtree, LineartData::_qtree::tile_height, LineartData::_qtree::tile_width, and LineartTriangle::v.
Referenced by lineart_add_triangles_worker().
|
static |
Definition at line 129 of file lineart_cpu.c.
References BLI_pophead(), BLI_spin_lock(), BLI_spin_unlock(), LineartData::edge_data_pool, ListBase::first, lineart_mem_acquire_thread(), LineartData::lock_cuts, and LineartData::wasted_cuts.
Referenced by lineart_edge_cut().
|
static |
Definition at line 5142 of file lineart_cpu.c.
References LineartCache::all_enabled_edge_types, BKE_collection_has_object_recursive_instanced(), BKE_defvert_ensure_index(), BKE_gpencil_dvert_ensure(), BKE_gpencil_stroke_add(), BKE_gpencil_stroke_geometry_update(), BKE_gpencil_stroke_set_random_color(), BKE_object_defgroup_name_index(), BKE_object_get_evaluated_mesh(), LineartCache::chains, count, Object::data, DEG_get_evaluated_object(), depsgraph, bGPDstroke::dvert, Mesh::dvert, G, Collection::id, Object::id, LISTBASE_FOREACH, LISTBASE_FOREACH_INDEX, LRT_EDGE_FLAG_CONTOUR, LRT_EDGE_FLAG_INTERSECTION, LRT_GPENCIL_INTERSECTION_MATCH, LRT_GPENCIL_INVERT_COLLECTION, LRT_GPENCIL_INVERT_SILHOUETTE_FILTER, LRT_GPENCIL_INVERT_SOURCE_VGROUP, LRT_GPENCIL_MATCH_OUTPUT_VGROUP, LRT_GPENCIL_MATERIAL_MASK_ENABLE, LRT_GPENCIL_MATERIAL_MASK_MATCH, LRT_SHADOW_FILTER_ILLUMINATED, LRT_SHADOW_FILTER_ILLUMINATED_ENCLOSED_SHAPES, LRT_SHADOW_FILTER_SHADED, LRT_SHADOW_MASK_ILLUMINATED, LRT_SHADOW_MASK_ILLUMINATED_SHAPE, LRT_SHADOW_MASK_SHADED, LRT_SHADOW_MASK_UNDEFINED, LRT_SHADOW_TEST_SHAPE_BITS, LRT_SILHOUETTE_FILTER_INDIVIDUAL, bGPDstroke::mat_nr, MAX2, max_ii(), MOD_lineart_chain_count(), mul_v3_m4v3(), Node::name, NULL, OB_MESH, usdtokens::opacity(), ID::orig_id, point, bGPDstroke::points, Mesh::totvert, Object::type, types, Mesh::vertex_group_names, and MDeformWeight::weight.
Referenced by MOD_lineart_gpencil_generate().
|
static |
Definition at line 1753 of file lineart_cpu.c.
References if(), lineart_add_loose_edge(), LooseEdgeData::me, and ME_LOOSEEDGE.
Referenced by lineart_geometry_object_load().
|
static |
Definition at line 1499 of file lineart_cpu.c.
References LineartData::_conf::allow_duplicated_types, BKE_mesh_looptri_get_real_edges(), BKE_object_material_get_eval(), LineartData::_conf::cam_is_persp, LineartData::_conf::cam_is_persp_secondary, LineartData::_conf::camera_pos, LineartData::_conf::camera_pos_secondary, LineartData::conf, EdgeFeatData::crease_threshold, dot_v3v3_db(), e, EdgeFeatData::edge_nabr, EdgeFeatReduceData::feat_edges, LineartData::_conf::filter_face_mark, LineartData::_conf::filter_face_mark_boundaries, LineartData::_conf::filter_face_mark_invert, LineartData::_conf::filter_face_mark_keep_contour, MEdge::flag, FreestyleEdge::flag, FreestyleFace::flag, LineartTriangle::flags, LineartData::_conf::force_crease, EdgeFeatData::freestyle_edge_index, FREESTYLE_EDGE_MARK, EdgeFeatData::freestyle_face_index, FREESTYLE_FACE_MARK, LineartVert::gloc, LineartTriangle::gn, if(), EdgeFeatData::ld, Material::lineart, lineart_edge_type_duplication_count(), lineart_triangle_from_index(), LRT_CULL_DISCARD, LRT_EDGE_FLAG_CONTOUR, LRT_EDGE_FLAG_CONTOUR_SECONDARY, LRT_EDGE_FLAG_CREASE, LRT_EDGE_FLAG_EDGE_MARK, LRT_EDGE_FLAG_INHIBIT, LRT_EDGE_FLAG_MATERIAL, LRT_TRIANGLE_MAT_BACK_FACE_CULLING, MaterialLineArt::mat_occlusion, EdgeFeatData::me, ME_SHARP, ME_SMOOTH, EdgeFeatData::mlooptri, EdgeFeatData::ob_eval, result, LineartData::_conf::sharp_as_crease, sub_v3_v3v3_db(), EdgeFeatData::tri_array, EdgeFeatData::use_auto_smooth, LineartData::_conf::use_back_face_culling, LineartData::_conf::use_contour, LineartData::_conf::use_contour_secondary, LineartData::_conf::use_crease, LineartData::_conf::use_edge_marks, EdgeFeatData::use_freestyle_edge, EdgeFeatData::use_freestyle_face, LineartData::_conf::use_material, EdgeFeatData::v_array, LineartData::_conf::view_vector, and LineartData::_conf::view_vector_secondary.
Referenced by lineart_geometry_object_load().
|
static |
Definition at line 3533 of file lineart_cpu.c.
References MEM_callocN.
Referenced by MOD_lineart_compute_feature_lines().
|
static |
Definition at line 3351 of file lineart_cpu.c.
References LineartIsecThread::array, LineartIsecThread::current, ListBase::first, LineartData::geom, LineartData::isect_scheduled_up_to, LineartData::isect_scheduled_up_to_index, LineartIsecThread::ld, LineartIsecThread::max, MEM_callocN, MEM_mallocN, LineartIsecThread::thread_id, and LineartData::_geom::triangle_buffer_pointers.
Referenced by lineart_main_add_triangles().
|
static |
Definition at line 2302 of file lineart_cpu.c.
References BKE_collection_has_object(), Freestyle::c, COLLECTION_LRT_USE_INTERSECTION_MASK, Object::id, LISTBASE_FOREACH, ID::orig_id, and result.
Referenced by lineart_object_load_single_instance().
|
static |
Definition at line 2320 of file lineart_cpu.c.
References BKE_collection_has_object(), Freestyle::c, COLLECTION_LRT_USE_INTERSECTION_PRIORITY, ObjectLineArt::flags, Object::id, ObjectLineArt::intersection_priority, Object::lineart, LISTBASE_FOREACH, OBJECT_LRT_OWN_INTERSECTION_PRIORITY, ID::orig_id, and result.
Referenced by lineart_object_load_single_instance().
|
static |
Definition at line 1726 of file lineart_cpu.c.
References lineart_loose_data_reallocate(), LooseEdgeData::loose_array, LooseEdgeData::loose_count, LooseEdgeData::loose_max, MEM_freeN, and NULL.
Referenced by loose_data_sum_reduce().
|
static |
Definition at line 1850 of file lineart_cpu.c.
References BKE_object_material_get_eval(), Material::blend_flag, MVert::co, copy_v3db_v3fl(), LineartTriangle::flags, MaterialLineArt::flags, LineartTriangle::gn, LineartTriangle::intersecting_verts, LineartTriangle::intersection_mask, LineartTriangle::intersection_priority, LineartObjectInfo::intersection_priority, MaterialLineArt::intersection_priority, Material::lineart, TriData::lineart_triangle_size, LRT_MATERIAL_CUSTOM_INTERSECTION_PRIORITY, LRT_MATERIAL_MASK_ENABLED, LRT_OBINDEX_LOWER, LRT_TRIANGLE_FORCE_INTERSECTION, LRT_TRIANGLE_INTERSECTION_ONLY, LRT_TRIANGLE_MAT_BACK_FACE_CULLING, LRT_TRIANGLE_NO_INTERSECTION, MA_BL_CULL_BACKFACE, MPoly::mat_nr, LineartTriangle::mat_occlusion, MaterialLineArt::mat_occlusion, LineartTriangle::material_mask_bits, MaterialLineArt::material_mask_bits, Mesh::mloop, TriData::mlooptri, Mesh::mpoly, mul_v3_mat3_m4v3_db(), Mesh::mvert, LineartObjectInfo::normal, normal_tri_v3(), normalize_v3_db(), TriData::ob_info, LineartObjectInfo::obindex, OBJECT_LRT_FORCE_INTERSECTION, OBJECT_LRT_INTERSECTION_ONLY, OBJECT_LRT_NO_INTERSECTION, OBJECT_LRT_OCCLUSION_ONLY, LineartObjectInfo::original_me, LineartObjectInfo::original_ob_eval, LineartObjectInfo::override_intersection_mask, MLoopTri::poly, LineartTriangle::target_reference, MLoopTri::tri, TriData::tri_adj, TriData::tri_arr, LineartObjectInfo::usage, LineartTriangle::v, MLoop::v, v1, v2, and TriData::vert_arr.
Referenced by lineart_geometry_object_load().
|
static |
Definition at line 1715 of file lineart_cpu.c.
References count, LooseEdgeData::loose_array, LooseEdgeData::loose_max, MEM_callocN, and MEM_freeN.
Referenced by lineart_add_loose_edge(), and lineart_join_loose_edge_arr().
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 | ( | 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 | ( | 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 | ( | 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 | ( | 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 | ( | Depsgraph * | depsgraph, |
Scene * | scene, | ||
Object * | camera, | ||
LineartData * | ld, | ||
bool | allow_duplicates, | ||
bool | do_shadow_casting, | ||
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_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 | ( | 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().
|
static |
Definition at line 4347 of file lineart_cpu.c.
References col, LineartData::conf, LineartData::_qtree::count_x, LineartData::_qtree::count_y, LineartData::_qtree::initials, lineart_main_remove_unused_lines_recursive(), LineartData::_conf::max_occlusion_level, and LineartData::qtree.
Referenced by MOD_lineart_compute_feature_lines().
|
static |
Definition at line 4301 of file lineart_cpu.c.
References LineartBoundingArea::child, e, LineartBoundingArea::line_count, LineartBoundingArea::linked_lines, LineartBoundingArea::max_line_count, MEM_callocN, and MEM_freeN.
Referenced by lineart_main_remove_unused_lines_from_tiles().
|
static |
Definition at line 693 of file lineart_cpu.c.
References LineartData::conf, LineartElementLinkNode::crease_threshold, LineartData::_conf::crease_threshold, LineartData::edge_data_pool, LineartElementLinkNode::element_count, LineartElementLinkNode::flags, LineartData::geom, LineartData::_geom::line_buffer_pointers, lineart_list_append_pointer_pool_sized(), lineart_mem_acquire(), and LRT_ELEMENT_IS_ADDITIONAL.
Referenced by lineart_main_cull_triangles().
|
static |
The following lineart_memory_get_XXX_space
functions are for allocating new memory for some modified geometries in the culling stage.
Definition at line 657 of file lineart_cpu.c.
References LineartElementLinkNode::element_count, LineartElementLinkNode::flags, LineartData::geom, lineart_list_append_pointer_pool_sized(), lineart_mem_acquire(), LRT_ELEMENT_IS_ADDITIONAL, LineartData::render_data_pool, LineartData::sizeof_triangle, and LineartData::_geom::triangle_buffer_pointers.
Referenced by lineart_main_cull_triangles().
|
static |
Definition at line 676 of file lineart_cpu.c.
References LineartElementLinkNode::element_count, LineartElementLinkNode::flags, LineartData::geom, lineart_list_append_pointer_pool_sized(), lineart_mem_acquire(), LRT_ELEMENT_IS_ADDITIONAL, LineartData::render_data_pool, and LineartData::_geom::vertex_buffer_pointers.
Referenced by lineart_main_cull_triangles().
|
static |
Definition at line 1420 of file lineart_cpu.c.
References MVert::co, copy_v3db_v3fl(), VertData::model_view, VertData::model_view_proj, mul_v3_m4v3_db(), mul_v4_m4v3_db(), VertData::mvert, v, and VertData::v_arr.
Referenced by lineart_geometry_object_load().
|
static |
Definition at line 2454 of file lineart_cpu.c.
References BKE_mesh_new_from_object(), BKE_object_get_evaluated_mesh(), LineartData::conf, copy_m4d_m4(), DEG_get_evaluated_object(), depsgraph, Mesh::edit_mesh, ELEM, LineartObjectInfo::free_use_mesh, Object::id, LineartObjectInfo::intersection_priority, invert_m4_m4(), lineart_geometry_check_visible(), lineart_geometry_load_assign_thread(), lineart_intersection_mask_check(), lineart_intersection_priority_check(), lineart_mem_acquire(), lineart_usage_check(), LRT_OBINDEX_SHIFT, Scene::master_collection, LineartObjectInfo::model_view, LineartObjectInfo::model_view_proj, mul_m4db_m4db_m4fl_uniq(), LineartObjectInfo::normal, OB_CURVES_LEGACY, OB_FONT, OB_MBALL, OB_MESH, OB_SURF, LineartObjectInfo::obindex, OBJECT_LRT_EXCLUDE, ID::orig_id, LineartObjectInfo::original_me, LineartObjectInfo::original_ob, LineartObjectInfo::original_ob_eval, LineartObjectInfo::override_intersection_mask, LineartData::render_data_pool, scene, LineartData::_conf::shift_x, LineartData::_conf::shift_y, Mesh::totpoly, transpose_m4(), Object::type, LineartObjectInfo::usage, LineartData::_conf::view, and LineartData::_conf::view_projection.
Referenced by lineart_main_load_geometries().
|
static |
Definition at line 2294 of file lineart_cpu.c.
References LineartObjectLoadTaskInfo::ld, lineart_geometry_object_load(), LineartObjectInfo::next, LineartObjectLoadTaskInfo::pending, and LineartObjectLoadTaskInfo::shadow_elns.
Referenced by lineart_main_load_geometries().
BLI_INLINE bool lineart_occlusion_is_adjacent_intersection | ( | LineartEdge * | e, |
LineartTriangle * | tri | ||
) |
To see if given line is connected to an adjacent intersection line.
Definition at line 346 of file lineart_cpu.c.
References e, LRT_LIGHT_CONTOUR_TARGET, and LineartTriangle::target_reference.
Referenced by lineart_occlusion_single_line().
|
static |
Definition at line 421 of file lineart_cpu.c.
References LineartPendingEdges::array, BLI_spin_lock(), BLI_spin_unlock(), LineartData::lock_task, LRT_THREAD_EDGE_COUNT, LineartPendingEdges::max, MIN2, LineartPendingEdges::next, LineartData::pending_edges, LineartRenderTaskInfo::pending_edges, and LineartData::scheduled_count.
Referenced by lineart_occlusion_worker().
|
static |
Definition at line 379 of file lineart_cpu.c.
References LineartData::_conf::allow_overlapping_edges, LineartTriangleThread::base, LineartData::_conf::cam_is_persp, LineartData::_conf::camera_pos, LineartData::conf, e, LineartTriangle::flags, if(), l, lineart_edge_cut(), lineart_occlusion_is_adjacent_intersection(), lineart_triangle_edge_image_space_occlusion(), LRT_EDGE_BA_MARCHING_BEGIN, LRT_EDGE_BA_MARCHING_END, LRT_EDGE_BA_MARCHING_NEXT, LRT_TRIANGLE_INTERSECTION_ONLY, LineartTriangle::mat_occlusion, LineartTriangle::material_mask_bits, LineartData::_conf::max_occlusion_level, r, LineartData::_conf::shift_x, LineartData::_conf::shift_y, LineartTriangleThread::testing_e, blender::threading::enumerable_thread_specific_utils::thread_id, LineartData::_conf::view_projection, and LineartData::_conf::view_vector.
Referenced by lineart_occlusion_worker().
|
static |
Definition at line 446 of file lineart_cpu.c.
References LineartPendingEdges::array, LineartRenderTaskInfo::ld, lineart_occlusion_make_task_info(), lineart_occlusion_single_line(), LineartPendingEdges::max, LineartRenderTaskInfo::pending_edges, and LineartRenderTaskInfo::thread_id.
Referenced by lineart_main_occlusion_begin().
|
static |
Test if v lies with in the triangle formed by v0, v1, and v2. Returns false when v is exactly on the edge.
For v to be inside the triangle, it needs to be at the same side of v0->v1, v1->v2, and v2->v0
, where the "side" is determined by checking the sign of cross(v1-v0, v1-v)
and so on.
Definition at line 491 of file lineart_cpu.c.
References Freestyle::c, v, v1, and v2.
Referenced by lineart_bounding_area_triangle_intersect().
|
static |
Similar with lineart_point_inside_triangle, but in 3d. Returns false when not co-planar.
Definition at line 616 of file lineart_cpu.c.
References cross_v3_v3v3_db(), dot_v3v3_db(), l, r, sub_v3_v3v3_db(), v, v1, and v2.
Referenced by lineart_triangle_2v_intersection_math().
Definition at line 522 of file lineart_cpu.c.
References DBL_TRIANGLE_LIM, LRT_DOUBLE_CLOSE_ENOUGH, ratiod(), sub_v2_v2v2_db(), v, and v1.
Referenced by lineart_point_triangle_relation().
|
static |
Same algorithm as lineart_point_inside_triangle(), but returns differently: 0-outside 1-on the edge 2-inside.
Definition at line 574 of file lineart_cpu.c.
References Freestyle::c, lineart_point_on_line_segment(), LRT_INSIDE_TRIANGLE, LRT_ON_TRIANGLE, LRT_OUTSIDE_TRIANGLE, r, v, v1, and v2.
Referenced by lineart_triangle_edge_image_space_occlusion().
|
static |
Definition at line 3308 of file lineart_cpu.c.
References BLI_spin_lock(), BLI_spin_unlock(), LineartElementLinkNode::element_count, LineartData::geom, LineartIsecThread::index_from, LineartIsecThread::index_to, LineartData::isect_scheduled_up_to, LineartData::isect_scheduled_up_to_index, ListBase::last, LineartIsecThread::ld, LineartData::lock_task, LRT_ISECT_TRIANGLE_PER_THREAD, MIN2, LineartElementLinkNode::next, LineartIsecThread::pending_from, LineartIsecThread::pending_to, and LineartData::_geom::triangle_buffer_pointers.
Referenced by lineart_add_triangles_worker().
|
static |
Definition at line 3167 of file lineart_cpu.c.
References copy_v3_v3_db(), dot_v3v3_db(), fabs(), LineartVert::gloc, LineartTriangle::gn, interp_v3_v3v3_db(), lineart_point_inside_triangle3d(), LRT_DOUBLE_CLOSE_ENOUGH, sub_v3_v3v3_db(), LineartTriangle::v, v1, and v2.
Referenced by lineart_triangle_intersect_math().
|
static |
Definition at line 1826 of file lineart_cpu.c.
References e, LineartTriangleAdjacent::e, and lineart_edge_match().
Referenced by lineart_geometry_object_load().
|
static |
Does near-plane cut on 1 triangle only. When cutting with far-plane, the camera vectors gets reversed by the caller so don't need to implement one in a different direction.
(!in0) means "when point 0 is visible". conditions for point 1, 2 are the same idea.
(in0) means "when point 0 is invisible". conditions for point 1, 2 are the same idea.
Definition at line 748 of file lineart_cpu.c.
References Freestyle::a, dot_v3v3_db(), e, LineartTriangle::flags, LineartVert::gloc, INCREASE_EDGE, LineartVert::index, interp_v3_v3v3_db(), LineartTriangle::intersecting_verts, lineart_add_edge_to_array(), lineart_triangle_post(), lineart_triangle_set_cull_flag(), LRT_CULL_DISCARD, LRT_CULL_GENERATED, LRT_CULL_USED, LRT_EDGE_FLAG_CONTOUR, mul_v4_m4v3_db(), LineartData::pending_edges, LineartElementLinkNode::pointer, RELINK_EDGE, REMOVE_TRIANGLE_EDGE, SELECT_EDGE, LineartData::sizeof_triangle, sub_v3_v3v3_db(), and LineartTriangle::v.
Referenced by lineart_main_cull_triangles().
|
static |
This is the main function to calculate the occlusion status between 1(one) triangle and 1(one) line. if returns true, then from/to will carry the occluded segments in ratio from e->v1
to e->v2
. The line is later cut with these two values.
TODO(@Yiming): This function uses a convoluted method that needs to be redesigned.
1) The lineart_intersect_seg_seg() and lineart_point_triangle_relation() are separate calls, which would potentially return results that doesn't agree, especially when it's an edge extruding from one of the triangle's point. To get the information using one math process can solve this problem.
2) Currently using discrete a/b/c/para_e1/para_e2/para_e3/is[3] values for storing intersection/edge_aligned/intersection_order info, which isn't optimal, needs a better representation (likely a struct) for readability and clarity of code path.
I keep this function as-is because it's still fast, and more importantly the output value threshold is already in tune with the cutting function in the next stage. While current "edge aligned" fix isn't ideal, it does solve most of the precision issue especially in orthographic camera mode.
Definition at line 2800 of file lineart_cpu.c.
References copy_v3_v3_db(), DBL_TRIANGLE_LIM, dot_v3v3_db(), e, fabs(), LineartVert::fbcoord, from, LineartVert::gloc, LineartTriangle::gn, interp_v3_v3v3_db(), INTERSECT_JUST_GREATER, INTERSECT_JUST_SMALLER, INTERSECT_SORT_MIN_TO_MAX_3, lineart_edge_from_triangle(), lineart_intersect_seg_seg(), lineart_point_triangle_relation(), LRT_EDGE_FLAG_PROJECTED_SHADOW, LRT_EDGE_FLAG_SHADOW_FACING_LIGHT, LRT_GUARD_NOT_FOUND, LRT_INSIDE_TRIANGLE, LRT_ISEC, LRT_ON_TRIANGLE, LRT_OUTSIDE_TRIANGLE, LRT_PARALLEL, MAX2, MAX3, MIN2, MIN3, mul_v3db_db(), mul_v4_m4v3_db(), ratiod(), sub_v3_v3v3_db(), LineartTriangle::target_reference, and LineartTriangle::v.
Referenced by lineart_occlusion_single_line().
|
static |
Because we have a variable size for LineartTriangle, we need an access helper. See LineartTriangleThread for more info.
Definition at line 1461 of file lineart_cpu.c.
References usdtokens::b(), and LineartData::sizeof_triangle.
Referenced by lineart_geometry_object_load(), and lineart_identify_mlooptri_feature_edges().
|
static |
Returns the two other verts of the triangle given a vertex. Returns false if the given vertex doesn't belong to this triangle.
Definition at line 2685 of file lineart_cpu.c.
References l, r, and LineartTriangle::v.
Referenced by lineart_triangle_intersect_math().
|
static |
Definition at line 3379 of file lineart_cpu.c.
References BLI_assert, LineartTriangle::flags, LineartVert::gloc, lineart_add_isec_thread(), lineart_triangle_intersect_math(), lineart_triangle_share_edge(), LineartBoundingArea::linked_triangles, LRT_TRIANGLE_FORCE_INTERSECTION, LRT_TRIANGLE_INTERSECTION_ONLY, LRT_TRIANGLE_NO_INTERSECTION, MAX3, MIN3, NULL, LineartTriangleThread::testing_e, LineartIsecThread::thread_id, and LineartTriangle::v.
Referenced by lineart_bounding_area_link_triangle().
|
static |
Definition at line 3207 of file lineart_cpu.c.
References copy_v3_v3_db(), LineartVert::gloc, lineart_triangle_2v_intersection_math(), lineart_triangle_get_other_verts(), lineart_triangle_share_point(), next, NULL, LineartTriangle::v, v1, and v2.
Referenced by lineart_triangle_intersect_in_bounding_area().
|
static |
Definition at line 710 of file lineart_cpu.c.
References copy_v3_v3_db(), LineartTriangle::flags, LineartTriangle::gn, LineartTriangle::intersection_mask, LineartTriangle::intersection_priority, LRT_CULL_GENERATED, LineartTriangle::mat_occlusion, LineartTriangle::material_mask_bits, and LineartTriangle::target_reference.
Referenced by lineart_triangle_cull_single().
|
static |
Definition at line 722 of file lineart_cpu.c.
References LineartTriangle::flags, and LRT_TRIANGLE_INTERSECTION_ONLY.
Referenced by lineart_triangle_cull_single().
|
static |
At this stage of the computation we don't have triangle adjacent info anymore, so we can only compare the global vert index.
Definition at line 3091 of file lineart_cpu.c.
References l, r, and BMLoop::v.
Referenced by lineart_triangle_intersect_in_bounding_area().
|
static |
Definition at line 3134 of file lineart_cpu.c.
References l, NULL, r, and BMLoop::v.
Referenced by lineart_triangle_intersect_math().
|
static |
Definition at line 3691 of file lineart_cpu.c.
References LineartData::thread_count.
Referenced by MOD_lineart_compute_feature_lines().
|
static |
See if this object in such collection is used for generating line art, Disabling a collection for line art will doable all objects inside.
Definition at line 2344 of file lineart_cpu.c.
References BKE_collection_has_object(), Freestyle::c, COLLECTION_HIDE_RENDER, COLLECTION_HIDE_VIEWPORT, COLLECTION_LRT_EXCLUDE, COLLECTION_LRT_FORCE_INTERSECTION, COLLECTION_LRT_INTERSECTION_ONLY, COLLECTION_LRT_NO_INTERSECTION, COLLECTION_LRT_OCCLUSION_ONLY, Object::id, Object::lineart, LISTBASE_FOREACH, OBJECT_LRT_EXCLUDE, OBJECT_LRT_FORCE_INTERSECTION, OBJECT_LRT_INHERIT, OBJECT_LRT_INTERSECTION_ONLY, OBJECT_LRT_NO_INTERSECTION, OBJECT_LRT_OCCLUSION_ONLY, ID::orig_id, result, and ObjectLineArt::usage.
Referenced by lineart_object_load_single_instance().
|
static |
Definition at line 1765 of file lineart_cpu.c.
References lineart_join_loose_edge_arr().
Referenced by lineart_geometry_object_load().
void MOD_lineart_clear_cache | ( | struct LineartCache ** | lc | ) |
Definition at line 3539 of file lineart_cpu.c.
References lineart_mem_destroy(), MEM_freeN, and NULL.
Referenced by bake_strokes(), bakeModifier(), BKE_gpencil_modifiers_calc(), generateStrokes(), and lineart_gpencil_bake_single_target().
bool MOD_lineart_compute_feature_lines | ( | Depsgraph * | depsgraph, |
LineartGpencilModifierData * | lmd, | ||
LineartCache ** | cached_result, | ||
bool | enable_stroke_depth_offset | ||
) |
This is the entry point of all line art calculations.
Definition at line 4957 of file lineart_cpu.c.
References LineartData::_conf::angle_splitting_threshold, BKE_scene_camera_switch_update(), LineartGpencilModifierData::calculation_flags, Scene::camera, LineartData::_conf::chain_smooth_tolerance, LineartData::chains, LineartCache::chains, LineartData::conf, DEG_get_evaluated_object(), DEG_get_evaluated_scene(), depsgraph, ListBase::first, LineartGpencilModifierData::flags, G, LineartData::geom, lineart_count_and_print_render_buffer_memory(), lineart_create_render_buffer(), lineart_destroy_render_data_keep_init(), lineart_init_cache(), 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_make_enclosed_shapes(), lineart_main_occlusion_begin(), lineart_main_perspective_division(), lineart_main_remove_unused_lines_from_tiles(), lineart_main_transform_and_add_shadow(), lineart_main_try_generate_shadow(), lineart_mem_destroy(), lineart_register_intersection_shadow_cuts(), lineart_triangle_size_get(), LRT_ALLOW_DUPLI_OBJECTS, LRT_GPENCIL_OFFSET_TOWARDS_CUSTOM_CAMERA, LRT_USE_CUSTOM_CAMERA, MEM_freeN, MOD_lineart_chain_clear_picked_flag(), MOD_lineart_chain_clip_at_border(), MOD_lineart_chain_connect(), MOD_lineart_chain_feature_lines(), MOD_lineart_chain_find_silhouette_backdrop_objects(), MOD_lineart_chain_offset_towards_camera(), MOD_lineart_chain_split_angle(), MOD_lineart_chain_split_for_fixed_occlusion(), MOD_lineart_finalize_chains(), MOD_lineart_smooth_chains(), NULL, OB_CAMERA, PIL_check_seconds_timer(), scene, LineartCache::shadow_data_pool, LineartCache::shadow_elns, LineartData::_conf::shadow_enclose_shapes, LineartData::_conf::shadow_selection, LineartData::_conf::shadow_use_silhouette, LineartData::sizeof_triangle, LineartGpencilModifierData::source_camera, LineartGpencilModifierData::stroke_depth_offset, Object::type, LineartData::_conf::use_image_boundary_trimming, and LineartData::_geom::vertex_buffer_pointers.
Referenced by bake_strokes(), bakeModifier(), and generateStrokes().
void MOD_lineart_destroy_render_data | ( | LineartGpencilModifierData * | lmd | ) |
Definition at line 3517 of file lineart_cpu.c.
References G, LineartGpencilModifierData::la_data_ptr, lineart_destroy_render_data(), MEM_freeN, and NULL.
Referenced by bake_strokes(), bakeModifier(), and generateStrokes().
LineartBoundingArea* MOD_lineart_get_bounding_area | ( | LineartData * | ld, |
double | x, | ||
double | y | ||
) |
Wrapper for more convenience.
Definition at line 4511 of file lineart_cpu.c.
References lineart_get_bounding_area(), MOD_lineart_get_parent_bounding_area(), NULL, x, and y.
Referenced by MOD_lineart_chain_feature_lines().
LineartBoundingArea* MOD_lineart_get_parent_bounding_area | ( | LineartData * | ld, |
double | x, | ||
double | y | ||
) |
This only gets initial "biggest" tile.
Definition at line 4442 of file lineart_cpu.c.
References col, LineartData::_qtree::count_x, LineartData::_qtree::count_y, LineartData::_qtree::initials, LineartData::qtree, LineartData::_qtree::tile_height, LineartData::_qtree::tile_width, x, and y.
Referenced by lineart_bounding_area_get_end_point(), lineart_bounding_area_link_chain(), and MOD_lineart_get_bounding_area().
void MOD_lineart_gpencil_generate | ( | LineartCache * | cache, |
struct Depsgraph * | depsgraph, | ||
struct Object * | ob, | ||
struct bGPDlayer * | gpl, | ||
struct bGPDframe * | gpf, | ||
int8_t | source_type, | ||
void * | source_reference, | ||
int | level_start, | ||
int | level_end, | ||
int | mat_nr, | ||
int16_t | edge_types, | ||
uint8_t | mask_switches, | ||
uint8_t | material_mask_bits, | ||
uint8_t | intersection_mask, | ||
int16_t | thickness, | ||
float | opacity, | ||
uint8_t | shadow_selection, | ||
uint8_t | silhouette_mode, | ||
const char * | source_vgname, | ||
const char * | vgname, | ||
int | modifier_flags, | ||
int | modifier_calculation_flags | ||
) |
Wrapper for external calls.
Definition at line 5368 of file lineart_cpu.c.
References depsgraph, invert_m4_m4(), lineart_gpencil_generate(), LRT_SOURCE_COLLECTION, LRT_SOURCE_OBJECT, NULL, Object::obmat, and usdtokens::opacity().
Referenced by bake_strokes(), and generate_strokes_actual().
|
static |
Definition at line 1434 of file lineart_cpu.c.
Referenced by lineart_edge_type_duplication_count(), and lineart_geometry_object_load().