Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-12-20 02:55:04 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-12-20 02:55:04 +0400
commita7bae8474b11ad2dbf6ccc45423bd47702f6c148 (patch)
tree65967cbe112f2fa2d911eebc03cdf779aa9e311f /source/blender/blenkernel/intern/texture.c
parentb66c87231abf35f2bc3443c7d7b4140aee0621bc (diff)
calculate weight paint colors once per vertex rather then on every face corner (was doing the same deform vert lookup and color calculation multiple times per vertex),
Quick shows over 2x speedup in my tests, will give bigger speedup with more vertex groups. If you happen to have vertices with no faces using them - vertex colors will be calculated unnecessarily, but this isnt a common use case for weight paint mode.
Diffstat (limited to 'source/blender/blenkernel/intern/texture.c')
-rw-r--r--source/blender/blenkernel/intern/texture.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c
index 93404dc25fb..7051376a1f4 100644
--- a/source/blender/blenkernel/intern/texture.c
+++ b/source/blender/blenkernel/intern/texture.c
@@ -349,9 +349,9 @@ ColorBand *add_colorband(int rangetype)
/* ------------------------------------------------------------------------- */
-int do_colorband(ColorBand *coba, float in, float out[4])
+int do_colorband(const ColorBand *coba, float in, float out[4])
{
- CBData *cbd1, *cbd2, *cbd0, *cbd3;
+ const CBData *cbd1, *cbd2, *cbd0, *cbd3;
float fac, mfac, t[4];
int a;