36 Commits

Author SHA1 Message Date
Remco Burema
a6a223bcc1 Prevent 'too small' starts from not rendering.
Not actually part of CURA-12188 but I was in the neighbourhood anyway.
2024-10-24 09:50:03 +02:00
Saumya Jain
3e1ee4b266 Updated shader for support seams
Added changes in shader to show the start of the support walls too along with the model walls

CURA-11227
2024-04-23 14:28:35 +02:00
Remco Burema
d6295171dd Add the last line (when time-sim active) as a separate batch instead.
part of CURA-11521
2024-03-13 08:43:41 +01:00
Remco Burema
6e75eb34af Make lines update in real-time in the simulation-view too.
This approach does suffer from returning to exactly the same point, which can mess up the view.

part of CURA-11521
2024-03-12 23:38:09 +01:00
Ghostkeeper
41ebd593c5
Revert "Merge branch 'bremco-graphics_buffer_update'"
This reverts commit 5e60cc6208c16d966505e7a97d9bbbb0644d2716, reversing
changes made to c9feace0fbe02beb2089ec0af7be35127d7420f7.
2021-12-08 12:02:49 +01:00
Remco Burema
ac8d5fc12c
More explicit float's in shader just to be sure.
CURA-8714
2021-11-23 09:27:25 +01:00
fieldOfView
c6b6af668d Fix shader compilation on some GPUs
Some GPUs (rightly) complain about the difference between a float and an int. Fixes #10837
2021-11-18 08:04:14 +01:00
Ghostkeeper
dc28370178
Remove implicit casts and comparisons of int to float
We can't change this index to an integer, because varying variables can't be integer, even though this variable will only really be tested on vertex level. Not sure if varying was the right choice, but I don't want to change that.
This prevents a crash, probably only occurring on certain GPUs.

Contributes to issue CURA-8657.
2021-11-15 15:19:57 +01:00
Remco Burema
458fbd35f1 Merge branch 'master' into graphics_buffer_update 2021-07-25 22:30:39 +02:00
Remco Burema
96ca3b1417 Handle render-range in shader.
Instead of re-uploading the mesh each time the range changes, handle the range in the shaders with the new draw-range parameters. This does however, mean the range has to be in vertices, not in elements. This necessitates some changes to the simulation-view, and some added bits deeper in the base code. Mainly, since each time the type of a line changes, there is an extra vertex, there needs to be a type-change count available to get from 'paths' to range indices.
2021-07-25 22:26:59 +02:00
Jaime van Kessel
91c4d8b5f2
Fix rendering issue in flow view 2021-05-17 10:37:38 +02:00
Felipe Navas
62bc71572a Add flow color scheme on preview 2021-05-10 01:04:01 -03:00
Jaime van Kessel
eb3bdfc18a
Merge branch 'layer_view_statistic_limits_only_visible' of github.com:Ultimaker/Cura 2021-05-06 13:10:38 +02:00
Ghostkeeper
171d425bf6
Match precision of input to precision of previous stage output
It'd probably get cast, but this is better.

Contributes to issue CURA-8189.
2021-04-28 16:33:24 +02:00
Jim Watson
396c26ce3d
Fix for crashes on Mac 10.13 in 2010 era hardware
Not sure I understand why this works - size_x/y are for the end of the line not the start
2021-04-24 18:56:08 +01:00
Ghostkeeper
cd551555ef
Merge branch 'master' into layer_view_statistic_limits_only_visible 2021-04-15 19:30:56 +02:00
Ghostkeeper
71b217c624
Fix colour calculations if spectrum is entirely one value
If the range of the colour spectrum is 0, i.e. there is only one value for the current colour spectrum, then this would previously give a division by 0 in the shader, causing the final colour to become black. This is unexpected and makes the layer view hard to read. Instead, we'll now use the middle of the range then.
This was likely a problem for a long time but only really became visible due to the colour spectrum now showing only the range of values for the visible structures. Previously it was a problem e.g. for layer thickness if all layers had the same thickness (i.e. initial layer height == layer height).
2021-04-03 17:29:33 +02:00
Ghostkeeper
fd6dbd3ede
Draw simulation view lines with a constant colour for the entire line
All of our current layer view colour schemes are properties of a line, not of a vertex. The line has a single feedrate, a single line type, a single layer thickness, a single material colour and a single width. This is even limited by the g-code specification itself, which is unable to represent lines with varying line width. However, we store this information in the vertices, the vertex data being the only data sent to layer view since layer view is sent as polylines to the shader.

This change makes the entire line take on the colour scheme of the vertex where its representative data is stored. This data is intended for the line, not just for that vertex, so it makes sense that the entire line listens to the data of the correct vertex, not just the nearest vertex of the line's endpoint.
2021-04-03 15:40:14 +02:00
Ghostkeeper
2c33ebdd05
Document part of the vertex positions generated here
Encountered as I made a failed attempt at solving the issue with rendering transparent support. I tried to order vertices appropriately but failed miserably.
2021-03-21 23:15:15 +01:00
Ghostkeeper
dc68fbc94a
Add colour scheme for line width
Implements CURA-7741.
2021-02-19 10:10:16 +01:00
bas
f6badcaeca Added starts color to theme, and support in shader / simulationpass 2020-11-11 13:44:21 +01:00
bas
757d7eee50 layers3d.shader now detects and draws 'starts' as boxes
Also adds a "show starts" option to the SimulationViewMenuComponent and corresponding logic

SimulationPass.py adds a prev_line_types attribute to the shader, which the shader uses to compare with its line_type to detect starts.
2020-10-28 09:49:26 +01:00
Kostas Karmas
6ffd250965 Format spacing
CURA-7426
2020-05-07 14:10:45 +02:00
Remco Burema
99e99e4650
Layerview can now deal with visibility extruder nrs. 4+
part of CURA-7426
2020-05-06 18:03:32 +02:00
Remco Burema
b0418716fd
Rename 'Feedrate' to 'Speed'.
At least in the interface. Even though Feedrate is congruent with the CNCdefinition thereof, Speed is less confusing for the user.
2020-02-11 13:03:27 +01:00
Remco Burema
2e88c172c1 Reduced amount of matrix multiplication in geometry shaders. 2019-04-19 23:00:26 +02:00
Remco Burema
ed6db6c9b0 Move multiplication from Python to shaders. (Needs the same-named Uranium branch.) 2019-04-19 16:58:38 +02:00
Jaime van Kessel
ffce9bd172 Ensure that the primetower gets drawn in the right color again
CURA-5932
2019-01-04 14:59:26 +01:00
Ghostkeeper
a8493ee35d
Give black materials at least some albedo
Otherwise you can't see the diffuse reflections and the entire thing just becomes a black silhouette.
2018-09-25 11:24:48 +02:00
Diego Prado Gesto
0328050548 Change layer thickness colormap to parula-like (https://es.mathworks.com/help/matlab/ref/parula.html) 2018-01-21 17:16:18 +01:00
Ghostkeeper
1aebe32ba6
Fix winding order of left endpoint triangles
Otherwise the left side is invisible due to backface culling.
2018-01-02 16:16:52 +01:00
Ruben D
f69375691f
Reduce vertices per tube by 1
Since the tubes are symmetrical, instead of using an extra vertex to flip the winding order, I just mirror all horizontal coordinates so that the triangles flip inside out.
2017-12-13 18:58:05 +01:00
Ruben D
e36099a380
Draw backside of travel lines inverted
This adds a front-facing primitive towards the back side of every travel line, causing those lines to be visible from both sides regardless of backface culling. This doubles the number of vertices for travel moves, but due to backface culling it comes down to approximately the same performance as the original.
2017-12-13 01:44:05 +01:00
Ruben D
3666b35ff3
Fix winding order of 3D tubes
Adding a copy of the first vertex causes the winding order to reverse.
2017-12-13 01:41:36 +01:00
Diego Prado Gesto
fa00a17c78 Make UI changes in the Simulation View for adapting the color gradient
in the Feedrate color scheme. Due to the travel speed is normally very
high compared with the other speeds in the model, the gradient is now
gradual instead of linear in order to show more changes in the low
values and less changes in the high values.
Adapt also the button styles and themes' colors.
Set the play/pause button to the left and reduce the size.
2017-11-26 21:21:18 +01:00
Diego Prado Gesto
2df06bbbb9 CURA-4526 Add Simulation View plugin 2017-11-21 10:51:57 +01:00