From 87d737cd792183d409760ab1f0a778abb9f1daa3 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 6 Oct 2022 12:12:09 +1100 Subject: [PATCH] Cleanup: spelling in code comments --- source/blender/blenkernel/BKE_blender.h | 2 +- .../basic_conservative_depth_geom.glsl | 4 ++-- .../eevee/shaders/effect_reflection_lib.glsl | 2 +- .../engines/eevee/shaders/lightprobe_lib.glsl | 2 +- .../shaders/eevee_attributes_lib.glsl | 2 +- .../eevee_depth_of_field_accumulator_lib.glsl | 2 +- .../eevee_depth_of_field_reduce_comp.glsl | 2 +- .../eevee_next/shaders/eevee_film_lib.glsl | 2 +- .../shaders/eevee_sampling_lib.glsl | 2 +- .../shaders/eevee_velocity_lib.glsl | 4 ++-- .../gpencil/shaders/gpencil_common_lib.glsl | 22 +++++++++---------- .../overlay_armature_shape_outline_vert.glsl | 4 ++-- ...y_armature_shape_outline_vert_no_geom.glsl | 2 +- .../shaders/overlay_background_frag.glsl | 4 ++-- .../overlay_edit_mesh_vert_no_geom.glsl | 4 ++-- .../shaders/overlay_edit_uv_edges_frag.glsl | 4 ++-- .../shaders/overlay_edit_uv_edges_geom.glsl | 2 +- ...overlay_motion_path_line_vert_no_geom.glsl | 2 +- .../shaders/overlay_paint_point_vert.glsl | 4 ++-- .../shaders/overlay_paint_wire_vert.glsl | 4 ++-- .../shaders/workbench_effect_dof_frag.glsl | 4 ++-- .../shaders/workbench_volume_frag.glsl | 2 +- .../shaders/common_debug_print_lib.glsl | 4 ++-- .../draw/intern/shaders/common_fxaa_lib.glsl | 2 +- .../draw/intern/shaders/common_view_lib.glsl | 4 ++-- .../common/gpu_shader_common_math.glsl | 2 +- .../common/gpu_shader_common_math_utils.glsl | 2 +- .../gpu_shader_2D_widget_base_frag.glsl | 2 +- .../gpu_shader_2D_widget_base_vert.glsl | 4 ++-- .../gpu/shaders/gpu_shader_codegen_lib.glsl | 2 +- .../gpu/shaders/gpu_shader_text_vert.glsl | 2 +- .../gpu_shader_material_principled.glsl | 2 +- .../shaders/opengl/glsl_shader_defines.glsl | 2 +- 33 files changed, 55 insertions(+), 55 deletions(-) diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index 1f0919bb3e6..acb67b30174 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -30,7 +30,7 @@ void BKE_blender_globals_main_replace(struct Main *bmain); * Replace current global Main by the given one, returning the old one. * * \warning Advanced, risky workaround addressing the issue that current RNA is not able to process - * correectly non-G_MAIN data, use with (a lot of) care. + * correctly non-G_MAIN data, use with (a lot of) care. */ struct Main *BKE_blender_globals_main_swap(struct Main *new_gmain); diff --git a/source/blender/draw/engines/basic/shaders/basic_conservative_depth_geom.glsl b/source/blender/draw/engines/basic/shaders/basic_conservative_depth_geom.glsl index d478f37691e..1a90a2f57c0 100644 --- a/source/blender/draw/engines/basic/shaders/basic_conservative_depth_geom.glsl +++ b/source/blender/draw/engines/basic/shaders/basic_conservative_depth_geom.glsl @@ -11,7 +11,7 @@ void main() { - /* Compute plane normal in ndc space. */ + /* Compute plane normal in NDC space. */ vec3 pos0 = gl_in[0].gl_Position.xyz / gl_in[0].gl_Position.w; vec3 pos1 = gl_in[1].gl_Position.xyz / gl_in[1].gl_Position.w; vec3 pos2 = gl_in[2].gl_Position.xyz / gl_in[2].gl_Position.w; @@ -33,7 +33,7 @@ void main() /* HACK: Fix cases where the triangle is too small make it cover at least one pixel. */ gl_Position.xy += drw_view.viewport_size_inverse * gl_Position.w * ofs; } - /* Test if the triangle is almost parralele with the view to avoid precision issues. */ + /* Test if the triangle is almost parallel with the view to avoid precision issues. */ else if (any(is_subpixel) || is_coplanar) { /* HACK: Fix cases where the triangle is Parallel to the view by deforming it slightly. */ vec2 ofs = (i == 0) ? vec2(-1.0) : ((i == 1) ? vec2(1.0, -1.0) : vec2(1.0)); diff --git a/source/blender/draw/engines/eevee/shaders/effect_reflection_lib.glsl b/source/blender/draw/engines/eevee/shaders/effect_reflection_lib.glsl index ed600a3be86..a6781a0debe 100644 --- a/source/blender/draw/engines/eevee/shaders/effect_reflection_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/effect_reflection_lib.glsl @@ -47,7 +47,7 @@ HitData decode_hit_data(vec4 hit_data, float hit_depth) return data; } -/* Blue noise categorised into 4 sets of samples. +/* Blue noise categorized into 4 sets of samples. * See "Stochastic all the things" presentation slide 32-37. */ const int resolve_samples_count = 9; const vec2 resolve_sample_offsets[36] = vec2[36]( diff --git a/source/blender/draw/engines/eevee/shaders/lightprobe_lib.glsl b/source/blender/draw/engines/eevee/shaders/lightprobe_lib.glsl index 6c1a95bba49..862d666ab5f 100644 --- a/source/blender/draw/engines/eevee/shaders/lightprobe_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/lightprobe_lib.glsl @@ -206,7 +206,7 @@ vec3 probe_evaluate_planar(int id, PlanarData pd, vec3 P, vec3 N, vec3 V, float vec4 refco = ProjectionMatrix * (ViewMatrix * vec4(ref_pos, 1.0)); refco.xy /= refco.w; - /* TODO: If we support non-ssr planar reflection, we should blur them with gaussian + /* TODO: If we support non-SSR planar reflection, we should blur them with gaussian * and chose the right mip depending on the cone footprint after projection */ /* NOTE: X is inverted here to compensate inverted drawing. */ vec3 radiance = textureLod(probePlanars, vec3(refco.xy * vec2(-0.5, 0.5) + 0.5, id), 0.0).rgb; diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_attributes_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_attributes_lib.glsl index 6fe5fa01fa3..ea1b02e56b3 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_attributes_lib.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_attributes_lib.glsl @@ -17,7 +17,7 @@ vec3 attr_load_orco(vec4 orco) { /* We know when there is no orco layer when orco.w is 1.0 because it uses the generic vertex - * attrib (which is [0,0,0,1]). */ + * attribute (which is [0,0,0,1]). */ if (orco.w == 1.0) { /* If the object does not have any deformation, the orco layer calculation is done on the fly * using the orco_madd factors. */ diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_accumulator_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_accumulator_lib.glsl index 99a47c541e9..49a00b60abf 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_accumulator_lib.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_accumulator_lib.glsl @@ -239,7 +239,7 @@ void dof_gather_accumulate_sample_ring(DofGatherData ring_data, } } -/* FIXME(fclem) Seems to be wrong since it needs ringcount+1 as input for +/* FIXME(fclem) Seems to be wrong since it needs `ringcount + 1` as input for * slightfocus gather. */ /* This should be replaced by web_sample_count_get() but doing so is breaking other things. */ int dof_gather_total_sample_count(const int ring_count, const int ring_density) diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_reduce_comp.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_reduce_comp.glsl index a6426cd06e4..41a6fe466b9 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_reduce_comp.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_reduce_comp.glsl @@ -82,7 +82,7 @@ void main() { ivec2 texel = min(ivec2(gl_GlobalInvocationID.xy), imageSize(inout_color_lod0_img) - 1); uvec2 texel_local = gl_LocalInvocationID.xy; - /* Increase readablility. */ + /* Increase readability. */ #define LOCAL_INDEX texel_local.y][texel_local.x #define LOCAL_OFFSET(x_, y_) texel_local.y + (y_)][texel_local.x + (x_) diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_film_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_film_lib.glsl index 21b9a83abb9..8845434412e 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_film_lib.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_film_lib.glsl @@ -187,7 +187,7 @@ void film_cryptomatte_layer_accum_and_store( if (pass_id == -1) { return; } - /* x = hash, y = accumed weight. Only keep track of 4 highest weighted samples. */ + /* x = hash, y = accumulated weight. Only keep track of 4 highest weighted samples. */ vec2 crypto_samples[4] = vec2[4](vec2(0.0), vec2(0.0), vec2(0.0), vec2(0.0)); for (int i = 0; i < film_buf.samples_len; i++) { FilmSample src = film_sample_get(i, texel_film); diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_sampling_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_sampling_lib.glsl index 0eea4a5ff33..a54133167ac 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_sampling_lib.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_sampling_lib.glsl @@ -41,7 +41,7 @@ vec3 sampling_rng_3D_get(const eSamplingDimension dimension) /** \name Random Number Generators. * \{ */ -/* Interlieved gradient noise by Jorge Jimenez +/* Interleaved gradient noise by Jorge Jimenez * http://www.iryoku.com/next-generation-post-processing-in-call-of-duty-advanced-warfare * Seeding found by Epic Game. */ float interlieved_gradient_noise(vec2 pixel, float seed, float offset) diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_velocity_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_velocity_lib.glsl index 8d02609fedc..a17aec8eae2 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_velocity_lib.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_velocity_lib.glsl @@ -32,7 +32,7 @@ vec4 velocity_surface(vec3 P_prv, vec3 P, vec3 P_nxt) next_uv = curr_uv; } /* NOTE: We output both vectors in the same direction so we can reuse the same vector - * with rgrg swizzle in viewport. */ + * with RGRG swizzle in viewport. */ vec4 motion = vec4(prev_uv - curr_uv, curr_uv - next_uv); /* Convert NDC velocity to UV velocity */ motion *= 0.5; @@ -54,7 +54,7 @@ vec4 velocity_background(vec3 vV) vec2 curr_uv = project_point(camera_curr.winmat, V).xy; vec2 next_uv = project_point(camera_next.winmat, V).xy; /* NOTE: We output both vectors in the same direction so we can reuse the same vector - * with rgrg swizzle in viewport. */ + * with RGRG swizzle in viewport. */ vec4 motion = vec4(prev_uv - curr_uv, curr_uv - next_uv); /* Convert NDC velocity to UV velocity */ motion *= 0.5; diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl index 6671c16aa0b..7ddfdc5f65c 100644 --- a/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl +++ b/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl @@ -101,33 +101,33 @@ void blend_mode_output( { switch (blend_mode) { case MODE_REGULAR: - /* Reminder: Blending func is premult alpha blend (dst.rgba * (1 - src.a) + src.rgb). */ + /* Reminder: Blending func is premult alpha blend `(dst.rgba * (1 - src.a) + src.rgb)`. */ color *= opacity; frag_color = color; frag_revealage = vec4(0.0, 0.0, 0.0, color.a); break; case MODE_MULTIPLY: - /* Reminder: Blending func is multiply blend (dst.rgba * src.rgba). */ + /* Reminder: Blending func is multiply blend `(dst.rgba * src.rgba)`. */ color.a *= opacity; frag_revealage = frag_color = (1.0 - color.a) + color.a * color; break; case MODE_DIVIDE: - /* Reminder: Blending func is multiply blend (dst.rgba * src.rgba). */ + /* Reminder: Blending func is multiply blend `(dst.rgba * src.rgba)`. */ color.a *= opacity; frag_revealage = frag_color = clamp(1.0 / max(vec4(1e-6), 1.0 - color * color.a), 0.0, 1e18); break; case MODE_HARDLIGHT: { - /* Reminder: Blending func is multiply blend (dst.rgba * src.rgba). */ + /* Reminder: Blending func is multiply blend `(dst.rgba * src.rgba)`. */ /** * We need to separate the overlay equation into 2 term (one mul and one add). * This is the standard overlay equation (per channel): - * rtn = (src < 0.5) ? (2.0 * src * dst) : (1.0 - 2.0 * (1.0 - src) * (1.0 - dst)); + * `rtn = (src < 0.5) ? (2.0 * src * dst) : (1.0 - 2.0 * (1.0 - src) * (1.0 - dst));` * We rewrite the second branch like this: - * rtn = 1 - 2 * (1 - src) * (1 - dst); - * rtn = 1 - 2 (1 - dst + src * dst - src); - * rtn = 1 - 2 (1 - dst * (1 - src) - src); - * rtn = 1 - 2 + dst * (2 - 2 * src) + 2 * src; - * rtn = (- 1 + 2 * src) + dst * (2 - 2 * src); + * `rtn = 1 - 2 * (1 - src) * (1 - dst);` + * `rtn = 1 - 2 (1 - dst + src * dst - src);` + * `rtn = 1 - 2 (1 - dst * (1 - src) - src);` + * `rtn = 1 - 2 + dst * (2 - 2 * src) + 2 * src;` + * `rtn = (- 1 + 2 * src) + dst * (2 - 2 * src);` */ color = mix(vec4(0.5), color, color.a * opacity); vec4 s = step(-0.5, -color); @@ -143,7 +143,7 @@ void blend_mode_output( break; case MODE_SUB: case MODE_ADD: - /* Reminder: Blending func is additive / subtractive blend (dst.rgba +/- src.rgba). */ + /* Reminder: Blending func is additive / subtractive blend `(dst.rgba +/- src.rgba)`. */ frag_color = color * color.a * opacity; frag_revealage = vec4(0.0); break; diff --git a/source/blender/draw/engines/overlay/shaders/overlay_armature_shape_outline_vert.glsl b/source/blender/draw/engines/overlay/shaders/overlay_armature_shape_outline_vert.glsl index 91eb6265192..bb45f213046 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_armature_shape_outline_vert.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_armature_shape_outline_vert.glsl @@ -25,8 +25,8 @@ void main() * doing it per instance on CPU and sending it on via instance attribute. */ mat3 normal_mat = transpose(inverse(mat3(model_mat))); /* TODO: FIX: there is still a problem with this vector - * when the bone is scaled or in persp mode. But it's - * barely visible at the outline corners. */ + * when the bone is scaled or in perspective mode. + * But it's barely visible at the outline corners. */ geom_in.ssNor = normalize(normal_world_to_view(normal_mat * snor).xy); geom_in.ssPos = proj(geom_in.pPos); diff --git a/source/blender/draw/engines/overlay/shaders/overlay_armature_shape_outline_vert_no_geom.glsl b/source/blender/draw/engines/overlay/shaders/overlay_armature_shape_outline_vert_no_geom.glsl index 12749e5b3a7..aee5087fc5a 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_armature_shape_outline_vert_no_geom.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_armature_shape_outline_vert_no_geom.glsl @@ -52,7 +52,7 @@ void do_vertex_shader(mat4 in_inst_obmat, void main() { /* Outputs a singular vertex as part of a LineList primitive, however, requires access to - * neighbouring 4 vertices. */ + * neighboring 4 vertices. */ /* Fetch verts from input type lines adjacency. */ int line_prim_id = (gl_VertexID / 2); int line_vertex_id = gl_VertexID % 2; diff --git a/source/blender/draw/engines/overlay/shaders/overlay_background_frag.glsl b/source/blender/draw/engines/overlay/shaders/overlay_background_frag.glsl index b25dcae9fca..960986bebd5 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_background_frag.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_background_frag.glsl @@ -18,8 +18,8 @@ float dither(void) void main() { /* The blend equation is: - * resutl.rgb = SRC.rgb * (1 - DST.a) + DST.rgb * (SRC.a) - * result.a = SRC.a * 0 + DST.a * SRC.a + * `result.rgb = SRC.rgb * (1 - DST.a) + DST.rgb * (SRC.a)` + * `result.a = SRC.a * 0 + DST.a * SRC.a` * This removes the alpha channel and put the background behind reference images * while masking the reference images by the render alpha. */ diff --git a/source/blender/draw/engines/overlay/shaders/overlay_edit_mesh_vert_no_geom.glsl b/source/blender/draw/engines/overlay/shaders/overlay_edit_mesh_vert_no_geom.glsl index 82f0d535508..1318c91f286 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_edit_mesh_vert_no_geom.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_edit_mesh_vert_no_geom.glsl @@ -65,7 +65,7 @@ void main() * input primitive types which use restart indices. */ int base_vertex_id = quad_id * 2; - /* Fetch attribute values for self and neighbouring vertex. */ + /* Fetch attribute values for self and neighboring vertex. */ vec3 in_pos0 = vertex_fetch_attribute(base_vertex_id, pos, vec3); vec3 in_pos1 = vertex_fetch_attribute(base_vertex_id + 1, pos, vec3); uchar4 in_data0 = vertex_fetch_attribute(base_vertex_id, data, uchar4); @@ -75,7 +75,7 @@ void main() vec3 in_vnor1 = vec3_1010102_Inorm_to_vec3( vertex_fetch_attribute(base_vertex_id + 1, vnor, vec3_1010102_Inorm)); - /* Calculate values for self and neighbouring vertex. */ + /* Calculate values for self and neighboring vertex. */ vec4 out_finalColor[2]; vec4 out_finalColorOuter[2]; int selectOveride[2]; diff --git a/source/blender/draw/engines/overlay/shaders/overlay_edit_uv_edges_frag.glsl b/source/blender/draw/engines/overlay/shaders/overlay_edit_uv_edges_frag.glsl index a849cb5160a..c9dc90e4113 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_edit_uv_edges_frag.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_edit_uv_edges_frag.glsl @@ -4,8 +4,8 @@ * We want to know how much a pixel is covered by a line. * We replace the square pixel with acircle of the same area and try to find the intersection area. * The area we search is the circular segment. https://en.wikipedia.org/wiki/Circular_segment - * The formula for the area uses inverse trig function and is quite complexe. Instead, - * we approximate it by using the smoothstep function and a 1.05 factor to the disc radius. + * The formula for the area uses inverse trig function and is quite complex. Instead, + * we approximate it by using the smooth-step function and a 1.05 factor to the disc radius. */ #define M_1_SQRTPI 0.5641895835477563 /* 1/sqrt(pi) */ #define DISC_RADIUS (M_1_SQRTPI * 1.05) diff --git a/source/blender/draw/engines/overlay/shaders/overlay_edit_uv_edges_geom.glsl b/source/blender/draw/engines/overlay/shaders/overlay_edit_uv_edges_geom.glsl index 8b19f671139..f31ebffd8b8 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_edit_uv_edges_geom.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_edit_uv_edges_geom.glsl @@ -28,7 +28,7 @@ void main() half_size += (lineStyle == OVERLAY_UV_LINE_STYLE_OUTLINE) ? max(sizeEdge * (doSmoothWire ? 1.0 : 3.0), 1.0) : 0.0; - /* Add 1 px for AA */ + /* Add 1 PX for AA. */ if (doSmoothWire) { half_size += 0.5; } diff --git a/source/blender/draw/engines/overlay/shaders/overlay_motion_path_line_vert_no_geom.glsl b/source/blender/draw/engines/overlay/shaders/overlay_motion_path_line_vert_no_geom.glsl index c83e7f095a7..3272a9fa2ce 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_motion_path_line_vert_no_geom.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_motion_path_line_vert_no_geom.glsl @@ -104,7 +104,7 @@ void main() * Note: Primitive is LineStrip for this shader. */ int base_vertex_id = quad_id; - /* Fetch attributes for self and neighbouring vertex. */ + /* Fetch attributes for self and neighboring vertex. */ vec3 in_pos0 = vertex_fetch_attribute(base_vertex_id, pos, vec3); vec3 in_pos1 = vertex_fetch_attribute(base_vertex_id + 1, pos, vec3); diff --git a/source/blender/draw/engines/overlay/shaders/overlay_paint_point_vert.glsl b/source/blender/draw/engines/overlay/shaders/overlay_paint_point_vert.glsl index 8736b2a87db..7b7408964f2 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_paint_point_vert.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_paint_point_vert.glsl @@ -10,8 +10,8 @@ void main() vec3 world_pos = point_object_to_world(pos); gl_Position = point_world_to_ndc(world_pos); - /* Add offset in Z to avoid zfighting and render selected wires on top. */ - /* TODO: scale this bias using znear and zfar range. */ + /* Add offset in Z to avoid Z-fighting and render selected wires on top. */ + /* TODO: scale this bias using Z-near and Z-far range. */ gl_Position.z -= (is_select ? 2e-4 : 1e-4); if (is_hidden) { diff --git a/source/blender/draw/engines/overlay/shaders/overlay_paint_wire_vert.glsl b/source/blender/draw/engines/overlay/shaders/overlay_paint_wire_vert.glsl index 749cc92f082..f34133596b1 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_paint_wire_vert.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_paint_wire_vert.glsl @@ -10,8 +10,8 @@ void main() vec3 world_pos = point_object_to_world(pos); gl_Position = point_world_to_ndc(world_pos); - /* Add offset in Z to avoid zfighting and render selected wires on top. */ - /* TODO: scale this bias using znear and zfar range. */ + /* Add offset in Z to avoid Z-fighting and render selected wires on top. */ + /* TODO: scale this bias using Z-near and Z-far range. */ gl_Position.z -= (is_select ? 2e-4 : 1e-4); if (is_hidden) { diff --git a/source/blender/draw/engines/workbench/shaders/workbench_effect_dof_frag.glsl b/source/blender/draw/engines/workbench/shaders/workbench_effect_dof_frag.glsl index 11d7c85d43a..2a3b5337451 100644 --- a/source/blender/draw/engines/workbench/shaders/workbench_effect_dof_frag.glsl +++ b/source/blender/draw/engines/workbench/shaders/workbench_effect_dof_frag.glsl @@ -89,7 +89,7 @@ void main() texel = (texel - 0.5) / vec4(textureSize(sceneColorTex, 0).xyxy); /* Using texelFetch can bypass the mip range setting on some platform. - * Using texture Lod fix this issue. Note that we need to disable filtering to get the right + * Using texture LOD fixes this issue. Note that we need to disable filtering to get the right * texel values. */ vec4 color1 = textureLod(sceneColorTex, texel.xy, 0.0); vec4 color2 = textureLod(sceneColorTex, texel.zw, 0.0); @@ -200,7 +200,7 @@ void main() vec2 get_random_vector(float offset) { - /* Interlieved gradient noise by Jorge Jimenez + /* Interleaved gradient noise by Jorge Jimenez * http://www.iryoku.com/next-generation-post-processing-in-call-of-duty-advanced-warfare */ float ign = fract(offset + 52.9829189 * fract(0.06711056 * gl_FragCoord.x + 0.00583715 * gl_FragCoord.y)); diff --git a/source/blender/draw/engines/workbench/shaders/workbench_volume_frag.glsl b/source/blender/draw/engines/workbench/shaders/workbench_volume_frag.glsl index afba3a0d784..133fe7f4b0f 100644 --- a/source/blender/draw/engines/workbench/shaders/workbench_volume_frag.glsl +++ b/source/blender/draw/engines/workbench/shaders/workbench_volume_frag.glsl @@ -30,7 +30,7 @@ vec4 sample_tricubic(sampler3D ima, vec3 co) vec3 f = co - tc; vec3 f2 = f * f; vec3 f3 = f2 * f; - /* Bspline coefs (optimized) */ + /* Bspline coefficients (optimized). */ vec3 w3 = f3 / 6.0; vec3 w0 = -w3 + f2 * 0.5 - f * 0.5 + 1.0 / 6.0; vec3 w1 = f3 * 0.5 - f2 + 2.0 / 3.0; diff --git a/source/blender/draw/intern/shaders/common_debug_print_lib.glsl b/source/blender/draw/intern/shaders/common_debug_print_lib.glsl index 89d1729b52d..5dc8f490a79 100644 --- a/source/blender/draw/intern/shaders/common_debug_print_lib.glsl +++ b/source/blender/draw/intern/shaders/common_debug_print_lib.glsl @@ -21,7 +21,7 @@ * * NOTE: Floating point representation might not be very precise (see drw_print_value(float)). * - * IMPORTANT: Multipler drawcalls can write to the buffer in sequence (if they are from different + * IMPORTANT: Multiple drawcalls can write to the buffer in sequence (if they are from different * shgroups). However, we add barriers to support this case and it might change the application * behavior. Uncomment DISABLE_DEBUG_SHADER_drw_print_BARRIER to remove the barriers if that * happens. But then you are limited to a single invocation output. @@ -92,7 +92,7 @@ void drw_print_char4(uint data) * it is referenced as an index for char4 and thus do not capture the right * reference. I do not know if this is undefined behavior. As a matter of * precaution, we implement all the append function separately. This behavior - * was observed on both Mesa & amdgpu-pro. + * was observed on both MESA & AMDGPU-PRO. */ /* Using ascii char code. Expect char1 to be less or equal to 0xFF. Appends chars to the right. */ void drw_print_append_char(uint char1, inout uint char4) diff --git a/source/blender/draw/intern/shaders/common_fxaa_lib.glsl b/source/blender/draw/intern/shaders/common_fxaa_lib.glsl index 599d875c500..3d8667e88c8 100644 --- a/source/blender/draw/intern/shaders/common_fxaa_lib.glsl +++ b/source/blender/draw/intern/shaders/common_fxaa_lib.glsl @@ -312,7 +312,7 @@ float FxaaLuma(vec4 rgba) /*--------------------------------------------------------------------------*/ vec4 FxaaPixelShader( /* - * Use noperspective interpolation here (turn off perspective interpolation). + * Use no perspective interpolation here (turn off perspective interpolation). * {xy} = center of pixel */ vec2 pos, /* diff --git a/source/blender/draw/intern/shaders/common_view_lib.glsl b/source/blender/draw/intern/shaders/common_view_lib.glsl index 46f16a9ca40..a7f8f858352 100644 --- a/source/blender/draw/intern/shaders/common_view_lib.glsl +++ b/source/blender/draw/intern/shaders/common_view_lib.glsl @@ -91,7 +91,7 @@ vec4 pack_line_data(vec2 frag_co, vec2 edge_start, vec2 edge_pos) edge /= len; vec2 perp = vec2(-edge.y, edge.x); float dist = dot(perp, frag_co - edge_start); - /* Add 0.1 to diffenrentiate with cleared pixels. */ + /* Add 0.1 to differentiate with cleared pixels. */ return vec4(perp * 0.5 + 0.5, dist * 0.25 + 0.5 + 0.1, 1.0); } else { @@ -226,7 +226,7 @@ layout(std140) uniform modelBlock # ifndef USE_GPU_SHADER_CREATE_INFO /* Intel GPU seems to suffer performance impact when the model matrix is in UBO storage. * So for now we just force using the legacy path. */ -/* Note that this is also a workaround of a problem on osx (amd or nvidia) +/* Note that this is also a workaround of a problem on OSX (AMD or NVIDIA) * and older amd driver on windows. */ uniform mat4 ModelMatrix; uniform mat4 ModelMatrixInverse; diff --git a/source/blender/gpu/shaders/common/gpu_shader_common_math.glsl b/source/blender/gpu/shaders/common/gpu_shader_common_math.glsl index 5f640f64056..1e858bd4760 100644 --- a/source/blender/gpu/shaders/common/gpu_shader_common_math.glsl +++ b/source/blender/gpu/shaders/common/gpu_shader_common_math.glsl @@ -126,7 +126,7 @@ void math_pingpong(float a, float b, float c, out float result) result = (b != 0.0) ? abs(fract((a - b) / (b * 2.0)) * b * 2.0 - b) : 0.0; } -/* Adapted from godotengine math_funcs.h. */ +/* Adapted from GODOT-engine math_funcs.h. */ void math_wrap(float a, float b, float c, out float result) { result = wrap(a, b, c); diff --git a/source/blender/gpu/shaders/common/gpu_shader_common_math_utils.glsl b/source/blender/gpu/shaders/common/gpu_shader_common_math_utils.glsl index 1ba22b4c5da..47f8e26db0b 100644 --- a/source/blender/gpu/shaders/common/gpu_shader_common_math_utils.glsl +++ b/source/blender/gpu/shaders/common/gpu_shader_common_math_utils.glsl @@ -132,7 +132,7 @@ vec3 fallback_pow(vec3 a, float b, vec3 fallback) fallback_pow(a.z, b, fallback.z)); } -/* Matirx Math */ +/* Matrix Math */ /* Return a 2D rotation matrix with the angle that the input 2D vector makes with the x axis. */ mat2 vector_to_rotation_matrix(vec2 vector) diff --git a/source/blender/gpu/shaders/gpu_shader_2D_widget_base_frag.glsl b/source/blender/gpu/shaders/gpu_shader_2D_widget_base_frag.glsl index 662589fb2ce..cd8ff73b833 100644 --- a/source/blender/gpu/shaders/gpu_shader_2D_widget_base_frag.glsl +++ b/source/blender/gpu/shaders/gpu_shader_2D_widget_base_frag.glsl @@ -6,7 +6,7 @@ vec3 compute_masks(vec2 uv) bool right_half = uv.x > outRectSize.x * 0.5; float corner_rad; - /* Correct aspect ratio for 2D views not using uniform scalling. + /* Correct aspect ratio for 2D views not using uniform scaling. * uv is already in pixel space so a uniform scale should give us a ratio of 1. */ float ratio = (butCo != -2.0) ? (dFdy(uv.y) / dFdx(uv.x)) : 1.0; vec2 uv_sdf = uv; diff --git a/source/blender/gpu/shaders/gpu_shader_2D_widget_base_vert.glsl b/source/blender/gpu/shaders/gpu_shader_2D_widget_base_vert.glsl index c102b422211..d6c93df9849 100644 --- a/source/blender/gpu/shaders/gpu_shader_2D_widget_base_vert.glsl +++ b/source/blender/gpu/shaders/gpu_shader_2D_widget_base_vert.glsl @@ -124,8 +124,8 @@ vec2 do_tria() } else if (triaType == 4.0) { /* ROUNDBOX_TRIA_CHECK */ - /* A bit more hacky: We use the two trias joined together to render - * both sides of the checkmark with different length. */ + /* A bit more hacky: We use the two triangles joined together to render + * both sides of the check-mark with different length. */ pos = arrow_pos[min(vidx, 2)]; /* Only keep 1 triangle. */ pos.y = tria2 ? -pos.y : pos.y; /* Mirror along X */ pos = pos.x * vec2(0.0872, -0.996) + pos.y * vec2(0.996, 0.0872); /* Rotate (85deg) */ diff --git a/source/blender/gpu/shaders/gpu_shader_codegen_lib.glsl b/source/blender/gpu/shaders/gpu_shader_codegen_lib.glsl index 94707de71ed..38734d5bbaf 100644 --- a/source/blender/gpu/shaders/gpu_shader_codegen_lib.glsl +++ b/source/blender/gpu/shaders/gpu_shader_codegen_lib.glsl @@ -67,7 +67,7 @@ vec3 orco_get(vec3 local_pos, mat4 modelmatinv, vec4 orco_madd[2], vec4 orco) /* If the object does not have any deformation, the orco layer calculation is done on the fly * using the orco_madd factors. * We know when there is no orco layer when orco.w is 1.0 because it uses the generic vertex - * attrib (which is [0,0,0,1]). */ + * attribute (which is [0,0,0,1]). */ if (orco.w == 0.0) { return orco.xyz * 0.5 + 0.5; } diff --git a/source/blender/gpu/shaders/gpu_shader_text_vert.glsl b/source/blender/gpu/shaders/gpu_shader_text_vert.glsl index 47527d907f4..87e464b6cce 100644 --- a/source/blender/gpu/shaders/gpu_shader_text_vert.glsl +++ b/source/blender/gpu/shaders/gpu_shader_text_vert.glsl @@ -6,7 +6,7 @@ void main() glyph_dim = abs(glyph_size); interp_size = int(glyph_size.x < 0) + int(glyph_size.y < 0); - /* Quad expension using instanced rendering. */ + /* Quad expansion using instanced rendering. */ float x = float(gl_VertexID % 2); float y = float(gl_VertexID / 2); vec2 quad = vec2(x, y); diff --git a/source/blender/gpu/shaders/material/gpu_shader_material_principled.glsl b/source/blender/gpu/shaders/material/gpu_shader_material_principled.glsl index 29ba4f3c119..0833809cc42 100644 --- a/source/blender/gpu/shaders/material/gpu_shader_material_principled.glsl +++ b/source/blender/gpu/shaders/material/gpu_shader_material_principled.glsl @@ -91,7 +91,7 @@ void node_bsdf_principled(vec4 base_color, diffuse_data.sss_id = uint(do_sss); /* NOTE(@fclem): We need to blend the reflection color but also need to avoid applying the - * weights so we compule the ratio. */ + * weights so we compute the ratio. */ float reflection_weight = specular_weight + glass_reflection_weight; float reflection_weight_inv = safe_rcp(reflection_weight); specular_weight *= reflection_weight_inv; diff --git a/source/blender/gpu/shaders/opengl/glsl_shader_defines.glsl b/source/blender/gpu/shaders/opengl/glsl_shader_defines.glsl index 0515a737e6e..706bae3e940 100644 --- a/source/blender/gpu/shaders/opengl/glsl_shader_defines.glsl +++ b/source/blender/gpu/shaders/opengl/glsl_shader_defines.glsl @@ -1,5 +1,5 @@ -/* Texture format tokens -- Type explictness required by other Graphics APIs. */ +/* Texture format tokens -- Type explicitness required by other Graphics APIs. */ #define depth2D sampler2D #define depth2DArray sampler2DArray #define depth2DMS sampler2DMS