From 3f2de9ac6da34e947e1bab8569c09e7a8b4dc877 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Sun, 14 Jul 2024 20:43:57 +0200 Subject: [PATCH] Recast: improve navmesh rendering Make boundaries and vertices a bit more thin and make vertices more dark. --- src/naveditor/Editor.cpp | 2 +- .../recast/DebugUtils/Source/DetourDebugDraw.cpp | 12 ++++++------ .../recast/DebugUtils/Source/RecastDebugDraw.cpp | 12 ++++++------ 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/naveditor/Editor.cpp b/src/naveditor/Editor.cpp index 287e7351..a4d86b12 100644 --- a/src/naveditor/Editor.cpp +++ b/src/naveditor/Editor.cpp @@ -40,7 +40,7 @@ unsigned int EditorDebugDraw::areaToCol(unsigned int area) switch(area) { // Ground (0) : light blue - case EDITOR_POLYAREA_GROUND: return duRGBA(0, 195, 255, 255); + case EDITOR_POLYAREA_GROUND: return duRGBA(0, 192, 215, 255); // Water : blue case EDITOR_POLYAREA_WATER: return duRGBA(0, 0, 255, 255); // Road : brown diff --git a/src/thirdparty/recast/DebugUtils/Source/DetourDebugDraw.cpp b/src/thirdparty/recast/DebugUtils/Source/DetourDebugDraw.cpp index 2191bb61..70ac4d51 100644 --- a/src/thirdparty/recast/DebugUtils/Source/DetourDebugDraw.cpp +++ b/src/thirdparty/recast/DebugUtils/Source/DetourDebugDraw.cpp @@ -182,11 +182,11 @@ static void drawMeshTile(duDebugDraw* dd, const dtNavMesh& mesh, const dtNavMesh // Draw inner poly boundaries if (flags & DU_DRAWNAVMESH_INNERBOUND) - drawPolyBoundaries(dd, tile, 2.5f, offset, true); + drawPolyBoundaries(dd, tile, 1.5f, offset, true); // Draw outer poly boundaries if (flags & DU_DRAWNAVMESH_OUTERBOUND) - drawPolyBoundaries(dd, tile, 4.5f, offset, false); + drawPolyBoundaries(dd, tile, 3.5f, offset, false); // Draw poly centers if (flags & DU_DRAWNAVMESH_POLYCENTERS) @@ -252,8 +252,8 @@ static void drawMeshTile(duDebugDraw* dd, const dtNavMesh& mesh, const dtNavMesh if (flags & DU_DRAWNAVMESH_VERTS) { - const unsigned int vcol = duRGBA(0,0,0,196); - dd->begin(DU_DRAW_POINTS, 5.0f, offset); + const unsigned int vcol = duRGBA(0,0,0,220); + dd->begin(DU_DRAW_POINTS, 4.0f, offset); for (int i = 0; i < tile->header->vertCount; ++i) { const float* v = &tile->verts[i*3]; @@ -838,7 +838,7 @@ void duDebugDrawTileCachePolyMesh(duDebugDraw* dd, const struct dtTileCachePolyM // Draw boundary edges const unsigned int colb = duRGBA(0,48,64,220); - dd->begin(DU_DRAW_LINES, 4.5f, offset); + dd->begin(DU_DRAW_LINES, 3.5f, offset); for (int i = 0; i < lmesh.npolys; ++i) { const unsigned short* p = &lmesh.polys[i*nvp*2]; @@ -890,7 +890,7 @@ void duDebugDrawTileCachePolyMesh(duDebugDraw* dd, const struct dtTileCachePolyM } dd->end(); - dd->begin(DU_DRAW_POINTS, 5.0f, offset); + dd->begin(DU_DRAW_POINTS, 4.0f, offset); const unsigned int colv = duRGBA(0,0,0,220); for (int i = 0; i < lmesh.nverts; ++i) { diff --git a/src/thirdparty/recast/DebugUtils/Source/RecastDebugDraw.cpp b/src/thirdparty/recast/DebugUtils/Source/RecastDebugDraw.cpp index 28deb048..12e73504 100644 --- a/src/thirdparty/recast/DebugUtils/Source/RecastDebugDraw.cpp +++ b/src/thirdparty/recast/DebugUtils/Source/RecastDebugDraw.cpp @@ -583,7 +583,7 @@ void duDebugDrawContours(duDebugDraw* dd, const rcContourSet& cset, const float* const unsigned char a = (unsigned char)(alpha*255.0f); - dd->begin(DU_DRAW_LINES, 4.5f, offset); + dd->begin(DU_DRAW_LINES, 3.5f, offset); for (int i = 0; i < cset.nconts; ++i) { @@ -610,7 +610,7 @@ void duDebugDrawContours(duDebugDraw* dd, const rcContourSet& cset, const float* } dd->end(); - dd->begin(DU_DRAW_POINTS, 5.0f, offset); + dd->begin(DU_DRAW_POINTS, 4.0f, offset); for (int i = 0; i < cset.nconts; ++i) { @@ -706,7 +706,7 @@ void duDebugDrawPolyMesh(duDebugDraw* dd, const struct rcPolyMesh& mesh, const f // Draw boundary edges const unsigned int colb = duRGBA(0,48,64,220); - dd->begin(DU_DRAW_LINES, 4.5f, offset); + dd->begin(DU_DRAW_LINES, 3.5f, offset); for (int i = 0; i < mesh.npolys; ++i) { const unsigned short* p = &mesh.polys[i*nvp*2]; @@ -732,7 +732,7 @@ void duDebugDrawPolyMesh(duDebugDraw* dd, const struct rcPolyMesh& mesh, const f } dd->end(); - dd->begin(DU_DRAW_POINTS, 5.0f, offset); + dd->begin(DU_DRAW_POINTS, 4.0f, offset); const unsigned int colv = duRGBA(0,0,0,220); for (int i = 0; i < mesh.nverts; ++i) { @@ -804,7 +804,7 @@ void duDebugDrawPolyMeshDetail(duDebugDraw* dd, const struct rcPolyMeshDetail& d dd->end(); // External edges. - dd->begin(DU_DRAW_LINES, 4.5f, offset); + dd->begin(DU_DRAW_LINES, 3.5f, offset); const unsigned int cole = duRGBA(0,0,0,64); for (int i = 0; i < dmesh.nmeshes; ++i) { @@ -832,7 +832,7 @@ void duDebugDrawPolyMeshDetail(duDebugDraw* dd, const struct rcPolyMeshDetail& d } dd->end(); - dd->begin(DU_DRAW_POINTS, 5.0f, offset); + dd->begin(DU_DRAW_POINTS, 4.0f, offset); const unsigned int colv = duRGBA(0,0,0,64); for (int i = 0; i < dmesh.nmeshes; ++i) {