Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormano-wii <germano.costa@ig.com.br>2019-05-04 22:44:44 +0300
committermano-wii <germano.costa@ig.com.br>2019-05-04 22:46:02 +0300
commitd32a103d53c46317ca2dd8bcf7c666782c05562f (patch)
treeec46c07fe1e082adc2ad2a9d5e437c183e697642
parentc68c81a870baa438a45e870aee677178632cce18 (diff)
Fix T63789: Precision issues in glsl noise texture
There is a significant precision loss when converting large float values to int.
-rw-r--r--source/blender/gpu/shaders/gpu_shader_material.glsl5
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 */