diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-07-31 12:07:56 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-07-31 12:07:56 +0300 |
commit | f6300030e01609a8f80645fd8c6603aa75da80d5 (patch) | |
tree | e381dc84daac9c17bea117fc96ed34e01652d7f4 /source | |
parent | 66da2f537ae80ce2b31d1eaf34ad8c03d858938d (diff) |
Cleanup: trailing space
Diffstat (limited to 'source')
13 files changed, 46 insertions, 46 deletions
diff --git a/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_blur_frag.glsl b/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_blur_frag.glsl index 1d66ba3d4d4..1bf1d025430 100644 --- a/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_blur_frag.glsl +++ b/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_blur_frag.glsl @@ -21,10 +21,10 @@ void main() ivec2 uv = ivec2(gl_FragCoord.xy); vec4 nloc = ProjectionMatrix * ViewMatrix * vec4(loc.xyz, 1.0); - + float dx = (ProjectionMatrix[3][3] == 0.0) ? (noffset[0] / (nloc.z * defaultpixsize)) : (noffset[0] / defaultpixsize); float dy = (ProjectionMatrix[3][3] == 0.0) ? (noffset[1] / (nloc.z * defaultpixsize)) : (noffset[1] / defaultpixsize); - + /* apply blurring, using a 9-tap filter with predefined gaussian weights */ /* depth */ float outdepth = 0; @@ -42,7 +42,7 @@ void main() gl_FragDepth = outdepth; - /* color */ + /* color */ vec4 outcolor = vec4(0.0); outcolor += texelFetch(strokeColor, ivec2(uv.x - 1.0 * dx, uv.y + 1.0 * dy), 0) * 0.0947416; outcolor += texelFetch(strokeColor, ivec2(uv.x - 0.0 * dx, uv.y + 1.0 * dy), 0) * 0.118318; diff --git a/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_colorize_frag.glsl b/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_colorize_frag.glsl index 7d0ce4a804e..33b249ac09b 100644 --- a/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_colorize_frag.glsl +++ b/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_colorize_frag.glsl @@ -28,12 +28,12 @@ void main() vec4 src_pixel= texelFetch(strokeColor, uv.xy, 0); float luminance = get_luminance(src_pixel); vec4 outcolor; - - /* is transparent */ + + /* is transparent */ if (src_pixel.a == 0.0f) { discard; } - + switch(mode) { case MODE_GRAYSCALE: { @@ -78,7 +78,7 @@ void main() { outcolor = src_pixel; } - + } gl_FragDepth = stroke_depth; diff --git a/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_flip_frag.glsl b/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_flip_frag.glsl index 94fb3405c79..43589461cd1 100644 --- a/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_flip_frag.glsl +++ b/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_flip_frag.glsl @@ -27,7 +27,7 @@ void main() if (mode[1] > 0) { uv.y = wsize.y - uv.y; } - + ivec2 iuv = ivec2(uv.x, uv.y); stroke_depth = texelFetch(strokeDepth, iuv, 0).r; outcolor = texelFetch(strokeColor, iuv, 0); diff --git a/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_light_frag.glsl b/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_light_frag.glsl index f3026c32fc8..6dcd0499baf 100644 --- a/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_light_frag.glsl +++ b/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_light_frag.glsl @@ -23,11 +23,11 @@ vec2 toScreenSpace(vec4 vertex) { /* need to calculate ndc because this is not done by vertex shader */ vec3 ndc = vec3(vertex).xyz / vertex.w; - + vec2 sc; sc.x = ((ndc.x + 1.0) / 2.0) * Viewport.x; sc.y = ((ndc.y + 1.0) / 2.0) * Viewport.y; - + return sc; } @@ -35,20 +35,20 @@ void main() { float stroke_depth; vec4 objcolor; - - vec4 light_loc = ProjectionMatrix * ViewMatrix * vec4(loc.xyz, 1.0); + + vec4 light_loc = ProjectionMatrix * ViewMatrix * vec4(loc.xyz, 1.0); vec2 light2d = toScreenSpace(light_loc); /* calc pixel scale */ float pxscale = (ProjectionMatrix[3][3] == 0.0) ? (10.0 / (light_loc.z * defaultpixsize)) : (10.0 / defaultpixsize); pxscale = max(pxscale, 0.000001); - /* the height over plane is received in the w component of the loc + /* the height over plane is received in the w component of the loc * and needs a factor to adapt to pixels */ float peak = height * 10.0 * pxscale; - vec3 light3d = vec3(light2d.x, light2d.y, peak); - + vec3 light3d = vec3(light2d.x, light2d.y, peak); + vec2 uv = vec2(gl_FragCoord.xy); vec3 frag_loc = vec3(uv.x, uv.y, 0); vec3 norm = vec3(0, 0, 1.0); /* always z-up */ @@ -56,15 +56,15 @@ void main() ivec2 iuv = ivec2(uv.x, uv.y); stroke_depth = texelFetch(strokeDepth, iuv, 0).r; objcolor = texelFetch(strokeColor, iuv, 0); - + /* diffuse light */ vec3 lightdir = normalize(light3d - frag_loc); float diff = max(dot(norm, lightdir), 0.0); float dist = length(light3d - frag_loc) / pxscale; - float factor = diff * ((energy * 100.0) / (dist * dist)); - + float factor = diff * ((energy * 100.0) / (dist * dist)); + vec3 result = factor * max(ambient, 0.1) * vec3(objcolor); - + gl_FragDepth = stroke_depth; FragColor = vec4(result.r, result.g, result.b, objcolor.a); } diff --git a/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_pixel_frag.glsl b/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_pixel_frag.glsl index d1a57a9a1b6..0b25dbbd012 100644 --- a/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_pixel_frag.glsl +++ b/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_pixel_frag.glsl @@ -23,15 +23,15 @@ void main() { vec2 uv = vec2(gl_FragCoord.xy); vec4 nloc = ProjectionMatrix * ViewMatrix * vec4(loc.xyz, 1.0); - + float dx = (ProjectionMatrix[3][3] == 0.0) ? (nsize[0] / (nloc.z * defaultpixsize)) : (nsize[0] / defaultpixsize); float dy = (ProjectionMatrix[3][3] == 0.0) ? (nsize[1] / (nloc.z * defaultpixsize)) : (nsize[1] / defaultpixsize); dx = max(abs(dx), 3.0); dy = max(abs(dy), 3.0); - + vec2 coord = vec2(dx * floor(uv.x / dx), dy * floor(uv.y / dy)); - + float stroke_depth = texelFetch(strokeDepth, ivec2(coord), 0).r; vec4 outcolor = texelFetch(strokeColor, ivec2(coord), 0); diff --git a/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_rim_prepare_frag.glsl b/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_rim_prepare_frag.glsl index fe35d3832e1..6ea4faf11fd 100644 --- a/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_rim_prepare_frag.glsl +++ b/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_rim_prepare_frag.glsl @@ -26,7 +26,7 @@ void main() { vec2 uv = vec2(gl_FragCoord.xy); vec4 nloc = ProjectionMatrix * ViewMatrix * vec4(loc.xyz, 1.0); - + float dx = (ProjectionMatrix[3][3] == 0.0) ? (noffset[0] / (nloc.z * defaultpixsize)) : (noffset[0] / defaultpixsize); float dy = (ProjectionMatrix[3][3] == 0.0) ? (noffset[1] / (nloc.z * defaultpixsize)) : (noffset[1] / defaultpixsize); @@ -35,7 +35,7 @@ void main() vec4 offset_pixel= texelFetch(strokeColor, ivec2(uv.x - dx, uv.y - dy), 0); vec4 outcolor; - /* is transparent */ + /* is transparent */ if (src_pixel.a == 0.0f) { discard; } @@ -56,7 +56,7 @@ void main() } else { outcolor = vec4(rim_color, 1.0); - } + } } gl_FragDepth = stroke_depth; diff --git a/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_rim_resolve_frag.glsl b/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_rim_resolve_frag.glsl index 5e5edbd8325..20d6b8a91f8 100644 --- a/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_rim_resolve_frag.glsl +++ b/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_rim_resolve_frag.glsl @@ -19,14 +19,14 @@ out vec4 FragColor; float overlay_color(float a, float b) { - float rtn; + float rtn; if (a < 0.5) { rtn = 2.0 * a * b; } else { rtn = 1.0 - 2.0 * (1.0 - a) * (1.0 - b); } - + return rtn; } @@ -53,16 +53,16 @@ vec4 get_blend_color(int mode, vec4 src_color, vec4 mix_color) else if (mode == MODE_DIVIDE) { outcolor = src_color / mix_color; } - else { + else { outcolor = mix_color; } - + /* use always the alpha of source color */ - + outcolor.a = src_color.a; /* use alpha to calculate the weight of the mixed color */ outcolor = mix(src_color, outcolor, mix_color.a); - + return outcolor; } @@ -75,8 +75,8 @@ void main() vec4 rim_pixel= texelFetch(strokeRim, uv.xy, 0); vec4 outcolor = src_pixel; - - /* is transparent */ + + /* is transparent */ if (src_pixel.a == 0.0f) { discard; } @@ -92,7 +92,7 @@ void main() outcolor = get_blend_color(mode, src_pixel, rim_pixel); } } - + gl_FragDepth = stroke_depth; FragColor = outcolor; } diff --git a/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_swirl_frag.glsl b/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_swirl_frag.glsl index 6ce64350b3d..78aacafdcb7 100644 --- a/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_swirl_frag.glsl +++ b/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_swirl_frag.glsl @@ -23,11 +23,11 @@ vec2 toScreenSpace(vec4 vertex) { /* need to calculate ndc because this is not done by vertex shader */ vec3 ndc = vec3(vertex).xyz / vertex.w; - + vec2 sc; sc.x = ((ndc.x + 1.0) / 2.0) * Viewport.x; sc.y = ((ndc.y + 1.0) / 2.0) * Viewport.y; - + return sc; } @@ -37,15 +37,15 @@ void main() vec2 uv = vec2(gl_FragCoord.xy); float stroke_depth; vec4 outcolor; - - vec4 center3d = ProjectionMatrix * ViewMatrix * vec4(loc.xyz, 1.0); + + vec4 center3d = ProjectionMatrix * ViewMatrix * vec4(loc.xyz, 1.0); vec2 center = toScreenSpace(center3d); vec2 tc = uv - center; float dist = length(tc); float pxradius = (ProjectionMatrix[3][3] == 0.0) ? (radius / (loc.z * defaultpixsize)) : (radius / defaultpixsize); pxradius = max(pxradius, 1); - + if (dist <= pxradius) { float percent = (pxradius - dist) / pxradius; float theta = percent * percent * angle * 8.0; diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index 4264645b52e..4a603e97615 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -1785,13 +1785,13 @@ void gp_stroke_delete_tagged_points(bGPDframe *gpf, bGPDstroke *gps, bGPDstroke /* Copy over the relevant point data */ new_stroke->points = MEM_callocN(sizeof(bGPDspoint) * new_stroke->totpoints, "gp delete stroke fragment"); memcpy(new_stroke->points, gps->points + island->start_idx, sizeof(bGPDspoint) * new_stroke->totpoints); - + /* Copy over vertex weight data (if available) */ if (new_stroke->dvert != NULL) { /* Copy over the relevant vertex-weight points */ new_stroke->dvert = MEM_callocN(sizeof(MDeformVert) * new_stroke->totpoints, "gp delete stroke fragment weight"); memcpy(new_stroke->dvert, gps->dvert + island->start_idx, sizeof(MDeformVert) * new_stroke->totpoints); - + /* Copy weights */ int e = island->start_idx; for (int i = 0; i < new_stroke->totpoints; i++) { diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 995ab91ff8b..fd5b2803650 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -1690,7 +1690,7 @@ static bool gp_session_initdata(bContext *C, wmOperator *op, tGPsdata *p) break; } - + /* unsupported views */ default: { diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 89e1a8caec8..f143d418fe3 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -1245,7 +1245,7 @@ void uiItemsFullEnumO( if (ui_layout_is_radial(layout)) { /* XXX: While "_all()" guarantees spatial stability, it's bad when an enum has > 8 items total, - * but only a small subset will ever be shown at once (e.g. Mode Switch menu, after the + * but only a small subset will ever be shown at once (e.g. Mode Switch menu, after the * introduction of GP editing modes) */ #if 0 diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index e6422c423b9..72023ebf2ae 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -1573,7 +1573,7 @@ void init_userdef_do_versions(Main *bmain) for (bTheme *btheme = U.themes.first; btheme; btheme = btheme->next) { memcpy(btheme, &U_theme_default, sizeof(*btheme)); } - + /* Annotations - new layer color * Replace anything that used to be set if it looks like was left * on the old default (i.e. black), which most users used diff --git a/source/blender/makesrna/intern/rna_shader_fx.c b/source/blender/makesrna/intern/rna_shader_fx.c index 4956333b202..950aef9a8dd 100644 --- a/source/blender/makesrna/intern/rna_shader_fx.c +++ b/source/blender/makesrna/intern/rna_shader_fx.c @@ -443,7 +443,7 @@ static void rna_def_shader_fx_light(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "ShaderFxLight", "ShaderFx"); RNA_def_struct_ui_text(srna, "Light Effect", "Light effect"); RNA_def_struct_sdna(srna, "LightShaderFxData"); @@ -517,7 +517,7 @@ void RNA_def_shader_fx(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Edit Mode", "Display effect in Edit mode"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); RNA_def_property_ui_icon(prop, ICON_EDITMODE_HLT, 0); - + prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", eShaderFxMode_Expanded); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); |