From faf529d03689c0c472ee5895625cd2902915cfd6 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 30 Mar 2014 13:03:57 +1100 Subject: BLI_rand: Add BLI_rng_get_float_unit_v3, was static rayshade func --- source/blender/render/intern/source/rayshade.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'source/blender/render') diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c index ae5b9ec5999..ed2c7455250 100644 --- a/source/blender/render/intern/source/rayshade.c +++ b/source/blender/render/intern/source/rayshade.c @@ -1672,18 +1672,6 @@ static void ray_trace_shadow_tra(Isect *is, ShadeInput *origshi, int depth, int /* aolight: function to create random unit sphere vectors for total random sampling */ -static void RandomSpherical(RNG *rng, float v[3]) -{ - float r; - v[2] = 2.f*BLI_rng_get_float(rng)-1.f; - if ((r = 1.f - v[2]*v[2])>0.f) { - float a = 6.283185307f*BLI_rng_get_float(rng); - r = sqrt(r); - v[0] = r * cosf(a); - v[1] = r * sinf(a); - } - else v[2] = 1.f; -} /* calc distributed spherical energy */ static void DS_energy(float *sphere, int tot, float vec[3]) @@ -1729,7 +1717,7 @@ void init_ao_sphere(World *wrld) /* init */ fp= wrld->aosphere; for (a=0; a