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:
authorJeroen Bakker <jeroen@blender.org>2019-12-18 18:10:01 +0300
committerJeroen Bakker <jeroen@blender.org>2019-12-19 10:34:31 +0300
commit4440739699bb237da8126168117e501aec770e89 (patch)
treeeb16398ad9d5b6ace12a7dfebae804c7e3c92f63 /source/blender/draw/intern/draw_cache_extract_mesh.c
parent0971f56bac242e983db4e089f11b2fd818a0b904 (diff)
Fix T72236: UV Stretching Overlay
The ratio for area stretching was packed into an unsigned int, but could contain negative numbers. This flipped the negative numbers to high positive numbers and rendered the wrong color in the stretching overlay. I can remember during {T63755} I had to flip the sign to get the correct result, but couldn't find out why that was needed. Now I know. Reviewed By: fclem, mano-wii Differential Revision: https://developer.blender.org/D6440
Diffstat (limited to 'source/blender/draw/intern/draw_cache_extract_mesh.c')
-rw-r--r--source/blender/draw/intern/draw_cache_extract_mesh.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/draw/intern/draw_cache_extract_mesh.c b/source/blender/draw/intern/draw_cache_extract_mesh.c
index 7d0cb7c7076..4bd0aac1ecc 100644
--- a/source/blender/draw/intern/draw_cache_extract_mesh.c
+++ b/source/blender/draw/intern/draw_cache_extract_mesh.c
@@ -2721,7 +2721,7 @@ static void *extract_stretch_area_init(const MeshRenderData *mr, void *buf)
{
static GPUVertFormat format = {0};
if (format.attr_len == 0) {
- GPU_vertformat_attr_add(&format, "ratio", GPU_COMP_U16, 1, GPU_FETCH_INT_TO_FLOAT_UNIT);
+ GPU_vertformat_attr_add(&format, "ratio", GPU_COMP_I16, 1, GPU_FETCH_INT_TO_FLOAT_UNIT);
}
GPUVertBuf *vbo = buf;
@@ -2788,7 +2788,7 @@ static void mesh_stretch_area_finish(const MeshRenderData *mr, void *buf, void *
/* Convert in place to avoid an extra allocation */
uint16_t *poly_stretch = (uint16_t *)area_ratio;
for (int p = 0; p < mr->poly_len; p++) {
- poly_stretch[p] = area_ratio[p] * 65534.0f;
+ poly_stretch[p] = area_ratio[p] * SHRT_MAX;
}
/* Copy face data for each loop. */