mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-12 03:27:55 +00:00
Decouple Smooth Normals from Realistic View (#14724)
This commit is contained in:
@@ -457,10 +457,9 @@ void GLModel::init_from(const indexed_triangle_set& its)
|
|||||||
data.reserve_indices(3 * its.indices.size());
|
data.reserve_indices(3 * its.indices.size());
|
||||||
|
|
||||||
// Read user preference: smooth normals enabled
|
// Read user preference: smooth normals enabled
|
||||||
const bool realistic_mode = wxGetApp().app_config != nullptr && wxGetApp().app_config->get_bool(SETTING_OPENGL_REALISTIC_MODE);
|
|
||||||
const bool smooth_normals_enabled = wxGetApp().app_config != nullptr && wxGetApp().app_config->get_bool(SETTING_OPENGL_PHONG_SMOOTH_NORMALS);
|
const bool smooth_normals_enabled = wxGetApp().app_config != nullptr && wxGetApp().app_config->get_bool(SETTING_OPENGL_PHONG_SMOOTH_NORMALS);
|
||||||
|
|
||||||
if (realistic_mode && smooth_normals_enabled) {
|
if (smooth_normals_enabled) {
|
||||||
// Use per-corner smooth normals (via IGL)
|
// Use per-corner smooth normals (via IGL)
|
||||||
using MapMatrixXfUnaligned = Eigen::Map<const Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor | Eigen::DontAlign>>;
|
using MapMatrixXfUnaligned = Eigen::Map<const Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor | Eigen::DontAlign>>;
|
||||||
using MapMatrixXiUnaligned = Eigen::Map<const Eigen::Matrix<int, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor | Eigen::DontAlign>>;
|
using MapMatrixXiUnaligned = Eigen::Map<const Eigen::Matrix<int, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor | Eigen::DontAlign>>;
|
||||||
|
|||||||
@@ -1797,6 +1797,17 @@ void PreferencesDialog::create_items()
|
|||||||
g_sizer = f_sizers.back();
|
g_sizer = f_sizers.back();
|
||||||
g_sizer->AddGrowableCol(0, 1);
|
g_sizer->AddGrowableCol(0, 1);
|
||||||
|
|
||||||
|
//// GRAPHICS > General
|
||||||
|
g_sizer->Add(create_item_title(_L("General")), 1, wxEXPAND);
|
||||||
|
|
||||||
|
auto smooth_normals = create_item_checkbox(
|
||||||
|
_L("Smooth normals"),
|
||||||
|
_L("Applies smooth normals to the model.\n\nRequires manual scene reload to take effect "
|
||||||
|
"(right-click on 3D view → \"Reload All\")."),
|
||||||
|
SETTING_OPENGL_PHONG_SMOOTH_NORMALS
|
||||||
|
);
|
||||||
|
g_sizer->Add(smooth_normals);
|
||||||
|
|
||||||
//// GRAPHICS > Realistic view
|
//// GRAPHICS > Realistic view
|
||||||
g_sizer->Add(create_item_title(_L("Realistic View")), 1, wxEXPAND);
|
g_sizer->Add(create_item_title(_L("Realistic View")), 1, wxEXPAND);
|
||||||
|
|
||||||
@@ -1821,15 +1832,6 @@ void PreferencesDialog::create_items()
|
|||||||
);
|
);
|
||||||
g_sizer->Add(item_realistic_shadows);
|
g_sizer->Add(item_realistic_shadows);
|
||||||
|
|
||||||
|
|
||||||
auto item_realistic_smooth_normals = create_item_checkbox(
|
|
||||||
_L("Smooth normals"),
|
|
||||||
_L("Applies smooth normals to the realistic view.\n\nRequires manual scene reload to take effect "
|
|
||||||
"(right-click on 3D view → \"Reload All\")."),
|
|
||||||
SETTING_OPENGL_PHONG_SMOOTH_NORMALS
|
|
||||||
);
|
|
||||||
g_sizer->Add(item_realistic_smooth_normals);
|
|
||||||
|
|
||||||
//// GRAPHICS > Anti-aliasing
|
//// GRAPHICS > Anti-aliasing
|
||||||
g_sizer->Add(create_item_title(_L("Anti-aliasing")), 1, wxEXPAND);
|
g_sizer->Add(create_item_title(_L("Anti-aliasing")), 1, wxEXPAND);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user