diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-06-26 14:35:18 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-06-26 14:50:48 +0300 |
commit | f1e49038543cf75766f4a220f62cdc6cdbc0e27d (patch) | |
tree | 0cec2c64739a6a4ca246fe26bed6fe629ea315cb /source/blender/draw/engines | |
parent | fae5a907d4d1380f087f1226ebbd65d9d0718cc6 (diff) |
Cleanup: full sentences in comments, improve comment formatting
Diffstat (limited to 'source/blender/draw/engines')
13 files changed, 24 insertions, 23 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_depth_of_field.c b/source/blender/draw/engines/eevee/eevee_depth_of_field.c index 77e7291b78d..4748323d6a7 100644 --- a/source/blender/draw/engines/eevee/eevee_depth_of_field.c +++ b/source/blender/draw/engines/eevee/eevee_depth_of_field.c @@ -626,7 +626,7 @@ static void dof_reduce_pass_init(EEVEE_FramebufferList *fbl, if (txl->dof_reduced_color) { /* TODO(fclem) In the future, we need to check if mip_count did not change. - * For now it's ok as we always define all mip level.*/ + * For now it's ok as we always define all mip level. */ if (res[0] != GPU_texture_width(txl->dof_reduced_color) || res[1] != GPU_texture_width(txl->dof_reduced_color)) { DRW_TEXTURE_FREE_SAFE(txl->dof_reduced_color); diff --git a/source/blender/draw/engines/eevee/eevee_lightcache.c b/source/blender/draw/engines/eevee/eevee_lightcache.c index 485ed9273a8..cdd66759308 100644 --- a/source/blender/draw/engines/eevee/eevee_lightcache.c +++ b/source/blender/draw/engines/eevee/eevee_lightcache.c @@ -1480,7 +1480,7 @@ void EEVEE_lightbake_job(void *custom_data, short *stop, short *do_update, float eevee_lightbake_delete_resources(lbake); - /* Free GPU smoke textures and the smoke domain list correctly: See also T73921.*/ + /* Free GPU smoke textures and the smoke domain list correctly: See also T73921. */ EEVEE_volumes_free_smoke_textures(); } diff --git a/source/blender/draw/engines/eevee/eevee_subsurface.c b/source/blender/draw/engines/eevee/eevee_subsurface.c index 7fd39007263..129822ed8a9 100644 --- a/source/blender/draw/engines/eevee/eevee_subsurface.c +++ b/source/blender/draw/engines/eevee/eevee_subsurface.c @@ -315,7 +315,7 @@ void EEVEE_subsurface_compute(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) if (!DRW_pass_is_empty(psl->sss_translucency_ps)) { /* We sample the shadow-maps using normal sampler. We need to disable Comparison mode. - * TODO(fclem): avoid this by using sampler objects.*/ + * TODO(fclem): avoid this by using sampler objects. */ GPU_texture_compare_mode(sldata->shadow_cube_pool, false); GPU_texture_compare_mode(sldata->shadow_cascade_pool, false); diff --git a/source/blender/draw/engines/eevee/eevee_volumes.c b/source/blender/draw/engines/eevee/eevee_volumes.c index eed36221fcb..56c5b367f7e 100644 --- a/source/blender/draw/engines/eevee/eevee_volumes.c +++ b/source/blender/draw/engines/eevee/eevee_volumes.c @@ -709,7 +709,7 @@ void EEVEE_volumes_compute(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) DRW_stats_group_start("Volumetrics"); /* We sample the shadow-maps using shadow sampler. We need to enable Comparison mode. - * TODO(fclem): avoid this by using sampler objects.*/ + * TODO(fclem): avoid this by using sampler objects. */ GPU_texture_compare_mode(sldata->shadow_cube_pool, true); GPU_texture_compare_mode(sldata->shadow_cascade_pool, true); 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 05496ad4ab0..4ee21cf8c2e 100644 --- a/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl @@ -201,6 +201,6 @@ float cone_cosine(float r) // return cos(2.0 * sqrt(2.0 / (gloss + 2))); /* Uludag 2014 in GPUPro5 */ // return pow(0.244, 1 / (gloss + 1)); - /* Jimenez 2016 in Practical Realtime Strategies for Accurate Indirect Occlusion*/ + /* Jimenez 2016 in Practical Realtime Strategies for Accurate Indirect Occlusion. */ return exp2(-3.32193 * r * r); } diff --git a/source/blender/draw/engines/eevee/shaders/closure_type_lib.glsl b/source/blender/draw/engines/eevee/shaders/closure_type_lib.glsl index 38ae3972aa7..f66f45635f4 100644 --- a/source/blender/draw/engines/eevee/shaders/closure_type_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/closure_type_lib.glsl @@ -99,7 +99,7 @@ Closure closure_mix(Closure cl1, Closure cl2, float fac) cl.flag = cl1.flag | cl2.flag; cl.ssr_data = mix(cl1.ssr_data, cl2.ssr_data, fac); bool use_cl1_ssr = FLAG_TEST(cl1.flag, CLOSURE_SSR_FLAG); - /* When mixing SSR don't blend roughness and normals but only specular (ssr_data.xyz).*/ + /* When mixing SSR don't blend roughness and normals but only specular (ssr_data.xyz). */ cl.ssr_data.w = (use_cl1_ssr) ? cl1.ssr_data.w : cl2.ssr_data.w; cl.ssr_normal = (use_cl1_ssr) ? cl1.ssr_normal : cl2.ssr_normal; @@ -122,7 +122,7 @@ Closure closure_add(Closure cl1, Closure cl2) cl.flag = cl1.flag | cl2.flag; cl.ssr_data = cl1.ssr_data + cl2.ssr_data; bool use_cl1_ssr = FLAG_TEST(cl1.flag, CLOSURE_SSR_FLAG); - /* When mixing SSR don't blend roughness and normals.*/ + /* When mixing SSR don't blend roughness and normals. */ cl.ssr_data.w = (use_cl1_ssr) ? cl1.ssr_data.w : cl2.ssr_data.w; cl.ssr_normal = (use_cl1_ssr) ? cl1.ssr_normal : cl2.ssr_normal; diff --git a/source/blender/draw/engines/eevee/shaders/common_uniforms_lib.glsl b/source/blender/draw/engines/eevee/shaders/common_uniforms_lib.glsl index d7996ab4bd1..c935eca6a39 100644 --- a/source/blender/draw/engines/eevee/shaders/common_uniforms_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/common_uniforms_lib.glsl @@ -37,7 +37,7 @@ layout(std140) uniform common_block int prbIrradianceVisSize; float prbIrradianceSmooth; float prbLodCubeMax; - /* Misc*/ + /* Misc */ int rayType; float rayDepth; float alphaHashOffset; diff --git a/source/blender/draw/engines/eevee/shaders/effect_dof_scatter_vert.glsl b/source/blender/draw/engines/eevee/shaders/effect_dof_scatter_vert.glsl index 276ab119fab..f349806d37e 100644 --- a/source/blender/draw/engines/eevee/shaders/effect_dof_scatter_vert.glsl +++ b/source/blender/draw/engines/eevee/shaders/effect_dof_scatter_vert.glsl @@ -25,7 +25,8 @@ flat out float spritesize; /* Load 4 Circle of confusion values. texel_co is centered around the 4 taps. */ vec4 fetch_cocs(vec2 texel_co) { - /* TODO(fclem) The textureGather(sampler, co, comp) variant isn't here on some implementations.*/ + /* TODO(fclem) The textureGather(sampler, co, comp) variant isn't here on some implementations. + */ #if 0 // GPU_ARB_texture_gather vec2 uvs = texel_co / vec2(textureSize(cocBuffer, 0)); /* Reminder: Samples order is CW starting from top left. */ 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 356ed102928..97b31a972e3 100644 --- a/source/blender/draw/engines/eevee/shaders/effect_translucency_frag.glsl +++ b/source/blender/draw/engines/eevee/shaders/effect_translucency_frag.glsl @@ -49,7 +49,7 @@ float light_translucent_power_with_falloff(LightData ld, vec3 N, vec4 l_vector) } else if (ld.l_type == SUN) { power = 1.0 / (1.0 + (ld.l_radius * ld.l_radius * 0.5)); - power *= ld.l_radius * ld.l_radius * M_PI; /* Removing area light power*/ + power *= ld.l_radius * ld.l_radius * M_PI; /* Removing area light power. */ power *= M_2PI * 0.78; /* Matching cycles with point light. */ power *= 0.082; /* XXX ad hoc, empirical */ falloff = dot(N, -ld.l_forward); 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 0f670532349..b1368f90846 100644 --- a/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl +++ b/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl @@ -101,23 +101,23 @@ void blend_mode_output( { switch (blend_mode) { case MODE_REGULAR: - /* Reminder: Blending func is premult alpha blend (dst.rgba * (1 - src.a) + src.rgb).*/ + /* Reminder: Blending func is premult alpha blend (dst.rgba * (1 - src.a) + src.rgb). */ color *= opacity; frag_color = color; frag_revealage = vec4(0.0, 0.0, 0.0, color.a); break; case MODE_MULTIPLY: - /* Reminder: Blending func is multiply blend (dst.rgba * src.rgba).*/ + /* Reminder: Blending func is multiply blend (dst.rgba * src.rgba). */ color.a *= opacity; frag_revealage = frag_color = (1.0 - color.a) + color.a * color; break; case MODE_DIVIDE: - /* Reminder: Blending func is multiply blend (dst.rgba * src.rgba).*/ + /* Reminder: Blending func is multiply blend (dst.rgba * src.rgba). */ color.a *= opacity; frag_revealage = frag_color = clamp(1.0 / max(vec4(1e-6), 1.0 - color * color.a), 0.0, 1e18); break; case MODE_HARDLIGHT: - /* Reminder: Blending func is multiply blend (dst.rgba * src.rgba).*/ + /* Reminder: Blending func is multiply blend (dst.rgba * src.rgba). */ /** * We need to separate the overlay equation into 2 term (one mul and one add). * This is the standard overlay equation (per channel): @@ -135,14 +135,14 @@ void blend_mode_output( frag_revealage = max(vec4(0.0), frag_revealage); break; case MODE_HARDLIGHT_SECOND_PASS: - /* Reminder: Blending func is additive blend (dst.rgba + src.rgba).*/ + /* Reminder: Blending func is additive blend (dst.rgba + src.rgba). */ color = mix(vec4(0.5), color, color.a * opacity); frag_revealage = frag_color = (-1.0 + 2.0 * color) * step(-0.5, -color); frag_revealage = max(vec4(0.0), frag_revealage); break; case MODE_SUB: case MODE_ADD: - /* Reminder: Blending func is additive / subtractive blend (dst.rgba +/- src.rgba).*/ + /* Reminder: Blending func is additive / subtractive blend (dst.rgba +/- src.rgba). */ frag_color = color * color.a * opacity; frag_revealage = vec4(0.0); break; @@ -347,7 +347,7 @@ float stroke_thickness_modulate(float thickness) float clamp_small_stroke_thickness(float thickness) { /* To avoid aliasing artifacts, we clamp the line thickness and - * reduce its opacity in the fragment shader.*/ + * reduce its opacity in the fragment shader. */ float min_thickness = gl_Position.w * 1.3; thickness = max(min_thickness, thickness); diff --git a/source/blender/draw/engines/overlay/overlay_particle.c b/source/blender/draw/engines/overlay/overlay_particle.c index 5fa74a8c3a6..e51f7032288 100644 --- a/source/blender/draw/engines/overlay/overlay_particle.c +++ b/source/blender/draw/engines/overlay/overlay_particle.c @@ -174,7 +174,7 @@ void OVERLAY_particle_cache_populate(OVERLAY_Data *vedata, Object *ob) int draw_as = (part->draw_as == PART_DRAW_REND) ? part->ren_as : part->draw_as; if (part->type == PART_HAIR) { - /* Hairs should have been rendered by the render engine.*/ + /* Hairs should have been rendered by the render engine. */ continue; } diff --git a/source/blender/draw/engines/overlay/shaders/armature_shape_outline_geom.glsl b/source/blender/draw/engines/overlay/shaders/armature_shape_outline_geom.glsl index 6398426952c..a2a478f400b 100644 --- a/source/blender/draw/engines/overlay/shaders/armature_shape_outline_geom.glsl +++ b/source/blender/draw/engines/overlay/shaders/armature_shape_outline_geom.glsl @@ -54,7 +54,7 @@ void main(void) * (avoid problems with point behind near plane). * If the chosen point is parallel to the edge in screen space, * choose the other point anyway. - * This fixes some issue with cubes in orthographic views.*/ + * This fixes some issue with cubes in orthographic views. */ if (vPos[0].z < vPos[3].z) { hidden_point = (abs(fac0) > 1e-5) ? ssPos[0] : ssPos[3]; } diff --git a/source/blender/draw/engines/workbench/workbench_private.h b/source/blender/draw/engines/workbench/workbench_private.h index 6247436feea..453ef9c7f8e 100644 --- a/source/blender/draw/engines/workbench/workbench_private.h +++ b/source/blender/draw/engines/workbench/workbench_private.h @@ -381,13 +381,13 @@ typedef struct WORKBENCH_ObjectData { } WORKBENCH_ObjectData; typedef struct WORKBENCH_ViewLayerData { - /** Depth of field sample location array.*/ + /** Depth of field sample location array. */ struct GPUUniformBuf *dof_sample_ubo; - /** All constant data used for a render loop.*/ + /** All constant data used for a render loop. */ struct GPUUniformBuf *world_ubo; - /** Cavity sample location array.*/ + /** Cavity sample location array. */ struct GPUUniformBuf *cavity_sample_ubo; - /** Blue noise texture used to randomize the sampling of some effects.*/ + /** Blue noise texture used to randomize the sampling of some effects. */ struct GPUTexture *cavity_jitter_tx; /** Materials UBO's allocated in a memblock for easy bookkeeping. */ struct BLI_memblock *material_ubo; |