Commit graph

32 commits

Author SHA1 Message Date
Andrew Sun
7814605906 Merge remote-tracking branch 'upstream/main' into libvgcode
# Conflicts:
#	src/libslic3r/GCode/GCodeProcessor.cpp
#	src/libslic3r/GCode/GCodeProcessor.hpp
#	src/slic3r/CMakeLists.txt
#	src/slic3r/GUI/GCodeViewer.cpp
#	src/slic3r/GUI/GCodeViewer.hpp
#	src/slic3r/GUI/GLCanvas3D.cpp
#	src/slic3r/GUI/GLCanvas3D.hpp
#	src/slic3r/GUI/GUI_Preview.cpp
2025-11-15 11:11:20 -05:00
Andrew Sun
c92328c9cc Port libvgcode from PrusaSlicer 2.8.0
Includes (but is not limited to) the following commits:

SPE-2218 - libvgcode - Fixed color of wipe moves for speed range view
SPE-2218 - libvgcode - Fixed detection of fan speed range
SPE-2218 - libvgcode - Fixed detection of temperature range
SPE-2218 - libvgcode - Fixed colors for Actual volumetric flow rate view
SPE-2214 - Fixed detection of toolpaths bounding box in GCodeViewer
SPE-2206 - Modified LibBGCode.cmake to get latest version of libbgcode which fixed parsing of gcode lines G4
libvgcode - Fixed potential out of bound access in ViewerImpl::update_view_full_range()
Tech ENABLE_GL_CORE_PROFILE set as default
Tech ENABLE_OPENGL_ES replaced by build option SLIC3R_OPENGL_ES
libvgcode - Precompiler definition of ENABLE_OPENGL_ES moved into CMakeLists.txt
Added missing include
libvgcode - Textures setup modified to work when building using emscripten
libvgcode - small optimization
libvgcode - fixed OpenGLWrapper::unload_opengl()
libvgcode - CMakeLists.txt modified to work with emscripten
libvgcode - Replace 'glVertexAttribIPointer()' with 'glVertexAttribPointer()' in SegmentTemplate::init() for OpenGL ES
libvgcode - Replace 'xor' with '^' Bitset.hpp
libvgcode - Newer glad library for OpenGL 4.6 and OpenGL ES 3.0
libvgcode - Alternate fix in method ViewerImpl::update_heights_widths() for OpenGL ES
libvgcode - Fixes in glAssertRecentCallImpl()
libvgcode - Fixes in method ViewerImpl::update_heights_widths() for OpenGL ES
Fixed ES shaders so they work with OpenGL ES 3.0
libvgcode - Use multiple plain textures in place of texture buffers for OpenGL ES
libvgcode - Use plain textures in place of texture buffers for OpenGL ES (partial implementation using one texture per buffer)
libvgcode - refactoring of class OpenGLWrapper
libvgcode - small refactoring in shaders
libvgcode - replacement of glMapBuffer() call for OpenGL ES
Fixed warning
libvgcode - Changes into CMakeLists.txt
Fixed debug export of gcode data to be configuration indipendent
Disabled tech ENABLE_NEW_GCODE_VIEWER_DEBUG
Removed obsolete tech ENABLE_GCODE_VIEWER_DATA_CHECKING
Code cleanup and techs removal - completed
Code cleanup and techs removal - step 1
SPE-1872: Implemented G2/G3 lines discretization for gcfMarlinFirmware firmware flavour
SPE-1872: Corrections into GCodeProcessor::process_G2_G3() to match firmware code
SPE-1872: Actual speed profile - Further enhancements of imgui debug window
SPE-1872: Actual speed profile - Rework in its calculation + enhanced imgui debug window
SPE-1872: New imgui widget to show actual speed profile
SPE-1872: Fixed actual speed for seam moves and at extrusion/travel/wipe start
SPE-1872: Fixed rendering of wipe moves when actual speed view is selected
SPE-1872: Actual speed profile extended to travel and wipe moves
SPE-1872: Fixes in function recalculate_trapezoids() and method GCodeProcessor::TimeMachine::calculate_time() to smooth actual speed profile
SPE-1872: Added debug graphic to show move actual speed profile
SPE-1872: libvgcode library: replace volumetric flow rate data with mm3_per_mm to reduce memory usage
SPE-1872: Added visualization of actual volumetric flow rate
SPE-1872: Fixes in calculating actual speed
SPE-1872: Added visualization of actual speed in gcode preview
SPE-2124: Added command line option 'opengl-aa' to allow the user to turn on the automatic selection of max number of supported samples for OpenGL antialising
#12117: Reduced moire patterns by using the highest number of samples available for multisampling
New gcode visualization integration - Partially enabled imgui debug window
New gcode visualization integration - Fixed center of gravity calculation and rendering
New gcode visualization library - Interface for estimated times
New gcode visualization library - Tool marker rendering
New gcode visualization library - Axes aligned bounding boxes calculation
Removed obsolete debug code
New gcode visualization library - Added statistic of used memory
New gcode visualization library - Separation of tool colors and color changes colors to simplify client code
Added missing include
New gcode visualization library - Added print color changes detection
New gcode visualization library - Modified OpenGL ES context detection
New gcode visualization library - Another makefile cleanup
New gcode visualization library - Makefiles cleanup
New gcode visualization library - Added suppression of error 'This function or variable may be unsafe' in VS2022
New gcode visualization library - Compatibility with OpenGL ES
New gcode visualization library - Interface cleanup and documentation
New gcode visualization library - Extended interface to give access to estimated times
New gcode visualization integration - Toggling of top layer only view state
New gcode visualization integration - Removed imperial units from tool position data
Small refactoring
New gcode visualization library - Custom values for travel and wipe moves radius
New gcode visualization library - Allow customization of range colors
New gcode visualization library - Partial update of interface comments/documentation
New gcode visualization integration - Follow-up of 35ee55e29bb231fd01a2eb71ae293832a37ca65d - Better fix for toolpaths visible range when toggling options' visibility
New gcode visualization integration - Fixed toolpaths reset
New gcode visualization library - Fixed method set_option_color()
New gcode visualization library - Fixed method ViewerImpl::set_extrusion_role_color()
New gcode visualization library - Added methods to release gpu resources on demand.
New gcode visualization library - Travel and wipe moves as options
New gcode visualization integration - Fixed toolpaths visible range when toggling options' visibility
New gcode visualization integration - Fixed management of gcode preview view type
New gcode visualization - Fixed wrong include
New gcode visualization - Added missing headers
New gcode visualization - Refactoring + added missing headers
New gcode visualization - New code set as standalone library + embed glad library to load OpenGL functions
New gcode visualization - Fixed errors and warnings when building the new code as a standalone library
New gcode visualization integration - Fixed layers ordering in pre-gcode preview
New gcode visualization integration - Fixed objects' tool colors in pre-gcode preview
Code cleanup
New gcode visualization integration - Tool position properties data window
New gcode visualization integration - Fixed in export toolpaths to obj
New gcode visualization - Inlining in source code
Refactoring
New gcode visualization integration - Export toolpaths to obj
Some refactoring and warning fix
New gcode visualization integration - Customizable travel moves colors
New gcode visualization integration - Customizable options colors
New gcode visualization integration - Customizable extrusion roles colors
New gcode visualization integration - Fixed pre-gcode preview layers times
New gcode visualization integration - Modify pre-gcode preview to use the new toolpaths renderer, objects WIP
New gcode visualization - Modify pre-gcode preview to use the new toolpaths renderer, WIP (brim/skirt/wipe tower)
New gcode visualization integration - Do not reset visible range when toggling options/roles visibility
New gcode visualization - Fixed color of first vertex of top layer (when top layer only option is enabled)
New gcode visualization - Customizable travels and wipes segment radius
New gcode visualization integration - Removed tech ENABLE_GCODE_VIEWER_STATISTICS
New gcode visualization integration - Added check of OpenGL version
New gcode visualization integration - Removed GCodeProcessorResult::spiral_vase_layers
Another bunch of warnings fixes
Fixed warnings
New gcode visualization integration - Removal of old visualization
Fixed includes
New gcode visualization integration - File structure of new code separated in api + src
New gcode visualization integration - View ranges management moved to new visualizer
New gcode visualization integration - Fixed top layer only visualization for MMU printers
New gcode visualization integration - Removed dependency on imgui from new visualizer
Some refactoring
New gcode visualization integration - Removed dependency on Slic3r::GCodeProcessorResult from new visualizer
New gcode visualization integration - Moves' data conversion moved to client side
New gcode visualization: layers times refactoring
A bunch of fixes for the new gcode visualization
New gcode visualization: render in gray color layers containing pause print or custom gcode options when in Color Print view
New gcode visualization integration - Tool colors
New gcode visualization integration - Layers times
New gcode visualization integration - Travels and Extrusion roles times
Fixed detection of start/end of contiguous extrusion paths
New gcode visualization integration - Extrusion roles
New gcode visualization integration - Colors
New gcode visualization integration - Tool position
Center of gravity and tool marker may both be rendered with fixed screen size and a scaling factor
Fixed rendering of options in new gcode visualization
Tool marker NOT rendered by the new visualization code
Center of gravity marker NOT rendered by the new visualization code
Fixed toolpaths_cog shaders
Tool position window for new gcode visualization
Top layer only coloring for neww gcode visualization
Refactoring in preview's new visualization
Hidden imgui debug dialog for new visualization in preview
Synchronization of moves between old and new visualization
Fixed missing gcode window in new visualization
Rendering of debug imgui dialog moved from class libvgcode::Viewer to class libvgcode::Toolpaths + warnings fixing
Some functionality moved from class libvgcode::Viewer to class libvgcode::Toolpaths
Some refactoring and cleanup
Refatoring of PathVertex and Toolpaths::load()
SPE-1982: Tech ENABLE_NEW_GCODE_VIEWER - 1st installment of new toolpaths rendering code (WIP)
2025-09-24 22:49:14 -04:00
lane.wei
6e063bdc8d ENH: 3dbed: support rendering extruder area with different color
JIRA: STUDIO-7494
Change-Id: I717999e8b7ab1d7d350299b412a3a270c6ba7a9e
(cherry picked from commit 62b1d00d1fd6675fd067b76778d6a577dfae0c24)
2025-08-24 23:18:12 +08:00
Noisyfox
70495a3bf9 Use texture instead of texelFetch to make it smoother 2024-08-19 23:11:01 +08:00
Noisyfox
13e18d1d65 Use a 2-pass depth based outline algorithm when selected 2024-08-18 19:31:08 +08:00
SoftFever
27f140fb18 Mdel preview renders the actual colors of the filaments based on the filaments currently loaded in the AMS
Ported from BambuStudio
2024-06-16 17:15:51 +08:00
SoftFever
685de31088 Revert "Add a simple subtle outline effect by drawing back faces using wireframe mode (#2934)"
This reverts commit 0cee513416.
2023-12-05 22:05:11 +08:00
Noisyfox
0cee513416
Add a simple subtle outline effect by drawing back faces using wireframe mode (#2934)
* Add a simple subtle outline effect by drawing back faces using wireframe mode

* Show outline in white if the model color is too dark

* Make the outline algorithm more reliable

* Enable cull face, which fix render on Linux

* Fix `disable_cullface`
2023-12-03 09:27:03 +08:00
Noisyfox
03a9014d3a
Show wireframe in MMU painter gizmo (#2808)
* Remove unused shader files

* Port wireframe shader from BBS

* Enable wireframe in MMU painter

Co-Authored-By: zhou.xu <zhou.xu@bambulab.com>

---------

Co-authored-by: zhou.xu <zhou.xu@bambulab.com>
2023-11-21 17:17:22 +08:00
Noisyfox
090a9247cb Cut: Fix model rendering 2023-11-04 11:41:11 +08:00
enricoturri1966
19ad0ca4d9 Tech ENABLE_LEGACY_OPENGL_REMOVAL - Fixed calculation of normal matrices sent to shaders
(cherry picked from commit prusa3d/PrusaSlicer@c468dcbed7)
2023-11-04 11:41:06 +08:00
enricoturri1966
fe78e40cb4 Various fixes 2023-11-04 11:41:06 +08:00
Noisyfox
0d27e084f3 Fix thumbnail shader 2023-11-04 11:41:05 +08:00
enricoturri1966
1e4f16bd39 Tech ENABLE_GL_SHADERS_ATTRIBUTES - Added shaders for glsl version 140
(cherry picked from commit prusa3d/PrusaSlicer@76d1d4949b)
2023-11-04 11:41:05 +08:00
enricoturri1966
15bad7fc19 Tech ENABLE_GL_IMGUI_SHADERS - Render imgui using shaders
(cherry picked from commit prusa3d/PrusaSlicer@d0d89a4d5b)
2023-11-04 11:41:05 +08:00
enricoturri1966
71fd4084c2 Tech ENABLE_LEGACY_OPENGL_REMOVAL - porting remaining changes
(cherry picked from commit prusa3d/PrusaSlicer@2f572d3cf0 )
2023-11-04 11:41:04 +08:00
enricoturri1966
9f4713eee8 Tech ENABLE_GLBEGIN_GLEND_SHADERS_ATTRIBUTES - Use vertex attributes and matrices in shaders. 1st installment.
Shader: flat - Default bed

(cherry picked from commit prusa3d/PrusaSlicer@a5ff37013b)
2023-11-04 11:41:04 +08:00
enricoturri1966
f9de4ec399 Tech ENABLE_GLBEGIN_GLEND_REMOVAL - Removed Slic3r::GUI::GeometryBuffer from 3DBed.hpp and replaced with GLModel
(cherry picked from commit prusa3d/PrusaSlicer@6b041429f6)
2023-11-04 11:41:03 +08:00
enricoturri1966
7907426d00 Tech ENABLE_GLBEGIN_GLEND_REMOVAL - Textures rendering
(cherry picked from commit prusa3d/PrusaSlicer@1a47211bfc)
2023-11-04 11:41:03 +08:00
enricoturri1966
04ad26f611 Tech ENABLE_GLBEGIN_GLEND_REMOVAL - Background rendering
(cherry picked from commit prusa3d/PrusaSlicer@eda55701a2)
2023-11-04 11:41:01 +08:00
enricoturri1966
7f0c095446 Tech ENABLE_GLBEGIN_GLEND_REMOVAL - 1st installment - Selection bounding box
(cherry picked from commit prusa3d/PrusaSlicer@22f38235ea)
2023-11-04 11:41:00 +08:00
zhou.xu
def87a59c0 FIX:The mirrored patch normal vector needs to be reversed
Change-Id: I3a67322eb59355ed91d1af390eb34f7f3d378198
(cherry picked from commit 3187f2b7944ddd2b9b6dc621da07dac6d4b3b31f)
2023-07-07 17:25:51 +08:00
zhou.xu
507a8a6d36 NEW: add overhang highlight area
overhang rgb=(200,0,0),remove supportType,do not save para after overhang operation preview

Change-Id: I947bbd9db264f00f0609b3f02140060f9a2621fb
(cherry picked from commit 796c4460fe998da206f9ca77973a20796fa1d3ca)
2023-07-07 17:25:51 +08:00
lane.wei
90760e0d07 ENH: refine the thumbnail rendering
1. add specific shader for thumbnail
2. do not render the negative-z part
3. fix the sinking related issue under cli

Change-Id: Ia59083437544c1c0bd924c811274ccbb137e9eb7
2023-04-17 15:39:02 +08:00
zhimin.zeng
b746877d70 FIX: modify the shader load error for mac
Change-Id: I3e2b282b145b4d87e09c22d4fec1b88537212d60
2023-04-17 15:39:02 +08:00
zhimin.zeng
cd4cddfca4 ENH: Cut optimization, support for custom connectors
Change-Id: I65163314374fb74f0b16df47dacae82caa6fab0d
(cherry picked from commit 7bacc2c2a89be471f6fee51dd07a42222a28b55a)
2023-04-17 15:39:02 +08:00
lane.wei
a9a228d071 ENH: wireframe: refine the rendering logic under paint
1. remove wireframe in 3d view, only keep in paint;
2. pass barycentric_coordinates from outside
3. add shortcut hints

Change-Id: I911e5cdf3475926d9527dc0839fdce072ed54746
(cherry picked from commit 6e16d0ccfb71741e55daabd757be9f9e7613e695)
2022-12-15 04:33:48 -05:00
lane.wei
79b5c94f4f ENH: enable wireframe
This reverts commit ed6e149381240fd83b61da70891127d400f30a39.

Change-Id: I010871fcf22322214c627fe907539c0916fa6ff5
2022-12-15 04:33:48 -05:00
lane.wei
227e1f4dc3 ENH: shader: add logic to avoid error when opengl version less than 3.0
use a seperate shader for function which needs opengl 3.0 supports

Change-Id: Iff30a90211aa10ae9c4a1e36afeb331d252fb814
2022-10-20 19:34:37 +08:00
lane.wei
b4d66394e7 NEW: add the wireframe rendering mode for debug
currently we can turn on/off it by 'ctrl+shift+enter'

Change-Id: Ic9e5460e8955376e8e2c1a3701e12a1f0b4216ad
2022-10-20 19:34:37 +08:00
lane.wei
5a2b0e845e ENH: rendering: refine the rendering logic of GLVolume
1. set the unprintable volume to black even if it is mmu painted
2. add the bounding check logic when the object is partly inside of current plate

Change-Id: I69ce25eb85a71398ed8fb1d275136c5d943796d6
2022-09-02 12:52:18 +08:00
lane.wei
1555904bef Add the full source of BambuStudio
using version 1.0.10
2022-07-15 23:42:08 +08:00