diff options
author | mano-wii <germano.costa@ig.com.br> | 2019-05-04 22:44:44 +0300 |
---|---|---|
committer | mano-wii <germano.costa@ig.com.br> | 2019-05-04 22:46:02 +0300 |
commit | d32a103d53c46317ca2dd8bcf7c666782c05562f (patch) | |
tree | ec46c07fe1e082adc2ad2a9d5e437c183e697642 /source/blender/gpu | |
parent | c68c81a870baa438a45e870aee677178632cce18 (diff) |
Fix T63789: Precision issues in glsl noise texture
There is a significant precision loss when converting large float values to int.
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_material.glsl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl index cf7a83e8a87..1cbf58f9d16 100644 --- a/source/blender/gpu/shaders/gpu_shader_material.glsl +++ b/source/blender/gpu/shaders/gpu_shader_material.glsl @@ -1162,8 +1162,9 @@ vec3 cellnoise_color(vec3 p) float floorfrac(float x, out int i) { - i = floor_to_int(x); - return x - i; + float x_floor = floor(x); + i = int(x_floor); + return x - x_floor; } /* bsdfs */ |