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:
authorCampbell Barton <ideasman42@gmail.com>2019-04-17 07:17:24 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-04-17 07:21:24 +0300
commite12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch)
tree8cf3453d12edb177a218ef8009357518ec6cab6a /source/blender/shader_fx
parentb3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff)
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'source/blender/shader_fx')
-rw-r--r--source/blender/shader_fx/CMakeLists.txt56
-rw-r--r--source/blender/shader_fx/FX_shader_types.h2
-rw-r--r--source/blender/shader_fx/intern/FX_shader_blur.c40
-rw-r--r--source/blender/shader_fx/intern/FX_shader_colorize.c42
-rw-r--r--source/blender/shader_fx/intern/FX_shader_flip.c38
-rw-r--r--source/blender/shader_fx/intern/FX_shader_glow.c40
-rw-r--r--source/blender/shader_fx/intern/FX_shader_light.c65
-rw-r--r--source/blender/shader_fx/intern/FX_shader_pixel.c38
-rw-r--r--source/blender/shader_fx/intern/FX_shader_rim.c42
-rw-r--r--source/blender/shader_fx/intern/FX_shader_shadow.c81
-rw-r--r--source/blender/shader_fx/intern/FX_shader_swirl.c63
-rw-r--r--source/blender/shader_fx/intern/FX_shader_util.c21
-rw-r--r--source/blender/shader_fx/intern/FX_shader_util.h3
-rw-r--r--source/blender/shader_fx/intern/FX_shader_wave.c38
14 files changed, 285 insertions, 284 deletions
diff --git a/source/blender/shader_fx/CMakeLists.txt b/source/blender/shader_fx/CMakeLists.txt
index e8f2a038dce..7d36e8836fd 100644
--- a/source/blender/shader_fx/CMakeLists.txt
+++ b/source/blender/shader_fx/CMakeLists.txt
@@ -20,48 +20,48 @@
# ***** END GPL LICENSE BLOCK *****
set(INC
- .
- intern
- ../blenkernel
- ../blenlib
- ../blenfont
- ../depsgraph
- ../makesdna
- ../makesrna
- ../bmesh
- ../render/extern/include
- ../../../intern/elbeem/extern
- ../../../intern/guardedalloc
- ../../../intern/eigen
+ .
+ intern
+ ../blenkernel
+ ../blenlib
+ ../blenfont
+ ../depsgraph
+ ../makesdna
+ ../makesrna
+ ../bmesh
+ ../render/extern/include
+ ../../../intern/elbeem/extern
+ ../../../intern/guardedalloc
+ ../../../intern/eigen
)
set(INC_SYS
- ${ZLIB_INCLUDE_DIRS}
+ ${ZLIB_INCLUDE_DIRS}
)
set(SRC
- intern/FX_shader_util.h
+ intern/FX_shader_util.h
- intern/FX_shader_blur.c
- intern/FX_shader_colorize.c
- intern/FX_shader_flip.c
- intern/FX_shader_glow.c
- intern/FX_shader_light.c
- intern/FX_shader_pixel.c
- intern/FX_shader_rim.c
- intern/FX_shader_shadow.c
- intern/FX_shader_swirl.c
- intern/FX_shader_util.c
- intern/FX_shader_wave.c
+ intern/FX_shader_blur.c
+ intern/FX_shader_colorize.c
+ intern/FX_shader_flip.c
+ intern/FX_shader_glow.c
+ intern/FX_shader_light.c
+ intern/FX_shader_pixel.c
+ intern/FX_shader_rim.c
+ intern/FX_shader_shadow.c
+ intern/FX_shader_swirl.c
+ intern/FX_shader_util.c
+ intern/FX_shader_wave.c
- FX_shader_types.h
+ FX_shader_types.h
)
set(LIB
)
if(WITH_INTERNATIONAL)
- add_definitions(-DWITH_INTERNATIONAL)
+ add_definitions(-DWITH_INTERNATIONAL)
endif()
add_definitions(${GL_DEFINITIONS})
diff --git a/source/blender/shader_fx/FX_shader_types.h b/source/blender/shader_fx/FX_shader_types.h
index d46bee8f45e..7a87c77f313 100644
--- a/source/blender/shader_fx/FX_shader_types.h
+++ b/source/blender/shader_fx/FX_shader_types.h
@@ -40,4 +40,4 @@ extern ShaderFxTypeInfo shaderfx_Type_Wave;
/* FX_shaderfx_util.c */
void shaderfx_type_init(ShaderFxTypeInfo *types[]);
-#endif /* __FX_SHADER_TYPES_H__ */
+#endif /* __FX_SHADER_TYPES_H__ */
diff --git a/source/blender/shader_fx/intern/FX_shader_blur.c b/source/blender/shader_fx/intern/FX_shader_blur.c
index 8f994255aa1..72d2a61dafd 100644
--- a/source/blender/shader_fx/intern/FX_shader_blur.c
+++ b/source/blender/shader_fx/intern/FX_shader_blur.c
@@ -29,31 +29,31 @@
static void initData(ShaderFxData *fx)
{
- BlurShaderFxData *gpfx = (BlurShaderFxData *)fx;
- ARRAY_SET_ITEMS(gpfx->radius, 1, 1);
- gpfx->samples = 4;
- gpfx->coc = 0.025f;
+ BlurShaderFxData *gpfx = (BlurShaderFxData *)fx;
+ ARRAY_SET_ITEMS(gpfx->radius, 1, 1);
+ gpfx->samples = 4;
+ gpfx->coc = 0.025f;
}
static void copyData(const ShaderFxData *md, ShaderFxData *target)
{
- BKE_shaderfx_copyData_generic(md, target);
+ BKE_shaderfx_copyData_generic(md, target);
}
ShaderFxTypeInfo shaderfx_Type_Blur = {
- /* name */ "Blur",
- /* structName */ "BlurShaderFxData",
- /* structSize */ sizeof(BlurShaderFxData),
- /* type */ eShaderFxType_GpencilType,
- /* flags */ eShaderFxTypeFlag_Single,
-
- /* copyData */ copyData,
-
- /* initData */ initData,
- /* freeData */ NULL,
- /* isDisabled */ NULL,
- /* updateDepsgraph */ NULL,
- /* dependsOnTime */ NULL,
- /* foreachObjectLink */ NULL,
- /* foreachIDLink */ NULL,
+ /* name */ "Blur",
+ /* structName */ "BlurShaderFxData",
+ /* structSize */ sizeof(BlurShaderFxData),
+ /* type */ eShaderFxType_GpencilType,
+ /* flags */ eShaderFxTypeFlag_Single,
+
+ /* copyData */ copyData,
+
+ /* initData */ initData,
+ /* freeData */ NULL,
+ /* isDisabled */ NULL,
+ /* updateDepsgraph */ NULL,
+ /* dependsOnTime */ NULL,
+ /* foreachObjectLink */ NULL,
+ /* foreachIDLink */ NULL,
};
diff --git a/source/blender/shader_fx/intern/FX_shader_colorize.c b/source/blender/shader_fx/intern/FX_shader_colorize.c
index 3faea305140..7438fbf7fa7 100644
--- a/source/blender/shader_fx/intern/FX_shader_colorize.c
+++ b/source/blender/shader_fx/intern/FX_shader_colorize.c
@@ -31,32 +31,32 @@
static void initData(ShaderFxData *fx)
{
- ColorizeShaderFxData *gpfx = (ColorizeShaderFxData *)fx;
- ARRAY_SET_ITEMS(gpfx->low_color, 0.0f, 0.0f, 0.0f, 1.0f);
- ARRAY_SET_ITEMS(gpfx->high_color, 1.0f, 1.0f, 1.0f, 1.0f);
- gpfx->mode = eShaderFxColorizeMode_GrayScale;
- gpfx->factor = 0.5f;
+ ColorizeShaderFxData *gpfx = (ColorizeShaderFxData *)fx;
+ ARRAY_SET_ITEMS(gpfx->low_color, 0.0f, 0.0f, 0.0f, 1.0f);
+ ARRAY_SET_ITEMS(gpfx->high_color, 1.0f, 1.0f, 1.0f, 1.0f);
+ gpfx->mode = eShaderFxColorizeMode_GrayScale;
+ gpfx->factor = 0.5f;
}
static void copyData(const ShaderFxData *md, ShaderFxData *target)
{
- BKE_shaderfx_copyData_generic(md, target);
+ BKE_shaderfx_copyData_generic(md, target);
}
ShaderFxTypeInfo shaderfx_Type_Colorize = {
- /* name */ "Colorize",
- /* structName */ "ColorizeShaderFxData",
- /* structSize */ sizeof(ColorizeShaderFxData),
- /* type */ eShaderFxType_GpencilType,
- /* flags */ 0,
-
- /* copyData */ copyData,
-
- /* initData */ initData,
- /* freeData */ NULL,
- /* isDisabled */ NULL,
- /* updateDepsgraph */ NULL,
- /* dependsOnTime */ NULL,
- /* foreachObjectLink */ NULL,
- /* foreachIDLink */ NULL,
+ /* name */ "Colorize",
+ /* structName */ "ColorizeShaderFxData",
+ /* structSize */ sizeof(ColorizeShaderFxData),
+ /* type */ eShaderFxType_GpencilType,
+ /* flags */ 0,
+
+ /* copyData */ copyData,
+
+ /* initData */ initData,
+ /* freeData */ NULL,
+ /* isDisabled */ NULL,
+ /* updateDepsgraph */ NULL,
+ /* dependsOnTime */ NULL,
+ /* foreachObjectLink */ NULL,
+ /* foreachIDLink */ NULL,
};
diff --git a/source/blender/shader_fx/intern/FX_shader_flip.c b/source/blender/shader_fx/intern/FX_shader_flip.c
index ff420d86b58..804b194ed68 100644
--- a/source/blender/shader_fx/intern/FX_shader_flip.c
+++ b/source/blender/shader_fx/intern/FX_shader_flip.c
@@ -33,29 +33,29 @@
static void initData(ShaderFxData *fx)
{
- FlipShaderFxData *gpfx = (FlipShaderFxData *)fx;
- gpfx->flag |= FX_FLIP_HORIZONTAL;
+ FlipShaderFxData *gpfx = (FlipShaderFxData *)fx;
+ gpfx->flag |= FX_FLIP_HORIZONTAL;
}
static void copyData(const ShaderFxData *md, ShaderFxData *target)
{
- BKE_shaderfx_copyData_generic(md, target);
+ BKE_shaderfx_copyData_generic(md, target);
}
-ShaderFxTypeInfo shaderfx_Type_Flip = {
- /* name */ "Flip",
- /* structName */ "FlipShaderFxData",
- /* structSize */ sizeof(FlipShaderFxData),
- /* type */ eShaderFxType_GpencilType,
- /* flags */ eShaderFxTypeFlag_Single,
-
- /* copyData */ copyData,
-
- /* initData */ initData,
- /* freeData */ NULL,
- /* isDisabled */ NULL,
- /* updateDepsgraph */ NULL,
- /* dependsOnTime */ NULL,
- /* foreachObjectLink */ NULL,
- /* foreachIDLink */ NULL,
+ShaderFxTypeInfo shaderfx_Type_Flip = {
+ /* name */ "Flip",
+ /* structName */ "FlipShaderFxData",
+ /* structSize */ sizeof(FlipShaderFxData),
+ /* type */ eShaderFxType_GpencilType,
+ /* flags */ eShaderFxTypeFlag_Single,
+
+ /* copyData */ copyData,
+
+ /* initData */ initData,
+ /* freeData */ NULL,
+ /* isDisabled */ NULL,
+ /* updateDepsgraph */ NULL,
+ /* dependsOnTime */ NULL,
+ /* foreachObjectLink */ NULL,
+ /* foreachIDLink */ NULL,
};
diff --git a/source/blender/shader_fx/intern/FX_shader_glow.c b/source/blender/shader_fx/intern/FX_shader_glow.c
index 8b47d3eba26..1b1e4dc9d94 100644
--- a/source/blender/shader_fx/intern/FX_shader_glow.c
+++ b/source/blender/shader_fx/intern/FX_shader_glow.c
@@ -36,34 +36,34 @@
static void initData(ShaderFxData *md)
{
- GlowShaderFxData *gpfx = (GlowShaderFxData *)md;
- ARRAY_SET_ITEMS(gpfx->glow_color, 0.75f, 1.0f, 1.0f);
- ARRAY_SET_ITEMS(gpfx->select_color, 0.0f, 0.0f, 0.0f);
- gpfx->threshold = 0.1f;
+ GlowShaderFxData *gpfx = (GlowShaderFxData *)md;
+ ARRAY_SET_ITEMS(gpfx->glow_color, 0.75f, 1.0f, 1.0f);
+ ARRAY_SET_ITEMS(gpfx->select_color, 0.0f, 0.0f, 0.0f);
+ gpfx->threshold = 0.1f;
- ARRAY_SET_ITEMS(gpfx->blur, 50, 0);
- gpfx->samples = 16;
+ ARRAY_SET_ITEMS(gpfx->blur, 50, 0);
+ gpfx->samples = 16;
}
static void copyData(const ShaderFxData *md, ShaderFxData *target)
{
- BKE_shaderfx_copyData_generic(md, target);
+ BKE_shaderfx_copyData_generic(md, target);
}
ShaderFxTypeInfo shaderfx_Type_Glow = {
- /* name */ "Glow",
- /* structName */ "GlowShaderFxData",
- /* structSize */ sizeof(GlowShaderFxData),
- /* type */ eShaderFxType_GpencilType,
- /* flags */ 0,
+ /* name */ "Glow",
+ /* structName */ "GlowShaderFxData",
+ /* structSize */ sizeof(GlowShaderFxData),
+ /* type */ eShaderFxType_GpencilType,
+ /* flags */ 0,
- /* copyData */ copyData,
+ /* copyData */ copyData,
- /* initData */ initData,
- /* freeData */ NULL,
- /* isDisabled */ NULL,
- /* updateDepsgraph */ NULL,
- /* dependsOnTime */ NULL,
- /* foreachObjectLink */ NULL,
- /* foreachIDLink */ NULL,
+ /* initData */ initData,
+ /* freeData */ NULL,
+ /* isDisabled */ NULL,
+ /* updateDepsgraph */ NULL,
+ /* dependsOnTime */ NULL,
+ /* foreachObjectLink */ NULL,
+ /* foreachIDLink */ NULL,
};
diff --git a/source/blender/shader_fx/intern/FX_shader_light.c b/source/blender/shader_fx/intern/FX_shader_light.c
index d4c726a63db..d3d5b9b69cb 100644
--- a/source/blender/shader_fx/intern/FX_shader_light.c
+++ b/source/blender/shader_fx/intern/FX_shader_light.c
@@ -40,56 +40,57 @@
static void initData(ShaderFxData *fx)
{
- LightShaderFxData *gpfx = (LightShaderFxData *)fx;
- gpfx->energy = 10.0f;
- gpfx->ambient = 5.0f;
- gpfx->object = NULL;
+ LightShaderFxData *gpfx = (LightShaderFxData *)fx;
+ gpfx->energy = 10.0f;
+ gpfx->ambient = 5.0f;
+ gpfx->object = NULL;
}
static void copyData(const ShaderFxData *md, ShaderFxData *target)
{
- BKE_shaderfx_copyData_generic(md, target);
+ BKE_shaderfx_copyData_generic(md, target);
}
static void updateDepsgraph(ShaderFxData *md, const ModifierUpdateDepsgraphContext *ctx)
{
- LightShaderFxData *fxd = (LightShaderFxData *)md;
- if (fxd->object != NULL) {
- DEG_add_object_relation(ctx->node, fxd->object, DEG_OB_COMP_TRANSFORM, "Light ShaderFx");
- }
- DEG_add_object_relation(ctx->node, ctx->object, DEG_OB_COMP_TRANSFORM, "Light ShaderFx");
+ LightShaderFxData *fxd = (LightShaderFxData *)md;
+ if (fxd->object != NULL) {
+ DEG_add_object_relation(ctx->node, fxd->object, DEG_OB_COMP_TRANSFORM, "Light ShaderFx");
+ }
+ DEG_add_object_relation(ctx->node, ctx->object, DEG_OB_COMP_TRANSFORM, "Light ShaderFx");
}
static bool isDisabled(ShaderFxData *fx, int UNUSED(userRenderParams))
{
- LightShaderFxData *fxd = (LightShaderFxData *)fx;
+ LightShaderFxData *fxd = (LightShaderFxData *)fx;
- return !fxd->object;
+ return !fxd->object;
}
-static void foreachObjectLink(
- ShaderFxData *fx, Object *ob,
- ShaderFxObjectWalkFunc walk, void *userData)
+static void foreachObjectLink(ShaderFxData *fx,
+ Object *ob,
+ ShaderFxObjectWalkFunc walk,
+ void *userData)
{
- LightShaderFxData *fxd = (LightShaderFxData *)fx;
+ LightShaderFxData *fxd = (LightShaderFxData *)fx;
- walk(userData, ob, &fxd->object, IDWALK_CB_NOP);
+ walk(userData, ob, &fxd->object, IDWALK_CB_NOP);
}
ShaderFxTypeInfo shaderfx_Type_Light = {
- /* name */ "Light",
- /* structName */ "LightShaderFxData",
- /* structSize */ sizeof(LightShaderFxData),
- /* type */ eShaderFxType_GpencilType,
- /* flags */ 0,
-
- /* copyData */ copyData,
-
- /* initData */ initData,
- /* freeData */ NULL,
- /* isDisabled */ isDisabled,
- /* updateDepsgraph */ updateDepsgraph,
- /* dependsOnTime */ NULL,
- /* foreachObjectLink */ foreachObjectLink,
- /* foreachIDLink */ NULL,
+ /* name */ "Light",
+ /* structName */ "LightShaderFxData",
+ /* structSize */ sizeof(LightShaderFxData),
+ /* type */ eShaderFxType_GpencilType,
+ /* flags */ 0,
+
+ /* copyData */ copyData,
+
+ /* initData */ initData,
+ /* freeData */ NULL,
+ /* isDisabled */ isDisabled,
+ /* updateDepsgraph */ updateDepsgraph,
+ /* dependsOnTime */ NULL,
+ /* foreachObjectLink */ foreachObjectLink,
+ /* foreachIDLink */ NULL,
};
diff --git a/source/blender/shader_fx/intern/FX_shader_pixel.c b/source/blender/shader_fx/intern/FX_shader_pixel.c
index 62efb7a0dd5..e0ea111d121 100644
--- a/source/blender/shader_fx/intern/FX_shader_pixel.c
+++ b/source/blender/shader_fx/intern/FX_shader_pixel.c
@@ -29,30 +29,30 @@
static void initData(ShaderFxData *fx)
{
- PixelShaderFxData *gpfx = (PixelShaderFxData *)fx;
- ARRAY_SET_ITEMS(gpfx->size, 5, 5);
- ARRAY_SET_ITEMS(gpfx->rgba, 0.0f, 0.0f, 0.0f, 0.9f);
+ PixelShaderFxData *gpfx = (PixelShaderFxData *)fx;
+ ARRAY_SET_ITEMS(gpfx->size, 5, 5);
+ ARRAY_SET_ITEMS(gpfx->rgba, 0.0f, 0.0f, 0.0f, 0.9f);
}
static void copyData(const ShaderFxData *md, ShaderFxData *target)
{
- BKE_shaderfx_copyData_generic(md, target);
+ BKE_shaderfx_copyData_generic(md, target);
}
ShaderFxTypeInfo shaderfx_Type_Pixel = {
- /* name */ "Pixelate",
- /* structName */ "PixelShaderFxData",
- /* structSize */ sizeof(PixelShaderFxData),
- /* type */ eShaderFxType_GpencilType,
- /* flags */ eShaderFxTypeFlag_Single,
-
- /* copyData */ copyData,
-
- /* initData */ initData,
- /* freeData */ NULL,
- /* isDisabled */ NULL,
- /* updateDepsgraph */ NULL,
- /* dependsOnTime */ NULL,
- /* foreachObjectLink */ NULL,
- /* foreachIDLink */ NULL,
+ /* name */ "Pixelate",
+ /* structName */ "PixelShaderFxData",
+ /* structSize */ sizeof(PixelShaderFxData),
+ /* type */ eShaderFxType_GpencilType,
+ /* flags */ eShaderFxTypeFlag_Single,
+
+ /* copyData */ copyData,
+
+ /* initData */ initData,
+ /* freeData */ NULL,
+ /* isDisabled */ NULL,
+ /* updateDepsgraph */ NULL,
+ /* dependsOnTime */ NULL,
+ /* foreachObjectLink */ NULL,
+ /* foreachIDLink */ NULL,
};
diff --git a/source/blender/shader_fx/intern/FX_shader_rim.c b/source/blender/shader_fx/intern/FX_shader_rim.c
index d4e6d618e35..d16210918fc 100644
--- a/source/blender/shader_fx/intern/FX_shader_rim.c
+++ b/source/blender/shader_fx/intern/FX_shader_rim.c
@@ -31,35 +31,35 @@
static void initData(ShaderFxData *fx)
{
- RimShaderFxData *gpfx = (RimShaderFxData *)fx;
- ARRAY_SET_ITEMS(gpfx->offset, 50, -100);
- ARRAY_SET_ITEMS(gpfx->rim_rgb, 1.0f, 1.0f, 0.5f);
- ARRAY_SET_ITEMS(gpfx->mask_rgb, 0.0f, 0.0f, 0.0f);
- gpfx->mode = eShaderFxRimMode_Multiply;
+ RimShaderFxData *gpfx = (RimShaderFxData *)fx;
+ ARRAY_SET_ITEMS(gpfx->offset, 50, -100);
+ ARRAY_SET_ITEMS(gpfx->rim_rgb, 1.0f, 1.0f, 0.5f);
+ ARRAY_SET_ITEMS(gpfx->mask_rgb, 0.0f, 0.0f, 0.0f);
+ gpfx->mode = eShaderFxRimMode_Multiply;
- ARRAY_SET_ITEMS(gpfx->blur, 0, 0);
- gpfx->samples = 2;
+ ARRAY_SET_ITEMS(gpfx->blur, 0, 0);
+ gpfx->samples = 2;
}
static void copyData(const ShaderFxData *md, ShaderFxData *target)
{
- BKE_shaderfx_copyData_generic(md, target);
+ BKE_shaderfx_copyData_generic(md, target);
}
ShaderFxTypeInfo shaderfx_Type_Rim = {
- /* name */ "Rim",
- /* structName */ "RimShaderFxData",
- /* structSize */ sizeof(RimShaderFxData),
- /* type */ eShaderFxType_GpencilType,
- /* flags */ 0,
+ /* name */ "Rim",
+ /* structName */ "RimShaderFxData",
+ /* structSize */ sizeof(RimShaderFxData),
+ /* type */ eShaderFxType_GpencilType,
+ /* flags */ 0,
- /* copyData */ copyData,
+ /* copyData */ copyData,
- /* initData */ initData,
- /* freeData */ NULL,
- /* isDisabled */ NULL,
- /* updateDepsgraph */ NULL,
- /* dependsOnTime */ NULL,
- /* foreachObjectLink */ NULL,
- /* foreachIDLink */ NULL,
+ /* initData */ initData,
+ /* freeData */ NULL,
+ /* isDisabled */ NULL,
+ /* updateDepsgraph */ NULL,
+ /* dependsOnTime */ NULL,
+ /* foreachObjectLink */ NULL,
+ /* foreachIDLink */ NULL,
};
diff --git a/source/blender/shader_fx/intern/FX_shader_shadow.c b/source/blender/shader_fx/intern/FX_shader_shadow.c
index 5c99b245954..04160f618eb 100644
--- a/source/blender/shader_fx/intern/FX_shader_shadow.c
+++ b/source/blender/shader_fx/intern/FX_shader_shadow.c
@@ -40,67 +40,68 @@
static void initData(ShaderFxData *md)
{
- ShadowShaderFxData *gpfx = (ShadowShaderFxData *)md;
- gpfx->rotation = 0.0f;
- ARRAY_SET_ITEMS(gpfx->offset, 15, 20);
- ARRAY_SET_ITEMS(gpfx->scale, 1.0f, 1.0f);
- ARRAY_SET_ITEMS(gpfx->shadow_rgba, 0.54f, 0.62f, 1.0f, 0.9f);
+ ShadowShaderFxData *gpfx = (ShadowShaderFxData *)md;
+ gpfx->rotation = 0.0f;
+ ARRAY_SET_ITEMS(gpfx->offset, 15, 20);
+ ARRAY_SET_ITEMS(gpfx->scale, 1.0f, 1.0f);
+ ARRAY_SET_ITEMS(gpfx->shadow_rgba, 0.54f, 0.62f, 1.0f, 0.9f);
- gpfx->amplitude = 10.0f;
- gpfx->period = 20.0f;
- gpfx->phase = 0.0f;
- gpfx->orientation = 1;
+ gpfx->amplitude = 10.0f;
+ gpfx->period = 20.0f;
+ gpfx->phase = 0.0f;
+ gpfx->orientation = 1;
- ARRAY_SET_ITEMS(gpfx->blur, 5, 5);
- gpfx->samples = 2;
+ ARRAY_SET_ITEMS(gpfx->blur, 5, 5);
+ gpfx->samples = 2;
- gpfx->object = NULL;
+ gpfx->object = NULL;
}
static void copyData(const ShaderFxData *md, ShaderFxData *target)
{
- BKE_shaderfx_copyData_generic(md, target);
+ BKE_shaderfx_copyData_generic(md, target);
}
static void updateDepsgraph(ShaderFxData *fx, const ModifierUpdateDepsgraphContext *ctx)
{
- ShadowShaderFxData *fxd = (ShadowShaderFxData *)fx;
- if (fxd->object != NULL) {
- DEG_add_object_relation(ctx->node, fxd->object, DEG_OB_COMP_TRANSFORM, "Shadow ShaderFx");
- }
- DEG_add_object_relation(ctx->node, ctx->object, DEG_OB_COMP_TRANSFORM, "Shadow ShaderFx");
+ ShadowShaderFxData *fxd = (ShadowShaderFxData *)fx;
+ if (fxd->object != NULL) {
+ DEG_add_object_relation(ctx->node, fxd->object, DEG_OB_COMP_TRANSFORM, "Shadow ShaderFx");
+ }
+ DEG_add_object_relation(ctx->node, ctx->object, DEG_OB_COMP_TRANSFORM, "Shadow ShaderFx");
}
static bool isDisabled(ShaderFxData *fx, int UNUSED(userRenderParams))
{
- ShadowShaderFxData *fxd = (ShadowShaderFxData *)fx;
+ ShadowShaderFxData *fxd = (ShadowShaderFxData *)fx;
- return (!fxd->object) && (fxd->flag & FX_SHADOW_USE_OBJECT);
+ return (!fxd->object) && (fxd->flag & FX_SHADOW_USE_OBJECT);
}
-static void foreachObjectLink(
- ShaderFxData *fx, Object *ob,
- ShaderFxObjectWalkFunc walk, void *userData)
+static void foreachObjectLink(ShaderFxData *fx,
+ Object *ob,
+ ShaderFxObjectWalkFunc walk,
+ void *userData)
{
- ShadowShaderFxData *fxd = (ShadowShaderFxData *)fx;
+ ShadowShaderFxData *fxd = (ShadowShaderFxData *)fx;
- walk(userData, ob, &fxd->object, IDWALK_CB_NOP);
+ walk(userData, ob, &fxd->object, IDWALK_CB_NOP);
}
ShaderFxTypeInfo shaderfx_Type_Shadow = {
- /* name */ "Shadow",
- /* structName */ "ShadowShaderFxData",
- /* structSize */ sizeof(ShadowShaderFxData),
- /* type */ eShaderFxType_GpencilType,
- /* flags */ 0,
-
- /* copyData */ copyData,
-
- /* initData */ initData,
- /* freeData */ NULL,
- /* isDisabled */ isDisabled,
- /* updateDepsgraph */ updateDepsgraph,
- /* dependsOnTime */ NULL,
- /* foreachObjectLink */ foreachObjectLink,
- /* foreachIDLink */ NULL,
+ /* name */ "Shadow",
+ /* structName */ "ShadowShaderFxData",
+ /* structSize */ sizeof(ShadowShaderFxData),
+ /* type */ eShaderFxType_GpencilType,
+ /* flags */ 0,
+
+ /* copyData */ copyData,
+
+ /* initData */ initData,
+ /* freeData */ NULL,
+ /* isDisabled */ isDisabled,
+ /* updateDepsgraph */ updateDepsgraph,
+ /* dependsOnTime */ NULL,
+ /* foreachObjectLink */ foreachObjectLink,
+ /* foreachIDLink */ NULL,
};
diff --git a/source/blender/shader_fx/intern/FX_shader_swirl.c b/source/blender/shader_fx/intern/FX_shader_swirl.c
index 033f307318d..ee865e13764 100644
--- a/source/blender/shader_fx/intern/FX_shader_swirl.c
+++ b/source/blender/shader_fx/intern/FX_shader_swirl.c
@@ -41,55 +41,56 @@
static void initData(ShaderFxData *md)
{
- SwirlShaderFxData *gpmd = (SwirlShaderFxData *)md;
- gpmd->radius = 100;
- gpmd->angle = M_PI_2;
+ SwirlShaderFxData *gpmd = (SwirlShaderFxData *)md;
+ gpmd->radius = 100;
+ gpmd->angle = M_PI_2;
}
static void copyData(const ShaderFxData *md, ShaderFxData *target)
{
- BKE_shaderfx_copyData_generic(md, target);
+ BKE_shaderfx_copyData_generic(md, target);
}
static void updateDepsgraph(ShaderFxData *fx, const ModifierUpdateDepsgraphContext *ctx)
{
- SwirlShaderFxData *fxd = (SwirlShaderFxData *)fx;
- if (fxd->object != NULL) {
- DEG_add_object_relation(ctx->node, fxd->object, DEG_OB_COMP_TRANSFORM, "Swirl ShaderFx");
- }
- DEG_add_object_relation(ctx->node, ctx->object, DEG_OB_COMP_TRANSFORM, "Swirl ShaderFx");
+ SwirlShaderFxData *fxd = (SwirlShaderFxData *)fx;
+ if (fxd->object != NULL) {
+ DEG_add_object_relation(ctx->node, fxd->object, DEG_OB_COMP_TRANSFORM, "Swirl ShaderFx");
+ }
+ DEG_add_object_relation(ctx->node, ctx->object, DEG_OB_COMP_TRANSFORM, "Swirl ShaderFx");
}
static bool isDisabled(ShaderFxData *fx, int UNUSED(userRenderParams))
{
- SwirlShaderFxData *fxd = (SwirlShaderFxData *)fx;
+ SwirlShaderFxData *fxd = (SwirlShaderFxData *)fx;
- return !fxd->object;
+ return !fxd->object;
}
-static void foreachObjectLink(
- ShaderFxData *fx, Object *ob,
- ShaderFxObjectWalkFunc walk, void *userData)
+static void foreachObjectLink(ShaderFxData *fx,
+ Object *ob,
+ ShaderFxObjectWalkFunc walk,
+ void *userData)
{
- SwirlShaderFxData *fxd = (SwirlShaderFxData *)fx;
+ SwirlShaderFxData *fxd = (SwirlShaderFxData *)fx;
- walk(userData, ob, &fxd->object, IDWALK_CB_NOP);
+ walk(userData, ob, &fxd->object, IDWALK_CB_NOP);
}
ShaderFxTypeInfo shaderfx_Type_Swirl = {
- /* name */ "Swirl",
- /* structName */ "SwirlShaderFxData",
- /* structSize */ sizeof(SwirlShaderFxData),
- /* type */ eShaderFxType_GpencilType,
- /* flags */ 0,
-
- /* copyData */ copyData,
-
- /* initData */ initData,
- /* freeData */ NULL,
- /* isDisabled */ isDisabled,
- /* updateDepsgraph */ updateDepsgraph,
- /* dependsOnTime */ NULL,
- /* foreachObjectLink */ foreachObjectLink,
- /* foreachIDLink */ NULL,
+ /* name */ "Swirl",
+ /* structName */ "SwirlShaderFxData",
+ /* structSize */ sizeof(SwirlShaderFxData),
+ /* type */ eShaderFxType_GpencilType,
+ /* flags */ 0,
+
+ /* copyData */ copyData,
+
+ /* initData */ initData,
+ /* freeData */ NULL,
+ /* isDisabled */ isDisabled,
+ /* updateDepsgraph */ updateDepsgraph,
+ /* dependsOnTime */ NULL,
+ /* foreachObjectLink */ foreachObjectLink,
+ /* foreachIDLink */ NULL,
};
diff --git a/source/blender/shader_fx/intern/FX_shader_util.c b/source/blender/shader_fx/intern/FX_shader_util.c
index e34acadced7..908a2b249b8 100644
--- a/source/blender/shader_fx/intern/FX_shader_util.c
+++ b/source/blender/shader_fx/intern/FX_shader_util.c
@@ -21,7 +21,6 @@
* \ingroup shader_fx
*/
-
#include <stdio.h>
#include "MEM_guardedalloc.h"
@@ -36,15 +35,15 @@
void shaderfx_type_init(ShaderFxTypeInfo *types[])
{
#define INIT_FX_TYPE(typeName) (types[eShaderFxType_##typeName] = &shaderfx_Type_##typeName)
- INIT_FX_TYPE(Blur);
- INIT_FX_TYPE(Colorize);
- INIT_FX_TYPE(Flip);
- INIT_FX_TYPE(Glow);
- INIT_FX_TYPE(Light);
- INIT_FX_TYPE(Pixel);
- INIT_FX_TYPE(Rim);
- INIT_FX_TYPE(Shadow);
- INIT_FX_TYPE(Swirl);
- INIT_FX_TYPE(Wave);
+ INIT_FX_TYPE(Blur);
+ INIT_FX_TYPE(Colorize);
+ INIT_FX_TYPE(Flip);
+ INIT_FX_TYPE(Glow);
+ INIT_FX_TYPE(Light);
+ INIT_FX_TYPE(Pixel);
+ INIT_FX_TYPE(Rim);
+ INIT_FX_TYPE(Shadow);
+ INIT_FX_TYPE(Swirl);
+ INIT_FX_TYPE(Wave);
#undef INIT_FX_TYPE
}
diff --git a/source/blender/shader_fx/intern/FX_shader_util.h b/source/blender/shader_fx/intern/FX_shader_util.h
index 11cc7a3ce9a..8ff5a6c0d0e 100644
--- a/source/blender/shader_fx/intern/FX_shader_util.h
+++ b/source/blender/shader_fx/intern/FX_shader_util.h
@@ -21,8 +21,7 @@
* \ingroup shader_fx
*/
-
#ifndef __FX_SHADER_UTIL_H__
#define __FX_SHADER_UTIL_H__
-#endif /* __FX_SHADER_UTIL_H__ */
+#endif /* __FX_SHADER_UTIL_H__ */
diff --git a/source/blender/shader_fx/intern/FX_shader_wave.c b/source/blender/shader_fx/intern/FX_shader_wave.c
index 5b427331429..8abe70ec22e 100644
--- a/source/blender/shader_fx/intern/FX_shader_wave.c
+++ b/source/blender/shader_fx/intern/FX_shader_wave.c
@@ -33,32 +33,32 @@
static void initData(ShaderFxData *fx)
{
- WaveShaderFxData *gpfx = (WaveShaderFxData *)fx;
- gpfx->amplitude = 10.0f;
- gpfx->period = 20.0f;
- gpfx->phase = 0.0f;
- gpfx->orientation = 1;
+ WaveShaderFxData *gpfx = (WaveShaderFxData *)fx;
+ gpfx->amplitude = 10.0f;
+ gpfx->period = 20.0f;
+ gpfx->phase = 0.0f;
+ gpfx->orientation = 1;
}
static void copyData(const ShaderFxData *md, ShaderFxData *target)
{
- BKE_shaderfx_copyData_generic(md, target);
+ BKE_shaderfx_copyData_generic(md, target);
}
ShaderFxTypeInfo shaderfx_Type_Wave = {
- /* name */ "Wave Distorsion",
- /* structName */ "WaveShaderFxData",
- /* structSize */ sizeof(WaveShaderFxData),
- /* type */ eShaderFxType_GpencilType,
- /* flags */ eShaderFxTypeFlag_Single,
+ /* name */ "Wave Distorsion",
+ /* structName */ "WaveShaderFxData",
+ /* structSize */ sizeof(WaveShaderFxData),
+ /* type */ eShaderFxType_GpencilType,
+ /* flags */ eShaderFxTypeFlag_Single,
- /* copyData */ copyData,
+ /* copyData */ copyData,
- /* initData */ initData,
- /* freeData */ NULL,
- /* isDisabled */ NULL,
- /* updateDepsgraph */ NULL,
- /* dependsOnTime */ NULL,
- /* foreachObjectLink */ NULL,
- /* foreachIDLink */ NULL,
+ /* initData */ initData,
+ /* freeData */ NULL,
+ /* isDisabled */ NULL,
+ /* updateDepsgraph */ NULL,
+ /* dependsOnTime */ NULL,
+ /* foreachObjectLink */ NULL,
+ /* foreachIDLink */ NULL,
};