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:
authorAras Pranckevicius <aras@nesnausk.org>2022-06-15 20:59:38 +0300
committerAras Pranckevicius <aras@nesnausk.org>2022-06-15 21:05:35 +0300
commit653100cd651d43daa1f814ef49d1f0d7a9a0ee52 (patch)
tree312ea5f2f41c9d559216231796be527fb1cf2eca /source/blender/io/wavefront_obj/exporter
parent004d858138fced20d45cf3cc0149fcef1922c8a0 (diff)
obj: reduce vertex colors to 4 decimal places, reenable tests
OBJ vertex color related tests were not producing identical results across various platforms, primarily due to sRGB<->Linear color space conversions. While D15193 has just made the color space conversion accuracy match much closer between platforms, it's still not 100% the same. This change reduces the amount of decimal places used for exporting vertex colors, to 4 digits (down from 6). Vertex normals were already always printed with 4 digits, and colors are conceptually similar (usually 0..1 range etc.). This makes the vertex color tests pass again, so re-enable them after adjusting to 4 decimals expectations.
Diffstat (limited to 'source/blender/io/wavefront_obj/exporter')
-rw-r--r--source/blender/io/wavefront_obj/exporter/obj_export_io.hh2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/io/wavefront_obj/exporter/obj_export_io.hh b/source/blender/io/wavefront_obj/exporter/obj_export_io.hh
index 157d7760307..5413c9969e3 100644
--- a/source/blender/io/wavefront_obj/exporter/obj_export_io.hh
+++ b/source/blender/io/wavefront_obj/exporter/obj_export_io.hh
@@ -132,7 +132,7 @@ constexpr FormattingSyntax syntax_elem_to_formatting(const eOBJSyntaxElement key
return {"v {:.6f} {:.6f} {:.6f}\n", 3, is_type_float<T...>};
}
case eOBJSyntaxElement::vertex_coords_color: {
- return {"v {:.6f} {:.6f} {:.6f} {:.6f} {:.6f} {:.6f}\n", 6, is_type_float<T...>};
+ return {"v {:.6f} {:.6f} {:.6f} {:.4f} {:.4f} {:.4f}\n", 6, is_type_float<T...>};
}
case eOBJSyntaxElement::uv_vertex_coords: {
return {"vt {:.6f} {:.6f}\n", 2, is_type_float<T...>};