[Bf-committers] [Bf-blender-cvs] [146eb79] master: Cycles: Tweak to leaf creation criteria in all BVH types

Sergey Sharybin sergey.vfx at gmail.com
Thu Jan 15 23:43:21 CET 2015


Hrm, just to clarify: after some further tests slowdown was not that
dramatic. Not sure why first test was so bad, maybe system was accidentally
swapping or so, or maybe non-baked hair did some weird stuff. Bummer.

In any case, from further tests there seems to be some degree of speed from
those changes, they're just not such exciting. And speed is now quite the
same between stable release and QBVH+watertight.

Just FYI for those who're playing alone at home :)

On Fri, Jan 16, 2015 at 1:43 AM, Sergey Sharybin <noreply at git.blender.org>
wrote:

> Commit: 146eb7947ef4e660849e51bc070761fbed322f31
> Author: Sergey Sharybin
> Date:   Fri Jan 16 01:38:54 2015 +0500
> Branches: master
> https://developer.blender.org/rB146eb7947ef4e660849e51bc070761fbed322f31
>
> Cycles: Tweak to leaf creation criteria in all BVH types
>
> Since leaf node gets split further into per-primitive type leaves old check
> for number of curves became a bit ridiculous -- it might lead to two leaf
> nodes
> each of which would contain only one curve primitive (one motion curve and
> one
> regular curve).
>
> This lead to quite dramatic slowdown for Victor model -- around 40%, which
> is
> totally unacceptable.
>
> This commit is aimed to prevent such situation and from quick render test
> it
> seems victor is now back to normal render time. Further testing is needed
> tho.
>
> There are also other ideas about splitting the node, will need to look into
> them next.
>
> ===================================================================
>
> M       intern/cycles/bvh/bvh_build.cpp
>
> ===================================================================
>
> diff --git a/intern/cycles/bvh/bvh_build.cpp
> b/intern/cycles/bvh/bvh_build.cpp
> index da263c4..3f56be0 100644
> --- a/intern/cycles/bvh/bvh_build.cpp
> +++ b/intern/cycles/bvh/bvh_build.cpp
> @@ -329,17 +329,22 @@ bool BVHBuild::range_within_max_leaf_size(const
> BVHRange& range)
>
>         size_t num_triangles = 0;
>         size_t num_curves = 0;
> +       size_t num_motion_curves = 0;
>
>         for(int i = 0; i < size; i++) {
>                 BVHReference& ref = references[range.start() + i];
>
> -               if(ref.prim_type() & PRIMITIVE_ALL_CURVE)
> +               if(ref.prim_type() & PRIMITIVE_CURVE)
>                         num_curves++;
> +               if(ref.prim_type() & PRIMITIVE_MOTION_CURVE)
> +                       num_motion_curves++;
>                 else if(ref.prim_type() & PRIMITIVE_ALL_TRIANGLE)
>                         num_triangles++;
>         }
>
> -       return (num_triangles < params.max_triangle_leaf_size) &&
> (num_curves < params.max_curve_leaf_size);
> +       return (num_triangles < params.max_triangle_leaf_size) &&
> +              (num_curves < params.max_curve_leaf_size);
> +              (num_motion_curves < params.max_curve_leaf_size);
>  }
>
>  /* multithreaded binning builder */
>
> _______________________________________________
> Bf-blender-cvs mailing list
> Bf-blender-cvs at blender.org
> http://lists.blender.org/mailman/listinfo/bf-blender-cvs
>



-- 
With best regards, Sergey Sharybin


More information about the Bf-committers mailing list