Blender V5.3
MOD_lineart.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2024 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include "BLI_enum_flags.hh"
12#include "BLI_linklist.hh"
14#include "BLI_math_vector_c.hh"
15#include "BLI_set.hh"
16#include "BLI_threads.hh"
17
18#include "ED_grease_pencil.hh"
19
20#include <algorithm>
21#include <cmath>
22
23namespace blender {
24
25struct Depsgraph;
27struct LineartEdge;
28struct LineartEdgeChain;
34struct LineartVert;
35struct LinkData;
36struct Mesh;
37struct Object;
38
40 /* This list is constructed during `update_depsgraph()` call, and stays valid until the next
41 * update. This way line art can load objects from this list instead of iterating over all
42 * objects that may or may not have finished evaluating. */
44};
45
48 size_t size;
49 size_t used_byte;
50 /* User memory starts here */
51};
52
54 ListBaseT<LineartStaticMemPoolNode> pools;
56};
57
61
64
65 /* first culled in line list to use adjacent triangle info, then go through triangle list. */
66 double gn[3];
67
71 uint8_t flags; /* #eLineartTriangleFlags */
72
73 /* target_reference = (obi->obindex | triangle_index) */
74 /* higher 12 bits-------^ ^-----index in object, lower 20 bits */
76
78
85};
86
99
107
110 void *pointer;
114
115 /* For edge element link nodes, used for shadow edge matching. */
118
121};
122
143
146 /* Two end points in frame-buffer coordinates viewed from the light source. */
147 double fbc1[4], fbc2[4];
148 double g1[3], g2[3];
152 LineartEdgeSegment *es_ref; /* Only for 3rd stage casting. */
153 ListBaseT<LineartShadowSegment> shadow_segments;
154};
155
160
161/* Represents a cutting point on a #LineartShadowEdge */
164 /* eLineartShadowSegmentFlag */
165 int flag;
166 /* The point after which a property of the segment is changed. e.g. shadow mask/target_ref etc.
167 * Coordinates in NDC during shadow calculation but transformed to global linear before cutting
168 * onto edges during the loading stage of the "actual" rendering. */
169 double ratio;
170 /* Left and right pos, because when casting shadows at some point there will be
171 * non-continuous cuts, see #lineart_shadow_edge_cut for detailed explanation. */
172 double fbc1[4], fbc2[4];
173 /* Global position. */
174 double g1[4], g2[4];
177};
178
180 double gloc[3];
181 double fbcoord[4];
182
183 /* Scene global index. */
184 int index;
185};
186
228
231 ListBaseT<LineartEdgeChainItem> chain;
232
234 float length;
235
239
241 int type;
247
248 /* We need local index for correct weight transfer, line art index is global, thus
249 * local_index=lineart_index-index_offset. */
251
254};
255
270
276
277 /* left/right mark.
278 * Because we revert list in chaining so we need the flag. */
280};
281
287
289 /* If tile gets this small, it's already much smaller than a pixel. No need to continue
290 * splitting. */
292 /* This is a tried-and-true safe value for high poly models that also needed ortho rendering. */
294};
295
296#define LRT_TILE_SPLITTING_TRIANGLE_LIMIT 100
297#define LRT_TILE_EDGE_COUNT_INITIAL 32
298
303
309
311 int w, h;
314
316 /* A pointer to LineartCache::chain_data_pool, which acts as a cache for edge chains. */
318 /* Reference to LineartCache::shadow_data_pool, stay available until the final round of line art
319 * calculation is finished. */
321
322 /* Storing shadow edge eln, array, and cuts for shadow information, so it's available when line
323 * art runs the second time for occlusion. Either a reference to LineartCache::shadow_data_pool
324 * (shadow stage) or a reference to LineartData::render_data_pool (final stage). */
326
327 struct _qtree {
328
331
332 /* When splitting bounding areas, if there's an ortho camera placed at a straight angle, there
333 * will be a lot of triangles aligned in line which can not be separated by continue
334 * subdividing the tile. So we set a strict limit when using ortho camera. See
335 * eLineArtTileRecursiveLimit. */
337
339
341
343
344 struct _geom {
345
346 ListBaseT<LineartElementLinkNode> vertex_buffer_pointers;
347 ListBaseT<LineartElementLinkNode> line_buffer_pointers;
348 ListBaseT<LineartElementLinkNode> triangle_buffer_pointers;
349
351 ListBaseT<LineartElementLinkNode> triangle_adjacent_pointers;
352
353 ListBaseT<LineartElementLinkNode> intersecting_vertex_buffer;
354
356
357 struct _conf {
358
359 double view_projection[4][4];
360 double view[4][4];
361
362 float overscan;
363
367
370
379 bool use_contour_secondary; /* From viewing camera, during shadow calculation. */
380
381 int shadow_selection; /* Needs to be numeric because it's not just on/off. */
384
396
401
404
406
409
410 /* Keep an copy of these data so when line art is running itself contained. */
412 /* "Secondary" ones are from viewing camera
413 * (as opposed to shadow camera), during shadow calculation. */
415 float cam_obmat[4][4];
417 double camera_pos[3];
419 double active_camera_pos[3]; /* Stroke offset calculation may use active or selected camera. */
422
426
428
429 double view_vector[3];
430 double view_vector_secondary[3]; /* For shadow. */
432
435
436 /* NOTE: Data inside #pending_edges are allocated with MEM_xxx call instead of in pool. */
439
440 /* Intermediate shadow results, list of LineartShadowEdge */
443
444 ListBaseT<LineartEdgeChain> chains;
445
446 ListBaseT<LineartEdgeSegment> wasted_cuts;
447 ListBaseT<LineartShadowSegment> wasted_shadow_cuts;
450};
451
473
474#define DBL_TRIANGLE_LIM 1e-8
475#define DBL_EDGE_LIM 1e-9
476
477#define LRT_MEMORY_POOL_1MB (1 << 20)
478
489
490#define LRT_SHADOW_MASK_UNDEFINED 0
491#define LRT_SHADOW_MASK_ILLUMINATED (1 << 0)
492#define LRT_SHADOW_MASK_SHADED (1 << 1)
493#define LRT_SHADOW_MASK_ENCLOSED_SHAPE (1 << 2)
494#define LRT_SHADOW_MASK_INHIBITED (1 << 3)
495#define LRT_SHADOW_SILHOUETTE_ERASED_GROUP (1 << 4)
496#define LRT_SHADOW_SILHOUETTE_ERASED_OBJECT (1 << 5)
497#define LRT_SHADOW_MASK_ILLUMINATED_SHAPE (1 << 6)
498
499#define LRT_SHADOW_TEST_SHAPE_BITS \
500 (LRT_SHADOW_MASK_ILLUMINATED | LRT_SHADOW_MASK_SHADED | LRT_SHADOW_MASK_INHIBITED | \
501 LRT_SHADOW_MASK_ILLUMINATED_SHAPE)
502
508#define LRT_THREAD_EDGE_COUNT 1000
509
521
522#define LRT_OBINDEX_SHIFT 20
523#define LRT_OBINDEX_LOWER 0x0FFFFF /* Lower 20 bits. */
524#define LRT_OBINDEX_HIGHER 0xFFF00000 /* Higher 12 bits. */
525#define LRT_EDGE_IDENTIFIER(obi, e) \
526 (((uint64_t)(obi->obindex | (e->v1->index & LRT_OBINDEX_LOWER)) << 32) | \
527 (obi->obindex | (e->v2->index & LRT_OBINDEX_LOWER)))
528#define LRT_LIGHT_CONTOUR_TARGET 0xFFFFFFFF
529
533 Object *original_ob_eval; /* For evaluated materials */
535 double model_view_proj[4][4];
536 double model_view[4][4];
537 double normal[4][4];
539 int usage;
543
544 /* Shifted LRT_OBINDEX_SHIFT bits to be combined with object triangle index. */
546
548
551};
552
556 /* LinkNode styled list */
558 /* Used to spread the load across several threads. This can not overflow. */
560 ListBaseT<LineartElementLinkNode> *shadow_elns;
561};
562
588 double l, r, u, b;
589 double cx, cy;
590
593
595
596 ListBaseT<LinkData> lp;
597 ListBaseT<LinkData> rp;
598 ListBaseT<LinkData> up;
599 ListBaseT<LinkData> bp;
600
606
607 /* Use array for speeding up multiple accesses. */
610
612 ListBaseT<LineartChainRegisterEntry> linked_chains;
613};
614
615#define LRT_TILE(tile, r, c, CCount) tile[r * CCount + c]
616
617#define LRT_CLAMP(a, Min, Max) a = a < Min ? Min : (a > Max ? Max : a)
618
619#define LRT_MAX3_INDEX(a, b, c) (a > b ? (a > c ? 0 : (b > c ? 1 : 2)) : (b > c ? 1 : 2))
620
621#define LRT_MIN3_INDEX(a, b, c) (a < b ? (a < c ? 0 : (b < c ? 1 : 2)) : (b < c ? 1 : 2))
622
623#define LRT_MAX3_INDEX_ABC(x, y, z) (x > y ? (x > z ? a : (y > z ? b : c)) : (y > z ? b : c))
624
625#define LRT_MIN3_INDEX_ABC(x, y, z) (x < y ? (x < z ? a : (y < z ? b : c)) : (y < z ? b : c))
626
627#define DBL_LOOSER 1e-5
628#define LRT_DOUBLE_CLOSE_LOOSER(a, b) (((a) + DBL_LOOSER) >= (b) && ((a) - DBL_LOOSER) <= (b))
629#define LRT_DOUBLE_CLOSE_ENOUGH(a, b) (((a) + DBL_EDGE_LIM) >= (b) && ((a) - DBL_EDGE_LIM) <= (b))
630#define LRT_DOUBLE_CLOSE_ENOUGH_TRI(a, b) \
631 (((a) + DBL_TRIANGLE_LIM) >= (b) && ((a) - DBL_TRIANGLE_LIM) <= (b))
632
633#define LRT_CLOSE_LOOSER_v3(a, b) \
634 (LRT_DOUBLE_CLOSE_LOOSER(a[0], b[0]) && LRT_DOUBLE_CLOSE_LOOSER(a[1], b[1]) && \
635 LRT_DOUBLE_CLOSE_LOOSER(a[2], b[2]))
636
637/* Notes on this function:
638 *
639 * r_ratio: The ratio on segment a1-a2. When r_ratio is very close to zero or one, it
640 * fixes the value to zero or one, this makes it easier to identify "on the tip" situations.
641 *
642 * r_aligned: True when 1) a and b is exactly on the same straight line and 2) a and b share a
643 * common end-point.
644 *
645 * IMPORTANT: if r_aligned is true, r_ratio will be either 0 or 1 depending on which point from
646 * segment a is shared with segment b. If it's a1 then r_ratio is 0, else then r_ratio is 1. This
647 * extra information is needed for line art occlusion stage to work correctly in such cases.
648 */
650 const double a2[2],
651 const double b1[2],
652 const double b2[2],
653 double *r_ratio,
654 bool *r_aligned)
655{
656/* Legacy intersection math aligns better with occlusion function quirks. */
657// #define USE_VECTOR_LINE_INTERSECTION
658#ifdef USE_VECTOR_LINE_INTERSECTION
659
660 /* from isect_line_line_v2_point() */
661
662 double s10[2], s32[2];
663 double div;
664
665 sub_v2_v2v2_db(s10, a2, a1);
666 sub_v2_v2v2_db(s32, b2, b1);
667
668 div = cross_v2v2_db(s10, s32);
669 if (div != 0.0f) {
670 const double u = cross_v2v2_db(a2, a1);
671 const double v = cross_v2v2_db(b2, b1);
672
673 const double rx = ((s32[0] * u) - (s10[0] * v)) / div;
674 const double ry = ((s32[1] * u) - (s10[1] * v)) / div;
675 double rr;
676
677 if (fabs(a2[0] - a1[0]) > fabs(a2[1] - a1[1])) {
678 *r_ratio = ratiod(a1[0], a2[0], rx);
679 if (fabs(b2[0] - b1[0]) > fabs(b2[1] - b1[1])) {
680 rr = ratiod(b1[0], b2[0], rx);
681 }
682 else {
683 rr = ratiod(b1[1], b2[1], ry);
684 }
685 if ((*r_ratio) > 0 && (*r_ratio) < 1 && rr > 0 && rr < 1) {
686 return 1;
687 }
688 return 0;
689 }
690
691 *r_ratio = ratiod(a1[1], a2[1], ry);
692 if (fabs(b2[0] - b1[0]) > fabs(b2[1] - b1[1])) {
693 rr = ratiod(b1[0], b2[0], rx);
694 }
695 else {
696 rr = ratiod(b1[1], b2[1], ry);
697 }
698 if ((*r_ratio) > 0 && (*r_ratio) < 1 && rr > 0 && rr < 1) {
699 return 1;
700 }
701 return 0;
702 }
703 return 0;
704
705#else
706 double k1, k2;
707 double x;
708 double y;
709 double ratio;
710 double x_diff = (a2[0] - a1[0]);
711 double x_diff2 = (b2[0] - b1[0]);
712
713 *r_aligned = false;
714
715 if (LRT_DOUBLE_CLOSE_ENOUGH(x_diff, 0)) {
716 if (LRT_DOUBLE_CLOSE_ENOUGH(x_diff2, 0)) {
717 /* This means two segments are both vertical. */
718 if ((LRT_DOUBLE_CLOSE_ENOUGH(a2[0], b1[0]) && LRT_DOUBLE_CLOSE_ENOUGH(a2[1], b1[1])) ||
719 (LRT_DOUBLE_CLOSE_ENOUGH(a2[0], b2[0]) && LRT_DOUBLE_CLOSE_ENOUGH(a2[1], b2[1])))
720 {
721 *r_aligned = true;
722 *r_ratio = 1;
723 }
724 else if ((LRT_DOUBLE_CLOSE_ENOUGH(a1[0], b1[0]) && LRT_DOUBLE_CLOSE_ENOUGH(a1[1], b1[1])) ||
725 (LRT_DOUBLE_CLOSE_ENOUGH(a1[0], b2[0]) && LRT_DOUBLE_CLOSE_ENOUGH(a1[1], b2[1])))
726 {
727 *r_aligned = true;
728 *r_ratio = 0;
729 }
730 return 0;
731 }
732 double r2 = ratiod(b1[0], b2[0], a1[0]);
733 x = interpd(b2[0], b1[0], r2);
734 y = interpd(b2[1], b1[1], r2);
735 *r_ratio = ratio = ratiod(a1[1], a2[1], y);
736 }
737 else {
738 if (LRT_DOUBLE_CLOSE_ENOUGH(x_diff2, 0)) {
739 ratio = ratiod(a1[0], a2[0], b1[0]);
740 x = interpd(a2[0], a1[0], ratio);
741 *r_ratio = ratio;
742 }
743 else {
744 double y_diff = a2[1] - a1[1], y_diff2 = b2[1] - b1[1];
745 k1 = y_diff / x_diff;
746 k2 = y_diff2 / x_diff2;
747
748 if (LRT_DOUBLE_CLOSE_ENOUGH_TRI(k2, k1)) {
749 /* This means two segments are parallel. This also handles k==0 (both completely
750 * horizontal) cases. */
751 if ((LRT_DOUBLE_CLOSE_ENOUGH(a2[0], b1[0]) && LRT_DOUBLE_CLOSE_ENOUGH(a2[1], b1[1])) ||
752 (LRT_DOUBLE_CLOSE_ENOUGH(a2[0], b2[0]) && LRT_DOUBLE_CLOSE_ENOUGH(a2[1], b2[1])))
753 {
754 *r_aligned = true;
755 *r_ratio = 1;
756 }
757 else if ((LRT_DOUBLE_CLOSE_ENOUGH(a1[0], b1[0]) &&
758 LRT_DOUBLE_CLOSE_ENOUGH(a1[1], b1[1])) ||
759 (LRT_DOUBLE_CLOSE_ENOUGH(a1[0], b2[0]) && LRT_DOUBLE_CLOSE_ENOUGH(a1[1], b2[1])))
760 {
761 *r_aligned = true;
762 *r_ratio = 0;
763 }
764 return 0;
765 }
766
767 x = (a1[1] - b1[1] - k1 * a1[0] + k2 * b1[0]) / (k2 - k1);
768
769 ratio = (x - a1[0]) / x_diff;
770
771 *r_ratio = ratio;
772 }
773 }
774
775 if (LRT_DOUBLE_CLOSE_ENOUGH(b1[0], b2[0])) {
776 y = interpd(a2[1], a1[1], ratio);
777 if (y > std::max(b1[1], b2[1]) || y < std::min(b1[1], b2[1])) {
778 return 0;
779 }
780 }
781 else if (ratio <= 0 || ratio > 1 || (b1[0] > b2[0] && x > b1[0]) ||
782 (b1[0] < b2[0] && x < b1[0]) || (b2[0] > b1[0] && x > b2[0]) ||
783 (b2[0] < b1[0] && x < b2[0]))
784 {
785 return 0;
786 }
787
788 if (LRT_DOUBLE_CLOSE_ENOUGH_TRI(*r_ratio, 1)) {
789 *r_ratio = 1;
790 }
791 else if (LRT_DOUBLE_CLOSE_ENOUGH_TRI(*r_ratio, 0)) {
792 *r_ratio = 0;
793 }
794
795 return 1;
796#endif
797}
798
799/* This is a special convenience function to lineart_intersect_seg_seg which will return true when
800 * the intersection point falls in the range of a1-a2 but not necessarily in the range of b1-b2. */
802 const double a2[2],
803 const double b1[2],
804 const double b2[2],
805 double *r_a_ratio)
806{
807 /* The define here is used to check how vector or slope method handles boundary cases. The result
808 * of `lim(div->0)` and `lim(k->0)` could both produce some unwanted flickers in line art, the
809 * influence of which is still not fully understood, so keep the switch there for further
810 * investigations. */
811#define USE_VECTOR_LINE_INTERSECTION_IGN
812#ifdef USE_VECTOR_LINE_INTERSECTION_IGN
813
814 /* from isect_line_line_v2_point() */
815
816 double s10[2], s32[2];
817 double div;
818
819 sub_v2_v2v2_db(s10, a2, a1);
820 sub_v2_v2v2_db(s32, b2, b1);
821
822 div = cross_v2v2_db(s10, s32);
823 if (div != 0.0f) {
824 const double u = cross_v2v2_db(a2, a1);
825 const double v = cross_v2v2_db(b2, b1);
826
827 const double rx = ((s32[0] * u) - (s10[0] * v)) / div;
828 const double ry = ((s32[1] * u) - (s10[1] * v)) / div;
829
830 if (fabs(a2[0] - a1[0]) > fabs(a2[1] - a1[1])) {
831 *r_a_ratio = ratiod(a1[0], a2[0], rx);
832 if ((*r_a_ratio) >= -DBL_EDGE_LIM && (*r_a_ratio) <= 1 + DBL_EDGE_LIM) {
833 return 1;
834 }
835 return 0;
836 }
837
838 *r_a_ratio = ratiod(a1[1], a2[1], ry);
839 if ((*r_a_ratio) >= -DBL_EDGE_LIM && (*r_a_ratio) <= 1 + DBL_EDGE_LIM) {
840 return 1;
841 }
842 return 0;
843 }
844 return 0;
845
846#else
847 double k1, k2;
848 double x;
849 double y;
850 double ratio;
851 double x_diff = (a2[0] - a1[0]);
852 double x_diff2 = (b2[0] - b1[0]);
853
854 if (LRT_DOUBLE_CLOSE_ENOUGH(x_diff, 0)) {
855 if (LRT_DOUBLE_CLOSE_ENOUGH(x_diff2, 0)) {
856 *r_a_ratio = 0;
857 return 0;
858 }
859 double r2 = ratiod(b1[0], b2[0], a1[0]);
860 x = interpd(b2[0], b1[0], r2);
861 y = interpd(b2[1], b1[1], r2);
862 *r_a_ratio = ratio = ratiod(a1[1], a2[1], y);
863 }
864 else {
865 if (LRT_DOUBLE_CLOSE_ENOUGH(x_diff2, 0)) {
866 ratio = ratiod(a1[0], a2[0], b1[0]);
867 x = interpd(a2[0], a1[0], ratio);
868 *r_a_ratio = ratio;
869 }
870 else {
871 k1 = (a2[1] - a1[1]) / x_diff;
872 k2 = (b2[1] - b1[1]) / x_diff2;
873
874 if ((k1 == k2)) {
875 return 0;
876 }
877 x = (a1[1] - b1[1] - k1 * a1[0] + k2 * b1[0]) / (k2 - k1);
878
879 ratio = (x - a1[0]) / x_diff;
880
881 *r_a_ratio = ratio;
882 }
883 }
884
885 if (ratio <= 0 || ratio >= 1) {
886 return 0;
887 }
888 return 1;
889#endif
890}
891
892struct bGPDframe;
893struct bGPDlayer;
894struct LineartGpencilModifierData;
895struct GreasePencilLineartModifierData;
896struct LineartData;
897struct Scene;
898
899void MOD_lineart_destroy_render_data_v3(GreasePencilLineartModifierData *lmd);
900
901void MOD_lineart_chain_feature_lines(LineartData *ld);
908void MOD_lineart_chain_connect(LineartData *ld);
909void MOD_lineart_chain_discard_unused(LineartData *ld, float threshold, uint8_t max_occlusion);
910void MOD_lineart_chain_clip_at_border(LineartData *ld);
915void MOD_lineart_chain_split_angle(LineartData *ld, float angle_threshold_rad);
916void MOD_lineart_smooth_chains(LineartData *ld, float tolerance);
917void MOD_lineart_chain_offset_towards_camera(LineartData *ld, float dist, bool use_custom_camera);
919
920int MOD_lineart_chain_count(const LineartEdgeChain *ec);
921void MOD_lineart_chain_clear_picked_flag(LineartCache *lc);
922void MOD_lineart_finalize_chains(LineartData *ld);
923
929bool MOD_lineart_compute_feature_lines_v3(Depsgraph *depsgraph,
930 GreasePencilLineartModifierData &lmd,
931 LineartCache **cached_result,
932 bool enable_stroke_depth_offset);
933
937LineartBoundingArea *MOD_lineart_get_parent_bounding_area(LineartData *ld, double x, double y);
938
942LineartBoundingArea *MOD_lineart_get_bounding_area(LineartData *ld, double x, double y);
943
944namespace bke::greasepencil {
945class Drawing;
946}
948 const float4x4 &mat,
949 Depsgraph *depsgraph,
951 int8_t source_type,
952 Object *source_object,
953 Collection *source_collection,
954 int level_start,
955 int level_end,
956 int mat_nr,
957 int16_t edge_types,
958 uchar mask_switches,
959 uchar material_mask_bits,
960 uchar intersection_mask,
961 float thickness,
962 float opacity,
963 const bool fill_strokes,
964 uchar shadow_selection,
965 uchar silhouette_mode,
966 const char *source_vgname,
967 const char *vgname,
968 int modifier_flags,
969 int modifier_calculation_flags);
970
975
978
979} // namespace blender
#define LRT_DOUBLE_CLOSE_ENOUGH(a, b)
#define LRT_DOUBLE_CLOSE_ENOUGH_TRI(a, b)
#define DBL_EDGE_LIM
#define BLI_INLINE
Definition scene.h:133
ccl_device_inline dual3 fabs(const ccl_private dual3 &a)
Definition math_dual.h:241
ENUM_OPERATORS(Layer::Flags)
BMesh Iterators.
void MOD_lineart_smooth_chains(LineartData *ld, float tolerance)
unsigned __int64 uint64_t
Definition BKE_text.h:91
LineartBoundingArea * MOD_lineart_get_parent_bounding_area(LineartData *ld, double x, double y)
MINLINE void sub_v2_v2v2_db(double r[2], const double a[2], const double b[2])
eLineArtElementNodeFlag
@ LRT_ELEMENT_BORDER_ONLY
@ LRT_ELEMENT_IS_ADDITIONAL
@ LRT_ELEMENT_INTERSECTION_DATA
@ LRT_ELEMENT_NO_INTERSECTION
pthread_spinlock_t SpinLock
eLineartTriangleFlags
@ LRT_CULL_DONT_CARE
@ LRT_TRIANGLE_MAT_BACK_FACE_CULLING
@ LRT_CULL_GENERATED
@ LRT_TRIANGLE_FORCE_INTERSECTION
@ LRT_TRIANGLE_INTERSECTION_ONLY
@ LRT_CULL_DISCARD
@ LRT_TRIANGLE_NO_INTERSECTION
BLI_INLINE int lineart_line_isec_2d_ignore_line2pos(const double a1[2], const double a2[2], const double b1[2], const double b2[2], double *r_a_ratio)
eLineArtTileRecursiveLimit
@ LRT_TILE_RECURSIVE_PERSPECTIVE
@ LRT_TILE_RECURSIVE_ORTHO
MINLINE double interpd(double target, double origin, double t)
void MOD_lineart_clear_cache(LineartCache **lc)
void MOD_lineart_chain_feature_lines(LineartData *ld)
ATTR_WARN_UNUSED_RESULT const BMVert * v
void MOD_lineart_chain_offset_towards_camera(LineartData *ld, float dist, bool use_custom_camera)
MatBase< float, 4, 4 > float4x4
void MOD_lineart_finalize_chains(LineartData *ld)
void MOD_lineart_chain_clip_at_border(LineartData *ld)
MINLINE double ratiod(double min, double max, double pos)
bool MOD_lineart_compute_feature_lines_v3(Depsgraph *depsgraph, GreasePencilLineartModifierData &lmd, LineartCache **cached_result, bool enable_stroke_depth_offset)
int MOD_lineart_chain_count(const LineartEdgeChain *ec)
void MOD_lineart_chain_clear_picked_flag(LineartCache *lc)
unsigned short uint16_t
Definition BKE_text.h:80
unsigned int uint32_t
Definition BKE_text.h:81
void MOD_lineart_chain_split_for_fixed_occlusion(LineartData *ld)
unsigned char uchar
Definition BKE_text.h:58
void MOD_lineart_gpencil_generate_v3(const LineartCache *cache, const float4x4 &inverse_mat, Depsgraph *depsgraph, bke::greasepencil::Drawing &drawing, const int8_t source_type, Object *source_object, Collection *source_collection, const int level_start, const int level_end, const int mat_nr, const int16_t edge_types, const uchar mask_switches, const uchar material_mask_bits, const uchar intersection_mask, const float thickness, const float opacity, const bool fill_strokes, const uchar shadow_selection, const uchar silhouette_mode, const char *source_vgname, const char *vgname, const int modifier_flags, const int modifier_calculation_flags)
void MOD_lineart_chain_split_angle(LineartData *ld, float angle_threshold_rad)
unsigned char uint8_t
Definition BKE_text.h:79
void MOD_lineart_chain_connect(LineartData *ld)
void MOD_lineart_destroy_render_data_v3(GreasePencilLineartModifierData *lmd)
eLineartShadowCameraType
@ LRT_SHADOW_CAMERA_DIRECTIONAL
@ LRT_SHADOW_CAMERA_POINT
MINLINE double cross_v2v2_db(const double a[2], const double b[2]) ATTR_WARN_UNUSED_RESULT
LineartBoundingArea * MOD_lineart_get_bounding_area(LineartData *ld, double x, double y)
eLineartShadowSegmentFlag
@ LRT_SHADOW_FACING_LIGHT
@ LRT_SHADOW_CASTED
float MOD_lineart_chain_compute_length(LineartEdgeChain *ec)
BLI_INLINE int lineart_intersect_seg_seg(const double a1[2], const double a2[2], const double b1[2], const double b2[2], double *r_ratio, bool *r_aligned)
void MOD_lineart_chain_find_silhouette_backdrop_objects(LineartData *ld)
void MOD_lineart_chain_discard_unused(LineartData *ld, const float threshold, uint8_t max_occlusion)
signed char int8_t
Definition BKE_text.h:76
signed short int16_t
Definition BKE_text.h:77
LineartCache * MOD_lineart_init_cache()
ListBaseT< LinkData > bp
LineartBoundingArea * child
LineartTriangle ** linked_triangles
ListBaseT< LinkData > lp
ListBaseT< LinkData > up
ListBaseT< LineartChainRegisterEntry > linked_chains
ListBaseT< LinkData > rp
LineartStaticMemPool chain_data_pool
ListBaseT< LineartElementLinkNode > shadow_elns
ListBaseT< LineartEdgeChain > chains
uint16_t all_enabled_edge_types
LineartStaticMemPool shadow_data_pool
ed::greasepencil::LineartLimitInfo LimitInfo
LineartChainRegisterEntry * prev
LineartChainRegisterEntry * next
ListBaseT< LineartElementLinkNode > vertex_buffer_pointers
ListBaseT< LineartElementLinkNode > intersecting_vertex_buffer
ListBaseT< LineartElementLinkNode > triangle_adjacent_pointers
ListBaseT< LineartElementLinkNode > line_buffer_pointers
ListBaseT< LineartElementLinkNode > triangle_buffer_pointers
LineartBoundingArea * initials
LineartStaticMemPool * chain_data_pool
LineartShadowEdge * shadow_edges
struct blender::LineartData::_geom geom
LineartStaticMemPool * edge_data_pool
struct blender::LineartData::_qtree qtree
struct blender::LineartData::_conf conf
ListBaseT< LineartEdgeChain > chains
struct LineartPendingEdges pending_edges
LineartStaticMemPool render_data_pool
ListBaseT< LineartEdgeSegment > wasted_cuts
LineartElementLinkNode * isect_scheduled_up_to
LineartStaticMemPool * shadow_data_pool
ListBaseT< LineartShadowSegment > wasted_shadow_cuts
LineartEdgeChainItem * prev
LineartEdgeChainItem * next
ListBaseT< LineartEdgeChainItem > chain
LineartEdgeChain * next
LineartEdgeChain * prev
LineartEdgeSegment * next
LineartEdgeSegment * prev
ListBaseT< LineartEdgeSegment > segments
LineartTriangle * t1
LineartTriangle * t2
eLineArtElementNodeFlag flags
LineartElementLinkNode * next
LineartElementLinkNode * prev
Set< const Object * > object_dependencies
LineartObjectInfo * next
LineartPendingEdges pending_edges
LineartElementLinkNode * v_eln
ListBaseT< LineartElementLinkNode > * shadow_elns
struct LineartPendingEdges pending_edges
ListBaseT< LineartShadowSegment > shadow_segments
LineartEdge * e_ref_light_contour
LineartShadowEdge * prev
LineartShadowEdge * next
LineartEdgeSegment * es_ref
LineartShadowSegment * prev
LineartShadowSegment * next
ListBaseT< LineartStaticMemPoolNode > pools