diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2017-09-27 16:35:58 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2017-09-27 22:21:39 +0300 |
commit | 88a3323a47e08ea123c73501e97a8f053bad2557 (patch) | |
tree | f98918e73fbf4189511531705fc773c5b25e72fb /source/blender/draw/engines/eevee | |
parent | cc8c064f11060dc7157d49282f769d49d30b9439 (diff) |
Eevee: Use fmod instead of floor.
Diffstat (limited to 'source/blender/draw/engines/eevee')
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_materials.c | 12 |
1 files changed, 5 insertions, 7 deletions
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; |