mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-21 21:58:03 -06:00
Tech ENABLE_DELAYED_TRANSPARENT_VOLUMES_RENDERING set as default
This commit is contained in:
parent
d749baf6bc
commit
30d2c3787f
3 changed files with 0 additions and 31 deletions
|
@ -41,8 +41,6 @@
|
||||||
//====================
|
//====================
|
||||||
#define ENABLE_2_4_0_ALPHA1 1
|
#define ENABLE_2_4_0_ALPHA1 1
|
||||||
|
|
||||||
// Enable delayed rendering of transparent volumes
|
|
||||||
#define ENABLE_DELAYED_TRANSPARENT_VOLUMES_RENDERING (1 && ENABLE_2_4_0_ALPHA1)
|
|
||||||
// Enable the fix of importing color print view from gcode files into GCodeViewer
|
// Enable the fix of importing color print view from gcode files into GCodeViewer
|
||||||
#define ENABLE_FIX_IMPORTING_COLOR_PRINT_VIEW_INTO_GCODEVIEWER (1 && ENABLE_2_4_0_ALPHA1)
|
#define ENABLE_FIX_IMPORTING_COLOR_PRINT_VIEW_INTO_GCODEVIEWER (1 && ENABLE_2_4_0_ALPHA1)
|
||||||
// Enable drawing contours, at cut level, for sinking volumes
|
// Enable drawing contours, at cut level, for sinking volumes
|
||||||
|
|
|
@ -1450,19 +1450,13 @@ void GLCanvas3D::render()
|
||||||
glsafe(::glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT));
|
glsafe(::glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT));
|
||||||
_render_background();
|
_render_background();
|
||||||
|
|
||||||
#if ENABLE_DELAYED_TRANSPARENT_VOLUMES_RENDERING
|
|
||||||
_render_objects(GLVolumeCollection::ERenderType::Opaque);
|
_render_objects(GLVolumeCollection::ERenderType::Opaque);
|
||||||
#else
|
|
||||||
_render_objects();
|
|
||||||
#endif // ENABLE_DELAYED_TRANSPARENT_VOLUMES_RENDERING
|
|
||||||
if (!m_main_toolbar.is_enabled())
|
if (!m_main_toolbar.is_enabled())
|
||||||
_render_gcode();
|
_render_gcode();
|
||||||
_render_sla_slices();
|
_render_sla_slices();
|
||||||
_render_selection();
|
_render_selection();
|
||||||
_render_bed(!camera.is_looking_downward(), true);
|
_render_bed(!camera.is_looking_downward(), true);
|
||||||
#if ENABLE_DELAYED_TRANSPARENT_VOLUMES_RENDERING
|
|
||||||
_render_objects(GLVolumeCollection::ERenderType::Transparent);
|
_render_objects(GLVolumeCollection::ERenderType::Transparent);
|
||||||
#endif // ENABLE_DELAYED_TRANSPARENT_VOLUMES_RENDERING
|
|
||||||
|
|
||||||
_render_sequential_clearance();
|
_render_sequential_clearance();
|
||||||
#if ENABLE_RENDER_SELECTION_CENTER
|
#if ENABLE_RENDER_SELECTION_CENTER
|
||||||
|
@ -5071,12 +5065,7 @@ void GLCanvas3D::_render_bed_for_picking(bool bottom)
|
||||||
wxGetApp().plater()->get_bed().render_for_picking(*this, bottom, scale_factor);
|
wxGetApp().plater()->get_bed().render_for_picking(*this, bottom, scale_factor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if ENABLE_DELAYED_TRANSPARENT_VOLUMES_RENDERING
|
|
||||||
void GLCanvas3D::_render_objects(GLVolumeCollection::ERenderType type)
|
void GLCanvas3D::_render_objects(GLVolumeCollection::ERenderType type)
|
||||||
#else
|
|
||||||
void GLCanvas3D::_render_objects()
|
|
||||||
#endif // ENABLE_DELAYED_TRANSPARENT_VOLUMES_RENDERING
|
|
||||||
{
|
{
|
||||||
if (m_volumes.empty())
|
if (m_volumes.empty())
|
||||||
return;
|
return;
|
||||||
|
@ -5108,20 +5097,14 @@ void GLCanvas3D::_render_objects()
|
||||||
if (shader != nullptr) {
|
if (shader != nullptr) {
|
||||||
shader->start_using();
|
shader->start_using();
|
||||||
|
|
||||||
#if ENABLE_DELAYED_TRANSPARENT_VOLUMES_RENDERING
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
case GLVolumeCollection::ERenderType::Opaque:
|
case GLVolumeCollection::ERenderType::Opaque:
|
||||||
{
|
{
|
||||||
#endif // ENABLE_DELAYED_TRANSPARENT_VOLUMES_RENDERING
|
|
||||||
if (m_picking_enabled && !m_gizmos.is_dragging() && m_layers_editing.is_enabled() && (m_layers_editing.last_object_id != -1) && (m_layers_editing.object_max_z() > 0.0f)) {
|
if (m_picking_enabled && !m_gizmos.is_dragging() && m_layers_editing.is_enabled() && (m_layers_editing.last_object_id != -1) && (m_layers_editing.object_max_z() > 0.0f)) {
|
||||||
int object_id = m_layers_editing.last_object_id;
|
int object_id = m_layers_editing.last_object_id;
|
||||||
#if ENABLE_DELAYED_TRANSPARENT_VOLUMES_RENDERING
|
|
||||||
m_volumes.render(type, false, wxGetApp().plater()->get_camera().get_view_matrix(), [object_id](const GLVolume& volume) {
|
m_volumes.render(type, false, wxGetApp().plater()->get_camera().get_view_matrix(), [object_id](const GLVolume& volume) {
|
||||||
#else
|
|
||||||
m_volumes.render(GLVolumeCollection::ERenderType::Opaque, false, wxGetApp().plater()->get_camera().get_view_matrix(), [object_id](const GLVolume& volume) {
|
|
||||||
#endif // ENABLE_DELAYED_TRANSPARENT_VOLUMES_RENDERING
|
|
||||||
// Which volume to paint without the layer height profile shader?
|
// Which volume to paint without the layer height profile shader?
|
||||||
return volume.is_active && (volume.is_modifier || volume.composite_id.object_id != object_id);
|
return volume.is_active && (volume.is_modifier || volume.composite_id.object_id != object_id);
|
||||||
});
|
});
|
||||||
|
@ -5130,11 +5113,7 @@ void GLCanvas3D::_render_objects()
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// do not cull backfaces to show broken geometry, if any
|
// do not cull backfaces to show broken geometry, if any
|
||||||
#if ENABLE_DELAYED_TRANSPARENT_VOLUMES_RENDERING
|
|
||||||
m_volumes.render(type, m_picking_enabled, wxGetApp().plater()->get_camera().get_view_matrix(), [this](const GLVolume& volume) {
|
m_volumes.render(type, m_picking_enabled, wxGetApp().plater()->get_camera().get_view_matrix(), [this](const GLVolume& volume) {
|
||||||
#else
|
|
||||||
m_volumes.render(GLVolumeCollection::ERenderType::Opaque, m_picking_enabled, wxGetApp().plater()->get_camera().get_view_matrix(), [this](const GLVolume& volume) {
|
|
||||||
#endif // ENABLE_DELAYED_TRANSPARENT_VOLUMES_RENDERING
|
|
||||||
return (m_render_sla_auxiliaries || volume.composite_id.volume_id >= 0);
|
return (m_render_sla_auxiliaries || volume.composite_id.volume_id >= 0);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -5153,7 +5132,6 @@ void GLCanvas3D::_render_objects()
|
||||||
shader->start_using();
|
shader->start_using();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if ENABLE_DELAYED_TRANSPARENT_VOLUMES_RENDERING
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GLVolumeCollection::ERenderType::Transparent:
|
case GLVolumeCollection::ERenderType::Transparent:
|
||||||
|
@ -5162,9 +5140,6 @@ void GLCanvas3D::_render_objects()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
m_volumes.render(GLVolumeCollection::ERenderType::Transparent, false, wxGetApp().plater()->get_camera().get_view_matrix());
|
|
||||||
#endif // ENABLE_DELAYED_TRANSPARENT_VOLUMES_RENDERING
|
|
||||||
shader->stop_using();
|
shader->stop_using();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -895,11 +895,7 @@ private:
|
||||||
void _render_background() const;
|
void _render_background() const;
|
||||||
void _render_bed(bool bottom, bool show_axes);
|
void _render_bed(bool bottom, bool show_axes);
|
||||||
void _render_bed_for_picking(bool bottom);
|
void _render_bed_for_picking(bool bottom);
|
||||||
#if ENABLE_DELAYED_TRANSPARENT_VOLUMES_RENDERING
|
|
||||||
void _render_objects(GLVolumeCollection::ERenderType type);
|
void _render_objects(GLVolumeCollection::ERenderType type);
|
||||||
#else
|
|
||||||
void _render_objects();
|
|
||||||
#endif // ENABLE_DELAYED_TRANSPARENT_VOLUMES_RENDERING
|
|
||||||
void _render_gcode();
|
void _render_gcode();
|
||||||
void _render_selection() const;
|
void _render_selection() const;
|
||||||
void _render_sequential_clearance();
|
void _render_sequential_clearance();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue