From 218634cb7e1b0241282aff113f7885e8e9acaab3 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Sat, 13 Jul 2024 21:29:37 +0200 Subject: [PATCH] Recast: slight rendering improvements - Make NavMesh light blue (original color, but more solid and vibrant). - Make Recast poly mesh and height field's darker blue, but more opaque. - Increase render thickness of outer poly boundaries (should and will be an option in the debug class soon). - Increase render size of poly verts (should and will be an option in the debug class soon). - Make gradient background color slightly more uniform with the GUI. --- src/naveditor/Editor.cpp | 2 +- src/naveditor/main.cpp | 8 ++++---- .../DebugUtils/Source/DetourDebugDraw.cpp | 10 +++++----- .../DebugUtils/Source/RecastDebugDraw.cpp | 20 +++++++++---------- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/naveditor/Editor.cpp b/src/naveditor/Editor.cpp index 85f09791..f8f3d1cc 100644 --- a/src/naveditor/Editor.cpp +++ b/src/naveditor/Editor.cpp @@ -38,7 +38,7 @@ unsigned int EditorDebugDraw::areaToCol(unsigned int area) switch(area) { // Ground (0) : light blue - case EDITOR_POLYAREA_GROUND: return duRGBA(0, 135, 255, 255); + case EDITOR_POLYAREA_GROUND: return duRGBA(0, 195, 255, 255); // Water : blue case EDITOR_POLYAREA_WATER: return duRGBA(0, 0, 255, 255); // Road : brown diff --git a/src/naveditor/main.cpp b/src/naveditor/main.cpp index f56098f4..edd86093 100644 --- a/src/naveditor/main.cpp +++ b/src/naveditor/main.cpp @@ -322,19 +322,19 @@ void draw_background(const GLfloat width, const GLfloat height) glBegin(GL_QUADS); // top-left - glColor3f(0.4f, 0.4f, 0.4f); + glColor3f(0.40f, 0.42f, 0.44f); glVertex2f(0.0f, 0.0f); // top-right - glColor3f(0.4f, 0.4f, 0.4f); + glColor3f(0.40f, 0.42f, 0.44f); glVertex2f(width, 0.0f); // bottom-right - glColor3f(0.1f, 0.1f, 0.1f); + glColor3f(0.10f, 0.12f, 0.14f); glVertex2f(width, height); // bottom-left - glColor3f(0.1f, 0.1f, 0.1f); + glColor3f(0.10f, 0.12f, 0.14f); glVertex2f(0.0f, height); glEnd(); diff --git a/src/thirdparty/recast/DebugUtils/Source/DetourDebugDraw.cpp b/src/thirdparty/recast/DebugUtils/Source/DetourDebugDraw.cpp index aa4ff72c..396d2954 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, 1.5f, true); + drawPolyBoundaries(dd, tile, 2.5f, true); // Draw outer poly boundaries if (flags & DU_DRAWNAVMESH_OUTERBOUND) - drawPolyBoundaries(dd, tile, 2.5f, false); + drawPolyBoundaries(dd, tile, 4.5f, false); // Draw poly centers if (flags & DU_DRAWNAVMESH_POLYCENTERS) @@ -253,7 +253,7 @@ 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, 3.0f); + dd->begin(DU_DRAW_POINTS, 5.0f); for (int i = 0; i < tile->header->vertCount; ++i) { const float* v = &tile->verts[i*3]; @@ -835,7 +835,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, 2.5f); + dd->begin(DU_DRAW_LINES, 4.5f); for (int i = 0; i < lmesh.npolys; ++i) { const unsigned short* p = &lmesh.polys[i*nvp*2]; @@ -887,7 +887,7 @@ void duDebugDrawTileCachePolyMesh(duDebugDraw* dd, const struct dtTileCachePolyM } dd->end(); - dd->begin(DU_DRAW_POINTS, 3.0f); + dd->begin(DU_DRAW_POINTS, 5.0f); 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 c565eb7f..b0b9ac10 100644 --- a/src/thirdparty/recast/DebugUtils/Source/RecastDebugDraw.cpp +++ b/src/thirdparty/recast/DebugUtils/Source/RecastDebugDraw.cpp @@ -233,7 +233,7 @@ void duDebugDrawCompactHeightfieldSolid(duDebugDraw* dd, const rcCompactHeightfi const unsigned char area = chf.areas[i]; unsigned int color; if (area == RC_WALKABLE_AREA) - color = duRGBA(0,192,255,64); + color = duRGBA(0,135,255,170); else if (area == RC_NULL_AREA) color = duRGBA(0,0,0,64); else @@ -400,7 +400,7 @@ void duDebugDrawHeightfieldLayer(duDebugDraw* dd, const struct rcHeightfieldLaye unsigned int col; if (area == RC_WALKABLE_AREA) - col = duLerpCol(color, duRGBA(0,192,255,64), 32); + col = duLerpCol(color, duRGBA(0,135,255,170), 32); else if (area == RC_NULL_AREA) col = duLerpCol(color, duRGBA(0,0,0,64), 32); else @@ -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, 2.5f); + dd->begin(DU_DRAW_LINES, 4.5f); 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, 3.0f); + dd->begin(DU_DRAW_POINTS, 5.0f); for (int i = 0; i < cset.nconts; ++i) { @@ -654,11 +654,11 @@ void duDebugDrawPolyMesh(duDebugDraw* dd, const struct rcPolyMesh& mesh) unsigned int color; if (area == RC_WALKABLE_AREA) - color = duRGBA(0,192,255,64); + color = duRGBA(0,135,255,170); else if (area == RC_NULL_AREA) color = duRGBA(0,0,0,64); else - color = duTransCol(dd->areaToCol(area), 64); + color = duTransCol(dd->areaToCol(area), 170); unsigned short vi[3]; for (int j = 2; j < nvp; ++j) @@ -706,7 +706,7 @@ void duDebugDrawPolyMesh(duDebugDraw* dd, const struct rcPolyMesh& mesh) // Draw boundary edges const unsigned int colb = duRGBA(0,48,64,220); - dd->begin(DU_DRAW_LINES, 2.5f); + dd->begin(DU_DRAW_LINES, 4.5f); 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) } dd->end(); - dd->begin(DU_DRAW_POINTS, 3.0f); + dd->begin(DU_DRAW_POINTS, 5.0f); 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, 2.5f); + dd->begin(DU_DRAW_LINES, 4.5f); 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, 3.0f); + dd->begin(DU_DRAW_POINTS, 5.0f); const unsigned int colv = duRGBA(0,0,0,64); for (int i = 0; i < dmesh.nmeshes; ++i) {