Toggle vertex color
This commit is contained in:
@@ -1881,6 +1881,13 @@ void MapView::setupViewMenu()
|
||||
_world->renderer()->markTerrainParamsUniformBlockDirty();
|
||||
});
|
||||
|
||||
ADD_TOGGLE_POST(view_menu, "Vertex Color", Qt::SHIFT | Qt::Key_F6, _draw_vertex_color,
|
||||
[=]
|
||||
{
|
||||
_world->renderer()->getTerrainParamsUniformBlock()->draw_vertex_color = _draw_vertex_color.get();
|
||||
_world->renderer()->markTerrainParamsUniformBlockDirty();
|
||||
});
|
||||
|
||||
ADD_TOGGLE (view_menu, "Toggle Animation", Qt::Key_F11, _draw_model_animations);
|
||||
ADD_TOGGLE (view_menu, "Draw fog", Qt::Key_F12, _draw_fog);
|
||||
ADD_TOGGLE_NS (view_menu, "Flight Bounds", _draw_mfbo);
|
||||
@@ -2083,6 +2090,7 @@ void MapView::setupHotkeys()
|
||||
alloff_doodads = _draw_wmo_doodads.get();
|
||||
alloff_contour = _draw_contour.get();
|
||||
alloff_climb = _draw_climb.get();
|
||||
alloff_vertex_color = _draw_vertex_color.get();
|
||||
alloff_wmo = _draw_wmo.get();
|
||||
alloff_fog = _draw_fog.get();
|
||||
alloff_terrain = _draw_terrain.get();
|
||||
@@ -2091,6 +2099,7 @@ void MapView::setupHotkeys()
|
||||
_draw_wmo_doodads.set (false);
|
||||
_draw_contour.set (true);
|
||||
_draw_climb.set (false);
|
||||
_draw_vertex_color.set(true);
|
||||
_draw_wmo.set (false);
|
||||
_draw_terrain.set (true);
|
||||
_draw_fog.set (false);
|
||||
@@ -2101,6 +2110,7 @@ void MapView::setupHotkeys()
|
||||
_draw_wmo_doodads.set (alloff_doodads);
|
||||
_draw_contour.set (alloff_contour);
|
||||
_draw_climb.set(alloff_climb);
|
||||
_draw_vertex_color.set(alloff_vertex_color);
|
||||
_draw_wmo.set (alloff_wmo);
|
||||
_draw_terrain.set (alloff_terrain);
|
||||
_draw_fog.set (alloff_fog);
|
||||
|
||||
@@ -136,6 +136,7 @@ private:
|
||||
void checkInputsSettings();
|
||||
|
||||
public:
|
||||
Noggit::BoolToggleProperty _draw_vertex_color = {true};
|
||||
Noggit::BoolToggleProperty _draw_climb = {false};
|
||||
Noggit::BoolToggleProperty _draw_contour = {false};
|
||||
Noggit::BoolToggleProperty _draw_mfbo = {false};
|
||||
@@ -210,6 +211,7 @@ private:
|
||||
bool alloff_fog = false;
|
||||
bool alloff_terrain = false;
|
||||
bool alloff_climb = false;
|
||||
bool alloff_vertex_color = false;
|
||||
|
||||
editing_mode terrainMode = editing_mode::ground;
|
||||
editing_mode saveterrainMode = terrainMode;
|
||||
|
||||
@@ -32,6 +32,8 @@ layout (std140) uniform overlay_params
|
||||
int climb_use_output_angle;
|
||||
int climb_use_smooth_interpolation;
|
||||
float climb_value;
|
||||
int draw_vertex_color;
|
||||
int padding[3];
|
||||
};
|
||||
|
||||
struct ChunkInstanceData
|
||||
@@ -253,7 +255,10 @@ void main()
|
||||
out_color.a = 1.0;
|
||||
|
||||
// apply vertex color
|
||||
if (draw_vertex_color != 0)
|
||||
{
|
||||
out_color.rgb *= vary_mccv;
|
||||
}
|
||||
|
||||
// apply world lighting
|
||||
out_color.rgb = clamp(out_color.rgb * (currColor + lDiffuse + spc), 0.0, 1.0);
|
||||
|
||||
@@ -74,6 +74,7 @@ ViewToolbar::ViewToolbar(MapView *mapView, ViewToolbar *tb)
|
||||
add_tool_icon(mapView, &mapView->_draw_wireframe, tr("Wireframe"), FontNoggit::VISIBILITY_WIREFRAME, tb);
|
||||
add_tool_icon(mapView, &mapView->_draw_contour, tr("Contours"), FontNoggit::VISIBILITY_CONTOURS, tb);
|
||||
add_tool_icon(mapView, &mapView->_draw_climb, tr("Climb"), FontNoggit::FAVORITE, tb, tb->_climb_secondary_tool);
|
||||
add_tool_icon(mapView, &mapView->_draw_vertex_color, tr("Vertex Color"), FontNoggit::FAVORITE, tb);
|
||||
|
||||
addSeparator();
|
||||
|
||||
|
||||
@@ -57,6 +57,8 @@ namespace OpenGL
|
||||
int climb_use_output_angle = false;
|
||||
int climb_use_smooth_interpolation = false;
|
||||
float climb_value;
|
||||
int draw_vertex_color = true;
|
||||
int padding[3];
|
||||
};
|
||||
|
||||
struct ChunkInstanceDataUniformBlock
|
||||
|
||||
Reference in New Issue
Block a user