diff options
author | Morten Mikkelsen <mikkelsen7@gmail.com> | 2012-12-20 09:03:00 +0400 |
---|---|---|
committer | Morten Mikkelsen <mikkelsen7@gmail.com> | 2012-12-20 09:03:00 +0400 |
commit | 6ccadbc6d6d059723b70548511b15b6539882259 (patch) | |
tree | 42497d201257d2e37d1185483128b2307edab46f /source/blender/render | |
parent | 423994bf396869f9eab2ad252abe5c034ca8181e (diff) |
must use permutation table
Diffstat (limited to 'source/blender/render')
-rw-r--r-- | source/blender/render/intern/source/multires_bake.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/render/intern/source/multires_bake.c b/source/blender/render/intern/source/multires_bake.c index 50be28bdc12..0c2d58172f0 100644 --- a/source/blender/render/intern/source/multires_bake.c +++ b/source/blender/render/intern/source/multires_bake.c @@ -1129,8 +1129,8 @@ static void apply_ao_callback(DerivedMesh *lores_dm, DerivedMesh *hires_dm, cons /* use N-Rooks to distribute our N ray samples across * a multi-dimensional domain (2D) */ - const unsigned short I = ao_random_table_1[(i + perm_offs) % ao_data->number_of_rays]; - const unsigned short J = ao_random_table_2[i]; + const unsigned short I = ao_data->permutation_table_1[(i + perm_offs) % ao_data->number_of_rays]; + const unsigned short J = ao_data->permutation_table_2[i]; const float JitPh = (get_ao_random2(I + perm_offs) & (MAX_NUMBER_OF_AO_RAYS-1))/((float) MAX_NUMBER_OF_AO_RAYS); const float JitTh = (get_ao_random1(J + perm_offs) & (MAX_NUMBER_OF_AO_RAYS-1))/((float) MAX_NUMBER_OF_AO_RAYS); @@ -1141,7 +1141,7 @@ static void apply_ao_callback(DerivedMesh *lores_dm, DerivedMesh *hires_dm, cons * weighted distribution relative to the north pole. */ float SiPhi = sqrt(SiSqPhi); - float CoPhi = SiSqPhi < 1.0f ? sqrtf(1.0f - SiSqPhi) : 1.0f - SiSqPhi; + float CoPhi = SiSqPhi < 1.0f ? sqrtf(1.0f - SiSqPhi) : 0; float CoThe = cos(Theta); float SiThe = sin(Theta); |