[Bf-blender-cvs] [88a3323a47e] blender2.8: Eevee: Use fmod instead of floor.
Clément Foucault
noreply at git.blender.org
Wed Sep 27 21:21:51 CEST 2017
Commit: 88a3323a47e08ea123c73501e97a8f053bad2557
Author: Clément Foucault
Date: Wed Sep 27 15:35:58 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB88a3323a47e08ea123c73501e97a8f053bad2557
Eevee: Use fmod instead of floor.
===================================================================
M source/blender/draw/engines/eevee/eevee_materials.c
===================================================================
diff --git a/source/blender/draw/engines/eevee/eevee_materials.c b/source/blender/draw/engines/eevee/eevee_materials.c
index f8e1249cce8..a3375c91ea1 100644
--- a/source/blender/draw/engines/eevee/eevee_materials.c
+++ b/source/blender/draw/engines/eevee/eevee_materials.c
@@ -456,15 +456,13 @@ void EEVEE_update_util_texture(float offset)
/* Copy blue noise in 3rd layer */
for (int i = 0; i < 64 * 64; i++) {
float noise;
- noise = blue_noise[i][0] + offset;
- noise = noise - floorf(noise); /* fract */
+ noise = fmod(blue_noise[i][0] + offset, 1.0f);
texels_layer[i][0] = noise;
- noise = blue_noise[i][1] + offset;
- noise = noise - floorf(noise); /* fract */
- texels_layer[i][1] = noise * 0.5 + 0.5;
- texels_layer[i][2] = cosf(noise * 2.0 * M_PI);
- texels_layer[i][3] = sinf(noise * 2.0 * M_PI);
+ noise = fmod(blue_noise[i][1] + offset, 1.0f);
+ texels_layer[i][1] = noise * 0.5f + 0.5f;
+ texels_layer[i][2] = cosf(noise * 2.0f * M_PI);
+ texels_layer[i][3] = sinf(noise * 2.0f * M_PI);
}
texels_layer += 64 * 64;
More information about the Bf-blender-cvs
mailing list