mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-12 20:29:04 +08:00
Added tech DISABLE_GCODEVIEWER_INSTANCED_MODELS to easily turn on/off instanced models to render options in gcode preview
This commit is contained in:
parent
c2258dead7
commit
383f6509a9
@ -26,6 +26,8 @@
|
||||
#define ENABLE_GCODE_VIEWER_DATA_CHECKING 0
|
||||
// Enable project dirty state manager debug window
|
||||
#define ENABLE_PROJECT_DIRTY_STATE_DEBUG_WINDOW 0
|
||||
// Disable using instanced models to render options in gcode preview
|
||||
#define DISABLE_GCODEVIEWER_INSTANCED_MODELS 1
|
||||
|
||||
|
||||
// Enable rendering of objects using environment map
|
||||
|
@ -584,14 +584,16 @@ void GCodeViewer::init()
|
||||
case EMoveType::Retract:
|
||||
case EMoveType::Unretract:
|
||||
case EMoveType::Seam: {
|
||||
// if (wxGetApp().is_gl_version_greater_or_equal_to(3, 3)) {
|
||||
// buffer.render_primitive_type = TBuffer::ERenderPrimitiveType::InstancedModel;
|
||||
// buffer.shader = "gouraud_light_instanced";
|
||||
// buffer.model.model.init_from(diamond(16));
|
||||
// buffer.model.color = option_color(type);
|
||||
// buffer.model.instances.format = InstanceVBuffer::EFormat::InstancedModel;
|
||||
// }
|
||||
// else {
|
||||
#if !DISABLE_GCODEVIEWER_INSTANCED_MODELS
|
||||
if (wxGetApp().is_gl_version_greater_or_equal_to(3, 3)) {
|
||||
buffer.render_primitive_type = TBuffer::ERenderPrimitiveType::InstancedModel;
|
||||
buffer.shader = "gouraud_light_instanced";
|
||||
buffer.model.model.init_from(diamond(16));
|
||||
buffer.model.color = option_color(type);
|
||||
buffer.model.instances.format = InstanceVBuffer::EFormat::InstancedModel;
|
||||
}
|
||||
else {
|
||||
#endif // !DISABLE_GCODEVIEWER_INSTANCED_MODELS
|
||||
buffer.render_primitive_type = TBuffer::ERenderPrimitiveType::BatchedModel;
|
||||
buffer.vertices.format = VBuffer::EFormat::PositionNormal3;
|
||||
buffer.shader = "gouraud_light";
|
||||
@ -599,8 +601,10 @@ void GCodeViewer::init()
|
||||
buffer.model.data = diamond(16);
|
||||
buffer.model.color = option_color(type);
|
||||
buffer.model.instances.format = InstanceVBuffer::EFormat::BatchedModel;
|
||||
// }
|
||||
break;
|
||||
#if !DISABLE_GCODEVIEWER_INSTANCED_MODELS
|
||||
}
|
||||
#endif // !DISABLE_GCODEVIEWER_INSTANCED_MODELS
|
||||
break;
|
||||
}
|
||||
case EMoveType::Wipe:
|
||||
case EMoveType::Extrude: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user