[Bf-blender-cvs] [797539e76cc] master: Cleanup: comments (long lines) in render

Campbell Barton noreply at git.blender.org
Sun Apr 21 22:35:29 CEST 2019


Commit: 797539e76ccf89165204f703ea25e39c8c14dfa1
Author: Campbell Barton
Date:   Mon Apr 22 03:05:53 2019 +1000
Branches: master
https://developer.blender.org/rB797539e76ccf89165204f703ea25e39c8c14dfa1

Cleanup: comments (long lines) in render

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

M	source/blender/render/extern/include/RE_pipeline.h
M	source/blender/render/intern/source/bake_api.c
M	source/blender/render/intern/source/external_engine.c
M	source/blender/render/intern/source/imagetexture.c
M	source/blender/render/intern/source/pipeline.c
M	source/blender/render/intern/source/render_result.c
M	source/blender/render/intern/source/render_texture.c
M	source/blender/render/intern/source/zbuf.c

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

diff --git a/source/blender/render/extern/include/RE_pipeline.h b/source/blender/render/extern/include/RE_pipeline.h
index 145508b514e..46d2df0acb5 100644
--- a/source/blender/render/extern/include/RE_pipeline.h
+++ b/source/blender/render/extern/include/RE_pipeline.h
@@ -91,7 +91,8 @@ typedef struct RenderPass {
 
 /* a renderlayer is a full image, but with all passes and samples */
 /* size of the rects is defined in RenderResult */
-/* after render, the Combined pass is in combined, for renderlayers read from files it is a real pass */
+/* after render, the Combined pass is in combined,
+ * for renderlayers read from files it is a real pass */
 typedef struct RenderLayer {
   struct RenderLayer *next, *prev;
 
@@ -125,8 +126,8 @@ typedef struct RenderResult {
   int rectx, recty;
   short crop, sample_nr;
 
-  /* the following rect32, rectf and rectz buffers are for temporary storage only, for RenderResult structs
-   * created in #RE_AcquireResultImage - which do not have RenderView */
+  /* The following rect32, rectf and rectz buffers are for temporary storage only,
+   * for RenderResult structs created in #RE_AcquireResultImage - which do not have RenderView */
 
   /* optional, 32 bits version of picture, used for ogl render and image curves */
   int *rect32;
diff --git a/source/blender/render/intern/source/bake_api.c b/source/blender/render/intern/source/bake_api.c
index bc0c73fd11f..e71d5b5f14c 100644
--- a/source/blender/render/intern/source/bake_api.c
+++ b/source/blender/render/intern/source/bake_api.c
@@ -17,19 +17,22 @@
 /** \file
  * \ingroup render
  *
- * \brief The API itself is simple. Blender sends a populated array of BakePixels to the renderer, and gets back an
- * array of floats with the result.
+ * \brief The API itself is simple.
+ * Blender sends a populated array of BakePixels to the renderer,
+ * and gets back an array of floats with the result.
  *
  * \section bake_api Development Notes for External Engines
  *
- * The Bake API is fully implemented with Python rna functions. The operator expects/call a function:
+ * The Bake API is fully implemented with Python rna functions.
+ * The operator expects/call a function:
  *
  * ``def bake(scene, object, pass_type, object_id, pixel_array, num_pixels, depth, result)``
  * - scene: current scene (Python object)
  * - object: object to render (Python object)
  * - pass_type: pass to render (string, e.g., "COMBINED", "AO", "NORMAL", ...)
  * - object_id: index of object to bake (to use with the pixel_array)
- * - pixel_array: list of primitive ids and barycentric coordinates to bake(Python object, see bake_pixel)
+ * - pixel_array: list of primitive ids and barycentric coordinates to
+ *   `bake(Python object, see bake_pixel)`.
  * - num_pixels: size of pixel_array, number of pixels to bake (int)
  * - depth: depth of pixels to return (int, assuming always 4 now)
  * - result: array to be populated by the engine (float array, PyLong_AsVoidPtr)
@@ -158,8 +161,10 @@ void RE_bake_margin(ImBuf *ibuf, char *mask, const int margin)
 }
 
 /**
- * This function returns the coordinate and normal of a barycentric u,v for a face defined by the primitive_id index.
- * The returned normal is actually the direction from the same barycentric coordinate in the cage to the base mesh
+ * This function returns the coordinate and normal of a barycentric u,v
+ * for a face defined by the primitive_id index.
+ * The returned normal is actually the direction from the same barycentric coordinate
+ * in the cage to the base mesh
  * The returned coordinate is the point in the cage mesh
  */
 static void calc_point_from_barycentric_cage(TriTessFace *triangles_low,
@@ -201,7 +206,8 @@ static void calc_point_from_barycentric_cage(TriTessFace *triangles_low,
 }
 
 /**
- * This function returns the coordinate and normal of a barycentric u,v for a face defined by the primitive_id index.
+ * This function returns the coordinate and normal of a barycentric u,v
+ * for a face defined by the primitive_id index.
  * The returned coordinate is extruded along the normal by cage_extrusion
  */
 static void calc_point_from_barycentric_extrusion(TriTessFace *triangles,
@@ -722,8 +728,8 @@ void RE_bake_pixels_populate(Mesh *me,
     for (a = 0; a < 3; a++) {
       const float *uv = mloopuv[lt->tri[a]].uv;
 
-      /* Note, workaround for pixel aligned UVs which are common and can screw up our intersection tests
-       * where a pixel gets in between 2 faces or the middle of a quad,
+      /* Note, workaround for pixel aligned UVs which are common and can screw up our
+       * intersection tests where a pixel gets in between 2 faces or the middle of a quad,
        * camera aligned quads also have this problem but they are less common.
        * Add a small offset to the UVs, fixes bug #18685 - Campbell */
       vec[a][0] = uv[0] * (float)bd.bk_image->width - (0.5f + 0.001f);
@@ -796,7 +802,8 @@ static void normal_compress(float out[3],
 }
 
 /**
- * This function converts an object space normal map to a tangent space normal map for a given low poly mesh
+ * This function converts an object space normal map
+ * to a tangent space normal map for a given low poly mesh.
  */
 void RE_bake_normal_world_to_tangent(const BakePixel pixel_array[],
                                      const size_t num_pixels,
diff --git a/source/blender/render/intern/source/external_engine.c b/source/blender/render/intern/source/external_engine.c
index c4eef235b5d..744595305d9 100644
--- a/source/blender/render/intern/source/external_engine.c
+++ b/source/blender/render/intern/source/external_engine.c
@@ -410,7 +410,8 @@ float RE_engine_get_camera_shift_x(RenderEngine *engine, Object *camera, bool us
 {
   Render *re = engine->re;
 
-  /* when using spherical stereo, get camera shift without multiview, leaving stereo to be handled by the engine */
+  /* When using spherical stereo, get camera shift without multiview,
+   * leaving stereo to be handled by the engine. */
   if (use_spherical_stereo)
     re = NULL;
 
@@ -424,7 +425,8 @@ void RE_engine_get_camera_model_matrix(RenderEngine *engine,
 {
   Render *re = engine->re;
 
-  /* when using spherical stereo, get model matrix without multiview, leaving stereo to be handled by the engine */
+  /* When using spherical stereo, get model matrix without multiview,
+   * leaving stereo to be handled by the engine. */
   if (use_spherical_stereo)
     re = NULL;
 
diff --git a/source/blender/render/intern/source/imagetexture.c b/source/blender/render/intern/source/imagetexture.c
index df114ed9c1d..fad54c675ba 100644
--- a/source/blender/render/intern/source/imagetexture.c
+++ b/source/blender/render/intern/source/imagetexture.c
@@ -597,7 +597,8 @@ static void boxsample(ImBuf *ibuf,
    * If variable 'imaprepeat' has been set, the
    * clipped-away parts are sampled as well.
    */
-  /* note: actually minx etc isn't in the proper range... this due to filter size and offset vectors for bump */
+  /* note: actually minx etc isn't in the proper range...
+   *       this due to filter size and offset vectors for bump */
   /* note: talpha must be initialized */
   /* note: even when 'imaprepeat' is set, this can only repeat once in any direction.
    * the point which min/max is derived from is assumed to be wrapped */
@@ -682,8 +683,8 @@ static void boxsample(ImBuf *ibuf,
   }
 }
 
-/*-----------------------------------------------------------------------------------------------------------------
- * from here, some functions only used for the new filtering */
+/* -------------------------------------------------------------------- */
+/* from here, some functions only used for the new filtering */
 
 /* anisotropic filters, data struct used instead of long line of (possibly unused) func args */
 typedef struct afdata_t {
@@ -1043,7 +1044,8 @@ static int imagewraposa_aniso(Tex *tex,
   miny = (maxy - miny) * 0.5f;
 
   if (tex->imaflag & TEX_FILTER_MIN) {
-    /* make sure the filtersize is minimal in pixels (normal, ref map can have miniature pixel dx/dy) */
+    /* Make sure the filtersize is minimal in pixels
+     * (normal, ref map can have miniature pixel dx/dy). */
     const float addval = (0.5f * tex->filtersize) / (float)MIN2(ibuf->x, ibuf->y);
     if (addval > minx)
       minx = addval;
@@ -1063,8 +1065,9 @@ static int imagewraposa_aniso(Tex *tex,
     float t;
     SWAP(float, minx, miny);
     /* must rotate dxt/dyt 90 deg
-     * yet another blender problem is that swapping X/Y axes (or any tex proj switches) should do something similar,
-     * but it doesn't, it only swaps coords, so filter area will be incorrect in those cases. */
+     * yet another blender problem is that swapping X/Y axes (or any tex proj switches)
+     * should do something similar, but it doesn't, it only swaps coords,
+     * so filter area will be incorrect in those cases. */
     t = dxt[0];
     dxt[0] = dxt[1];
     dxt[1] = -t;
@@ -1368,8 +1371,9 @@ static int imagewraposa_aniso(Tex *tex,
   }
 
   /* de-premul, this is being premulled in shade_input_do_shade()
-   * TXF: this currently does not (yet?) work properly, destroys edge AA in clip/checker mode, so for now commented out
-   * also disabled in imagewraposa() to be able to compare results with blender's default texture filtering */
+   * TXF: this currently does not (yet?) work properly, destroys edge AA in clip/checker mode,
+   * so for now commented out also disabled in imagewraposa()
+   * to be able to compare results with blender's default texture filtering */
 
   /* brecht: tried to fix this, see "TXF alpha" comments */
 
@@ -1404,8 +1408,8 @@ int imagewraposa(Tex *tex,
   float maxd, pixsize, val1, val2, val3;
   int curmap, retval, imaprepeat, imapextend;
 
-  /* TXF: since dxt/dyt might be modified here and since they might be needed after imagewraposa() call,
-   * make a local copy here so that original vecs remain untouched */
+  /* TXF: since dxt/dyt might be modified here and since they might be needed after imagewraposa()
+   * call, make a local copy here so that original vecs remain untouched. */
   copy_v2_v2(dxt, DXT);
   copy_v2_v2(dyt, DYT);
 
@@ -1471,7 +1475,8 @@ int imagewraposa(Tex *tex,
   miny = (maxy - m

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list