diff options
author | Peter Kim <pk15950@gmail.com> | 2022-09-08 07:00:12 +0300 |
---|---|---|
committer | Peter Kim <pk15950@gmail.com> | 2022-09-08 07:00:12 +0300 |
commit | 00dcfdf916c69672210b006e62d966f1bc2fbeb7 (patch) | |
tree | 0cbb1b91fe26c750197126085b74224a795a103c /source/blender/makesdna/DNA_gpencil_modifier_types.h | |
parent | a39532670f6b668da7be5810fb1f844b82feeba3 (diff) | |
parent | d5934974219135102f364f57c45a8b1465e2b8d9 (diff) |
Merge branch 'master' into xr-devxr-dev
Diffstat (limited to 'source/blender/makesdna/DNA_gpencil_modifier_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_gpencil_modifier_types.h | 45 |
1 files changed, 37 insertions, 8 deletions
diff --git a/source/blender/makesdna/DNA_gpencil_modifier_types.h b/source/blender/makesdna/DNA_gpencil_modifier_types.h index 56963bae3e1..ca1eac0bde8 100644 --- a/source/blender/makesdna/DNA_gpencil_modifier_types.h +++ b/source/blender/makesdna/DNA_gpencil_modifier_types.h @@ -998,6 +998,23 @@ typedef enum eLineartGpencilModifierSource { LRT_SOURCE_SCENE = 2, } eLineartGpencilModifierSource; +typedef enum eLineartGpencilModifierShadowFilter { + /* These options need to be ordered in this way because those latter options requires line art to + * run a few extra stages. Having those values set up this way will allow + * #BKE_gpencil_get_lineart_modifier_limits() to find out maximum stages needed in multiple + * cached line art modifiers. */ + LRT_SHADOW_FILTER_NONE = 0, + LRT_SHADOW_FILTER_ILLUMINATED = 1, + LRT_SHADOW_FILTER_SHADED = 2, + LRT_SHADOW_FILTER_ILLUMINATED_ENCLOSED_SHAPES = 3, +} eLineartGpencilModifierShadowFilter; + +typedef enum eLineartGpencilModifierSilhouetteFilter { + LRT_SILHOUETTE_FILTER_NONE = 0, + LRT_SILHOUETTE_FILTER_GROUP = (1 << 0), + LRT_SILHOUETTE_FILTER_INDIVIDUAL = (1 << 1), +} eLineartGpencilModifierSilhouetteFilter; + /* This enum is for modifier internal state only. */ typedef enum eLineArtGPencilModifierFlags { /* These two moved to #eLineartMainFlags to keep consistent with flag variable purpose. */ @@ -1008,6 +1025,7 @@ typedef enum eLineArtGPencilModifierFlags { LRT_GPENCIL_USE_CACHE = (1 << 4), LRT_GPENCIL_OFFSET_TOWARDS_CUSTOM_CAMERA = (1 << 5), LRT_GPENCIL_INVERT_COLLECTION = (1 << 6), + LRT_GPENCIL_INVERT_SILHOUETTE_FILTER = (1 << 7), } eLineArtGPencilModifierFlags; typedef enum eLineartGpencilMaskSwitches { @@ -1024,8 +1042,7 @@ struct LineartCache; typedef struct LineartGpencilModifierData { GpencilModifierData modifier; - /** Line type enable flags, bits in #eLineartEdgeFlag. */ - short edge_types; + uint16_t edge_types; /* line type enable flags, bits in eLineartEdgeFlag */ /** Object or Collection, from #eLineartGpencilModifierSource. */ char source_type; @@ -1035,6 +1052,7 @@ typedef struct LineartGpencilModifierData { short level_end; struct Object *source_camera; + struct Object *light_contour_object; struct Object *source_object; struct Collection *source_collection; @@ -1049,14 +1067,19 @@ typedef struct LineartGpencilModifierData { char source_vertex_group[64]; char vgname[64]; - /** - * Camera focal length is divided by `1 + overscan`, before calculation, which give a wider FOV, + /* Camera focal length is divided by (1 + over-scan), before calculation, which give a wider FOV, * this doesn't change coordinates range internally (-1, 1), but makes the calculated frame * bigger than actual output. This is for the easier shifting calculation. A value of 0.5 means - * the "internal" focal length become 2/3 of the actual camera. - */ + * the "internal" focal length become 2/3 of the actual camera. */ float overscan; + /* Values for point light and directional (sun) light. */ + /* For point light, fov always gonna be 120 deg horizontal, with 3 "cameras" covering 360 deg. */ + float shadow_camera_fov; + float shadow_camera_size; + float shadow_camera_near; + float shadow_camera_far; + float opacity; short thickness; @@ -1064,7 +1087,9 @@ typedef struct LineartGpencilModifierData { unsigned char material_mask_bits; unsigned char intersection_mask; - char _pad[3]; + unsigned char shadow_selection; + unsigned char silhouette_selection; + char _pad[1]; /** `0..1` range for cosine angle */ float crease_threshold; @@ -1078,7 +1103,7 @@ typedef struct LineartGpencilModifierData { /* CPU mode */ float chaining_image_threshold; - /* Ported from SceneLineArt flags. */ + /* eLineartMainFlags, for one time calculation. */ int calculation_flags; /* #eLineArtGPencilModifierFlags, modifier internal state. */ @@ -1095,6 +1120,10 @@ typedef struct LineartGpencilModifierData { char level_start_override; char level_end_override; short edge_types_override; + char shadow_selection_override; + char shadow_use_silhouette_override; + + char _pad2[6]; struct LineartCache *cache; /* Keep a pointer to the render buffer so we can call destroy from ModifierData. */ |