From 2abfcebb0eb7989e3d1e7d03f37ecf5c088210af Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 10 Oct 2020 18:19:55 +1100 Subject: Cleanup: use C comments for descriptive text Follow our code style guide by using C-comments for text descriptions. --- .../shaders/gpu_shader_2D_edituvs_points_vert.glsl | 6 +++--- .../gpu_shader_2D_point_uniform_size_aa_vert.glsl | 6 +++--- ...ader_2D_point_uniform_size_outline_aa_vert.glsl | 6 +++--- ...uniform_size_varying_color_outline_aa_vert.glsl | 6 +++--- ...ader_3D_point_uniform_size_outline_aa_vert.glsl | 6 +++--- .../shaders/gpu_shader_gpencil_stroke_geom.glsl | 12 ++++++------ .../gpu_shader_point_uniform_color_aa_frag.glsl | 14 +++++++------- ...shader_point_uniform_color_outline_aa_frag.glsl | 22 +++++++++++----------- ...shader_point_varying_color_outline_aa_frag.glsl | 22 +++++++++++----------- ...oint_varying_color_varying_outline_aa_frag.glsl | 22 +++++++++++----------- 10 files changed, 61 insertions(+), 61 deletions(-) (limited to 'source/blender/gpu') diff --git a/source/blender/gpu/shaders/gpu_shader_2D_edituvs_points_vert.glsl b/source/blender/gpu/shaders/gpu_shader_2D_edituvs_points_vert.glsl index 3f3bfa5410c..bec565be1df 100644 --- a/source/blender/gpu/shaders/gpu_shader_2D_edituvs_points_vert.glsl +++ b/source/blender/gpu/shaders/gpu_shader_2D_edituvs_points_vert.glsl @@ -30,15 +30,15 @@ void main() fillColor = (is_selected) ? selectColor : deselect_col; outlineColor = (is_pinned) ? pinnedColor : vec4(fillColor.rgb, 0.0); - // calculate concentric radii in pixels + /* Calculate concentric radii in pixels. */ float radius = 0.5 * pointSize; - // start at the outside and progress toward the center + /* Start at the outside and progress toward the center. */ radii[0] = radius; radii[1] = radius - 1.0; radii[2] = radius - outlineWidth; radii[3] = radius - outlineWidth - 1.0; - // convert to PointCoord units + /* Convert to PointCoord units. */ radii /= pointSize; } diff --git a/source/blender/gpu/shaders/gpu_shader_2D_point_uniform_size_aa_vert.glsl b/source/blender/gpu/shaders/gpu_shader_2D_point_uniform_size_aa_vert.glsl index a7681353d49..1453393aa9f 100644 --- a/source/blender/gpu/shaders/gpu_shader_2D_point_uniform_size_aa_vert.glsl +++ b/source/blender/gpu/shaders/gpu_shader_2D_point_uniform_size_aa_vert.glsl @@ -10,13 +10,13 @@ void main() gl_Position = ModelViewProjectionMatrix * vec4(pos, 0.0, 1.0); gl_PointSize = size; - // calculate concentric radii in pixels + /* calculate concentric radii in pixels */ float radius = 0.5 * size; - // start at the outside and progress toward the center + /* start at the outside and progress toward the center */ radii[0] = radius; radii[1] = radius - 1.0; - // convert to PointCoord units + /* convert to PointCoord units */ radii /= size; } diff --git a/source/blender/gpu/shaders/gpu_shader_2D_point_uniform_size_outline_aa_vert.glsl b/source/blender/gpu/shaders/gpu_shader_2D_point_uniform_size_outline_aa_vert.glsl index a3439ebe3c4..5c555b2d3e7 100644 --- a/source/blender/gpu/shaders/gpu_shader_2D_point_uniform_size_outline_aa_vert.glsl +++ b/source/blender/gpu/shaders/gpu_shader_2D_point_uniform_size_outline_aa_vert.glsl @@ -11,15 +11,15 @@ void main() gl_Position = ModelViewProjectionMatrix * vec4(pos, 0.0, 1.0); gl_PointSize = size; - // calculate concentric radii in pixels + /* calculate concentric radii in pixels */ float radius = 0.5 * size; - // start at the outside and progress toward the center + /* start at the outside and progress toward the center */ radii[0] = radius; radii[1] = radius - 1.0; radii[2] = radius - outlineWidth; radii[3] = radius - outlineWidth - 1.0; - // convert to PointCoord units + /* convert to PointCoord units */ radii /= size; } diff --git a/source/blender/gpu/shaders/gpu_shader_2D_point_uniform_size_varying_color_outline_aa_vert.glsl b/source/blender/gpu/shaders/gpu_shader_2D_point_uniform_size_varying_color_outline_aa_vert.glsl index 287bd351534..3eec271913a 100644 --- a/source/blender/gpu/shaders/gpu_shader_2D_point_uniform_size_varying_color_outline_aa_vert.glsl +++ b/source/blender/gpu/shaders/gpu_shader_2D_point_uniform_size_varying_color_outline_aa_vert.glsl @@ -14,15 +14,15 @@ void main() gl_PointSize = size; fillColor = color; - // calculate concentric radii in pixels + /* Calculate concentric radii in pixels. */ float radius = 0.5 * size; - // start at the outside and progress toward the center + /* Start at the outside and progress toward the center. */ radii[0] = radius; radii[1] = radius - 1.0; radii[2] = radius - outlineWidth; radii[3] = radius - outlineWidth - 1.0; - // convert to PointCoord units + /* Convert to PointCoord units. */ radii /= size; } diff --git a/source/blender/gpu/shaders/gpu_shader_3D_point_uniform_size_outline_aa_vert.glsl b/source/blender/gpu/shaders/gpu_shader_3D_point_uniform_size_outline_aa_vert.glsl index 8bd344ed0e7..fb5506a778d 100644 --- a/source/blender/gpu/shaders/gpu_shader_3D_point_uniform_size_outline_aa_vert.glsl +++ b/source/blender/gpu/shaders/gpu_shader_3D_point_uniform_size_outline_aa_vert.glsl @@ -15,16 +15,16 @@ void main() gl_Position = ModelViewProjectionMatrix * pos_4d; gl_PointSize = size; - // calculate concentric radii in pixels + /* calculate concentric radii in pixels */ float radius = 0.5 * size; - // start at the outside and progress toward the center + /* start at the outside and progress toward the center */ radii[0] = radius; radii[1] = radius - 1.0; radii[2] = radius - outlineWidth; radii[3] = radius - outlineWidth - 1.0; - // convert to PointCoord units + /* convert to PointCoord units */ radii /= size; #ifdef USE_WORLD_CLIP_PLANES diff --git a/source/blender/gpu/shaders/gpu_shader_gpencil_stroke_geom.glsl b/source/blender/gpu/shaders/gpu_shader_gpencil_stroke_geom.glsl index 21c925560b9..da6e6502e62 100644 --- a/source/blender/gpu/shaders/gpu_shader_gpencil_stroke_geom.glsl +++ b/source/blender/gpu/shaders/gpu_shader_gpencil_stroke_geom.glsl @@ -69,10 +69,10 @@ void main(void) vec4 P3 = gl_in[3].gl_Position; /* get the four vertices passed to the shader */ - vec2 sp0 = toScreenSpace(P0); // start of previous segment - vec2 sp1 = toScreenSpace(P1); // end of previous segment, start of current segment - vec2 sp2 = toScreenSpace(P2); // end of current segment, start of next segment - vec2 sp3 = toScreenSpace(P3); // end of next segment + vec2 sp0 = toScreenSpace(P0); /* start of previous segment */ + vec2 sp1 = toScreenSpace(P1); /* end of previous segment, start of current segment */ + vec2 sp2 = toScreenSpace(P2); /* end of current segment, start of next segment */ + vec2 sp3 = toScreenSpace(P3); /* end of next segment */ /* culling outside viewport */ vec2 area = Viewport * 4.0; @@ -100,8 +100,8 @@ void main(void) vec2 n2 = vec2(-v2.y, v2.x); /* determine miter lines by averaging the normals of the 2 segments */ - vec2 miter_a = normalize(n0 + n1); // miter at start of current segment - vec2 miter_b = normalize(n1 + n2); // miter at end of current segment + vec2 miter_a = normalize(n0 + n1); /* miter at start of current segment */ + vec2 miter_b = normalize(n1 + n2); /* miter at end of current segment */ /* determine the length of the miter by projecting it onto normal and then inverse it */ float an1 = dot(miter_a, n1); diff --git a/source/blender/gpu/shaders/gpu_shader_point_uniform_color_aa_frag.glsl b/source/blender/gpu/shaders/gpu_shader_point_uniform_color_aa_frag.glsl index a8e9c620535..52d59d2030f 100644 --- a/source/blender/gpu/shaders/gpu_shader_point_uniform_color_aa_frag.glsl +++ b/source/blender/gpu/shaders/gpu_shader_point_uniform_color_aa_frag.glsl @@ -8,13 +8,13 @@ void main() { float dist = length(gl_PointCoord - vec2(0.5)); - // transparent outside of point - // --- 0 --- - // smooth transition - // --- 1 --- - // pure point color - // ... - // dist = 0 at center of point + /* transparent outside of point + * --- 0 --- + * smooth transition + * --- 1 --- + * pure point color + * ... + * dist = 0 at center of point */ fragColor.rgb = color.rgb; fragColor.a = mix(color.a, 0.0, smoothstep(radii[1], radii[0], dist)); diff --git a/source/blender/gpu/shaders/gpu_shader_point_uniform_color_outline_aa_frag.glsl b/source/blender/gpu/shaders/gpu_shader_point_uniform_color_outline_aa_frag.glsl index 1c1301dd818..2ece73b3845 100644 --- a/source/blender/gpu/shaders/gpu_shader_point_uniform_color_outline_aa_frag.glsl +++ b/source/blender/gpu/shaders/gpu_shader_point_uniform_color_outline_aa_frag.glsl @@ -9,17 +9,17 @@ void main() { float dist = length(gl_PointCoord - vec2(0.5)); - // transparent outside of point - // --- 0 --- - // smooth transition - // --- 1 --- - // pure outline color - // --- 2 --- - // smooth transition - // --- 3 --- - // pure point color - // ... - // dist = 0 at center of point + /* transparent outside of point + * --- 0 --- + * smooth transition + * --- 1 --- + * pure outline color + * --- 2 --- + * smooth transition + * --- 3 --- + * pure point color + * ... + * dist = 0 at center of point */ float midStroke = 0.5 * (radii[1] + radii[2]); diff --git a/source/blender/gpu/shaders/gpu_shader_point_varying_color_outline_aa_frag.glsl b/source/blender/gpu/shaders/gpu_shader_point_varying_color_outline_aa_frag.glsl index 11694de38ca..1d936e4e072 100644 --- a/source/blender/gpu/shaders/gpu_shader_point_varying_color_outline_aa_frag.glsl +++ b/source/blender/gpu/shaders/gpu_shader_point_varying_color_outline_aa_frag.glsl @@ -9,17 +9,17 @@ void main() { float dist = length(gl_PointCoord - vec2(0.5)); - // transparent outside of point - // --- 0 --- - // smooth transition - // --- 1 --- - // pure outline color - // --- 2 --- - // smooth transition - // --- 3 --- - // pure fill color - // ... - // dist = 0 at center of point + /* transparent outside of point + * --- 0 --- + * smooth transition + * --- 1 --- + * pure outline color + * --- 2 --- + * smooth transition + * --- 3 --- + * pure fill color + * ... + * dist = 0 at center of point */ float midStroke = 0.5 * (radii[1] + radii[2]); diff --git a/source/blender/gpu/shaders/gpu_shader_point_varying_color_varying_outline_aa_frag.glsl b/source/blender/gpu/shaders/gpu_shader_point_varying_color_varying_outline_aa_frag.glsl index 6d997ec14cc..c9bd9e881bf 100644 --- a/source/blender/gpu/shaders/gpu_shader_point_varying_color_varying_outline_aa_frag.glsl +++ b/source/blender/gpu/shaders/gpu_shader_point_varying_color_varying_outline_aa_frag.glsl @@ -8,17 +8,17 @@ void main() { float dist = length(gl_PointCoord - vec2(0.5)); - // transparent outside of point - // --- 0 --- - // smooth transition - // --- 1 --- - // pure outline color - // --- 2 --- - // smooth transition - // --- 3 --- - // pure fill color - // ... - // dist = 0 at center of point + /* transparent outside of point + * --- 0 --- + * smooth transition + * --- 1 --- + * pure outline color + * --- 2 --- + * smooth transition + * --- 3 --- + * pure fill color + * ... + * dist = 0 at center of point */ float midStroke = 0.5 * (radii[1] + radii[2]); -- cgit v1.2.3