[Bf-blender-cvs] [63f0e150eda] master: Cleanup: comments (long lines) in draw

Campbell Barton noreply at git.blender.org
Wed May 1 03:33:48 CEST 2019


Commit: 63f0e150edaeea26fbcc48f62597f4f5c71cc64a
Author: Campbell Barton
Date:   Wed May 1 10:35:46 2019 +1000
Branches: master
https://developer.blender.org/rB63f0e150edaeea26fbcc48f62597f4f5c71cc64a

Cleanup: comments (long lines) in draw

===================================================================

M	source/blender/blenkernel/intern/curve.c
M	source/blender/draw/engines/eevee/eevee_bloom.c
M	source/blender/draw/engines/eevee/eevee_depth_of_field.c
M	source/blender/draw/engines/eevee/eevee_lightprobes.c
M	source/blender/draw/engines/eevee/eevee_lights.c
M	source/blender/draw/engines/eevee/eevee_materials.c
M	source/blender/draw/engines/eevee/eevee_screen_raytrace.c
M	source/blender/draw/engines/eevee/shaders/ambient_occlusion_lib.glsl
M	source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl
M	source/blender/draw/engines/eevee/shaders/effect_temporal_aa.glsl
M	source/blender/draw/engines/eevee/shaders/lightprobe_lib.glsl
M	source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl
M	source/blender/draw/engines/eevee/shaders/ltc_lib.glsl
M	source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl
M	source/blender/draw/engines/eevee/shaders/shadow_store_frag.glsl
M	source/blender/draw/engines/external/external_engine.c
M	source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
M	source/blender/draw/engines/gpencil/gpencil_draw_utils.c
M	source/blender/draw/engines/gpencil/gpencil_engine.c
M	source/blender/draw/engines/gpencil/gpencil_shader_fx.c
M	source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl
M	source/blender/draw/engines/workbench/shaders/workbench_effect_dof_frag.glsl
M	source/blender/draw/engines/workbench/shaders/workbench_volume_frag.glsl
M	source/blender/draw/engines/workbench/workbench_effect_dof.c
M	source/blender/draw/engines/workbench/workbench_materials.c
M	source/blender/draw/intern/draw_anim_viz.c
M	source/blender/draw/intern/draw_armature.c
M	source/blender/draw/intern/draw_cache.c
M	source/blender/draw/intern/draw_cache_impl_mesh.c
M	source/blender/draw/intern/draw_common.c
M	source/blender/draw/intern/draw_hair.c
M	source/blender/draw/intern/draw_instance_data.c
M	source/blender/draw/intern/draw_manager_data.c
M	source/blender/draw/intern/draw_manager_exec.c
M	source/blender/draw/intern/draw_manager_shader.c
M	source/blender/draw/modes/edit_mesh_mode.c
M	source/blender/draw/modes/edit_mesh_mode_text.c
M	source/blender/draw/modes/edit_metaball_mode.c
M	source/blender/draw/modes/object_mode.c
M	source/blender/draw/modes/paint_texture_mode.c
M	source/blender/draw/modes/sculpt_mode.c
M	source/blender/draw/modes/shaders/common_fxaa_lib.glsl
M	source/blender/draw/modes/shaders/common_hair_lib.glsl
M	source/blender/draw/modes/shaders/edit_mesh_overlay_frag.glsl
M	source/blender/draw/modes/shaders/object_grid_frag.glsl

===================================================================

diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index 4f695606217..dc677449a4c 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -3928,6 +3928,8 @@ static bool tridiagonal_solve_with_limits(
   return true;
 }
 
+/* Keep ascii art. */
+/* clang-format off */
 /*
  * This function computes the handles of a series of auto bezier points
  * on the basis of 'no acceleration discontinuities' at the points.
@@ -3979,6 +3981,7 @@ static bool tridiagonal_solve_with_limits(
  * 4. The equations for zero acceleration border conditions are basically the above
  *    equation with parts omitted, so the handle size correction also applies.
  */
+/* clang-format on */
 
 static void bezier_eq_continuous(
     float *a, float *b, float *c, float *d, float *dy, float *l, int i)
diff --git a/source/blender/draw/engines/eevee/eevee_bloom.c b/source/blender/draw/engines/eevee/eevee_bloom.c
index e5d33daa0d0..b0013151a70 100644
--- a/source/blender/draw/engines/eevee/eevee_bloom.c
+++ b/source/blender/draw/engines/eevee/eevee_bloom.c
@@ -206,31 +206,32 @@ void EEVEE_bloom_cache_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *ved
   if ((effects->enabled_effects & EFFECT_BLOOM) != 0) {
     /**  Bloom algorithm
      *
-     * Overview :
+     * Overview:
      * - Downsample the color buffer doing a small blur during each step.
      * - Accumulate bloom color using previously downsampled color buffers
      *   and do an upsample blur for each new accumulated layer.
      * - Finally add accumulation buffer onto the source color buffer.
      *
      *  [1/1] is original copy resolution (can be half or quarter res for performance)
+     * <pre>
+     *                            [DOWNSAMPLE CHAIN]                      [UPSAMPLE CHAIN]
      *
-     *                                [DOWNSAMPLE CHAIN]                      [UPSAMPLE CHAIN]
-     *
-     *  Source Color ── [Blit] ──>  Bright Color Extract [1/1]                  Final Color
-     *                                        |                                      Λ
-     *                                [Downsample First]       Source Color ─> + [Resolve]
-     *                                        v                                      |
-     *                              Color Downsampled [1/2] ────────────> + Accumulation Buffer [1/2]
-     *                                        |                                      Λ
-     *                                       ───                                    ───
-     *                                      Repeat                                 Repeat
-     *                                       ───                                    ───
-     *                                        v                                      |
-     *                              Color Downsampled [1/N-1] ──────────> + Accumulation Buffer [1/N-1]
-     *                                        |                                      Λ
-     *                                   [Downsample]                            [Upsample]
-     *                                        v                                      |
-     *                              Color Downsampled [1/N] ─────────────────────────┘
+     * Source Color ─ [Blit] ─> Bright Color Extract [1/1]                  Final Color
+     *                                    |                                      Λ
+     *                            [Downsample First]       Source Color ─> + [Resolve]
+     *                                    v                                      |
+     *                          Color Downsampled [1/2] ────────────> + Accumulation Buffer [1/2]
+     *                                    |                                      Λ
+     *                                   ───                                    ───
+     *                                  Repeat                                 Repeat
+     *                                   ───                                    ───
+     *                                    v                                      |
+     *                          Color Downsampled [1/N-1] ──────────> + Accumulation Buffer [1/N-1]
+     *                                    |                                      Λ
+     *                               [Downsample]                            [Upsample]
+     *                                    v                                      |
+     *                          Color Downsampled [1/N] ─────────────────────────┘
+     * </pre>
      */
     DRWShadingGroup *grp;
     const bool use_highres = true;
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 62ccf30e12c..0864d869451 100644
--- a/source/blender/draw/engines/eevee/eevee_depth_of_field.c
+++ b/source/blender/draw/engines/eevee/eevee_depth_of_field.c
@@ -141,10 +141,12 @@ int EEVEE_depth_of_field_init(EEVEE_ViewLayerData *UNUSED(sldata),
       float focus_dist = BKE_camera_object_dof_distance(camera);
       float focal_len = cam->lens;
 
-      /* this is factor that converts to the scene scale. focal length and sensor are expressed in mm
-       * unit.scale_length is how many meters per blender unit we have. We want to convert to blender units though
-       * because the shader reads coordinates in world space, which is in blender units.
-       * Note however that focus_distance is already in blender units and shall not be scaled here (see T48157). */
+      /* this is factor that converts to the scene scale. focal length and sensor are expressed in
+       * mm unit.scale_length is how many meters per blender unit we have. We want to convert to
+       * blender units though because the shader reads coordinates in world space, which is in
+       * blender units.
+       * Note however that focus_distance is already in blender units and shall not be scaled here
+       * (see T48157). */
       float scale = (scene_eval->unit.system) ? scene_eval->unit.scale_length : 1.0f;
       float scale_camera = 0.001f / scale;
       /* we want radius here for the aperture number  */
diff --git a/source/blender/draw/engines/eevee/eevee_lightprobes.c b/source/blender/draw/engines/eevee/eevee_lightprobes.c
index 550821ee92a..a4a17de7a57 100644
--- a/source/blender/draw/engines/eevee/eevee_lightprobes.c
+++ b/source/blender/draw/engines/eevee/eevee_lightprobes.c
@@ -145,7 +145,8 @@ static void planar_pool_ensure_alloc(EEVEE_Data *vedata, int num_planar_ref)
           width, height, max_ii(1, num_planar_ref), GPU_DEPTH_COMPONENT24, 0, NULL);
     }
     else if (num_planar_ref == 0) {
-      /* Makes Opengl Happy : Create a placeholder texture that will never be sampled but still bound to shader. */
+      /* Makes Opengl Happy : Create a placeholder texture that will never be sampled but still
+       * bound to shader. */
       txl->planar_pool = DRW_texture_create_2d_array(
           1, 1, 1, GPU_RGBA8, DRW_TEX_FILTER | DRW_TEX_MIPMAP, NULL);
       txl->planar_depth = DRW_texture_create_2d_array(1, 1, 1, GPU_DEPTH_COMPONENT24, 0, NULL);
diff --git a/source/blender/draw/engines/eevee/eevee_lights.c b/source/blender/draw/engines/eevee/eevee_lights.c
index 917043d70e7..270defb039b 100644
--- a/source/blender/draw/engines/eevee/eevee_lights.c
+++ b/source/blender/draw/engines/eevee/eevee_lights.c
@@ -680,7 +680,8 @@ static float light_shape_power_get(const Light *la, const EEVEE_Light *evli)
     power = 1.0f / (evli->sizex * evli->sizey * 4.0f * M_PI) * /* 1/(w*h*Pi) */
             80.0f; /* XXX : Empirical, Fit cycles power */
     if (ELEM(la->area_shape, LA_AREA_DISK, LA_AREA_ELLIPSE)) {
-      /* Scale power to account for the lower area of the ellipse compared to the surrounding rectangle. */
+      /* Scale power to account for the lower area of the ellipse compared to the surrounding
+       * rectangle. */
       power *= 4.0f / M_PI;
     }
   }
@@ -693,8 +694,9 @@ static float light_shape_power_get(const Light *la, const EEVEE_Light *evli)
   }
   else {
     power = 1.0f / (evli->radius * evli->radius * M_PI); /* 1/(r²*Pi) */
-    /* Make illumation power closer to cycles for bigger radii. Cycles uses a cos^3 term that we cannot reproduce
-     * so we account for that by scaling the light power. This function is the result of a rough manual fitting. */
+    /* Make illumation power closer to cycles for bigger radii. Cycles uses a cos^3 term that we
+     * cannot reproduce so we account for that by scaling the light power. This function is the
+     * result of a rough manual fitting. */
     power += 1.0f / (2.0f * M_PI); /* power *= 1 + r²/2 */
   }
   return power;
@@ -1383,7 +1385,8 @@ void EEVEE_draw_shadows(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
       DRW_draw_pass(psl->shadow_pass);
     }
 
-    /* 0.001f is arbitrary, but it should be relatively small so that filter size is not too big. */
+    /* 0.001f is arbitrary, but it should be relatively small so that filter size is not too big.
+     */
     float filter_texture_size = la->soft * 0.001f;
     float filter_pixel_size = ceil(filter_texture_size / srd->cube_texel_size);
     linfo->filter_size = srd->cube_texel_size * ((filter_pixel_size > 1.0f) ? 1.5f : 0.0f);
diff --git a/source/blender/draw/engines/eevee/eevee_materials.c b/source/blender/draw/engines/eevee/eevee_materials.c
index ae145546856..8d90a2d29cc 100644
--- a/source/blender/draw/engines/eevee/eevee_materials.c
+++ b/source/blender/draw/engines/eevee/eevee_materials.c
@@ -1409,9 +1409,9 @@ static void material_opaque(Material *ma,
           }
           else {
             if (use_translucency) {
-              /* NOTE: This is a nasty workaround, because the sss profile might not have been generated
-               * but the UBO is still declared in this

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list