diff options
author | Campbell Barton <campbell@blender.org> | 2022-10-06 04:12:09 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-10-06 04:13:00 +0300 |
commit | 87d737cd792183d409760ab1f0a778abb9f1daa3 (patch) | |
tree | 14e4a18e75eb3adc20e1b5579ab4fa27cadeb839 /source/blender/draw/engines | |
parent | 51bd26d0faad306183c58bff0865b72cf99fbe90 (diff) |
Cleanup: spelling in code comments
Diffstat (limited to 'source/blender/draw/engines')
21 files changed, 40 insertions, 40 deletions
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; |