From b9c03d9d2e3c2b97d3db5a98f80f21fc94fe9cd5 Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Mon, 19 Feb 2024 22:28:47 -0700 Subject: [PATCH] lightpreview: adjust drawflat colors --- lightpreview/glview.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lightpreview/glview.cpp b/lightpreview/glview.cpp index 27ba225c..3f7245b2 100644 --- a/lightpreview/glview.cpp +++ b/lightpreview/glview.cpp @@ -1454,7 +1454,10 @@ void GLView::renderBSP(const QString &file, const mbsp_t &bsp, const bspxentries for (const auto &[f, model_offset] : faces) { const int fnum = Face_GetNum(&bsp, f); const auto plane_normal = Face_Normal(&bsp, f); - const qvec3f flat_color = qvec3f{Random(), Random(), Random()}; + qvec3f flat_color = qvec3f{Random(), Random(), Random()}; + // remap to [0.5, 1] for better contrast against cracks through to the void + flat_color /= 2.0f; + flat_color += qvec3f(0.5f, 0.5f, 0.5f); const size_t first_vertex_of_face = verts.size();