Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYiming Wu <xp8110@outlook.com>2022-06-29 17:54:29 +0300
committerYiming Wu <xp8110@outlook.com>2022-06-29 17:54:29 +0300
commit6dd8ceef2a21f64cbb61a96560c50c162f9dae39 (patch)
treedff82af871b36d7df37213cdcc2a94dfd1ca70b2 /source/blender/makesdna/DNA_gpencil_modifier_types.h
parent2ac5b55289d361de7fccc9be188b98df358ab932 (diff)
LineArt: Shadow and related functionalities.
This patch includes the full shadow functionality for LineArt: - Light contour and cast shadow lines. - Lit/shaded region selection. - Enclosed light/shadow shape calculation. - Silhouette/anti-silhouette selection. - Intersection priority based on shadow edge identifier. Reviewed By: Sebastian Parborg (zeddb) Differential Revision: https://developer.blender.org/D15109
Diffstat (limited to 'source/blender/makesdna/DNA_gpencil_modifier_types.h')
-rw-r--r--source/blender/makesdna/DNA_gpencil_modifier_types.h42
1 files changed, 33 insertions, 9 deletions
diff --git a/source/blender/makesdna/DNA_gpencil_modifier_types.h b/source/blender/makesdna/DNA_gpencil_modifier_types.h
index 56963bae3e1..f6a54308efc 100644
--- a/source/blender/makesdna/DNA_gpencil_modifier_types.h
+++ b/source/blender/makesdna/DNA_gpencil_modifier_types.h
@@ -998,6 +998,18 @@ typedef enum eLineartGpencilModifierSource {
LRT_SOURCE_SCENE = 2,
} eLineartGpencilModifierSource;
+typedef enum eLineartGpencilModifierShadowFilter {
+ LRT_SHADOW_FILTER_NONE = 0,
+ LRT_SHADOW_FILTER_LIT = 1,
+ LRT_SHADOW_FILTER_SHADED = 2,
+} 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 +1020,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 +1037,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 +1047,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 +1062,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,
- * this doesn't change coordinates range internally (-1, 1), but makes the calculated frame
+ /* Camera focal length is divided by (1 + overscan), before caluclation, which give a wider FOV,
+ * this doesn't change coordinates range internally (-1, 1), but makes the caluclated 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 +1082,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 +1098,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 +1115,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. */