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:
authorMatt Ebb <matt@mke3.net>2008-11-04 08:17:02 +0300
committerMatt Ebb <matt@mke3.net>2008-11-04 08:17:02 +0300
commitf5f0c8fb37eaac8be9efc44b2802fb87fcf85727 (patch)
tree743a13963283a443d71fb2bc2f08ab4f38ae616c /source/blender/render/intern/source/pointdensity.c
parent389588bb4f9f273d5cc1f679e351604859dafc0b (diff)
* Fixed a strange problem with the way textures are interpreted - was causing weird things with point density turbulence on
* Reverted the spin field once more..
Diffstat (limited to 'source/blender/render/intern/source/pointdensity.c')
-rw-r--r--source/blender/render/intern/source/pointdensity.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c
index 483cc96122b..c80ee767142 100644
--- a/source/blender/render/intern/source/pointdensity.c
+++ b/source/blender/render/intern/source/pointdensity.c
@@ -304,9 +304,9 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres)
PointDensityRangeData pdr;
float density=0.0f, time=0.0f;
float vec[3] = {0.0, 0.0, 0.0};
- float tv[3];
float co[3];
float turb, noise_fac;
+ int num;
if ((!pd) || (!pd->point_tree)) {
texres->tin = 0.0f;
@@ -331,11 +331,13 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres)
if (ELEM(pd->noise_influence, TEX_PD_NOISE_VEL, TEX_PD_NOISE_TIME)) {
/* find the average speed vectors or particle time,
* for perturbing final density lookup with */
- BLI_bvhtree_range_query(pd->point_tree, co, pd->radius, accum_density, &pdr);
+ num = BLI_bvhtree_range_query(pd->point_tree, co, pd->radius, accum_density, &pdr);
density = 0.0f;
- if (pd->noise_influence == TEX_PD_NOISE_TIME)
- vec[0] = vec[1] = vec[2] = time;
+ if (pd->noise_influence == TEX_PD_NOISE_TIME) {
+ vec[0] = vec[1] = vec[2] = time/num;
+ //if ((G.rt==1) && (time > 0.f)) printf("time: %f time/num: %f \n", time, time/num);
+ }
Normalize(vec);
}
@@ -357,7 +359,7 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres)
texres->tr = vec[0];
texres->tg = vec[1];
texres->tb = vec[2];
- texres->ta = density;
+ //texres->ta = density;
BRICONTRGB;
return retval;