Blender  V3.3
Classes | Macros | Typedefs | Enumerations | Functions | Variables
lineart_cpu.c File Reference
#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 }
 

Functions

static void lineart_bounding_area_link_edge (LineartData *ld, LineartBoundingArea *root_ba, LineartEdge *e)
 
static bool lineart_get_edge_bounding_areas (LineartData *ld, LineartEdge *e, int *rowbegin, int *rowend, int *colbegin, int *colend)
 
static bool lineart_triangle_edge_image_space_occlusion (const LineartTriangle *tri, const LineartEdge *e, const double *override_camera_loc, const bool override_cam_is_persp, const bool allow_overlapping_edges, const double m_view_projection[4][4], const double camera_dir[3], const float cam_shift_x, const float cam_shift_y, double *from, double *to)
 
static void lineart_bounding_area_link_triangle (LineartData *ld, LineartBoundingArea *root_ba, LineartTriangle *tri, double l_r_u_b[4], int recursive, int recursive_level, bool do_intersection, struct LineartIsecThread *th)
 
static void lineart_free_bounding_area_memory (LineartBoundingArea *ba, bool recursive)
 
static void lineart_free_bounding_area_memories (LineartData *ld)
 
static LineartCachelineart_init_cache (void)
 
static void lineart_discard_segment (LineartData *ld, LineartEdgeSegment *es)
 
static LineartEdgeSegmentlineart_give_segment (LineartData *ld)
 
void lineart_edge_cut (LineartData *ld, LineartEdge *e, double start, double end, uchar material_mask_bits, uchar mat_occlusion, uint32_t shadow_bits)
 
BLI_INLINE bool lineart_occlusion_is_adjacent_intersection (LineartEdge *e, LineartTriangle *tri)
 
static void lineart_bounding_area_triangle_reallocate (LineartBoundingArea *ba)
 
static void lineart_bounding_area_line_add (LineartBoundingArea *ba, LineartEdge *e)
 
static void lineart_occlusion_single_line (LineartData *ld, LineartEdge *e, int thread_id)
 
static int lineart_occlusion_make_task_info (LineartData *ld, LineartRenderTaskInfo *rti)
 
static void lineart_occlusion_worker (TaskPool *__restrict UNUSED(pool), LineartRenderTaskInfo *rti)
 
void lineart_main_occlusion_begin (LineartData *ld)
 
static bool lineart_point_inside_triangle (const double v[2], const double v0[2], const double v1[2], const double v2[2])
 
static int lineart_point_on_line_segment (double v[2], double v0[2], double v1[2])
 
static int lineart_point_triangle_relation (double v[2], double v0[2], double v1[2], double v2[2])
 
static bool lineart_point_inside_triangle3d (double v[3], double v0[3], double v1[3], double v2[3])
 
static LineartElementLinkNodelineart_memory_get_triangle_space (LineartData *ld)
 
static LineartElementLinkNodelineart_memory_get_vert_space (LineartData *ld)
 
static LineartElementLinkNodelineart_memory_get_edge_space (LineartData *ld)
 
static void lineart_triangle_post (LineartTriangle *tri, LineartTriangle *orig)
 
static void lineart_triangle_set_cull_flag (LineartTriangle *tri, uchar flag)
 
static bool lineart_edge_match (LineartTriangle *tri, LineartEdge *e, int v1, int v2)
 
static void lineart_discard_duplicated_edges (LineartEdge *old_e)
 
static void lineart_triangle_cull_single (LineartData *ld, LineartTriangle *tri, int in0, int in1, int in2, double cam_pos[3], double view_dir[3], bool allow_boundaries, double m_view_projection[4][4], Object *ob, int *r_v_count, int *r_e_count, int *r_t_count, LineartElementLinkNode *v_eln, LineartElementLinkNode *e_eln, LineartElementLinkNode *t_eln)
 
void lineart_main_cull_triangles (LineartData *ld, bool clip_far)
 
void lineart_main_free_adjacent_data (LineartData *ld)
 
void lineart_main_perspective_division (LineartData *ld)
 
void lineart_main_discard_out_of_frame_edges (LineartData *ld)
 
static void lineart_mvert_transform_task (void *__restrict userdata, const int i, const TaskParallelTLS *__restrict UNUSED(tls))
 
static int lineart_edge_type_duplication_count (int eflag)
 
static LineartTrianglelineart_triangle_from_index (LineartData *ld, LineartTriangle *rt_array, int index)
 
static void feat_data_sum_reduce (const void *__restrict UNUSED(userdata), void *__restrict chunk_join, void *__restrict chunk)
 
static void lineart_identify_mlooptri_feature_edges (void *__restrict userdata, const int i, const TaskParallelTLS *__restrict tls)
 
static void lineart_loose_data_reallocate (LooseEdgeData *loose_data, int count)
 
static void lineart_join_loose_edge_arr (LooseEdgeData *loose_data, LooseEdgeData *to_be_joined)
 
static void lineart_add_loose_edge (LooseEdgeData *loose_data, MEdge *e)
 
static void lineart_identify_loose_edges (void *__restrict UNUSED(userdata), const int i, const TaskParallelTLS *__restrict tls)
 
static void loose_data_sum_reduce (const void *__restrict UNUSED(userdata), void *__restrict chunk_join, void *__restrict chunk)
 
void lineart_add_edge_to_array (LineartPendingEdges *pe, LineartEdge *e)
 
static void lineart_add_edge_to_array_thread (LineartObjectInfo *obi, LineartEdge *e)
 
void lineart_finalize_object_edge_array_reserve (LineartPendingEdges *pe, int count)
 
static void lineart_finalize_object_edge_array (LineartPendingEdges *pe, LineartObjectInfo *obi)
 
static void lineart_triangle_adjacent_assign (LineartTriangle *tri, LineartTriangleAdjacent *tri_adj, LineartEdge *e)
 
static void lineart_load_tri_task (void *__restrict userdata, const int i, const TaskParallelTLS *__restrict UNUSED(tls))
 
static void lineart_edge_neighbor_init_task (void *__restrict userdata, const int i, const TaskParallelTLS *__restrict UNUSED(tls))
 
static LineartEdgeNeighborlineart_build_edge_neighbor (Mesh *me, int total_edges)
 
static void lineart_geometry_object_load (LineartObjectInfo *ob_info, LineartData *la_data, ListBase *shadow_elns)
 
static void lineart_object_load_worker (TaskPool *__restrict UNUSED(pool), LineartObjectLoadTaskInfo *olti)
 
static uchar lineart_intersection_mask_check (Collection *c, Object *ob)
 
static uchar lineart_intersection_priority_check (Collection *c, Object *ob)
 
static int lineart_usage_check (Collection *c, Object *ob, bool is_render)
 
static void lineart_geometry_load_assign_thread (LineartObjectLoadTaskInfo *olti_list, LineartObjectInfo *obi, int thread_count, int this_face_count)
 
static bool lineart_geometry_check_visible (double model_view_proj[4][4], double shift_x, double shift_y, Mesh *use_mesh)
 
static void lineart_object_load_single_instance (LineartData *ld, Depsgraph *depsgraph, Scene *scene, Object *ob, Object *ref_ob, float use_mat[4][4], bool is_render, LineartObjectLoadTaskInfo *olti, int thread_count, int obindex)
 
void lineart_main_load_geometries (Depsgraph *depsgraph, Scene *scene, Object *camera, LineartData *ld, bool allow_duplicates, bool do_shadow_casting, ListBase *shadow_elns)
 
static bool lineart_triangle_get_other_verts (const LineartTriangle *tri, const LineartVert *vt, LineartVert **l, LineartVert **r)
 
bool lineart_edge_from_triangle (const LineartTriangle *tri, const LineartEdge *e, bool allow_overlapping_edges)
 
static bool lineart_triangle_share_edge (const LineartTriangle *l, const LineartTriangle *r)
 
static LineartVertlineart_triangle_share_point (const LineartTriangle *l, const LineartTriangle *r)
 
static bool lineart_triangle_2v_intersection_math (LineartVert *v1, LineartVert *v2, LineartTriangle *tri, const double *last, double *rv)
 
static bool lineart_triangle_intersect_math (LineartTriangle *tri, LineartTriangle *t2, double *v1, double *v2)
 
static void lineart_add_isec_thread (LineartIsecThread *th, const double *v1, const double *v2, LineartTriangle *tri1, LineartTriangle *tri2)
 
static bool lineart_schedule_new_triangle_task (LineartIsecThread *th)
 
static void lineart_init_isec_thread (LineartIsecData *d, LineartData *ld, int thread_count)
 
static void lineart_destroy_isec_thread (LineartIsecData *d)
 
static void lineart_triangle_intersect_in_bounding_area (LineartTriangle *tri, LineartBoundingArea *ba, LineartIsecThread *th, int up_to)
 
void lineart_main_get_view_vector (LineartData *ld)
 
static void lineart_end_bounding_area_recursive (LineartBoundingArea *ba)
 
void lineart_destroy_render_data_keep_init (LineartData *ld)
 
static void lineart_destroy_render_data (LineartData *ld)
 
void MOD_lineart_destroy_render_data (LineartGpencilModifierData *lmd)
 
void MOD_lineart_clear_cache (struct LineartCache **lc)
 
static LineartDatalineart_create_render_buffer (Scene *scene, LineartGpencilModifierData *lmd, Object *camera, Object *active_camera, LineartCache *lc)
 
static int lineart_triangle_size_get (LineartData *ld)
 
void lineart_main_bounding_area_make_initial (LineartData *ld)
 
static void lineart_bounding_areas_connect_new (LineartData *ld, LineartBoundingArea *root)
 
static void lineart_bounding_areas_connect_recursive (LineartData *ld, LineartBoundingArea *root)
 
void lineart_main_bounding_areas_connect_post (LineartData *ld)
 
static void lineart_bounding_area_split (LineartData *ld, LineartBoundingArea *root, int recursive_level)
 
static bool lineart_bounding_area_edge_intersect (LineartData *UNUSED(fb), const double l[2], const double r[2], LineartBoundingArea *ba)
 
static bool lineart_bounding_area_triangle_intersect (LineartData *fb, LineartTriangle *tri, LineartBoundingArea *ba, bool *r_triangle_vert_inside)
 
static void lineart_clear_linked_edges_recursive (LineartData *ld, LineartBoundingArea *root_ba)
 
void lineart_main_clear_linked_edges (LineartData *ld)
 
void lineart_main_link_lines (LineartData *ld)
 
static void lineart_main_remove_unused_lines_recursive (LineartBoundingArea *ba, uint8_t max_occlusion)
 
static void lineart_main_remove_unused_lines_from_tiles (LineartData *ld)
 
static bool lineart_get_triangle_bounding_areas (LineartData *ld, LineartTriangle *tri, int *rowbegin, int *rowend, int *colbegin, int *colend)
 
LineartBoundingAreaMOD_lineart_get_parent_bounding_area (LineartData *ld, double x, double y)
 
static LineartBoundingArealineart_get_bounding_area (LineartData *ld, double x, double y)
 
LineartBoundingAreaMOD_lineart_get_bounding_area (LineartData *ld, double x, double y)
 
static void lineart_add_triangles_worker (TaskPool *__restrict UNUSED(pool), LineartIsecThread *th)
 
static void lineart_create_edges_from_isec_data (LineartIsecData *d)
 
void lineart_main_add_triangles (LineartData *ld)
 
LineartBoundingArealineart_edge_first_bounding_area (LineartData *ld, double *fbcoord1, double *fbcoord2)
 
LineartBoundingArealineart_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)
 
bool MOD_lineart_compute_feature_lines (Depsgraph *depsgraph, LineartGpencilModifierData *lmd, LineartCache **cached_result, bool enable_stroke_depth_offset)
 
static void lineart_gpencil_generate (LineartCache *cache, Depsgraph *depsgraph, Object *gpencil_object, float(*gp_obmat_inverse)[4], bGPDlayer *UNUSED(gpl), bGPDframe *gpf, int level_start, int level_end, int material_nr, Object *source_object, Collection *source_collection, int types, uchar mask_switches, uchar material_mask_bits, uchar intersection_mask, int16_t thickness, float opacity, uchar shaodow_selection, uchar silhouette_mode, const char *source_vgname, const char *vgname, int modifier_flags, int modifier_calculation_flags)
 
void MOD_lineart_gpencil_generate (LineartCache *cache, Depsgraph *depsgraph, Object *ob, bGPDlayer *gpl, bGPDframe *gpf, int8_t source_type, void *source_reference, int level_start, int level_end, int mat_nr, int16_t edge_types, uchar mask_switches, uchar material_mask_bits, uchar intersection_mask, int16_t thickness, float opacity, uchar shadow_selection, uchar silhouette_mode, const char *source_vgname, const char *vgname, int modifier_flags, int modifier_calculation_flags)
 

Variables

static const int LRT_MESH_EDGE_TYPES []
 

Macro Definition Documentation

◆ INCREASE_EDGE

#define INCREASE_EDGE
Value:
new_e = &((LineartEdge *)e_eln->pointer)[e_count]; \
e_count++; \
e = new_e; \
es = lineart_mem_acquire(&ld->render_data_pool, sizeof(LineartEdgeSegment)); \
BLI_addtail(&e->segments, es);
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
void * lineart_mem_acquire(struct LineartStaticMemPool *smp, size_t size)
Definition: lineart_util.c:104

◆ INTERSECT_JUST_GREATER

#define INTERSECT_JUST_GREATER (   is,
  order,
  num,
  index 
)
Value:
{ \
index = (num < is[order[0]] ? \
order[0] : \
(num < is[order[1]] ? order[1] : (num < is[order[2]] ? order[2] : -1))); \
}
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint order

Definition at line 2760 of file lineart_cpu.c.

◆ INTERSECT_JUST_SMALLER

#define INTERSECT_JUST_SMALLER (   is,
  order,
  num,
  index 
)
Value:
{ \
index = (num > is[order[2]] ? \
order[2] : \
(num > is[order[1]] ? order[1] : (num > is[order[0]] ? order[0] : -1))); \
}

Definition at line 2768 of file lineart_cpu.c.

◆ INTERSECT_SORT_MIN_TO_MAX_3

#define INTERSECT_SORT_MIN_TO_MAX_3 (   ia,
  ib,
  ic,
  lst 
)
Value:
{ \
lst[0] = LRT_MIN3_INDEX(ia, ib, ic); \
lst[1] = (((ia <= ib && ib <= ic) || (ic <= ib && ib <= ia)) ? \
1 : \
(((ic <= ia && ia <= ib) || (ib < ia && ia <= ic)) ? 0 : 2)); \
lst[2] = LRT_MAX3_INDEX(ia, ib, ic); \
}
#define LRT_MIN3_INDEX(a, b, c)
Definition: MOD_lineart.h:580
#define LRT_MAX3_INDEX(a, b, c)
Definition: MOD_lineart.h:578

Definition at line 2750 of file lineart_cpu.c.

◆ LRT_CULL_DECIDE_INSIDE

#define LRT_CULL_DECIDE_INSIDE
Value:
/* These three represents points that are in the clipping range or not. */ \
in0 = 0, in1 = 0, in2 = 0; \
if (clip_far) { \
/* Point outside far plane. */ \
if (tri->v[0]->fbcoord[use_w] > clip_end) { \
in0 = 1; \
} \
if (tri->v[1]->fbcoord[use_w] > clip_end) { \
in1 = 1; \
} \
if (tri->v[2]->fbcoord[use_w] > clip_end) { \
in2 = 1; \
} \
} \
else { \
/* Point inside near plane. */ \
if (tri->v[0]->fbcoord[use_w] < clip_start) { \
in0 = 1; \
} \
if (tri->v[1]->fbcoord[use_w] < clip_start) { \
in1 = 1; \
} \
if (tri->v[2]->fbcoord[use_w] < clip_start) { \
in2 = 1; \
} \
}

◆ LRT_CULL_ENSURE_MEMORY

#define LRT_CULL_ENSURE_MEMORY
Value:
if (v_count > 60) { \
v_eln->element_count = v_count; \
v_count = 0; \
} \
if (t_count > 60) { \
t_eln->element_count = t_count; \
t_count = 0; \
} \
if (e_count > 60) { \
e_eln->element_count = e_count; \
e_count = 0; \
}
static LineartElementLinkNode * lineart_memory_get_vert_space(LineartData *ld)
Definition: lineart_cpu.c:676
static LineartElementLinkNode * lineart_memory_get_triangle_space(LineartData *ld)
Definition: lineart_cpu.c:657
static LineartElementLinkNode * lineart_memory_get_edge_space(LineartData *ld)
Definition: lineart_cpu.c:693

◆ LRT_GUARD_NOT_FOUND

#define LRT_GUARD_NOT_FOUND
Value:
if (cross_v1 < 0 || cross_v2 < 0) { \
return false; \
}

◆ LRT_ISEC

#define LRT_ISEC (   index)    (index == 0 ? isec_e1 : (index == 1 ? isec_e2 : isec_e3))

Definition at line 2775 of file lineart_cpu.c.

◆ LRT_ISECT_TRIANGLE_PER_THREAD

#define LRT_ISECT_TRIANGLE_PER_THREAD   4096

Definition at line 3306 of file lineart_cpu.c.

◆ LRT_MESH_EDGE_TYPES_COUNT

#define LRT_MESH_EDGE_TYPES_COUNT   6

Definition at line 1443 of file lineart_cpu.c.

◆ LRT_PARALLEL

#define LRT_PARALLEL (   index)    (index == 0 ? para_e1 : (index == 1 ? para_e2 : para_e3))

Definition at line 2776 of file lineart_cpu.c.

◆ LRT_TRI_SAME_POINT

#define LRT_TRI_SAME_POINT (   tri,
  i,
  pt 
)
Value:
((LRT_DOUBLE_CLOSE_ENOUGH(tri->v[i]->gloc[0], pt->gloc[0]) && \
LRT_DOUBLE_CLOSE_ENOUGH(tri->v[i]->gloc[1], pt->gloc[1]) && \
LRT_DOUBLE_CLOSE_ENOUGH(tri->v[i]->gloc[2], pt->gloc[2])) || \
(LRT_DOUBLE_CLOSE_ENOUGH(tri->v[i]->gloc[0], pt->gloc[0]) && \
LRT_DOUBLE_CLOSE_ENOUGH(tri->v[i]->gloc[1], pt->gloc[1]) && \
LRT_DOUBLE_CLOSE_ENOUGH(tri->v[i]->gloc[2], pt->gloc[2])))
#define LRT_DOUBLE_CLOSE_ENOUGH(a, b)
Definition: MOD_lineart.h:588

◆ LRT_VERT_OUT_OF_BOUND

#define LRT_VERT_OUT_OF_BOUND (   v)     (v && (v->fbcoord[0] < -1 || v->fbcoord[0] > 1 || v->fbcoord[1] < -1 || v->fbcoord[1] > 1))

◆ RELINK_EDGE

#define RELINK_EDGE (   e_num,
  new_tri 
)
Value:
if (tri_adj->e[e_num]) { \
old_e = tri_adj->e[e_num]; \
old_e->t1 = ((old_e->t1 == tri) ? (new_tri) : (old_e->t1)); \
old_e->t2 = ((old_e->t2 == tri) ? (new_tri) : (old_e->t2)); \
}

◆ REMOVE_TRIANGLE_EDGE

#define REMOVE_TRIANGLE_EDGE
Value:
if (tri_adj->e[0]) { \
tri_adj->e[0]->flags = LRT_EDGE_FLAG_CHAIN_PICKED; \
lineart_discard_duplicated_edges(tri_adj->e[0]); \
} \
if (tri_adj->e[1]) { \
tri_adj->e[1]->flags = LRT_EDGE_FLAG_CHAIN_PICKED; \
lineart_discard_duplicated_edges(tri_adj->e[1]); \
} \
if (tri_adj->e[2]) { \
tri_adj->e[2]->flags = LRT_EDGE_FLAG_CHAIN_PICKED; \
lineart_discard_duplicated_edges(tri_adj->e[2]); \
}
@ LRT_EDGE_FLAG_CHAIN_PICKED

◆ SELECT_EDGE

#define SELECT_EDGE (   e_num,
  v1_link,
  v2_link,
  new_tri 
)
Value:
if (tri_adj->e[e_num]) { \
old_e = tri_adj->e[e_num]; \
new_flag = old_e->flags; \
old_e->flags = LRT_EDGE_FLAG_CHAIN_PICKED; \
lineart_discard_duplicated_edges(old_e); \
INCREASE_EDGE \
e->v1 = (v1_link); \
e->v2 = (v2_link); \
e->v1->index = (v1_link)->index; \
e->v2->index = (v1_link)->index; \
e->flags = new_flag; \
e->object_ref = ob; \
e->t1 = ((old_e->t1 == tri) ? (new_tri) : (old_e->t1)); \
e->t2 = ((old_e->t2 == tri) ? (new_tri) : (old_e->t2)); \
lineart_add_edge_to_array(&ld->pending_edges, e); \
}

Typedef Documentation

◆ EdgeFeatData

typedef struct EdgeFeatData EdgeFeatData

◆ EdgeFeatReduceData

◆ EdgeNeighborData

◆ LineartEdgeNeighbor

◆ LineartIsecData

◆ LineartIsecSingle

◆ LineartIsecThread

◆ LooseEdgeData

typedef struct LooseEdgeData LooseEdgeData

◆ TriData

typedef struct TriData TriData

◆ VertData

typedef struct VertData VertData

Enumeration Type Documentation

◆ LineartPointTri

Enumerator
LRT_OUTSIDE_TRIANGLE 
LRT_ON_TRIANGLE 
LRT_INSIDE_TRIANGLE 

Definition at line 564 of file lineart_cpu.c.

Function Documentation

◆ feat_data_sum_reduce()

static void feat_data_sum_reduce ( const void *__restrict   UNUSEDuserdata,
void *__restrict  chunk_join,
void *__restrict  chunk 
)
static

Definition at line 1490 of file lineart_cpu.c.

References EdgeFeatReduceData::feat_edges.

Referenced by lineart_geometry_object_load().

◆ lineart_add_edge_to_array()

void lineart_add_edge_to_array ( LineartPendingEdges pe,
LineartEdge e 
)

◆ lineart_add_edge_to_array_thread()

static void lineart_add_edge_to_array_thread ( LineartObjectInfo obi,
LineartEdge e 
)
static

◆ lineart_add_isec_thread()

static void lineart_add_isec_thread ( LineartIsecThread th,
const double v1,
const double v2,
LineartTriangle tri1,
LineartTriangle tri2 
)
static

◆ lineart_add_loose_edge()

static void lineart_add_loose_edge ( LooseEdgeData loose_data,
MEdge e 
)
static

◆ lineart_add_triangles_worker()

static void lineart_add_triangles_worker ( TaskPool *__restrict   UNUSEDpool,
LineartIsecThread th 
)
static

◆ lineart_bounding_area_edge_intersect()

static bool lineart_bounding_area_edge_intersect ( LineartData UNUSEDfb,
const double  l[2],
const double  r[2],
LineartBoundingArea ba 
)
static

◆ lineart_bounding_area_line_add()

static void lineart_bounding_area_line_add ( LineartBoundingArea ba,
LineartEdge e 
)
static

◆ lineart_bounding_area_link_edge()

static void lineart_bounding_area_link_edge ( LineartData ld,
LineartBoundingArea root_ba,
LineartEdge e 
)
static

◆ lineart_bounding_area_link_triangle()

static void lineart_bounding_area_link_triangle ( LineartData ld,
LineartBoundingArea root_ba,
LineartTriangle tri,
double  l_r_u_b[4],
int  recursive,
int  recursive_level,
bool  do_intersection,
struct LineartIsecThread th 
)
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().

◆ lineart_bounding_area_next()

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.

◆ lineart_bounding_area_split()

static void lineart_bounding_area_split ( LineartData ld,
LineartBoundingArea root,
int  recursive_level 
)
static

◆ lineart_bounding_area_triangle_intersect()

static bool lineart_bounding_area_triangle_intersect ( LineartData fb,
LineartTriangle tri,
LineartBoundingArea ba,
bool r_triangle_vert_inside 
)
static

◆ lineart_bounding_area_triangle_reallocate()

static void lineart_bounding_area_triangle_reallocate ( LineartBoundingArea ba)
static

◆ lineart_bounding_areas_connect_new()

static void lineart_bounding_areas_connect_new ( LineartData ld,
LineartBoundingArea root 
)
static

◆ lineart_bounding_areas_connect_recursive()

static void lineart_bounding_areas_connect_recursive ( LineartData ld,
LineartBoundingArea root 
)
static

◆ lineart_build_edge_neighbor()

static LineartEdgeNeighbor* lineart_build_edge_neighbor ( Mesh me,
int  total_edges 
)
static

◆ lineart_clear_linked_edges_recursive()

static void lineart_clear_linked_edges_recursive ( LineartData ld,
LineartBoundingArea root_ba 
)
static

◆ lineart_create_edges_from_isec_data()

static void lineart_create_edges_from_isec_data ( LineartIsecData d)
static

◆ lineart_create_render_buffer()

static LineartData* lineart_create_render_buffer ( Scene scene,
LineartGpencilModifierData lmd,
Object camera,
Object active_camera,
LineartCache lc 
)
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().

◆ lineart_destroy_isec_thread()

static void lineart_destroy_isec_thread ( LineartIsecData d)
static

Definition at line 3370 of file lineart_cpu.c.

References LineartIsecThread::array, and MEM_freeN.

Referenced by lineart_main_add_triangles().

◆ lineart_destroy_render_data()

static void lineart_destroy_render_data ( LineartData ld)
static

◆ lineart_destroy_render_data_keep_init()

void lineart_destroy_render_data_keep_init ( LineartData ld)

◆ lineart_discard_duplicated_edges()

static void lineart_discard_duplicated_edges ( LineartEdge old_e)
static

Definition at line 735 of file lineart_cpu.c.

References e, LRT_EDGE_FLAG_CHAIN_PICKED, and LRT_EDGE_FLAG_NEXT_IS_DUPLICATION.

◆ lineart_discard_segment()

static void lineart_discard_segment ( LineartData ld,
LineartEdgeSegment es 
)
static

◆ 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 
)

◆ lineart_edge_first_bounding_area()

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.

◆ lineart_edge_from_triangle()

bool lineart_edge_from_triangle ( const LineartTriangle tri,
const LineartEdge e,
bool  allow_overlapping_edges 
)

◆ lineart_edge_match()

static bool lineart_edge_match ( LineartTriangle tri,
LineartEdge e,
int  v1,
int  v2 
)
static

Definition at line 729 of file lineart_cpu.c.

References e, LineartTriangle::v, v1, and v2.

Referenced by lineart_triangle_adjacent_assign().

◆ lineart_edge_neighbor_init_task()

static void lineart_edge_neighbor_init_task ( void *__restrict  userdata,
const int  i,
const TaskParallelTLS *__restrict   UNUSEDtls 
)
static

◆ lineart_edge_type_duplication_count()

static int lineart_edge_type_duplication_count ( int  eflag)
static

◆ lineart_end_bounding_area_recursive()

static void lineart_end_bounding_area_recursive ( LineartBoundingArea ba)
static

◆ lineart_finalize_object_edge_array()

static void lineart_finalize_object_edge_array ( LineartPendingEdges pe,
LineartObjectInfo obi 
)
static

◆ lineart_finalize_object_edge_array_reserve()

void lineart_finalize_object_edge_array_reserve ( LineartPendingEdges pe,
int  count 
)

◆ lineart_free_bounding_area_memories()

static void lineart_free_bounding_area_memories ( LineartData ld)
static

◆ lineart_free_bounding_area_memory()

static void lineart_free_bounding_area_memory ( LineartBoundingArea ba,
bool  recursive 
)
static

◆ lineart_geometry_check_visible()

static bool lineart_geometry_check_visible ( double  model_view_proj[4][4],
double  shift_x,
double  shift_y,
Mesh use_mesh 
)
static

◆ lineart_geometry_load_assign_thread()

static void lineart_geometry_load_assign_thread ( LineartObjectLoadTaskInfo olti_list,
LineartObjectInfo obi,
int  thread_count,
int  this_face_count 
)
static

◆ lineart_geometry_object_load()

static void lineart_geometry_object_load ( LineartObjectInfo ob_info,
LineartData la_data,
ListBase shadow_elns 
)
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().

◆ lineart_get_bounding_area()

static LineartBoundingArea* lineart_get_bounding_area ( LineartData ld,
double  x,
double  y 
)
static

◆ lineart_get_edge_bounding_areas()

static bool lineart_get_edge_bounding_areas ( LineartData ld,
LineartEdge e,
int *  rowbegin,
int *  rowend,
int *  colbegin,
int *  colend 
)
static

◆ lineart_get_triangle_bounding_areas()

static bool lineart_get_triangle_bounding_areas ( LineartData ld,
LineartTriangle tri,
int *  rowbegin,
int *  rowend,
int *  colbegin,
int *  colend 
)
static

◆ lineart_give_segment()

static LineartEdgeSegment* lineart_give_segment ( LineartData ld)
static

◆ lineart_gpencil_generate()

static void lineart_gpencil_generate ( LineartCache cache,
Depsgraph depsgraph,
Object gpencil_object,
float(*)  gp_obmat_inverse[4],
bGPDlayer UNUSEDgpl,
bGPDframe gpf,
int  level_start,
int  level_end,
int  material_nr,
Object source_object,
Collection source_collection,
int  types,
uchar  mask_switches,
uchar  material_mask_bits,
uchar  intersection_mask,
int16_t  thickness,
float  opacity,
uchar  shaodow_selection,
uchar  silhouette_mode,
const char *  source_vgname,
const char *  vgname,
int  modifier_flags,
int  modifier_calculation_flags 
)
static

◆ lineart_identify_loose_edges()

static void lineart_identify_loose_edges ( void *__restrict   UNUSEDuserdata,
const int  i,
const TaskParallelTLS *__restrict  tls 
)
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().

◆ lineart_identify_mlooptri_feature_edges()

static void lineart_identify_mlooptri_feature_edges ( void *__restrict  userdata,
const int  i,
const TaskParallelTLS *__restrict  tls 
)
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().

◆ lineart_init_cache()

static LineartCache * lineart_init_cache ( void  )
static

Definition at line 3533 of file lineart_cpu.c.

References MEM_callocN.

Referenced by MOD_lineart_compute_feature_lines().

◆ lineart_init_isec_thread()

static void lineart_init_isec_thread ( LineartIsecData d,
LineartData ld,
int  thread_count 
)
static

◆ lineart_intersection_mask_check()

static uchar lineart_intersection_mask_check ( Collection c,
Object ob 
)
static

◆ lineart_intersection_priority_check()

static uchar lineart_intersection_priority_check ( Collection c,
Object ob 
)
static

◆ lineart_join_loose_edge_arr()

static void lineart_join_loose_edge_arr ( LooseEdgeData loose_data,
LooseEdgeData to_be_joined 
)
static

◆ lineart_load_tri_task()

static void lineart_load_tri_task ( void *__restrict  userdata,
const int  i,
const TaskParallelTLS *__restrict   UNUSEDtls 
)
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().

◆ lineart_loose_data_reallocate()

static void lineart_loose_data_reallocate ( LooseEdgeData loose_data,
int  count 
)
static

◆ lineart_main_add_triangles()

void lineart_main_add_triangles ( LineartData ld)

◆ lineart_main_bounding_area_make_initial()

void lineart_main_bounding_area_make_initial ( LineartData ld)

◆ lineart_main_bounding_areas_connect_post()

void lineart_main_bounding_areas_connect_post ( LineartData ld)

◆ lineart_main_clear_linked_edges()

void lineart_main_clear_linked_edges ( LineartData ld)

◆ lineart_main_cull_triangles()

void lineart_main_cull_triangles ( LineartData ld,
bool  clip_far 
)

◆ lineart_main_discard_out_of_frame_edges()

void lineart_main_discard_out_of_frame_edges ( LineartData ld)

◆ lineart_main_free_adjacent_data()

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().

◆ lineart_main_get_view_vector()

void lineart_main_get_view_vector ( LineartData ld)

◆ lineart_main_link_lines()

void lineart_main_link_lines ( LineartData ld)

◆ lineart_main_load_geometries()

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().

◆ lineart_main_occlusion_begin()

void lineart_main_occlusion_begin ( LineartData ld)

◆ lineart_main_perspective_division()

void lineart_main_perspective_division ( LineartData ld)

◆ lineart_main_remove_unused_lines_from_tiles()

static void lineart_main_remove_unused_lines_from_tiles ( LineartData ld)
static

◆ lineart_main_remove_unused_lines_recursive()

static void lineart_main_remove_unused_lines_recursive ( LineartBoundingArea ba,
uint8_t  max_occlusion 
)
static

◆ lineart_memory_get_edge_space()

static LineartElementLinkNode* lineart_memory_get_edge_space ( LineartData ld)
static

◆ lineart_memory_get_triangle_space()

static LineartElementLinkNode* lineart_memory_get_triangle_space ( LineartData ld)
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().

◆ lineart_memory_get_vert_space()

static LineartElementLinkNode* lineart_memory_get_vert_space ( LineartData ld)
static

◆ lineart_mvert_transform_task()

static void lineart_mvert_transform_task ( void *__restrict  userdata,
const int  i,
const TaskParallelTLS *__restrict   UNUSEDtls 
)
static

◆ lineart_object_load_single_instance()

static void lineart_object_load_single_instance ( LineartData ld,
Depsgraph depsgraph,
Scene scene,
Object ob,
Object ref_ob,
float  use_mat[4][4],
bool  is_render,
LineartObjectLoadTaskInfo olti,
int  thread_count,
int  obindex 
)
static

◆ lineart_object_load_worker()

static void lineart_object_load_worker ( TaskPool *__restrict   UNUSEDpool,
LineartObjectLoadTaskInfo olti 
)
static

◆ lineart_occlusion_is_adjacent_intersection()

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().

◆ lineart_occlusion_make_task_info()

static int lineart_occlusion_make_task_info ( LineartData ld,
LineartRenderTaskInfo rti 
)
static

◆ lineart_occlusion_single_line()

static void lineart_occlusion_single_line ( LineartData ld,
LineartEdge e,
int  thread_id 
)
static

◆ lineart_occlusion_worker()

static void lineart_occlusion_worker ( TaskPool *__restrict   UNUSEDpool,
LineartRenderTaskInfo rti 
)
static

◆ lineart_point_inside_triangle()

static bool lineart_point_inside_triangle ( const double  v[2],
const double  v0[2],
const double  v1[2],
const double  v2[2] 
)
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().

◆ lineart_point_inside_triangle3d()

static bool lineart_point_inside_triangle3d ( double  v[3],
double  v0[3],
double  v1[3],
double  v2[3] 
)
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().

◆ lineart_point_on_line_segment()

static int lineart_point_on_line_segment ( double  v[2],
double  v0[2],
double  v1[2] 
)
static

◆ lineart_point_triangle_relation()

static int lineart_point_triangle_relation ( double  v[2],
double  v0[2],
double  v1[2],
double  v2[2] 
)
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().

◆ lineart_schedule_new_triangle_task()

static bool lineart_schedule_new_triangle_task ( LineartIsecThread th)
static

◆ lineart_triangle_2v_intersection_math()

static bool lineart_triangle_2v_intersection_math ( LineartVert v1,
LineartVert v2,
LineartTriangle tri,
const double last,
double rv 
)
static

◆ lineart_triangle_adjacent_assign()

static void lineart_triangle_adjacent_assign ( LineartTriangle tri,
LineartTriangleAdjacent tri_adj,
LineartEdge e 
)
static

Definition at line 1826 of file lineart_cpu.c.

References e, LineartTriangleAdjacent::e, and lineart_edge_match().

Referenced by lineart_geometry_object_load().

◆ lineart_triangle_cull_single()

static void lineart_triangle_cull_single ( LineartData ld,
LineartTriangle tri,
int  in0,
int  in1,
int  in2,
double  cam_pos[3],
double  view_dir[3],
bool  allow_boundaries,
double  m_view_projection[4][4],
Object ob,
int *  r_v_count,
int *  r_e_count,
int *  r_t_count,
LineartElementLinkNode v_eln,
LineartElementLinkNode e_eln,
LineartElementLinkNode t_eln 
)
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.

identify
1-----|-------0
| | ---
| |---
| ---|
2-- |
(near)---------->(far)
Will become:
|N******0
|* ***
|N**
|
|
(near)---------->(far)
#define N

(in0) means "when point 0 is invisible". conditions for point 1, 2 are the same idea.

0------|----------1
-- | |
---| |
|-- |
| --- |
| --- |
| --2
(near)---------->(far)
Will become:
|N*********1
|* *** |
|* *** |
|N** |
| *** |
| *** |
| **2
(near)---------->(far)

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().

◆ lineart_triangle_edge_image_space_occlusion()

static bool lineart_triangle_edge_image_space_occlusion ( const LineartTriangle tri,
const LineartEdge e,
const double override_camera_loc,
const bool  override_cam_is_persp,
const bool  allow_overlapping_edges,
const double  m_view_projection[4][4],
const double  camera_dir[3],
const float  cam_shift_x,
const float  cam_shift_y,
double from,
double to 
)
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().

◆ lineart_triangle_from_index()

static LineartTriangle* lineart_triangle_from_index ( LineartData ld,
LineartTriangle rt_array,
int  index 
)
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().

◆ lineart_triangle_get_other_verts()

static bool lineart_triangle_get_other_verts ( const LineartTriangle tri,
const LineartVert vt,
LineartVert **  l,
LineartVert **  r 
)
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().

◆ lineart_triangle_intersect_in_bounding_area()

static void lineart_triangle_intersect_in_bounding_area ( LineartTriangle tri,
LineartBoundingArea ba,
LineartIsecThread th,
int  up_to 
)
static

◆ lineart_triangle_intersect_math()

static bool lineart_triangle_intersect_math ( LineartTriangle tri,
LineartTriangle t2,
double v1,
double v2 
)
static

◆ lineart_triangle_post()

static void lineart_triangle_post ( LineartTriangle tri,
LineartTriangle orig 
)
static

◆ lineart_triangle_set_cull_flag()

static void lineart_triangle_set_cull_flag ( LineartTriangle tri,
uchar  flag 
)
static

Definition at line 722 of file lineart_cpu.c.

References LineartTriangle::flags, and LRT_TRIANGLE_INTERSECTION_ONLY.

Referenced by lineart_triangle_cull_single().

◆ lineart_triangle_share_edge()

static bool lineart_triangle_share_edge ( const LineartTriangle l,
const LineartTriangle r 
)
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().

◆ lineart_triangle_share_point()

static LineartVert* lineart_triangle_share_point ( const LineartTriangle l,
const LineartTriangle r 
)
static

Definition at line 3134 of file lineart_cpu.c.

References l, NULL, r, and BMLoop::v.

Referenced by lineart_triangle_intersect_math().

◆ lineart_triangle_size_get()

static int lineart_triangle_size_get ( LineartData ld)
static

Definition at line 3691 of file lineart_cpu.c.

References LineartData::thread_count.

Referenced by MOD_lineart_compute_feature_lines().

◆ lineart_usage_check()

static int lineart_usage_check ( Collection c,
Object ob,
bool  is_render 
)
static

◆ loose_data_sum_reduce()

static void loose_data_sum_reduce ( const void *__restrict   UNUSEDuserdata,
void *__restrict  chunk_join,
void *__restrict  chunk 
)
static

Definition at line 1765 of file lineart_cpu.c.

References lineart_join_loose_edge_arr().

Referenced by lineart_geometry_object_load().

◆ MOD_lineart_clear_cache()

void MOD_lineart_clear_cache ( struct LineartCache **  lc)

◆ MOD_lineart_compute_feature_lines()

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.

Returns
True when a change is made.

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().

◆ MOD_lineart_destroy_render_data()

void MOD_lineart_destroy_render_data ( LineartGpencilModifierData lmd)

◆ MOD_lineart_get_bounding_area()

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().

◆ MOD_lineart_get_parent_bounding_area()

LineartBoundingArea* MOD_lineart_get_parent_bounding_area ( LineartData ld,
double  x,
double  y 
)

◆ MOD_lineart_gpencil_generate()

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 
)

Variable Documentation

◆ LRT_MESH_EDGE_TYPES

const int LRT_MESH_EDGE_TYPES[]
static