diff --git a/intern/opencolorio/gpu_shader_display_transform_frag.glsl b/intern/opencolorio/gpu_shader_display_transform_frag.glsl index 71045fb4cb7..f2b248c7cca 100644 --- a/intern/opencolorio/gpu_shader_display_transform_frag.glsl +++ b/intern/opencolorio/gpu_shader_display_transform_frag.glsl @@ -101,7 +101,7 @@ vec4 curvemapping_evaluate_premulRGBF(vec4 col) /* Using a triangle distribution which gives a more final uniform noise. * See Banding in Games:A Noisy Rant(revision 5) Mikkel Gjøl, Playdead (slide 27) */ -/* GPUs are rounding before writing to framebuffer so we center the distribution around 0.0. */ +/* GPUs are rounding before writing to frame-buffer so we center the distribution around 0.0. */ /* Return triangle noise in [-1..1[ range */ float dither_random_value(vec2 co) { @@ -165,11 +165,11 @@ vec4 OCIO_ProcessColor(vec4 col, vec4 col_overlay) /* Convert to display space. */ col = OCIO_to_display(col); - /* Blend with overlay in UI colorspace. + /* Blend with overlay in UI color-space. * - * UI colorspace here refers to the display linear color space, + * UI color-space here refers to the display linear color space, * i.e: The linear color space w.r.t. display chromaticity and radiometry. - * We separate the colormanagement process into two steps to be able to + * We separate the color-management process into two steps to be able to * merge UI using alpha blending in the correct color space. */ if (parameters.use_overlay) { col.rgb = pow(col.rgb, vec3(parameters.exponent * 2.2)); @@ -179,7 +179,7 @@ vec4 OCIO_ProcessColor(vec4 col, vec4 col_overlay) col = clamp(col, 0.0, 1.0); } else { - /* When using extended colorspace, interpolate towards clamped color to improve display of + /* When using extended color-space, interpolate towards clamped color to improve display of * alpha-blended overlays. */ col = mix(max(col, 0.0), clamp(col, 0.0, 1.0), col_overlay.a); } diff --git a/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl b/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl index b0c7437e997..652acd87cad 100644 --- a/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl @@ -107,7 +107,7 @@ float bxdf_ggx_D(float NH, float a2) float D_ggx_opti(float NH, float a2) { float tmp = (NH * a2 - NH) * NH + 1.0; - return M_PI * tmp * tmp; /* Doing RCP and mul a2 at the end */ + return M_PI * tmp * tmp; /* Doing RCP and multiply a2 at the end. */ } float bxdf_ggx_smith_G1(float NX, float a2) @@ -119,10 +119,10 @@ float G1_Smith_GGX_opti(float NX, float a2) { /* Using Brian Karis approach and refactoring by NX/NX * this way the (2*NL)*(2*NV) in G = G1(V) * G1(L) gets canceled by the brdf denominator 4*NL*NV - * Rcp is done on the whole G later + * RCP is done on the whole G later * Note that this is not convenient for the transmission formula */ return NX + sqrt(NX * (NX - NX * a2) + a2); - /* return 2 / (1 + sqrt(1 + a2 * (1 - NX*NX) / (NX*NX) ) ); /* Reference function */ + // return 2 / (1 + sqrt(1 + a2 * (1 - NX*NX) / (NX*NX) ) ); /* Reference function. */ } /* Compute the GGX BRDF without the Fresnel term, multiplied by the cosine foreshortening term. */ diff --git a/source/blender/draw/engines/eevee/shaders/btdf_lut_frag.glsl b/source/blender/draw/engines/eevee/shaders/btdf_lut_frag.glsl index 287c4bbe196..a4616010ea6 100644 --- a/source/blender/draw/engines/eevee/shaders/btdf_lut_frag.glsl +++ b/source/blender/draw/engines/eevee/shaders/btdf_lut_frag.glsl @@ -60,8 +60,8 @@ void main() /* Balancing the adjustments made in G1_Smith. */ float G1_l = NL * 2.0 / G1_Smith_GGX_opti(NL, a2); - /* btdf = abs(VH*LH) * (ior*ior) * D * G(V) * G(L) / (Ht2 * NV) - * pdf = (VH * abs(LH)) * (ior*ior) * D * G(V) / (Ht2 * NV) */ + // btdf = abs(VH*LH) * (ior*ior) * D * G(V) * G(L) / (Ht2 * NV) + // pdf = (VH * abs(LH)) * (ior*ior) * D * G(V) / (Ht2 * NV) float btdf = G1_l * abs(VH * LH) / (VH * abs(LH)); btdf_accum += btdf; diff --git a/source/blender/draw/engines/eevee/shaders/closure_eval_diffuse_lib.glsl b/source/blender/draw/engines/eevee/shaders/closure_eval_diffuse_lib.glsl index 0177dbec785..5d14cb327c6 100644 --- a/source/blender/draw/engines/eevee/shaders/closure_eval_diffuse_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/closure_eval_diffuse_lib.glsl @@ -79,7 +79,7 @@ void closure_Diffuse_indirect_end(ClosureInputDiffuse cl_in, ClosureEvalCommon cl_common, inout ClosureOutputDiffuse cl_out) { - /* If not enough light has been accumulated from probes, use the world specular cubemap + /* If not enough light has been accumulated from probes, use the world specular cube-map * to fill the remaining energy needed. */ if (cl_common.diffuse_accum > 0.0) { vec3 probe_radiance = probe_evaluate_world_diff(cl_eval.probe_sampling_dir); diff --git a/source/blender/draw/engines/eevee/shaders/closure_eval_glossy_lib.glsl b/source/blender/draw/engines/eevee/shaders/closure_eval_glossy_lib.glsl index e1e97fa0da9..3cfb6e65e85 100644 --- a/source/blender/draw/engines/eevee/shaders/closure_eval_glossy_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/closure_eval_glossy_lib.glsl @@ -123,7 +123,7 @@ void closure_Glossy_cubemap_eval(ClosureInputGlossy cl_in, ClosureCubemapData cube, inout ClosureOutputGlossy cl_out) { -/* Ensure cubemap probes contribution only gets applied once when running split pass */ +/* Ensure cube-map probes contribution only gets applied once when running split pass */ #ifndef RESOLVE_SSR vec3 probe_radiance = probe_evaluate_cube( cube.id, cl_common.P, cl_eval.probe_sampling_dir, cl_in.roughness); @@ -138,7 +138,7 @@ void closure_Glossy_indirect_end(ClosureInputGlossy cl_in, { /* Ensure specular contribution only gets applied once when running split pass */ #ifndef RESOLVE_SSR - /* If not enough light has been accumulated from probes, use the world specular cubemap + /* If not enough light has been accumulated from probes, use the world specular cube-map * to fill the remaining energy needed. */ if (specToggle && cl_common.specular_accum > 0.0) { vec3 probe_radiance = probe_evaluate_world_spec(cl_eval.probe_sampling_dir, cl_in.roughness); diff --git a/source/blender/draw/engines/eevee/shaders/closure_eval_lib.glsl b/source/blender/draw/engines/eevee/shaders/closure_eval_lib.glsl index 6326d65fc31..f9047aaff5e 100644 --- a/source/blender/draw/engines/eevee/shaders/closure_eval_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/closure_eval_lib.glsl @@ -75,7 +75,7 @@ { \ CLOSURE_EVAL_DECLARE(t0, t1, t2, t3); \ \ - /* Starts at 1 because 0 is world cubemap. */ \ + /* Starts at 1 because 0 is world cube-map. */ \ for (int i = 1; cl_common.specular_accum > 0.0 && i < prbNumRenderCube && i < MAX_PROBE; \ i++) { \ ClosureCubemapData cube = closure_cubemap_eval_init(i, cl_common); \ @@ -216,17 +216,17 @@ struct ClosureEvalCommon { vec3 P; /** Normal vector, always facing camera. */ vec3 N; - /** Normal vector, always facing camera. (viewspace) */ + /** Normal vector, always facing camera. (view-space) */ vec3 vN; - /** Surface position. (viewspace) */ + /** Surface position. (view-space) */ vec3 vP; /** Geometric normal, always facing camera. */ vec3 Ng; - /** Geometric normal, always facing camera. (viewspace) */ + /** Geometric normal, always facing camera. (view-space) */ vec3 vNg; - /** Random numbers. 3 random sequences. zw is a random point on a circle. */ + /** Random numbers. 3 random sequences. `zw` is a random point on a circle. */ vec4 rand; - /** Specular probe accumulator. Shared between planar and cubemap probe. */ + /** Specular probe accumulator. Shared between planar and cube-map probe. */ float specular_accum; /** Diffuse probe accumulator. */ float diffuse_accum; @@ -237,7 +237,7 @@ struct ClosureOutput { vec3 radiance; }; -/* Workaround for screenspace shadows in SSR pass. */ +/* Workaround for screen-space shadows in SSR pass. */ float FragDepth; ClosureEvalCommon closure_Common_eval_init(ClosureInputCommon cl_in) diff --git a/source/blender/draw/engines/eevee/shaders/closure_eval_refraction_lib.glsl b/source/blender/draw/engines/eevee/shaders/closure_eval_refraction_lib.glsl index 00d2c677b90..c9683a41748 100644 --- a/source/blender/draw/engines/eevee/shaders/closure_eval_refraction_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/closure_eval_refraction_lib.glsl @@ -114,7 +114,7 @@ void closure_Refraction_indirect_end(ClosureInputRefraction cl_in, ClosureEvalCommon cl_common, inout ClosureOutputRefraction cl_out) { - /* If not enough light has been accumulated from probes, use the world specular cubemap + /* If not enough light has been accumulated from probes, use the world specular cube-map * to fill the remaining energy needed. */ if (specToggle && cl_common.specular_accum > 0.0) { vec3 probe_radiance = probe_evaluate_world_spec(cl_eval.probe_sampling_dir, diff --git a/source/blender/draw/engines/eevee/shaders/closure_eval_translucent_lib.glsl b/source/blender/draw/engines/eevee/shaders/closure_eval_translucent_lib.glsl index f927fe4cc3a..07ce0043be0 100644 --- a/source/blender/draw/engines/eevee/shaders/closure_eval_translucent_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/closure_eval_translucent_lib.glsl @@ -61,7 +61,7 @@ void closure_Translucent_indirect_end(ClosureInputTranslucent cl_in, ClosureEvalCommon cl_common, inout ClosureOutputTranslucent cl_out) { - /* If not enough light has been accumulated from probes, use the world specular cubemap + /* If not enough light has been accumulated from probes, use the world specular cube-map * to fill the remaining energy needed. */ if (cl_common.diffuse_accum > 0.0) { vec3 probe_radiance = probe_evaluate_world_diff(cl_in.N); diff --git a/source/blender/draw/engines/eevee/shaders/cubemap_lib.glsl b/source/blender/draw/engines/eevee/shaders/cubemap_lib.glsl index 9922f4d555e..bbf7a97c732 100644 --- a/source/blender/draw/engines/eevee/shaders/cubemap_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/cubemap_lib.glsl @@ -2,7 +2,7 @@ * * SPDX-License-Identifier: GPL-2.0-or-later */ -/* Fallback implementation for hardware not supporting cubemap arrays. +/* Fallback implementation for hardware not supporting cube-map arrays. * `samplerCubeArray` fallback declaration as sampler2DArray in `glsl_shader_defines.glsl`. */ #ifndef GPU_ARB_texture_cube_map_array diff --git a/source/blender/draw/engines/eevee/shaders/effect_dof_lib.glsl b/source/blender/draw/engines/eevee/shaders/effect_dof_lib.glsl index cc6031e911e..d9873e05991 100644 --- a/source/blender/draw/engines/eevee/shaders/effect_dof_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/effect_dof_lib.glsl @@ -133,7 +133,7 @@ float dof_load_gather_coc(sampler2D gather_input_coc_buffer, vec2 uv, float lod) return coc * 0.5; } -/* Distribute weights between near/slightfocus/far fields (slide 117). */ +/* Distribute weights between near/slight-focus/far fields (slide 117). */ #define layer_threshold 4.0 /* Make sure it overlaps. */ #define layer_offset_fg (0.5 + 1.0) @@ -502,7 +502,8 @@ void dof_gather_accumulate_sample_ring(DofGatherData ring_data, } } -/* FIXME(@fclem): Seems to be wrong since it needs `ringcount + 1` as input for slightfocus gather. +/* FIXME(@fclem): Seems to be wrong since it needs `ringcount + 1` as input for slight-focus + * gather. */ int dof_gather_total_sample_count(const int ring_count, const int ring_density) { diff --git a/source/blender/draw/engines/eevee/shaders/effect_reflection_resolve_frag.glsl b/source/blender/draw/engines/eevee/shaders/effect_reflection_resolve_frag.glsl index a5bafb8c7f7..f3275122baa 100644 --- a/source/blender/draw/engines/eevee/shaders/effect_reflection_resolve_frag.glsl +++ b/source/blender/draw/engines/eevee/shaders/effect_reflection_resolve_frag.glsl @@ -298,7 +298,7 @@ void main() in_Glossy_0.roughness = roughness; /* Do a full deferred evaluation of the glossy BSDF. The only difference is that we inject the - * SSR resolve before the cubemap iter. BRDF term is already computed during main pass and is + * SSR resolve before the cube-map iter. BRDF term is already computed during main pass and is * passed as specular color. */ CLOSURE_EVAL_FUNCTION_1(ssr_resolve, Glossy); diff --git a/source/blender/draw/engines/eevee/shaders/effect_translucency_frag.glsl b/source/blender/draw/engines/eevee/shaders/effect_translucency_frag.glsl index 6a6ad2929b9..f4fc84a600b 100644 --- a/source/blender/draw/engines/eevee/shaders/effect_translucency_frag.glsl +++ b/source/blender/draw/engines/eevee/shaders/effect_translucency_frag.glsl @@ -53,7 +53,7 @@ float light_translucent_power_with_falloff(LightData ld, vec3 N, vec4 l_vector) float shadow_cube_radial_depth(vec3 cubevec, float tex_id, int shadow_id) { float depth = sample_cube(sssShadowCubes, cubevec, tex_id).r; - /* To reverting the constant bias from shadow rendering. (Tweaked for 16bit shadowmaps) */ + /* To reverting the constant bias from shadow rendering. (Tweaked for 16bit shadow-maps) */ const float depth_bias = 3.1e-5; depth = saturate(depth - depth_bias); @@ -107,13 +107,13 @@ vec3 light_translucent(LightData ld, vec3 P, vec3 N, vec4 l_vector, vec2 rand, f depths.z = sample_cascade(sssShadowCascades, shpos.xy - ofs.xy, tex_id).r; depths.w = sample_cascade(sssShadowCascades, shpos.xy - ofs.yx, tex_id).r; - /* To reverting the constant bias from shadow rendering. (Tweaked for 16bit shadowmaps) */ + /* To reverting the constant bias from shadow rendering. (Tweaked for 16bit shadow-maps) */ float depth_bias = 3.1e-5; depths = saturate(depths - depth_bias); d = saturate(d - depth_bias); /* Size of a texel in world space. - * FIXME This is only correct if l_right is the same right vector used for shadowmap creation. + * FIXME This is only correct if l_right is the same right vector used for shadow-map creation. * This won't work if the shadow matrix is rotated (soft shadows). * TODO: precompute. */ float unit_world_in_uv_space = length(mat3(scascade(data_id).shadowmat[int(id)]) * ld.l_right); @@ -133,10 +133,10 @@ vec3 light_translucent(LightData ld, vec3 P, vec3 N, vec4 l_vector, vec2 rand, f vec3 cubevec = transform_point(scube(data_id).shadowmat, P); dist = length(cubevec); cubevec /= dist; - /* tex_id == data_id for cube shadowmap */ + /* `tex_id == data_id` for cube shadow-map. */ float tex_id = float(data_id); d = shadow_cube_radial_depth(cubevec, tex_id, shadow_id); - /* NOTE: The offset is irregular in respect to cubeface uvs. But it has + /* NOTE: The offset is irregular in respect to cube-face uvs. But it has * a much more uniform behavior than biasing based on face derivatives. */ depths.x = shadow_cube_radial_depth(cubevec + T * ofs, tex_id, shadow_id); depths.y = shadow_cube_radial_depth(cubevec + B * ofs, tex_id, shadow_id); @@ -149,7 +149,7 @@ vec3 light_translucent(LightData ld, vec3 P, vec3 N, vec4 l_vector, vec2 rand, f float s = min(d, min_v4(depths)); - /* To avoid light leak from depth discontinuity and shadowmap aliasing. */ + /* To avoid light leak from depth discontinuity and shadow-map aliasing. */ float slope_bias = (abs(dx) + abs(dy)) * 0.5; s -= slope_bias; diff --git a/source/blender/draw/engines/eevee/shaders/lightprobe_filter_diffuse_frag.glsl b/source/blender/draw/engines/eevee/shaders/lightprobe_filter_diffuse_frag.glsl index 3051c7a38d4..5912743294b 100644 --- a/source/blender/draw/engines/eevee/shaders/lightprobe_filter_diffuse_frag.glsl +++ b/source/blender/draw/engines/eevee/shaders/lightprobe_filter_diffuse_frag.glsl @@ -147,7 +147,7 @@ void main() if (NL > 0.0) { /* Coarse Approximation of the mapping distortion - * Unit Sphere -> Cubemap Face */ + * Unit Sphere -> Cube-map Face. */ const float dist = 4.0 * M_PI / 6.0; /* http://http.developer.nvidia.com/GPUGems3/gpugems3_ch20.html : Equation 13 */ float lod = clamp(lodFactor - 0.5 * log2(pdf * dist), 0.0, lodMax); diff --git a/source/blender/draw/engines/eevee/shaders/lightprobe_filter_glossy_frag.glsl b/source/blender/draw/engines/eevee/shaders/lightprobe_filter_glossy_frag.glsl index 547344a2e81..6a2e37ce30a 100644 --- a/source/blender/draw/engines/eevee/shaders/lightprobe_filter_glossy_frag.glsl +++ b/source/blender/draw/engines/eevee/shaders/lightprobe_filter_glossy_frag.glsl @@ -47,7 +47,7 @@ void main() float NH = max(1e-8, dot(N, H)); /* cosTheta */ /* Coarse Approximation of the mapping distortion - * Unit Sphere -> Cubemap Face */ + * Unit Sphere -> Cube-map Face. */ const float dist = 4.0 * M_PI / 6.0; /* http://http.developer.nvidia.com/GPUGems3/gpugems3_ch20.html : Equation 13 */ float lod = clamp(lodFactor - 0.5 * log2(pdf * dist), 0.0, lodMax); diff --git a/source/blender/draw/engines/eevee/shaders/lightprobe_filter_visibility_frag.glsl b/source/blender/draw/engines/eevee/shaders/lightprobe_filter_visibility_frag.glsl index ede2ba0f85c..7c7561d1571 100644 --- a/source/blender/draw/engines/eevee/shaders/lightprobe_filter_visibility_frag.glsl +++ b/source/blender/draw/engines/eevee/shaders/lightprobe_filter_visibility_frag.glsl @@ -60,7 +60,7 @@ void main() /* clamp to [0-1] */ cos.xy = fract(cos.xy); - /* get cubemap vector */ + /* Get cube-map vector. */ cos = normalize(octahedral_to_cubemap_proj(cos.xy)); vec3 T, B; diff --git a/source/blender/draw/engines/eevee/shaders/lightprobe_vert_no_geom.glsl b/source/blender/draw/engines/eevee/shaders/lightprobe_vert_no_geom.glsl index 830ec0e8342..c2b1202ece1 100644 --- a/source/blender/draw/engines/eevee/shaders/lightprobe_vert_no_geom.glsl +++ b/source/blender/draw/engines/eevee/shaders/lightprobe_vert_no_geom.glsl @@ -3,7 +3,7 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ /* Non-geometry shader equivalent for eevee_legacy_lightprobe_vert + eevee_legacy_lightprobe_geom. - * generates geometry instance per cubeface for multi-layered rendering. */ + * generates geometry instance per cube-face for multi-layered rendering. */ void main() { diff --git a/source/blender/draw/engines/eevee/shaders/lights_lib.glsl b/source/blender/draw/engines/eevee/shaders/lights_lib.glsl index 6a772cc11f4..66f0a875852 100644 --- a/source/blender/draw/engines/eevee/shaders/lights_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/lights_lib.glsl @@ -167,7 +167,7 @@ float sample_cube_shadow(int shadow_id, vec3 P) /* TODO: Shadow Cube Array. */ float face = cubeFaceIndexEEVEE(cubevec); vec2 coord = cubeFaceCoordEEVEE(cubevec, face, shadowCubeTexture); - /* tex_id == data_id for cube shadowmap */ + /* `tex_id == data_id` for cube shadow-map. */ float tex_id = float(data_id); return texture(shadowCubeTexture, vec4(coord, tex_id * 6.0 + face, dist)); } diff --git a/source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl b/source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl index 141567576dc..0c1a7b5b9f8 100644 --- a/source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl @@ -21,7 +21,7 @@ struct Ray { vec3 direction; }; -/* Inputs expected to be in viewspace. */ +/* Inputs expected to be in view-space. */ void raytrace_clip_ray_to_near_plane(inout Ray ray) { float near_dist = get_view_z_from_depth(0.0); @@ -30,7 +30,7 @@ void raytrace_clip_ray_to_near_plane(inout Ray ray) } } -/* Screenspace ray ([0..1] "uv" range) where direction is normalize to be as small as one +/* Screen-space ray ([0..1] "uv" range) where direction is normalize to be as small as one * full-resolution pixel. The ray is also clipped to all frustum sides. */ struct ScreenSpaceRay { @@ -180,7 +180,7 @@ bool raytrace(Ray ray, /* Reject hit if background. */ hit = hit && (depth_sample != 1.0); #endif - /* Refine hit using intersection between the sampled heightfield and the ray. + /* Refine hit using intersection between the sampled height-field and the ray. * This simplifies nicely to this single line. */ time = mix(prev_time, time, saturate(prev_delta / (prev_delta - delta))); @@ -236,7 +236,7 @@ bool raytrace_planar(Ray ray, RayTraceParameters params, int planar_ref_id, out } /* Reject hit if background. */ hit = hit && (depth_sample != 1.0); - /* Refine hit using intersection between the sampled heightfield and the ray. + /* Refine hit using intersection between the sampled height-field and the ray. * This simplifies nicely to this single line. */ time = mix(prev_time, time, saturate(prev_delta / (prev_delta - delta))); diff --git a/source/blender/draw/engines/eevee/shaders/volumetric_lib.glsl b/source/blender/draw/engines/eevee/shaders/volumetric_lib.glsl index 7a61dec5544..150ffa5d04b 100644 --- a/source/blender/draw/engines/eevee/shaders/volumetric_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/volumetric_lib.glsl @@ -119,7 +119,7 @@ vec3 light_volume_light_vector(LightData ld, vec3 P) vec3 participating_media_extinction(vec3 wpos, sampler3D volume_extinction) { - /* Waiting for proper volume shadowmaps and out of frustum shadow map. */ + /* Waiting for proper volume shadow-maps and out of frustum shadow map. */ vec3 ndc = project_point(ProjectionMatrix, transform_point(ViewMatrix, wpos)); vec3 volume_co = ndc_to_volume(ndc * 0.5 + 0.5); diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_bxdf_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_bxdf_lib.glsl index 4123c436228..15dc924cf8a 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_bxdf_lib.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_bxdf_lib.glsl @@ -21,7 +21,7 @@ float bxdf_ggx_D(float NH, float a2) float bxdf_ggx_D_opti(float NH, float a2) { float tmp = (NH * a2 - NH) * NH + 1.0; - /* Doing RCP and mul a2 at the end. */ + /* Doing RCP and multiply a2 at the end. */ return M_PI * tmp * tmp; } @@ -34,7 +34,7 @@ float bxdf_ggx_smith_G1_opti(float NX, float a2) { /* Using Brian Karis approach and refactoring by NX/NX * this way the `(2*NL)*(2*NV)` in `G = G1(V) * G1(L)` gets canceled by the BRDF denominator - * `4*NL*NV` Rcp is done on the whole G later. Note that this is not convenient for the + * `4*NL*NV` RCP is done on the whole G later. Note that this is not convenient for the * transmission formula. */ return NX + sqrt(NX * (NX - NX * a2) + a2); } @@ -53,7 +53,7 @@ float bsdf_ggx(vec3 N, vec3 L, vec3 V, float roughness) float G = bxdf_ggx_smith_G1(NV, a2) * bxdf_ggx_smith_G1(NL, a2); float D = bxdf_ggx_D(NH, a2); - /* brdf * NL = `((D * G) / (4 * NV * NL)) * NL`. */ + /* BRDF * NL = `((D * G) / (4 * NV * NL)) * NL`. */ return (0.25 * D * G) / NV; } diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_cubemap_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_cubemap_lib.glsl index 9922f4d555e..bbf7a97c732 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_cubemap_lib.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_cubemap_lib.glsl @@ -2,7 +2,7 @@ * * SPDX-License-Identifier: GPL-2.0-or-later */ -/* Fallback implementation for hardware not supporting cubemap arrays. +/* Fallback implementation for hardware not supporting cube-map arrays. * `samplerCubeArray` fallback declaration as sampler2DArray in `glsl_shader_defines.glsl`. */ #ifndef GPU_ARB_texture_cube_map_array 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 56a0eb9b4b2..713bdc119d5 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 @@ -265,7 +265,7 @@ void dof_gather_accumulate_sample_ring(DofGatherData ring_data, } /* FIXME(fclem) Seems to be wrong since it needs `ringcount + 1` as input for - * slightfocus gather. */ + * slight-focus 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) { @@ -635,7 +635,7 @@ void dof_slight_focus_gather(depth2D depth_tx, pair_data[i].color = safe_color(textureLod(color_tx, sample_uv, 0.0)); pair_data[i].dist = ring_dist; if (DOF_BOKEH_TEXTURE) { - /* Contains subpixel distance to bokeh shape. */ + /* Contains sub-pixel distance to bokeh shape. */ ivec2 lut_texel = ivec2(round(sample_offset)) + dof_max_slight_focus_radius; pair_data[i].dist = texelFetch(bkh_lut_tx, lut_texel, 0).r; } diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_lib.glsl index 731d78a5251..c2382a49d7a 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_lib.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_lib.glsl @@ -45,7 +45,7 @@ const bool no_slight_focus_pass = false; const bool no_focus_pass = false; const bool no_hole_fill_pass = false; -/* Distribute weights between near/slightfocus/far fields (slide 117). */ +/* Distribute weights between near/slight-focus/far fields (slide 117). */ const float dof_layer_threshold = 4.0; /* Make sure it overlaps. */ const float dof_layer_offset_fg = 0.5 + 1.0; diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_resolve_comp.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_resolve_comp.glsl index 631f3bc0de4..22522b6cdf5 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_resolve_comp.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_resolve_comp.glsl @@ -53,7 +53,7 @@ vec3 dof_neighborhood_clamp(vec2 frag_coord, vec3 color, float center_coc, float for (int i = 0; i < 4; i++) { /** * Visit the 4 half-res texels around (and containing) the fullres texel. - * Here a diagram of a fullscreen texel (f) in the bottom left corner of a half res texel. + * Here a diagram of a full-screen texel (f) in the bottom left corner of a half res texel. * We sample the stable half-resolution texture at the 4 location denoted by (h). * ┌───────┬───────┐ * │ h │ h │ diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_stabilize_comp.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_stabilize_comp.glsl index fc32b4e0dd6..642e6f67ab3 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_stabilize_comp.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_stabilize_comp.glsl @@ -226,7 +226,7 @@ vec2 dof_pixel_history_motion_vector(ivec2 texel_sample) } /* Load color using a special filter to avoid losing detail. - * \a texel is sample position with subpixel accuracy. */ + * \a texel is sample position with sub-pixel accuracy. */ DofSample dof_sample_history(vec2 input_texel) { #if 1 /* Bilinar. */ 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 3ed45c9d9b2..60213f822e8 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 @@ -334,7 +334,7 @@ void film_combined_neighbor_boundbox(ivec2 texel, out vec4 min_c, out vec4 max_c * Compute Variance of neighborhood as described in: * "An Excursion in Temporal Supersampling" by Marco Salvi at GDC 2016. * and: - * "A Survey of Temporal Antialiasing Techniques" by Yang et al. + * "A Survey of Temporal Anti-aliasing Techniques" by Yang et al. */ /* First 2 moments. */ @@ -352,7 +352,7 @@ void film_combined_neighbor_boundbox(ivec2 texel, out vec4 min_c, out vec4 max_c const float gamma = 1.25; /* Standard deviation. */ vec4 sigma = sqrt(abs(mu2 - sqr(mu1))); - /* eq. 6 in "A Survey of Temporal Antialiasing Techniques". */ + /* eq. 6 in "A Survey of Temporal Anti-aliasing Techniques". */ min_c = mu1 - gamma * sigma; max_c = mu1 + gamma * sigma; #else diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_geom_world_vert.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_geom_world_vert.glsl index bfff954b324..220afe1b2d0 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_geom_world_vert.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_geom_world_vert.glsl @@ -3,7 +3,7 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ /** - * Custom fullscreen triangle with placeholders varyings. + * Custom full-screen triangle with placeholders varyings. */ #pragma BLENDER_REQUIRE(common_view_lib.glsl) @@ -12,7 +12,7 @@ void main() { - /* Fullscreen triangle. */ + /* Full-screen triangle. */ int v = gl_VertexID % 3; float x = float((v & 1) << 2) - 1.0; float y = float((v & 2) << 1) - 1.0; diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_light_culling_tile_comp.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_light_culling_tile_comp.glsl index 40270a17dc1..a574c654bf3 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_light_culling_tile_comp.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_light_culling_tile_comp.glsl @@ -21,7 +21,7 @@ struct CullingTile { vec4 bounds; }; -/* Corners are expected to be in viewspace so that the cone is starting from the origin. +/* Corners are expected to be in view-space so that the cone is starting from the origin. * Corner order does not matter. */ vec4 tile_bound_cone(vec3 v00, vec3 v01, vec3 v10, vec3 v11) { @@ -37,7 +37,7 @@ vec4 tile_bound_cone(vec3 v00, vec3 v01, vec3 v10, vec3 v11) return vec4(center, angle_cosine); } -/* Corners are expected to be in viewspace. Returns Z-aligned bounding cylinder. +/* Corners are expected to be in view-space. Returns Z-aligned bounding cylinder. * Corner order does not matter. */ vec4 tile_bound_cylinder(vec3 v00, vec3 v01, vec3 v10, vec3 v11) { diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_irradiance_load_comp.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_irradiance_load_comp.glsl index ede31cf46db..ee941b03f02 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_irradiance_load_comp.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_irradiance_load_comp.glsl @@ -124,7 +124,7 @@ void main() if (gl_LocalInvocationID.z % 4 == 0u) { /* Encode 4 cells into one volume sample. */ ivec4 cell_validity_bits = ivec4(0); - /* Encode validty of each samples in the grid cell. */ + /* Encode validity of each samples in the grid cell. */ for (int cell = 0; cell < 4; cell++) { for (int i = 0; i < 8; i++) { ivec3 offset = lightprobe_irradiance_grid_cell_corner(i); diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_motion_blur_dilate_comp.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_motion_blur_dilate_comp.glsl index a5f4b1ce45b..285486fe677 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_motion_blur_dilate_comp.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_motion_blur_dilate_comp.glsl @@ -22,7 +22,7 @@ MotionRect compute_motion_rect(ivec2 tile, vec2 motion) #if DEBUG_BYPASS_DILATION return MotionRect(tile, ivec2(1)); #endif - /* Ceil to number of tile touched. */ + /* `ceil()` to number of tile touched. */ ivec2 point1 = tile + ivec2(sign(motion) * ceil(abs(motion) / float(MOTION_BLUR_TILE_SIZE))); ivec2 point2 = tile; diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_octahedron_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_octahedron_lib.glsl index 2b33ea2c0dd..c6dbb09f52a 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_octahedron_lib.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_octahedron_lib.glsl @@ -3,7 +3,7 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ /** - * Convert from a cubemap vector to an octahedron UV coordinate. + * Convert from a cube-map vector to an octahedron UV coordinate. */ vec2 octahedral_uv_from_direction(vec3 co) { diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_ray_generate_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_ray_generate_lib.glsl index 6c891fbf7dd..184c1771c04 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_ray_generate_lib.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_ray_generate_lib.glsl @@ -20,7 +20,7 @@ #define RAY_BIAS_REFRACTION 0.02 #define RAY_BIAS_DIFFUSE 0.02 -/* Returns viewspace ray. */ +/* Returns view-space ray. */ vec3 ray_generate_direction(vec2 noise, ClosureReflection reflection, vec3 V, out float pdf) { vec2 noise_offset = sampling_rng_2D_get(SAMPLING_RAYTRACE_U); @@ -39,7 +39,7 @@ vec3 ray_generate_direction(vec2 noise, ClosureReflection reflection, vec3 V, ou return sample_ggx_reflect(Xi, roughness_sqr, V, N, T, B, pdf); } -/* Returns viewspace ray. */ +/* Returns view-space ray. */ vec3 ray_generate_direction(vec2 noise, ClosureRefraction refraction, vec3 V, out float pdf) { vec2 noise_offset = sampling_rng_2D_get(SAMPLING_RAYTRACE_U); @@ -58,7 +58,7 @@ vec3 ray_generate_direction(vec2 noise, ClosureRefraction refraction, vec3 V, ou return sample_ggx_refract(Xi, roughness_sqr, refraction.ior, V, N, T, B, pdf); } -/* Returns viewspace ray. */ +/* Returns view-space ray. */ vec3 ray_generate_direction(vec2 noise, ClosureDiffuse diffuse, vec3 V, out float pdf) { vec2 noise_offset = sampling_rng_2D_get(SAMPLING_RAYTRACE_U); diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_ray_tile_classify_comp.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_ray_tile_classify_comp.glsl index bf758a25092..53c83515abd 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_ray_tile_classify_comp.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_ray_tile_classify_comp.glsl @@ -26,7 +26,7 @@ void main() if (all(equal(gl_LocalInvocationID, uvec3(0)))) { /* Clear num_groups_x to 0 so that we can use it as counter in the compaction phase. * Note that these writes are subject to race condition, but we write the same value - * from all workgroups. */ + * from all work-groups. */ denoise_dispatch_buf.num_groups_x = 0u; denoise_dispatch_buf.num_groups_y = 1u; denoise_dispatch_buf.num_groups_z = 1u; diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_ray_trace_screen_comp.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_ray_trace_screen_comp.glsl index 245b1cf0ea3..8b502e4a352 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_ray_trace_screen_comp.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_ray_trace_screen_comp.glsl @@ -58,7 +58,7 @@ void main() bool hit = false; float hit_time = 0.0; - /* Transform the ray into viewspace. */ + /* Transform the ray into view-space. */ Ray ray_view; ray_view.origin = transform_point(drw_view.viewmat, ray.origin); ray_view.direction = transform_direction(drw_view.viewmat, ray.direction); diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_ray_trace_screen_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_ray_trace_screen_lib.glsl index 640a66b3004..ac3a3a97d23 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_ray_trace_screen_lib.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_ray_trace_screen_lib.glsl @@ -14,7 +14,7 @@ #pragma BLENDER_REQUIRE(eevee_ray_types_lib.glsl) -/* Inputs expected to be in viewspace. */ +/* Inputs expected to be in view-space. */ void raytrace_clip_ray_to_near_plane(inout Ray ray) { float near_dist = get_view_z_from_depth(0.0); @@ -24,7 +24,7 @@ void raytrace_clip_ray_to_near_plane(inout Ray ray) } /** - * Raytrace against the given hizbuffer heightfield. + * Raytrace against the given HIZ-buffer height-field. * * \param stride_rand: Random number in [0..1] range. Offset along the ray to avoid banding * artifact when steps are too large. @@ -33,7 +33,7 @@ void raytrace_clip_ray_to_near_plane(inout Ray ray) * \param discard_backface: If true, raytrace will return false if we hit a surface from behind. * \param allow_self_intersection: If false, raytrace will return false if the ray is not covering * at least one pixel. - * \param ray: Viewspace ray. Direction premultiplied by maximum length. + * \param ray: View-space ray. Direction premultiplied by maximum length. * * \return True if there is a valid intersection. */ @@ -117,7 +117,7 @@ bool raytrace_screen(RayTraceData rt_data, /* Reject hit if background. */ hit = hit && (depth_sample != 1.0); #endif - /* Refine hit using intersection between the sampled heightfield and the ray. + /* Refine hit using intersection between the sampled height-field and the ray. * This simplifies nicely to this single line. */ time = mix(prev_time, time, saturate(prev_delta / (prev_delta - delta))); diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_ray_types_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_ray_types_lib.glsl index 3ad23284bc0..b8279a12236 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_ray_types_lib.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_ray_types_lib.glsl @@ -14,7 +14,7 @@ struct Ray { float max_time; }; -/* Screenspace ray ([0..1] "uv" range) where direction is normalize to be as small as one +/* Screen-space ray ([0..1] "uv" range) where direction is normalize to be as small as one * full-resolution pixel. The ray is also clipped to all frustum sides. * Z component is device normalized Z (aka. depth buffer value). * W component is device normalized Z + Thickness. diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_reflection_probe_eval_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_reflection_probe_eval_lib.glsl index 67a7b2fc33c..a4574192e48 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_reflection_probe_eval_lib.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_reflection_probe_eval_lib.glsl @@ -60,7 +60,7 @@ vec4 reflection_probe_eval(ClosureReflection reflection, if (NL > 0.0) { /* Coarse Approximation of the mapping distortion - * Unit Sphere -> Cubemap Face */ + * Unit Sphere -> Cube-map Face. */ const float dist = 4.0 * M_PI / 6.0; /* http://http.developer.nvidia.com/GPUGems3/gpugems3_ch20.html : Equation 13 */ diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_reflection_probe_remap_comp.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_reflection_probe_remap_comp.glsl index f8e66416c7c..2d608dd93e0 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_reflection_probe_remap_comp.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_reflection_probe_remap_comp.glsl @@ -2,7 +2,7 @@ * * SPDX-License-Identifier: GPL-2.0-or-later */ -/* Shader to convert cubemap to octahedral projection. */ +/* Shader to convert cube-map to octahedral projection. */ #pragma BLENDER_REQUIRE(eevee_octahedron_lib.glsl) diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_debug_frag.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_debug_frag.glsl index 59d8454086f..da672c58739 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_debug_frag.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_debug_frag.glsl @@ -3,7 +3,7 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ /** - * Debug drawing for virtual shadowmaps. + * Debug drawing for virtual shadow-maps. * See eShadowDebug for more information. */ @@ -16,7 +16,7 @@ #pragma BLENDER_REQUIRE(eevee_sampling_lib.glsl) #pragma BLENDER_REQUIRE(eevee_shadow_tilemap_lib.glsl) -/** Control the scaling of the tilemap splat. */ +/** Control the scaling of the tile-map splat. */ const float pixel_scale = 4.0; vec3 debug_random_color(ivec2 v) @@ -102,11 +102,11 @@ bool debug_tilemaps(vec3 P, LightData light) int tilemap = px.x / SHADOW_TILEMAP_RES; int tilemap_index = light.tilemap_index + tilemap; if ((px.y < SHADOW_TILEMAP_RES) && (tilemap_index <= light_tilemap_max_get(light))) { - /* Debug actual values in the tilemap buffer. */ + /* Debug actual values in the tile-map buffer. */ ShadowTileMapData tilemap = tilemaps_buf[tilemap_index]; int tile_index = shadow_tile_offset(px % SHADOW_TILEMAP_RES, tilemap.tiles_index, 0); ShadowTileData tile = shadow_tile_unpack(tiles_buf[tile_index]); - /* Leave 1 px border between tilemaps. */ + /* Leave 1 px border between tile-maps. */ if (!any(equal(ivec2(gl_FragCoord.xy) % (SHADOW_TILEMAP_RES * debug_tile_size_px), ivec2(0)))) { gl_FragDepth = 0.0; diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_lib.glsl index f9dae355733..aa52006a456 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_lib.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_lib.glsl @@ -4,7 +4,7 @@ #pragma BLENDER_REQUIRE(eevee_shadow_tilemap_lib.glsl) -/** \a unormalized_uv is the uv coordinates for the whole tilemap [0..SHADOW_TILEMAP_RES]. */ +/** \a unormalized_uv is the uv coordinates for the whole tile-map [0..SHADOW_TILEMAP_RES]. */ vec2 shadow_page_uv_transform( vec2 atlas_size, uvec3 page, uint lod, vec2 unormalized_uv, ivec2 tile_lod0_coord) { @@ -80,7 +80,7 @@ mat4x4 shadow_load_normal_matrix(LightData light) } } -/* Returns minimum bias (in world space unit) needed for a given geometry normal and a shadowmap +/* Returns minimum bias (in world space unit) needed for a given geometry normal and a shadow-map * page to avoid self shadowing artifacts. Note that this can return a negative bias to better * match the surface. */ float shadow_slope_bias_get(vec2 atlas_size, LightData light, vec3 lNg, vec3 lP, vec2 uv, uint lod) @@ -106,9 +106,9 @@ float shadow_slope_bias_get(vec2 atlas_size, LightData light, vec3 lNg, vec3 lP, struct ShadowSample { /* Signed delta in world units from the shading point to the occluder. Negative if occluded. */ float occluder_delta; - /* Tile coordinate inside the tilemap [0..SHADOW_TILEMAP_RES). */ + /* Tile coordinate inside the tile-map [0..SHADOW_TILEMAP_RES). */ ivec2 tile_coord; - /* UV coordinate inside the tilemap [0..SHADOW_TILEMAP_RES). */ + /* UV coordinate inside the tile-map [0..SHADOW_TILEMAP_RES). */ vec2 uv; /* Minimum slope bias to apply during comparison. */ float bias; diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_page_allocate_comp.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_page_allocate_comp.glsl index b2743cd294c..86f96770dbd 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_page_allocate_comp.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_page_allocate_comp.glsl @@ -3,7 +3,7 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ /** - * Virtual shadowmapping: Allocation. + * Virtual shadow-mapping: Allocation. * * Allocates pages to tiles needing them. * Note that allocation can fail, in this case the tile is left with no page. diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_page_clear_comp.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_page_clear_comp.glsl index dc2558b277b..ab5e078bb64 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_page_clear_comp.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_page_clear_comp.glsl @@ -3,9 +3,9 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ /** - * Virtual shadowmapping: Page Clear. + * Virtual shadow-mapping: Page Clear. * - * Equivalent to a framebuffer depth clear but only for pages pushed to the clear_page_buf. + * Equivalent to a frame-buffer depth clear but only for pages pushed to the clear_page_buf. */ #pragma BLENDER_REQUIRE(common_math_lib.glsl) diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_page_defrag_comp.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_page_defrag_comp.glsl index d428f96550d..2bd5f656c42 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_page_defrag_comp.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_page_defrag_comp.glsl @@ -3,7 +3,7 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ /** - * Virtual shadowmapping: Defrag. + * Virtual shadow-mapping: Defrag. * * Defragment the cached page buffer making one continuous array. * @@ -11,11 +11,11 @@ * Here is an example of the behavior of this buffer during one update cycle: * * Initial state: 5 cached pages. Buffer starts at index 2 and ends at 6. - * [--xxxxx---------] + * `[--xxxxx---------]` * After page free step: 2 cached pages were removed (r), 3 pages were inserted in the cache (i). - * [--xrxrxiii------] + * `[--xrxrxiii------]` * After page defrag step: The buffer is compressed into only 6 pages. - * [----xxxxxx------] + * `[----xxxxxx------]` */ #pragma BLENDER_REQUIRE(eevee_shadow_page_ops_lib.glsl) diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_page_free_comp.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_page_free_comp.glsl index 60c4f98eef1..6e7e4a4dcbd 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_page_free_comp.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_page_free_comp.glsl @@ -3,9 +3,9 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ /** - * Virtual shadowmapping: Tile page freeing. + * Virtual shadow-mapping: Tile page freeing. * - * Releases the allocated pages held by tilemaps that have been become unused. + * Releases the allocated pages held by tile-maps that have been become unused. * Also reclaim cached pages if the tiles needs them. * Note that we also count the number of new page allocations needed. */ diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_page_mask_comp.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_page_mask_comp.glsl index 28a47eec997..6fc09b05b3e 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_page_mask_comp.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_page_mask_comp.glsl @@ -3,7 +3,7 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ /** - * Virtual shadowmapping: Usage un-tagging + * Virtual shadow-mapping: Usage un-tagging * * Remove used tag from masked tiles (LOD overlap). */ @@ -22,7 +22,7 @@ void main() * the level underneath. If this adds up to 4 the underneath tile is flag unused as its data * is not needed for rendering. * - * This is because 2 receivers can tag used the same area of the shadowmap but with different + * This is because 2 receivers can tag used the same area of the shadow-map but with different * LODs. */ bool is_used = false; ivec2 tile_co = ivec2(gl_GlobalInvocationID.xy); diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_page_ops_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_page_ops_lib.glsl index 1cee80e7e89..f4414383785 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_page_ops_lib.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_page_ops_lib.glsl @@ -106,7 +106,7 @@ void shadow_page_cache_update_page_ref(uint page_index, uint new_page_index) tiles_buf[tile_index] = shadow_tile_pack(tile); } -/* Update cached page reference when a tile referencing a cached page moves inside the tilemap. */ +/* Update cached page reference when a tile referencing a cached page moves inside the tile-map. */ void shadow_page_cache_update_tile_ref(uint page_index, uint new_tile_index) { pages_cached_buf[page_index].y = new_tile_index; diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tag_update_comp.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tag_update_comp.glsl index a49e415de32..c5c08c07bd1 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tag_update_comp.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tag_update_comp.glsl @@ -3,7 +3,7 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ /** - * Virtual shadowmapping: Update tagging + * Virtual shadow-mapping: Update tagging * * Any updated shadow caster needs to tag the shadow map tiles it was in and is now into. * This is done in 2 pass of this same shader. One for past object bounds and one for new object @@ -70,7 +70,7 @@ void main() AABB aabb_tag; AABB aabb_map = shape_aabb(vec3(-0.99999), vec3(0.99999)); - /* Directionnal winmat have no correct near/far in the Z dimension at this point. + /* Directional `winmat` have no correct near/far in the Z dimension at this point. * Do not clip in this dimension. */ if (tilemap.projection_type != SHADOW_PROJECTION_CUBEFACE) { aabb_map.min.z = -FLT_MAX; diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tag_usage_comp.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tag_usage_comp.glsl index 848c385e231..d95445babaa 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tag_usage_comp.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tag_usage_comp.glsl @@ -3,7 +3,7 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ /** - * Virtual shadowmapping: Usage tagging + * Virtual shadow-mapping: Usage tagging * * Shadow pages are only allocated if they are visible. * This pass scan the depth buffer and tag all tiles that are needed for light shadowing as diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tag_usage_frag.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tag_usage_frag.glsl index 0ff3dc0fada..a6d5a358600 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tag_usage_frag.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tag_usage_frag.glsl @@ -3,7 +3,7 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ /** - * Virtual shadowmapping: Usage tagging + * Virtual shadow-mapping: Usage tagging * * Shadow pages are only allocated if they are visible. * This ray-marches the current fragment along the bounds depth and tags all the intersected shadow diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tag_usage_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tag_usage_lib.glsl index 8fcdf314ef6..b8d712bf3bb 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tag_usage_lib.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tag_usage_lib.glsl @@ -3,7 +3,7 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ /** - * Virtual shadowmapping: Usage tagging + * Virtual shadow-mapping: Usage tagging * * Shadow pages are only allocated if they are visible. * This contains the common logic used for tagging shadows for opaque and transparent receivers. @@ -167,7 +167,7 @@ void shadow_tag_usage_tilemap_punctual(uint l_idx, vec3 P, float dist_to_cam, fl /** * \a radius Radius of the tagging area in world space. - * Used for downsampled/ray-marched tagging, so all the shadowmap texels covered get correctly + * Used for downsampled/ray-marched tagging, so all the shadow-map texels covered get correctly * tagged. */ void shadow_tag_usage(vec3 vP, vec3 P, vec3 V, float radius, float dist_to_cam, vec2 pixel) diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tag_usage_surfels_comp.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tag_usage_surfels_comp.glsl index f38057ae4d8..294a7d7c93c 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tag_usage_surfels_comp.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tag_usage_surfels_comp.glsl @@ -3,7 +3,7 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ /** - * Virtual shadowmapping: Usage tagging + * Virtual shadow-mapping: Usage tagging * * Shadow pages are only allocated if they are visible. * This pass iterates the surfels buffer and tag all tiles that are needed for light shadowing as diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tag_usage_vert.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tag_usage_vert.glsl index 97d9bc50015..b55df5c2e84 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tag_usage_vert.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tag_usage_vert.glsl @@ -3,7 +3,7 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ /** - * Virtual shadowmapping: Usage tagging + * Virtual shadow-mapping: Usage tagging * * Shadow pages are only allocated if they are visible. * This renders the bounding boxes for transparent objects in order to tag the correct shadows. diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_test.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_test.glsl index 92dc5dbc8f9..06318f84762 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_test.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_test.glsl @@ -112,7 +112,7 @@ void main() EXPECT_EQ(coords.tile_coord, ivec2(SHADOW_TILEMAP_RES - 1)); EXPECT_NEAR(coords.uv, vec2(SHADOW_TILEMAP_RES), 1e-3); - /* Test clipmap level selection. */ + /* Test clip-map level selection. */ camera_lP = vec3(2.0, 2.0, 0.0); /* Follows ShadowDirectional::end_sync(). */ @@ -143,7 +143,7 @@ void main() EXPECT_EQ(coords.tile_coord, ivec2(0)); EXPECT_NEAR(coords.uv, vec2(0), 1e-3); - /* Test clipmap offset. */ + /* Test clip-map offset. */ light.clipmap_base_offset = ivec2(31, 1); lP = vec3(2.0001, 0.0001, 0.0); @@ -160,7 +160,7 @@ void main() coords = shadow_directional_coordinates(light, lP); EXPECT_EQ(coords.tile_coord, ivec2(SHADOW_TILEMAP_RES / 2) + ivec2(1, 0)); - /* Test clipmap negative offsets. */ + /* Test clip-map negative offsets. */ light.clipmap_base_offset = ivec2(-31, -1); lP = vec3(-2.0001, -0.0001, 0.0); @@ -185,7 +185,7 @@ void main() LightData light; light.type = LIGHT_SUN_ORTHO; light.clipmap_lod_min = 0; /* Range [-0.5..0.5]. */ - light.clipmap_lod_max = 2; /* 3 tilemaps. */ + light.clipmap_lod_max = 2; /* 3 tile-maps. */ light.tilemap_index = 1; light._position = vec3(0.0); light._clipmap_lod_bias = light.clipmap_lod_min - 1; @@ -236,7 +236,7 @@ void main() // EXPECT_EQ(coords.tile_coord, ivec2(SHADOW_TILEMAP_RES - 1)); // EXPECT_NEAR(coords.uv, vec2(SHADOW_TILEMAP_RES), 1e-3); - /* Test clipmap level selection. */ + /* Test clip-map level selection. */ // camera_lP = vec3(2.0, 2.0, 0.0); /* Follows ShadowDirectional::end_sync(). */ @@ -267,7 +267,7 @@ void main() // EXPECT_EQ(coords.tile_coord, ivec2(0)); // EXPECT_NEAR(coords.uv, vec2(0), 1e-3); - /* Test clipmap offset. */ + /* Test clip-map offset. */ // light.clipmap_base_offset = ivec2(31, 1); // lP = vec3(2.0001, 0.0001, 0.0); @@ -284,7 +284,7 @@ void main() // coords = shadow_directional_coordinates(light, lP); // EXPECT_EQ(coords.tile_coord, ivec2(SHADOW_TILEMAP_RES / 2) + ivec2(1, 0)); - /* Test clipmap negative offsets. */ + /* Test clip-map negative offsets. */ // light.clipmap_base_offset = ivec2(-31, -1); // lP = vec3(-2.0001, -0.0001, 0.0); diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tilemap_bounds_comp.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tilemap_bounds_comp.glsl index 4c24f0226a1..8fe6e740dc6 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tilemap_bounds_comp.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tilemap_bounds_comp.glsl @@ -3,10 +3,10 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ /** - * Virtual shadowmapping: Bounds computation for directional shadows. + * Virtual shadow-mapping: Bounds computation for directional shadows. * * Iterate through all shadow casters and extract min/max per directional shadow. - * This needs to happen first in the pipeline to allow tagging all relevant tilemap as dirty if + * This needs to happen first in the pipeline to allow tagging all relevant tile-map as dirty if * their range changes. */ @@ -65,7 +65,7 @@ void main() atomicMin(light_buf[l_idx].clip_near, global_min); atomicMax(light_buf[l_idx].clip_far, global_max); /* TODO(fclem): This feel unnecessary but we currently have no indexing from - * tilemap to lights. This is because the lights are selected by culling phase. */ + * tile-map to lights. This is because the lights are selected by culling phase. */ for (int i = light.tilemap_index; i <= light_tilemap_max_get(light); i++) { int index = tilemaps_buf[i].clip_data_index; atomicMin(tilemaps_clip_buf[index].clip_near, global_min); diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tilemap_finalize_comp.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tilemap_finalize_comp.glsl index b711589970f..e20c8a4cc5b 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tilemap_finalize_comp.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tilemap_finalize_comp.glsl @@ -3,9 +3,9 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ /** - * Virtual shadowmapping: Tilemap to texture conversion. + * Virtual shadow-mapping: Tile-map to texture conversion. * - * For all visible light tilemaps, copy page coordinate to a texture. + * For all visible light tile-maps, copy page coordinate to a texture. * This avoids one level of indirection when evaluating shadows and allows * to use a sampler instead of a SSBO bind. */ @@ -151,7 +151,7 @@ void main() /* Tile coordinate relative to chosen viewport origin. */ ivec2 viewport_tile_co = tile_co_lod - rect_min; /* We need to add page indirection to the render map for the whole viewport even if this one - * might extend outside of the shadowmap range. To this end, we need to wrap the threads to + * might extend outside of the shadow-map range. To this end, we need to wrap the threads to * always cover the whole mip. This is because the viewport cannot be bigger than the mip * level itself. */ int lod_res = SHADOW_TILEMAP_RES >> lod; diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tilemap_init_comp.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tilemap_init_comp.glsl index bef0931b651..a8f64b83dc1 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tilemap_init_comp.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tilemap_init_comp.glsl @@ -3,11 +3,11 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ /** - * Virtual shadowmapping: Setup phase for tilemaps. + * Virtual shadow-mapping: Setup phase for tile-maps. * * Clear the usage flag. - * Also tag for update shifted tiles for directional shadow clipmaps. - * Dispatched with one local thread per LOD0 tile and one workgroup per tilemap. + * Also tag for update shifted tiles for directional shadow clip-maps. + * Dispatched with one local thread per LOD0 tile and one work-group per tile-map. */ #pragma BLENDER_REQUIRE(gpu_shader_utildefines_lib.glsl) @@ -43,7 +43,7 @@ void main() int clip_index = tilemap.clip_data_index; if (clip_index == -1) { - /* Noop. This is the case for unused tilemaps that are getting pushed to the free heap. */ + /* Noop. This is the case for unused tile-maps that are getting pushed to the free heap. */ } else if (tilemap.projection_type != SHADOW_PROJECTION_CUBEFACE) { ShadowTileMapClip clip_data = tilemaps_clip_buf[clip_index]; @@ -60,7 +60,7 @@ void main() tilemaps_clip_buf[clip_index].clip_far = floatBitsToOrderedInt(-FLT_MAX); } else { - /* For cubefaces, simply use the light near and far distances. */ + /* For cube-faces, simply use the light near and far distances. */ tilemaps_clip_buf[clip_index].clip_near_stored = tilemap.clip_near; tilemaps_clip_buf[clip_index].clip_far_stored = tilemap.clip_far; } @@ -74,7 +74,7 @@ void main() ivec2 tile_wrapped = ivec2((ivec2(SHADOW_TILEMAP_RES) + tile_shifted) % SHADOW_TILEMAP_RES); /* If this tile was shifted in and contains old information, update it. - * Note that cubemap always shift all tiles on update. */ + * Note that cube-map always shift all tiles on update. */ bool do_update = !in_range_inclusive(tile_shifted, ivec2(0), ivec2(SHADOW_TILEMAP_RES - 1)); /* TODO(fclem): Might be better to resize the depth stored instead of a full render update. */ diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tilemap_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tilemap_lib.glsl index a562fdea244..29f689f7cf0 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tilemap_lib.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tilemap_lib.glsl @@ -6,7 +6,7 @@ #pragma BLENDER_REQUIRE(common_shape_lib.glsl) /* ---------------------------------------------------------------------- */ -/** \name Tilemap data +/** \name Tile-map data * \{ */ int shadow_tile_index(ivec2 tile) @@ -19,7 +19,7 @@ ivec2 shadow_tile_coord(int tile_index) return ivec2(tile_index % SHADOW_TILEMAP_RES, tile_index / SHADOW_TILEMAP_RES); } -/* Return bottom left pixel position of the tilemap inside the tilemap atlas. */ +/* Return bottom left pixel position of the tile-map inside the tile-map atlas. */ ivec2 shadow_tilemap_start(int tilemap_index) { return SHADOW_TILEMAP_RES * @@ -93,8 +93,8 @@ int shadow_tile_offset(ivec2 tile, int tiles_index, int lod) /** \note: Will clamp if out of bounds. */ ShadowTileData shadow_tile_load(usampler2D tilemaps_tx, ivec2 tile_co, int tilemap_index) { - /* NOTE(@fclem): This clamp can hide some small imprecision at clipmap transition. - * Can be disabled to check if the clipmap is well centered. */ + /* NOTE(@fclem): This clamp can hide some small imprecision at clip-map transition. + * Can be disabled to check if the clip-map is well centered. */ tile_co = clamp(tile_co, ivec2(0), ivec2(SHADOW_TILEMAP_RES - 1)); uint tile_data = texelFetch(tilemaps_tx, shadow_tile_coord_in_atlas(tile_co, tilemap_index), 0).x; @@ -105,7 +105,7 @@ ShadowTileData shadow_tile_load(usampler2D tilemaps_tx, ivec2 tile_co, int tilem * This function should be the inverse of ShadowDirectional::coverage_get(). * * \a lP shading point position in light space, relative to the to camera position snapped to - * the smallest clipmap level (`shadow_world_to_local(light, P) - light._position`). + * the smallest clip-map level (`shadow_world_to_local(light, P) - light._position`). */ int shadow_directional_level(LightData light, vec3 lP) { @@ -113,13 +113,13 @@ int shadow_directional_level(LightData light, vec3 lP) if (light.type == LIGHT_SUN) { /* We need to hide one tile worth of data to hide the moving transition. */ const float narrowing = float(SHADOW_TILEMAP_RES) / (float(SHADOW_TILEMAP_RES) - 1.0001); - /* Since the distance is centered around the camera (and thus by extension the tilemap), + /* Since the distance is centered around the camera (and thus by extension the tile-map), * we need to multiply by 2 to get the lod level which covers the following range: * [-coverage_get(lod)/2..coverage_get(lod)/2] */ lod = log2(length(lP) * narrowing * 2.0); } else { - /* The narrowing need to be stronger since the tilemap position is not rounded but floored. */ + /* The narrowing need to be stronger since the tile-map position is not rounded but floored. */ const float narrowing = float(SHADOW_TILEMAP_RES) / (float(SHADOW_TILEMAP_RES) - 2.5001); /* Since we want half of the size, bias the level by -1. */ float lod_min_half_size = exp2(float(light.clipmap_lod_min - 1)); @@ -130,11 +130,11 @@ int shadow_directional_level(LightData light, vec3 lP) } struct ShadowCoordinates { - /* Index of the tilemap to containing the tile. */ + /* Index of the tile-map to containing the tile. */ int tilemap_index; /* LOD of the tile to load relative to the min level. Always positive. */ int lod_relative; - /* Tile coordinate inside the tilemap. */ + /* Tile coordinate inside the tile-map. */ ivec2 tile_coord; /* UV coordinates in [0..SHADOW_TILEMAP_RES) range. */ vec2 uv; @@ -158,7 +158,7 @@ ShadowCoordinates shadow_directional_coordinates_at_level(LightData light, vec3 { ShadowCoordinates ret; /* This difference needs to be less than 32 for the later shift to be valid. - * This is ensured by ShadowDirectional::clipmap_level_range(). */ + * This is ensured by `ShadowDirectional::clipmap_level_range()`. */ int level_relative = level - light.clipmap_lod_min; ret.tilemap_index = light.tilemap_index + level_relative; @@ -173,7 +173,7 @@ ShadowCoordinates shadow_directional_coordinates_at_level(LightData light, vec3 ret.uv /= exp2(float(ret.lod_relative)); ret.uv = ret.uv * float(SHADOW_TILEMAP_RES) + float(SHADOW_TILEMAP_RES / 2); ret.uv -= vec2(clipmap_offset); - /* Clamp to avoid out of tilemap access. */ + /* Clamp to avoid out of tile-map access. */ ret.tile_coord = clamp(ivec2(ret.uv), ivec2(0.0), ivec2(SHADOW_TILEMAP_RES - 1)); return ret; } @@ -218,7 +218,7 @@ ShadowCoordinates shadow_punctual_coordinates(LightData light, vec3 lP, int face ret.uv = lP.xy / abs(lP.z); /* UVs in [0..SHADOW_TILEMAP_RES] range. */ ret.uv = ret.uv * float(SHADOW_TILEMAP_RES / 2) + float(SHADOW_TILEMAP_RES / 2); - /* Clamp to avoid out of tilemap access. */ + /* Clamp to avoid out of tile-map access. */ ret.tile_coord = clamp(ivec2(ret.uv), ivec2(0), ivec2(SHADOW_TILEMAP_RES - 1)); return ret; } diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_surf_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_surf_lib.glsl index 5d94f7d1beb..4d011e9778f 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_surf_lib.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_surf_lib.glsl @@ -131,7 +131,7 @@ void init_interface() #ifdef GPU_VERTEX_SHADER void shadow_viewport_layer_set(int view_id, int lod) { - /* We still render to a layered framebuffer in the case of Metal + Tile Based Renderer. + /* We still render to a layered frame-buffer in the case of Metal + Tile Based Renderer. * Since it needs correct depth buffering, each view needs to not overlap each others. * It doesn't matter much for other platform, so we use that as a way to pass the view id. */ gpu_Layer = view_id; diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_surf_shadow_frag.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_surf_shadow_frag.glsl index 5be1e0b2df0..a53117501c4 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_surf_shadow_frag.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_surf_shadow_frag.glsl @@ -5,7 +5,7 @@ /** * Virtual Shadow map output. * - * Meshes are rasterize onto an empty framebuffer. Each generated fragment then checks which + * Meshes are rasterize onto an empty frame-buffer. Each generated fragment then checks which * virtual page it is supposed to go and load the physical page address. * If a physical page exists, we then use atomicMin to mimic a less-than depth test and write to * the destination texel. diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_volume_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_volume_lib.glsl index 478ac0a023e..c26f85ef3ec 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_volume_lib.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_volume_lib.glsl @@ -112,7 +112,7 @@ vec3 volume_light(LightData ld, vec3 L, float l_dist) vec3 volume_participating_media_extinction(vec3 wpos, sampler3D volume_extinction) { - /* Waiting for proper volume shadowmaps and out of frustum shadow map. */ + /* Waiting for proper volume shadow-maps and out of frustum shadow map. */ vec3 ndc = project_point(ProjectionMatrix, transform_point(ViewMatrix, wpos)); vec3 volume_co = ndc_to_volume(ndc * 0.5 + 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 a9f8594a3a6..88ddfcfe2f6 100644 --- a/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl +++ b/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl @@ -34,7 +34,7 @@ void blend_mode_output( case MODE_HARDLIGHT: { /* 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). + * We need to separate the overlay equation into 2 term (one multiply 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));` * We rewrite the second branch like this: diff --git a/source/blender/draw/engines/overlay/shaders/overlay_antialiasing_frag.glsl b/source/blender/draw/engines/overlay/shaders/overlay_antialiasing_frag.glsl index fe7587670ca..954e6b114e1 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_antialiasing_frag.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_antialiasing_frag.glsl @@ -10,7 +10,7 @@ * 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 M_1_SQRTPI 0.5641895835477563 /* `1/sqrt(pi)`. */ #define DISC_RADIUS (M_1_SQRTPI * 1.05) #define LINE_SMOOTH_START (0.5 - DISC_RADIUS) diff --git a/source/blender/draw/engines/overlay/shaders/overlay_armature_sphere_outline_vert.glsl b/source/blender/draw/engines/overlay/shaders/overlay_armature_sphere_outline_vert.glsl index 3151ba29687..9d707acd3a6 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_armature_sphere_outline_vert.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_armature_sphere_outline_vert.glsl @@ -22,7 +22,7 @@ void main() bool is_persp = (drw_view.winmat[3][3] == 0.0); /* This is the local space camera ray (not normalize). - * In perspective mode it's also the viewspace position + * In perspective mode it's also the view-space position * of the sphere center. */ vec3 cam_ray = (is_persp) ? model_view_matrix[3].xyz : vec3(0.0, 0.0, -1.0); cam_ray = mat3(sphereMatrix) * cam_ray; diff --git a/source/blender/draw/engines/overlay/shaders/overlay_armature_sphere_solid_vert.glsl b/source/blender/draw/engines/overlay/shaders/overlay_armature_sphere_solid_vert.glsl index 0ab4eb2bab5..68e1f335f71 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_armature_sphere_solid_vert.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_armature_sphere_solid_vert.glsl @@ -22,7 +22,7 @@ void main() bool is_persp = (drw_view.winmat[3][3] == 0.0); /* This is the local space camera ray (not normalize). - * In perspective mode it's also the viewspace position + * In perspective mode it's also the view-space position * of the sphere center. */ vec3 cam_ray = (is_persp) ? model_view_matrix[3].xyz : vec3(0.0, 0.0, -1.0); cam_ray = mat3(sphereMatrix) * cam_ray; @@ -51,7 +51,7 @@ void main() float cos_b = cos(a); float sin_b = sqrt(clamp(1.0 - cos_b * cos_b, 0.0, 1.0)); #if 1 - /* Instead of choosing the biggest circle in screenspace, + /* Instead of choosing the biggest circle in screen-space, * we choose the nearest with the same angular size. This * permit us to leverage GL_ARB_conservative_depth in the * fragment shader. */ diff --git a/source/blender/draw/engines/overlay/shaders/overlay_edit_mesh_frag.glsl b/source/blender/draw/engines/overlay/shaders/overlay_edit_mesh_frag.glsl index 2683218e1e1..a0056c09c00 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_edit_mesh_frag.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_edit_mesh_frag.glsl @@ -10,7 +10,7 @@ * 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 M_1_SQRTPI 0.5641895835477563 /* `1/sqrt(pi)`. */ #define DISC_RADIUS (M_1_SQRTPI * 1.05) #define GRID_LINE_SMOOTH_START (0.5 - DISC_RADIUS) diff --git a/source/blender/draw/engines/overlay/shaders/overlay_edit_mesh_geom.glsl b/source/blender/draw/engines/overlay/shaders/overlay_edit_mesh_geom.glsl index 1d7fb6093fd..c8bf2dc29ff 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_edit_mesh_geom.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_edit_mesh_geom.glsl @@ -55,7 +55,7 @@ void main() half_size += (geometry_flat_out.finalColorOuter.a > 0.0) ? max(sizeEdge, 1.0) : 0.0; if (do_smooth_wire) { - /* Add 1 px for AA */ + /* Add 1px for AA */ half_size += 0.5; } 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 117b662a568..2200a22209a 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 @@ -189,7 +189,7 @@ void main() half_size += (geometry_flat_out.finalColorOuter.a > 0.0) ? max(sizeEdge, 1.0) : 0.0; if (do_smooth_wire) { - /* Add 1 px for AA */ + /* Add 1px for AA */ half_size += 0.5; } diff --git a/source/blender/draw/engines/overlay/shaders/overlay_edit_uv_edges_vert_no_geom.glsl b/source/blender/draw/engines/overlay/shaders/overlay_edit_uv_edges_vert_no_geom.glsl index be23d410f82..cfd92633fe4 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_edit_uv_edges_vert_no_geom.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_edit_uv_edges_vert_no_geom.glsl @@ -98,7 +98,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 1px for AA */ if (doSmoothWire) { half_size += 0.5; } diff --git a/source/blender/draw/engines/overlay/shaders/overlay_grid_frag.glsl b/source/blender/draw/engines/overlay/shaders/overlay_grid_frag.glsl index 81a9f839154..92f07368fd4 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_grid_frag.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_grid_frag.glsl @@ -20,7 +20,7 @@ * For an alternate approach, see: * https://developer.nvidia.com/gpugems/gpugems2/part-iii-high-quality-rendering/chapter-22-fast-prefiltered-lines */ -#define M_1_SQRTPI 0.5641895835477563 /* 1/sqrt(pi) */ +#define M_1_SQRTPI 0.5641895835477563 /* `1/sqrt(pi)`. */ #define DISC_RADIUS (M_1_SQRTPI * 1.05) #define GRID_LINE_SMOOTH_START (0.5 + DISC_RADIUS) #define GRID_LINE_SMOOTH_END (0.5 - DISC_RADIUS) diff --git a/source/blender/draw/engines/overlay/shaders/overlay_outline_detect_frag.glsl b/source/blender/draw/engines/overlay/shaders/overlay_outline_detect_frag.glsl index 35841b312d1..e54e55bb9fc 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_outline_detect_frag.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_outline_detect_frag.glsl @@ -93,7 +93,7 @@ bool line_offset(bvec2 edges, vec2 ofs, inout vec2 line_point) return false; } -/* Changes Antialiasing pattern and makes line thicker. 0.0 is thin. */ +/* Changes Anti-aliasing pattern and makes line thicker. 0.0 is thin. */ #define PROXIMITY_OFS -0.35 /* Use surrounding edges to approximate the outline direction to create smooth lines. */ @@ -225,7 +225,7 @@ void main() has_edge_neg_x = has_edge_neg_y = false; } - /* WATCH: Keep in sync with outlineId of the prepass. */ + /* WATCH: Keep in sync with outlineId of the pre-pass. */ uint color_id = ref_col >> 14u; if (ref_col == 0u) { fragColor = vec4(0.0); @@ -247,7 +247,7 @@ void main() const float epsilon = 3.0 / 8388608.0; bool occluded = (ref_depth > scene_depth + epsilon); - /* NOTE: We never set alpha to 1.0 to avoid Antialiasing destroying the line. */ + /* NOTE: We never set alpha to 1.0 to avoid Anti-aliasing destroying the line. */ fragColor *= (occluded ? alphaOcclu : 1.0) * (254.0 / 255.0); int edge_case = 0; diff --git a/source/blender/draw/engines/overlay/shaders/overlay_outline_prepass_curves_vert.glsl b/source/blender/draw/engines/overlay/shaders/overlay_outline_prepass_curves_vert.glsl index 9d0ddc19816..fdc69e35706 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_outline_prepass_curves_vert.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_outline_prepass_curves_vert.glsl @@ -47,7 +47,7 @@ void main() thickness); vec3 world_pos; if (hairThicknessRes > 1) { - /* Calculate the thickness, thicktime, worldpos taken into account the outline. */ + /* Calculate the thickness, thick-time, worldpos taken into account the outline. */ float outline_width = point_world_to_ndc(center_wpos).w * 1.25 * sizeViewportInv.y * drw_view.wininv[1][1]; thickness += outline_width; diff --git a/source/blender/draw/engines/overlay/shaders/overlay_particle_vert.glsl b/source/blender/draw/engines/overlay/shaders/overlay_particle_vert.glsl index 0e574086b18..224dcf05853 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_particle_vert.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_particle_vert.glsl @@ -18,7 +18,7 @@ vec3 rotate(vec3 vec, vec4 quat) void main() { - /* Drawsize packed in alpha. */ + /* Draw-size packed in alpha. */ float draw_size = ucolor.a; vec3 world_pos = part_pos; diff --git a/source/blender/draw/engines/overlay/shaders/overlay_point_varying_color_frag.glsl b/source/blender/draw/engines/overlay/shaders/overlay_point_varying_color_frag.glsl index 54d3dbd321d..ae19372389d 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_point_varying_color_frag.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_point_varying_color_frag.glsl @@ -8,7 +8,7 @@ void main() float dist_squared = dot(centered, centered); const float rad_squared = 0.25; - /* Round point with jaggy edges. */ + /* Round point with jagged edges. */ if (dist_squared > rad_squared) { discard; return; diff --git a/source/blender/draw/engines/workbench/shaders/workbench_common_lib.glsl b/source/blender/draw/engines/workbench/shaders/workbench_common_lib.glsl index d9571a22221..f1a59543404 100644 --- a/source/blender/draw/engines/workbench/shaders/workbench_common_lib.glsl +++ b/source/blender/draw/engines/workbench/shaders/workbench_common_lib.glsl @@ -7,7 +7,7 @@ #define CAVITY_BUFFER_RANGE 4.0 /* From http://aras-p.info/texts/CompactNormalStorage.html - * Using Method #4: Spheremap Transform */ + * Using Method #4: Sphere-map Transform */ vec3 workbench_normal_decode(vec4 enc) { vec2 fenc = enc.xy * 4.0 - 2.0; @@ -20,7 +20,7 @@ vec3 workbench_normal_decode(vec4 enc) } /* From http://aras-p.info/texts/CompactNormalStorage.html - * Using Method #4: Spheremap Transform */ + * Using Method #4: Sphere-map Transform */ vec2 workbench_normal_encode(bool front_face, vec3 n) { n = normalize(front_face ? n : -n); diff --git a/source/blender/draw/engines/workbench/shaders/workbench_composite_frag.glsl b/source/blender/draw/engines/workbench/shaders/workbench_composite_frag.glsl index eb83b414cc2..90ece6c6362 100644 --- a/source/blender/draw/engines/workbench/shaders/workbench_composite_frag.glsl +++ b/source/blender/draw/engines/workbench/shaders/workbench_composite_frag.glsl @@ -9,7 +9,7 @@ void main() { - /* Normal and Incident vector are in viewspace. Lighting is evaluated in viewspace. */ + /* Normal and Incident vector are in view-space. Lighting is evaluated in view-space. */ vec3 I = get_view_vector_from_screen_uv(uvcoordsvar.st); vec3 N = workbench_normal_decode(texture(normalBuffer, uvcoordsvar.st)); vec4 mat_data = texture(materialBuffer, uvcoordsvar.st); 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 ece08afa2a0..ae7c3bc3ce8 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 @@ -340,7 +340,7 @@ void main() void main() { - /* Fullscreen pass */ + /* Full-screen pass. */ vec2 pixel_size = 0.5 / vec2(textureSize(halfResColorTex, 0).xy); vec2 uv = gl_FragCoord.xy * pixel_size; diff --git a/source/blender/draw/engines/workbench/shaders/workbench_effect_smaa_frag.glsl b/source/blender/draw/engines/workbench/shaders/workbench_effect_smaa_frag.glsl index 2878e1376d4..acd571485cc 100644 --- a/source/blender/draw/engines/workbench/shaders/workbench_effect_smaa_frag.glsl +++ b/source/blender/draw/engines/workbench/shaders/workbench_effect_smaa_frag.glsl @@ -28,7 +28,7 @@ void main() out_color += texture(colorTex, uvs) * (1.0 - mixFactor); } out_color /= taaAccumulatedWeight; - /* Exit log2 space used for Antialiasing. */ + /* Exit log2 space used for Anti-aliasing. */ out_color = exp2(out_color) - 0.5; /* Avoid float precision issue. */ diff --git a/source/blender/draw/engines/workbench/shaders/workbench_next_composite_frag.glsl b/source/blender/draw/engines/workbench/shaders/workbench_next_composite_frag.glsl index 5cd50b77944..4c555252503 100644 --- a/source/blender/draw/engines/workbench/shaders/workbench_next_composite_frag.glsl +++ b/source/blender/draw/engines/workbench/shaders/workbench_next_composite_frag.glsl @@ -12,7 +12,7 @@ void main() { vec2 uv = uvcoordsvar.st; - /* Normal and Incident vector are in viewspace. Lighting is evaluated in viewspace. */ + /* Normal and Incident vector are in view-space. Lighting is evaluated in view-space. */ vec3 V = get_view_vector_from_screen_uv(uv); vec3 N = workbench_normal_decode(texture(normal_tx, uv)); vec4 mat_data = texture(material_tx, uv); diff --git a/source/blender/draw/engines/workbench/shaders/workbench_transparent_accum_frag.glsl b/source/blender/draw/engines/workbench/shaders/workbench_transparent_accum_frag.glsl index 90404a2d60f..a5491896081 100644 --- a/source/blender/draw/engines/workbench/shaders/workbench_transparent_accum_frag.glsl +++ b/source/blender/draw/engines/workbench/shaders/workbench_transparent_accum_frag.glsl @@ -52,7 +52,7 @@ float calculate_transparent_weight(void) void main() { - /* Normal and Incident vector are in viewspace. Lighting is evaluated in viewspace. */ + /* Normal and Incident vector are in view-space. Lighting is evaluated in view-space. */ vec2 uv_viewport = gl_FragCoord.xy * world_data.viewport_size_inv; vec3 I = get_view_vector_from_screen_uv(uv_viewport); vec3 N = normalize(normal_interp); @@ -90,7 +90,7 @@ void main() void main() { - /* Normal and Incident vector are in viewspace. Lighting is evaluated in viewspace. */ + /* Normal and Incident vector are in view-space. Lighting is evaluated in view-space. */ vec2 uv_viewport = gl_FragCoord.xy * world_data.viewport_size_inv; vec3 I = get_view_vector_from_screen_uv(uv_viewport); vec3 N = normalize(normal_interp); diff --git a/source/blender/draw/intern/shaders/common_fxaa_lib.glsl b/source/blender/draw/intern/shaders/common_fxaa_lib.glsl index 607261949cb..084efbb7100 100644 --- a/source/blender/draw/intern/shaders/common_fxaa_lib.glsl +++ b/source/blender/draw/intern/shaders/common_fxaa_lib.glsl @@ -274,7 +274,7 @@ NOTE: the other tuning knobs are now in the shader function inputs! /* (#B1#) */ float FxaaLuma(vec4 rgba) { - /* NOTE: sqrt because the sampled colors are in a linear colorspace! + /* NOTE: sqrt because the sampled colors are in a linear color-space! * this approximates a perceptual conversion, which is good enough for the * algorithm */ return sqrt(dot(rgba.rgb, vec3(0.2126, 0.7152, 0.0722))); diff --git a/source/blender/draw/intern/shaders/common_gpencil_lib.glsl b/source/blender/draw/intern/shaders/common_gpencil_lib.glsl index 1b3381c33f0..795f83e99fd 100644 --- a/source/blender/draw/intern/shaders/common_gpencil_lib.glsl +++ b/source/blender/draw/intern/shaders/common_gpencil_lib.glsl @@ -70,7 +70,7 @@ float gpencil_stroke_thickness_modulate(float thickness, vec4 ndc_pos, vec4 view thickness = max(1.0, thickness * gpThicknessScale + gpThicknessOffset); if (gpThicknessIsScreenSpace) { - /* Multiply offset by view Z so that offset is constant in screenspace. + /* Multiply offset by view Z so that offset is constant in screen-space. * (e.i: does not change with the distance to camera) */ thickness *= ndc_pos.w; } @@ -234,7 +234,7 @@ vec4 gpencil_vertex(vec4 viewport_size, vec2 ss_adj = gpencil_project_to_screenspace(ndc_adj, viewport_size); vec2 ss1 = gpencil_project_to_screenspace(ndc1, viewport_size); vec2 ss2 = gpencil_project_to_screenspace(ndc2, viewport_size); - /* Screenspace Lines tangents. */ + /* Screen-space Lines tangents. */ float line_len; vec2 line = safe_normalize_len(ss2 - ss1, line_len); vec2 line_adj = safe_normalize((use_curr) ? (ss1 - ss_adj) : (ss_adj - ss2)); diff --git a/source/blender/draw/intern/shaders/common_grease_pencil_lib.glsl b/source/blender/draw/intern/shaders/common_grease_pencil_lib.glsl index eac81d03a41..ab7cf94bffa 100644 --- a/source/blender/draw/intern/shaders/common_grease_pencil_lib.glsl +++ b/source/blender/draw/intern/shaders/common_grease_pencil_lib.glsl @@ -70,7 +70,7 @@ float gpencil_stroke_thickness_modulate(float thickness, vec4 ndc_pos, vec4 view thickness = max(1.0, thickness * gpThicknessScale + gpThicknessOffset); if (gpThicknessIsScreenSpace) { - /* Multiply offset by view Z so that offset is constant in screenspace. + /* Multiply offset by view Z so that offset is constant in screen-space. * (e.i: does not change with the distance to camera) */ thickness *= ndc_pos.w; } @@ -241,7 +241,7 @@ vec4 gpencil_vertex(vec4 viewport_size, vec2 ss_adj = gpencil_project_to_screenspace(ndc_adj, viewport_size); vec2 ss1 = gpencil_project_to_screenspace(ndc1, viewport_size); vec2 ss2 = gpencil_project_to_screenspace(ndc2, viewport_size); - /* Screenspace Lines tangents. */ + /* Screen-space Lines tangents. */ float line_len; vec2 line = safe_normalize_len(ss2 - ss1, line_len); vec2 line_adj = safe_normalize((use_curr) ? (ss1 - ss_adj) : (ss_adj - ss2)); diff --git a/source/blender/draw/intern/shaders/common_hair_lib.glsl b/source/blender/draw/intern/shaders/common_hair_lib.glsl index 0fd32781150..672b567f57b 100644 --- a/source/blender/draw/intern/shaders/common_hair_lib.glsl +++ b/source/blender/draw/intern/shaders/common_hair_lib.glsl @@ -27,9 +27,9 @@ uniform int hairStrandsRes = 8; /** - * hairThicknessRes : Subdiv around the hair. + * hairThicknessRes : Subdivide around the hair. * 1 - Wire Hair: Only one pixel thick, independent of view distance. - * 2 - Polystrip Hair: Correct width, flat if camera is parallel. + * 2 - Poly-strip Hair: Correct width, flat if camera is parallel. * 3+ - Cylinder Hair: Massive calculation but potentially perfect. Still need proper support. */ uniform int hairThicknessRes = 1; diff --git a/source/blender/draw/intern/shaders/common_math_geom_lib.glsl b/source/blender/draw/intern/shaders/common_math_geom_lib.glsl index 12e354c23a8..357fe9e0489 100644 --- a/source/blender/draw/intern/shaders/common_math_geom_lib.glsl +++ b/source/blender/draw/intern/shaders/common_math_geom_lib.glsl @@ -174,7 +174,7 @@ void make_orthonormal_basis(vec3 N, out vec3 T, out vec3 B) /* ---- Encode / Decode Normal buffer data ---- */ /* From http://aras-p.info/texts/CompactNormalStorage.html - * Using Method #4: Spheremap Transform */ + * Using Method #4: Sphere-map Transform */ vec2 normal_encode(vec3 n, vec3 view) { float p = sqrt(n.z * 8.0 + 8.0); diff --git a/source/blender/draw/intern/shaders/common_subdiv_lib.glsl b/source/blender/draw/intern/shaders/common_subdiv_lib.glsl index 0878797cb6b..f78ebc48d20 100644 --- a/source/blender/draw/intern/shaders/common_subdiv_lib.glsl +++ b/source/blender/draw/intern/shaders/common_subdiv_lib.glsl @@ -78,20 +78,20 @@ struct PatchCoord { }; /* This structure is a carbon copy of OpenSubDiv's PatchCoord.QuadNode. - * Each child is a bitfield. */ + * Each child is a bit-field. */ struct QuadNode { uvec4 child; }; bool is_set(uint i) { - /* QuadNode.Child.isSet is the first bit of the bitfield. */ + /* QuadNode.Child.isSet is the first bit of the bit-field. */ return (i & 0x1u) != 0; } bool is_leaf(uint i) { - /* QuadNode.Child.isLeaf is the second bit of the bitfield. */ + /* QuadNode.Child.isLeaf is the second bit of the bit-field. */ return (i & 0x2u) != 0; } diff --git a/source/blender/draw/intern/shaders/common_view_lib.glsl b/source/blender/draw/intern/shaders/common_view_lib.glsl index fafa939b9e7..464e42fb46a 100644 --- a/source/blender/draw/intern/shaders/common_view_lib.glsl +++ b/source/blender/draw/intern/shaders/common_view_lib.glsl @@ -208,7 +208,7 @@ uniform mat4 ModelMatrixInverse; #endif /** Transform shortcuts. */ -/* Rule of thumb: Try to reuse world positions and normals because converting through viewspace +/* Rule of thumb: Try to reuse world positions and normals because converting through view-space * will always be decomposed in at least 2 matrix operation. */ /** @@ -260,13 +260,13 @@ vec3 point_world_to_view(vec3 p) return (ViewMatrix * vec4(p, 1.0)).xyz; } -/* Viewspace Z is used to adjust for perspective projection. +/* View-space Z is used to adjust for perspective projection. * Homogenous W is used to convert from NDC to homogenous space. - * Offset is in viewspace, so positive values are closer to the camera. */ + * Offset is in view-space, so positive values are closer to the camera. */ float get_homogenous_z_offset(float vs_z, float hs_w, float vs_offset) { if (vs_offset == 0.0) { - /* Don't calculate homogenous offset if viewspace offset is zero. */ + /* Don't calculate homogenous offset if view-space offset is zero. */ return 0.0; } else if (ProjectionMatrix[3][3] == 0.0) { diff --git a/source/blender/editors/interface/view2d.cc b/source/blender/editors/interface/view2d.cc index 36e7a671610..5c92b248eef 100644 --- a/source/blender/editors/interface/view2d.cc +++ b/source/blender/editors/interface/view2d.cc @@ -1357,7 +1357,7 @@ void UI_view2d_dot_grid_draw(const View2D *v2d, int count_x; float start_x; - /* Count points that fit in viewport minus space for the scrollbars. */ + /* Count points that fit in viewport minus space for the scroll-bars. */ grid_axis_start_and_count( step, v2d->cur.xmin, v2d->cur.xmax - V2D_SCROLL_WIDTH, &start_x, &count_x); int count_y; diff --git a/source/blender/editors/scene/scene_fps.cc b/source/blender/editors/scene/scene_fps.cc index eb9c7fce0fa..bba3fe1c501 100644 --- a/source/blender/editors/scene/scene_fps.cc +++ b/source/blender/editors/scene/scene_fps.cc @@ -5,7 +5,7 @@ /** \file * \ingroup edscene * - * Define `ED_scene_api_*` functions. + * Define `ED_scene_fps_*` functions. */ #include diff --git a/source/blender/gpu/metal/kernels/gpu_shader_fullscreen_blit_vert.glsl b/source/blender/gpu/metal/kernels/gpu_shader_fullscreen_blit_vert.glsl index f8d97ee00f9..11c9a0cc8d1 100644 --- a/source/blender/gpu/metal/kernels/gpu_shader_fullscreen_blit_vert.glsl +++ b/source/blender/gpu/metal/kernels/gpu_shader_fullscreen_blit_vert.glsl @@ -5,8 +5,8 @@ void main() { /* The position represents a 0-1 square, we first scale it by the size we want to have it on - * screen next we divide by the fullscreen size, this will bring everything in range [0,1]. Next - * we scale to NDC range [-1,1]. */ + * screen next we divide by the full-screen size, this will bring everything in range [0,1]. + * Next we scale to NDC range [-1,1]. */ gl_Position = vec4((((pos * size + dst_offset) / fullscreen) * 2.0 - 1.0), 1.0, 1.0); vec2 uvoff = (src_offset / fullscreen); uvcoordsvar = vec4(pos + uvoff, 0.0, 0.0); diff --git a/source/blender/gpu/shaders/common/gpu_shader_test_lib.glsl b/source/blender/gpu/shaders/common/gpu_shader_test_lib.glsl index a8d328c03f0..6942246593a 100644 --- a/source/blender/gpu/shaders/common/gpu_shader_test_lib.glsl +++ b/source/blender/gpu/shaders/common/gpu_shader_test_lib.glsl @@ -146,7 +146,7 @@ TestOutputRawData as_raw_data(mat4x4 v) { WRITE_MATRIX(v); } int g_test_id = 0; #ifdef GPU_METAL -/* Vector comparison in MSL return a bvec. Collapse it like in GLSL. */ +/* Vector comparison in MSL return a `bvec`. Collapse it like in GLSL. */ # define COLLAPSE_BOOL(OP) bool(all(OP)) #else # define COLLAPSE_BOOL(OP) (OP) diff --git a/source/blender/gpu/shaders/gpu_shader_2D_nodelink_frag.glsl b/source/blender/gpu/shaders/gpu_shader_2D_nodelink_frag.glsl index b75722e6b92..860386d366b 100644 --- a/source/blender/gpu/shaders/gpu_shader_2D_nodelink_frag.glsl +++ b/source/blender/gpu/shaders/gpu_shader_2D_nodelink_frag.glsl @@ -14,7 +14,7 @@ void main() float normalized_distance = fract(distance_along_line / dashLength); /* Checking if `normalized_distance <= dashFactor` is already enough for a basic - * dash, however we want to handle a nice antialias. */ + * dash, however we want to handle a nice anti-alias. */ float dash_center = dashLength * dashFactor * 0.5; float normalized_distance_triangle = diff --git a/source/blender/gpu/shaders/gpu_shader_2D_nodelink_vert.glsl b/source/blender/gpu/shaders/gpu_shader_2D_nodelink_vert.glsl index 0803f20e61f..cc7e3a49cfb 100644 --- a/source/blender/gpu/shaders/gpu_shader_2D_nodelink_vert.glsl +++ b/source/blender/gpu/shaders/gpu_shader_2D_nodelink_vert.glsl @@ -115,7 +115,7 @@ void main(void) gl_Position.xy += exp_axis * node_link_data.aspect * expand_dist; /* If the link is not muted or is not a reroute arrow the points are squashed to the center of - * the line. Magic numbers are defined in drawnode.c */ + * the line. Magic numbers are defined in `drawnode.cc`. */ if ((expand.x == 1.0 && !doMuted) || (expand.y != 1.0 && (pos.x < 0.70 || pos.x > 0.71) && !doArrow)) { 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 85aec46bd2b..a22562d45e7 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 @@ -143,10 +143,11 @@ vec2 do_tria() } else if (triaType == 5.0) { /* ROUNDBOX_TRIA_HOLD_ACTION_ARROW */ - /* We use a single triangle to cut the round rect in half. The edge will not be Antialiased. */ + /* We use a single triangle to cut the round rect in half. + * The edge will not be Anti-aliased. */ pos = tria2 ? vec2(0.0) : arrow_pos[min(vidx, 2)]; /* Only keep 1 triangle. */ pos = pos.x * vec2(0.707, 0.707) + pos.y * vec2(-0.707, 0.707); /* Rotate (45deg) */ - pos += vec2(-1.7, 2.4); /* Translate (hardcoded, might want to remove) */ + pos += vec2(-1.7, 2.4); /* Translate (hard-coded, might want to remove). */ size *= 0.4; /* Scale */ uvInterp = arrow_uvs[vidx]; uvInterp -= vec2(0.05, 0.05); /* Translate */ diff --git a/source/blender/gpu/shaders/material/gpu_shader_material_tex_image.glsl b/source/blender/gpu/shaders/material/gpu_shader_material_tex_image.glsl index de195d83d80..73524864409 100644 --- a/source/blender/gpu/shaders/material/gpu_shader_material_tex_image.glsl +++ b/source/blender/gpu/shaders/material/gpu_shader_material_tex_image.glsl @@ -125,7 +125,7 @@ void tex_box_blend( * in between we blend between two textures, and in the middle we a blend * between three textures. * - * the Nxyz values are the barycentric coordinates in an equilateral + * the `Nxyz` values are the barycentric coordinates in an equilateral * triangle, which in case of blending, in the middle has a smaller * equilateral triangle where 3 textures blend. this divides things into * 7 zones, with an if () test for each zone diff --git a/source/blender/gpu/shaders/material/gpu_shader_material_tex_musgrave.glsl b/source/blender/gpu/shaders/material/gpu_shader_material_tex_musgrave.glsl index d34cd4fd117..dd8c4a3a833 100644 --- a/source/blender/gpu/shaders/material/gpu_shader_material_tex_musgrave.glsl +++ b/source/blender/gpu/shaders/material/gpu_shader_material_tex_musgrave.glsl @@ -47,7 +47,7 @@ void node_tex_musgrave_fBm_1d(vec3 co, fac = value; } -/* 1D Musgrave Multifractal +/* 1D Musgrave Multi-fractal * * H: highest fractal dimension * lacunarity: gap between successive frequencies @@ -133,7 +133,7 @@ void node_tex_musgrave_hetero_terrain_1d(vec3 co, fac = value; } -/* 1D Hybrid Additive/Multiplicative Multifractal Terrain +/* 1D Hybrid Additive/Multiplicative Multi-fractal Terrain * * H: fractal dimension of the roughest area * lacunarity: gap between successive frequencies @@ -186,7 +186,7 @@ void node_tex_musgrave_hybrid_multi_fractal_1d(vec3 co, fac = value; } -/* 1D Ridged Multifractal Terrain +/* 1D Ridged Multi-fractal Terrain * * H: fractal dimension of the roughest area * lacunarity: gap between successive frequencies @@ -272,7 +272,7 @@ void node_tex_musgrave_fBm_2d(vec3 co, fac = value; } -/* 2D Musgrave Multifractal +/* 2D Musgrave Multi-fractal * * H: highest fractal dimension * lacunarity: gap between successive frequencies @@ -358,7 +358,7 @@ void node_tex_musgrave_hetero_terrain_2d(vec3 co, fac = value; } -/* 2D Hybrid Additive/Multiplicative Multifractal Terrain +/* 2D Hybrid Additive/Multiplicative Multi-fractal Terrain * * H: fractal dimension of the roughest area * lacunarity: gap between successive frequencies @@ -411,7 +411,7 @@ void node_tex_musgrave_hybrid_multi_fractal_2d(vec3 co, fac = value; } -/* 2D Ridged Multifractal Terrain +/* 2D Ridged Multi-fractal Terrain * * H: fractal dimension of the roughest area * lacunarity: gap between successive frequencies @@ -497,7 +497,7 @@ void node_tex_musgrave_fBm_3d(vec3 co, fac = value; } -/* 3D Musgrave Multifractal +/* 3D Musgrave Multi-fractal * * H: highest fractal dimension * lacunarity: gap between successive frequencies @@ -583,7 +583,7 @@ void node_tex_musgrave_hetero_terrain_3d(vec3 co, fac = value; } -/* 3D Hybrid Additive/Multiplicative Multifractal Terrain +/* 3D Hybrid Additive/Multiplicative Multi-fractal Terrain * * H: fractal dimension of the roughest area * lacunarity: gap between successive frequencies @@ -636,7 +636,7 @@ void node_tex_musgrave_hybrid_multi_fractal_3d(vec3 co, fac = value; } -/* 3D Ridged Multifractal Terrain +/* 3D Ridged Multi-fractal Terrain * * H: fractal dimension of the roughest area * lacunarity: gap between successive frequencies @@ -722,7 +722,7 @@ void node_tex_musgrave_fBm_4d(vec3 co, fac = value; } -/* 4D Musgrave Multifractal +/* 4D Musgrave Multi-fractal * * H: highest fractal dimension * lacunarity: gap between successive frequencies @@ -808,7 +808,7 @@ void node_tex_musgrave_hetero_terrain_4d(vec3 co, fac = value; } -/* 4D Hybrid Additive/Multiplicative Multifractal Terrain +/* 4D Hybrid Additive/Multiplicative Multi-fractal Terrain * * H: fractal dimension of the roughest area * lacunarity: gap between successive frequencies @@ -861,7 +861,7 @@ void node_tex_musgrave_hybrid_multi_fractal_4d(vec3 co, fac = value; } -/* 4D Ridged Multifractal Terrain +/* 4D Ridged Multi-fractal Terrain * * H: fractal dimension of the roughest area * lacunarity: gap between successive frequencies diff --git a/source/blender/gpu/shaders/metal/mtl_shader_defines.msl b/source/blender/gpu/shaders/metal/mtl_shader_defines.msl index b9f43323247..22f7e73e7e5 100644 --- a/source/blender/gpu/shaders/metal/mtl_shader_defines.msl +++ b/source/blender/gpu/shaders/metal/mtl_shader_defines.msl @@ -315,7 +315,7 @@ struct SStruct { /* Texture-write functions. */ #define imageStore(_tex, _coord, _value) _texture_write_internal(_tex, _coord, _value) -/* Cubemap support always available when using Metal. */ +/* Cube-map support always available when using Metal. */ #define textureLod_cubemapArray(tex, co, lod) textureLod(tex, co, lod) /* Singular return values from texture functions of type DEPTH are often indexed with either .r or @@ -1032,6 +1032,7 @@ inline float2x2 operator-(float2x2 a) * normalized to a float. * The implementation should query the attribute type using vertex_fetch_get_attr_type(attr_name): * + * \code{.cc} * float fweight = 0.0; * if(vertex_fetch_get_attr_type(in_weight) == GPU_SHADER_ATTR_TYPE_INT) { * int iweight = vertex_fetch_attribute(gl_VertexID, in_weight, int); @@ -1039,6 +1040,7 @@ inline float2x2 operator-(float2x2 a) * } else { * fweight = = vertex_fetch_attribute(gl_VertexID, in_weight, float); * } + * \endcode * * Note: These uniforms are generated as part of the same data block used for regular uniforms * and attribute data is written prior to each draw call, depending on the configuration of diff --git a/source/blender/gpu/shaders/opengl/glsl_shader_defines.glsl b/source/blender/gpu/shaders/opengl/glsl_shader_defines.glsl index cc1df99070c..c4e0ba03c57 100644 --- a/source/blender/gpu/shaders/opengl/glsl_shader_defines.glsl +++ b/source/blender/gpu/shaders/opengl/glsl_shader_defines.glsl @@ -2,7 +2,7 @@ * * SPDX-License-Identifier: GPL-2.0-or-later */ -/* Cubemap support and fallback implementation declarations. */ +/* Cube-map support and fallback implementation declarations. */ #ifdef GPU_ARB_texture_cube_map_array # define textureLod_cubemapArray(tex, co, lod) textureLod(tex, co, lod) #else diff --git a/source/blender/gpu/tests/shaders/gpu_framebuffer_layer_viewport_test.glsl b/source/blender/gpu/tests/shaders/gpu_framebuffer_layer_viewport_test.glsl index a218c2e53e4..2bcb9626bc3 100644 --- a/source/blender/gpu/tests/shaders/gpu_framebuffer_layer_viewport_test.glsl +++ b/source/blender/gpu/tests/shaders/gpu_framebuffer_layer_viewport_test.glsl @@ -5,7 +5,7 @@ #ifdef GPU_VERTEX_SHADER void main() { - /* Fullscreen triangle. */ + /* Full-screen triangle. */ int v = gl_VertexID % 3; float x = -1.0 + float((v & 1) << 2); float y = -1.0 + float((v & 2) << 1);