File: layers3d.shader

package info (click to toggle)
cura 5.0.0-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 122,888 kB
  • sloc: python: 44,572; sh: 81; xml: 32; makefile: 16
file content (447 lines) | stat: -rw-r--r-- 19,793 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
[shaders]
vertex41core =
    #version 410
    uniform highp mat4 u_modelMatrix;
    uniform highp mat4 u_viewMatrix;
    uniform highp mat4 u_projectionMatrix;

    uniform lowp float u_active_extruder;
    uniform lowp float u_max_feedrate;
    uniform lowp float u_min_feedrate;
    uniform lowp float u_max_thickness;
    uniform lowp float u_min_thickness;
    uniform lowp float u_max_line_width;
    uniform lowp float u_min_line_width;
    uniform lowp float u_max_flow_rate;
    uniform lowp float u_min_flow_rate;
    uniform lowp int u_layer_view_type;
    uniform lowp mat4 u_extruder_opacity;  // currently only for max 16 extruders, others always visible

    uniform highp mat4 u_normalMatrix;

    in highp vec4 a_vertex;
    in lowp vec4 a_color;
    in lowp vec4 a_material_color;
    in highp vec4 a_normal;
    in highp vec2 a_line_dim;  // line width and thickness
    in highp float a_extruder;
    in highp float a_prev_line_type;
    in highp float a_line_type;
    in highp float a_feedrate;
    in highp float a_thickness;

    out lowp vec4 v_color;

    out highp vec3 v_vertex;
    out highp vec3 v_normal;
    out lowp vec2 v_line_dim;
    out highp int v_extruder;
    out highp mat4 v_extruder_opacity;
    out float v_prev_line_type;
    out float v_line_type;

    out lowp vec4 f_color;
    out highp vec3 f_vertex;
    out highp vec3 f_normal;

    vec4 feedrateGradientColor(float abs_value, float min_value, float max_value)
    {
        float value;
        if(abs(max_value - min_value) < 0.0001) //Max and min are equal (barring floating point rounding errors).
        {
            value = 0.5; //Pick a colour in exactly the middle of the range.
        }
        else
        {
            value = (abs_value - min_value) / (max_value - min_value);
        }
        float red = value;
        float green = 1.0 - abs(1.0 - 4.0 * value);
        if (value > 0.375)
        {
            green = 0.5;
        }
        float blue = max(1.0 - 4.0 * value, 0.0);
        return vec4(red, green, blue, 1.0);
    }

    vec4 layerThicknessGradientColor(float abs_value, float min_value, float max_value)
    {
        float value;
        if(abs(max_value - min_value) < 0.0001) //Max and min are equal (barring floating point rounding errors).
        {
            value = 0.5; //Pick a colour in exactly the middle of the range.
        }
        else
        {
            value = (abs_value - min_value) / (max_value - min_value);
        }
        float red = min(max(4.0 * value - 2.0, 0.0), 1.0);
        float green = min(1.5*value, 0.75);
        if (value > 0.75)
        {
            green = value;
        }
        float blue = 0.75-abs(0.25-value);
        return vec4(red, green, blue, 1.0);
    }

    vec4 lineWidthGradientColor(float abs_value, float min_value, float max_value)
    {
        float value;
        if(abs(max_value - min_value) < 0.0001) //Max and min are equal (barring floating point rounding errors).
        {
            value = 0.5; //Pick a colour in exactly the middle of the range.
        }
        else
        {
            value = (abs_value - min_value) / (max_value - min_value);
        }
        float red = value;
        float green = 1.0 - abs(1.0 - 4.0 * value);
        if(value > 0.375)
        {
            green = 0.5;
        }
        float blue = max(1.0 - 4.0 * value, 0.0);
        return vec4(red, green, blue, 1.0);
    }

    float clamp(float v)
    {
        float t = v < 0.0 ? 0.0 : v;
        return t > 1.0 ? 1.0 : t;
    }

    // Inspired by https://stackoverflow.com/a/46628410
    vec4 flowRateGradientColor(float abs_value, float min_value, float max_value)
    {
        float t;
        if(abs(min_value - max_value) < 0.0001)
        {
          t = 0;
        }
        else
        {
          t = 2.0 * ((abs_value - min_value) / (max_value - min_value)) - 1;
        }
        float red = clamp(1.5 - abs(2.0 * t - 1.0));
        float green = clamp(1.5 - abs(2.0 * t));
        float blue = clamp(1.5 - abs(2.0 * t + 1.0));
        return vec4(red, green, blue, 1.0);
    }

    void main()
    {
        vec4 v1_vertex = a_vertex;
        v1_vertex.y -= a_line_dim.y / 2;  // half layer down

        vec4 world_space_vert = u_modelMatrix * v1_vertex;
        gl_Position = world_space_vert;
        // shade the color depending on the extruder index stored in the alpha component of the color

        switch (u_layer_view_type) {
            case 0:  // "Material color"
                v_color = a_material_color;
                break;
            case 1:  // "Line type"
                v_color = a_color;
                break;
            case 2:  // "Speed", or technically 'Feedrate'
                v_color = feedrateGradientColor(a_feedrate, u_min_feedrate, u_max_feedrate);
                break;
            case 3:  // "Layer thickness"
                v_color = layerThicknessGradientColor(a_line_dim.y, u_min_thickness, u_max_thickness);
                break;
            case 4:  // "Line width"
                v_color = lineWidthGradientColor(a_line_dim.x, u_min_line_width, u_max_line_width);
                break;
            case 5:  // "Flow"
                float flow_rate =  a_line_dim.x * a_line_dim.y * a_feedrate;
                v_color = flowRateGradientColor(flow_rate, u_min_flow_rate, u_max_flow_rate);
                break;
        }

        v_vertex = world_space_vert.xyz;
        v_normal = (u_normalMatrix * normalize(a_normal)).xyz;
        v_line_dim = a_line_dim;
        v_extruder = int(a_extruder);
        v_prev_line_type = a_prev_line_type;
        v_line_type = a_line_type;
        v_extruder_opacity = u_extruder_opacity;

        // for testing without geometry shader
        f_color = v_color;
        f_vertex = v_vertex;
        f_normal = v_normal;
    }

geometry41core =
    #version 410

    uniform highp mat4 u_modelMatrix;
    uniform highp mat4 u_viewMatrix;
    uniform highp mat4 u_projectionMatrix;

    uniform lowp vec4 u_starts_color;

    uniform int u_show_travel_moves;
    uniform int u_show_helpers;
    uniform int u_show_skin;
    uniform int u_show_infill;
    uniform int u_show_starts;

    layout(lines) in;
    layout(triangle_strip, max_vertices = 40) out;

    in vec4 v_color[];
    in vec3 v_vertex[];
    in vec3 v_normal[];
    in lowp vec2 v_line_dim[];
    in int v_extruder[];
    in mat4 v_extruder_opacity[];
    in float v_prev_line_type[];
    in float v_line_type[];

    out vec4 f_color;
    out vec3 f_normal;
    out vec3 f_vertex;

    // Set the set of variables and EmitVertex
    void myEmitVertex(vec3 vertex, vec4 color, vec3 normal, vec4 pos) {
        f_vertex = vertex;
        f_color = color;
        f_normal = normal;
        gl_Position = pos;
        EmitVertex();
    }

    void main()
    {
        highp mat4 viewProjectionMatrix = u_projectionMatrix * u_viewMatrix;

        vec4 g_vertex_delta;
        vec3 g_vertex_normal_horz;  // horizontal and vertical in respect to layers
        vec4 g_vertex_offset_horz;  // vec4 to match gl_in[x].gl_Position
        vec3 g_vertex_normal_vert;
        vec4 g_vertex_offset_vert;
        vec3 g_vertex_normal_horz_head;
        vec4 g_vertex_offset_horz_head;

        float size_x;
        float size_y;

        if ((v_extruder_opacity[0][int(mod(v_extruder[0], 4))][v_extruder[0] / 4] == 0.0) && (v_line_type[0] != 8) && (v_line_type[0] != 9)) {
            return;
        }
        // See LayerPolygon; 8 is MoveCombingType, 9 is RetractionType
        if ((u_show_travel_moves == 0) && ((v_line_type[0] == 8) || (v_line_type[0] == 9))) {
            return;
        }
        if ((u_show_helpers == 0) && ((v_line_type[0] == 4) || (v_line_type[0] == 5) || (v_line_type[0] == 7) || (v_line_type[0] == 10) || v_line_type[0] == 11)) {
            return;
        }
        if ((u_show_skin == 0) && ((v_line_type[0] == 1) || (v_line_type[0] == 2) || (v_line_type[0] == 3))) {
            return;
        }
        if ((u_show_infill == 0) && (v_line_type[0] == 6)) {
            return;
        }

        if ((v_line_type[0] == 8) || (v_line_type[0] == 9)) {
            // fixed size for movements
            size_x = 0.05;
        } else {
            size_x = v_line_dim[1].x / 2 + 0.01;  // radius, and make it nicely overlapping
        }
        size_y = v_line_dim[1].y / 2 + 0.01;

        g_vertex_delta = gl_in[1].gl_Position - gl_in[0].gl_Position; //Actual movement exhibited by the line.
        g_vertex_normal_horz_head = normalize(vec3(-g_vertex_delta.x, -g_vertex_delta.y, -g_vertex_delta.z)); //Lengthwise normal vector pointing backwards.
        g_vertex_offset_horz_head = vec4(g_vertex_normal_horz_head * size_x, 0.0); //Lengthwise offset vector pointing backwards.

        g_vertex_normal_horz = normalize(vec3(g_vertex_delta.z, g_vertex_delta.y, -g_vertex_delta.x)); //Normal vector pointing right.
        g_vertex_offset_horz = vec4(g_vertex_normal_horz * size_x, 0.0); //Offset vector pointing right.

        g_vertex_normal_vert = vec3(0.0, 1.0, 0.0); //Upwards normal vector.
        g_vertex_offset_vert = vec4(g_vertex_normal_vert * size_y, 0.0); //Upwards offset vector. Goes up by half the layer thickness.

        if ((v_line_type[0] == 8) || (v_line_type[0] == 9)) { //Travel or retraction moves.
            vec4 va_head = viewProjectionMatrix * (gl_in[0].gl_Position + g_vertex_offset_horz_head + g_vertex_offset_vert);
            vec4 va_up =  viewProjectionMatrix * (gl_in[0].gl_Position + g_vertex_offset_horz + g_vertex_offset_vert);
            vec4 va_down = viewProjectionMatrix * (gl_in[0].gl_Position - g_vertex_offset_horz + g_vertex_offset_vert);
            vec4 vb_head =  viewProjectionMatrix * (gl_in[1].gl_Position - g_vertex_offset_horz_head + g_vertex_offset_vert);
            vec4 vb_down = viewProjectionMatrix * (gl_in[1].gl_Position - g_vertex_offset_horz + g_vertex_offset_vert);
            vec4 vb_up = viewProjectionMatrix * (gl_in[1].gl_Position + g_vertex_offset_horz + g_vertex_offset_vert);

            // Travels: flat plane with pointy ends
            myEmitVertex(v_vertex[0], v_color[1], g_vertex_normal_vert, va_up);
            myEmitVertex(v_vertex[0], v_color[1], g_vertex_normal_vert, va_head);
            myEmitVertex(v_vertex[0], v_color[1], g_vertex_normal_vert, va_down);
            myEmitVertex(v_vertex[0], v_color[1], g_vertex_normal_vert, va_up);
            myEmitVertex(v_vertex[1], v_color[1], g_vertex_normal_vert, vb_down);
            myEmitVertex(v_vertex[1], v_color[1], g_vertex_normal_vert, vb_up);
            myEmitVertex(v_vertex[1], v_color[1], g_vertex_normal_vert, vb_head);
            //And reverse so that the line is also visible from the back side.
            myEmitVertex(v_vertex[1], v_color[1], g_vertex_normal_vert, vb_up);
            myEmitVertex(v_vertex[1], v_color[1], g_vertex_normal_vert, vb_down);
            myEmitVertex(v_vertex[0], v_color[1], g_vertex_normal_vert, va_up);
            myEmitVertex(v_vertex[0], v_color[1], g_vertex_normal_vert, va_down);
            myEmitVertex(v_vertex[0], v_color[1], g_vertex_normal_vert, va_head);
            myEmitVertex(v_vertex[0], v_color[1], g_vertex_normal_vert, va_up);

            EndPrimitive();
        } else {
            vec4 va_m_horz = viewProjectionMatrix * (gl_in[0].gl_Position - g_vertex_offset_horz); //Line start, left vertex.
            vec4 vb_m_horz = viewProjectionMatrix * (gl_in[1].gl_Position - g_vertex_offset_horz); //Line end, left vertex.
            vec4 va_p_vert = viewProjectionMatrix * (gl_in[0].gl_Position + g_vertex_offset_vert); //Line start, top vertex.
            vec4 vb_p_vert = viewProjectionMatrix * (gl_in[1].gl_Position + g_vertex_offset_vert); //Line end, top vertex.
            vec4 va_p_horz = viewProjectionMatrix * (gl_in[0].gl_Position + g_vertex_offset_horz); //Line start, right vertex.
            vec4 vb_p_horz = viewProjectionMatrix * (gl_in[1].gl_Position + g_vertex_offset_horz); //Line end, right vertex.
            vec4 va_m_vert = viewProjectionMatrix * (gl_in[0].gl_Position - g_vertex_offset_vert); //Line start, bottom vertex.
            vec4 vb_m_vert = viewProjectionMatrix * (gl_in[1].gl_Position - g_vertex_offset_vert); //Line end, bottom vertex.
            vec4 va_head   = viewProjectionMatrix * (gl_in[0].gl_Position + g_vertex_offset_horz_head); //Line start, tip.
            vec4 vb_head   = viewProjectionMatrix * (gl_in[1].gl_Position - g_vertex_offset_horz_head); //Line end, tip.

            // All normal lines are rendered as 3d tubes.
            myEmitVertex(v_vertex[0], v_color[1], -g_vertex_normal_horz, va_m_horz);
            myEmitVertex(v_vertex[1], v_color[1], -g_vertex_normal_horz, vb_m_horz);
            myEmitVertex(v_vertex[0], v_color[1], g_vertex_normal_vert, va_p_vert);
            myEmitVertex(v_vertex[1], v_color[1], g_vertex_normal_vert, vb_p_vert);
            myEmitVertex(v_vertex[0], v_color[1], g_vertex_normal_horz, va_p_horz);
            myEmitVertex(v_vertex[1], v_color[1], g_vertex_normal_horz, vb_p_horz);
            myEmitVertex(v_vertex[0], v_color[1], -g_vertex_normal_vert, va_m_vert);
            myEmitVertex(v_vertex[1], v_color[1], -g_vertex_normal_vert, vb_m_vert);
            myEmitVertex(v_vertex[0], v_color[1], -g_vertex_normal_horz, va_m_horz);
            myEmitVertex(v_vertex[1], v_color[1], -g_vertex_normal_horz, vb_m_horz);

            EndPrimitive();

            // left side
            myEmitVertex(v_vertex[0], v_color[1], -g_vertex_normal_horz, va_m_horz);
            myEmitVertex(v_vertex[0], v_color[1], g_vertex_normal_vert, va_p_vert);
            myEmitVertex(v_vertex[0], v_color[1], g_vertex_normal_horz_head, va_head);
            myEmitVertex(v_vertex[0], v_color[1], g_vertex_normal_horz, va_p_horz);

            EndPrimitive();

            myEmitVertex(v_vertex[0], v_color[1], g_vertex_normal_horz, va_p_horz);
            myEmitVertex(v_vertex[0], v_color[1], -g_vertex_normal_vert, va_m_vert);
            myEmitVertex(v_vertex[0], v_color[1], g_vertex_normal_horz_head, va_head);
            myEmitVertex(v_vertex[0], v_color[1], -g_vertex_normal_horz, va_m_horz);

            EndPrimitive();

            // right side
            myEmitVertex(v_vertex[1], v_color[1], g_vertex_normal_horz, vb_p_horz);
            myEmitVertex(v_vertex[1], v_color[1], g_vertex_normal_vert, vb_p_vert);
            myEmitVertex(v_vertex[1], v_color[1], -g_vertex_normal_horz_head, vb_head);
            myEmitVertex(v_vertex[1], v_color[1], -g_vertex_normal_horz, vb_m_horz);

            EndPrimitive();

            myEmitVertex(v_vertex[1], v_color[1], -g_vertex_normal_horz, vb_m_horz);
            myEmitVertex(v_vertex[1], v_color[1], -g_vertex_normal_vert, vb_m_vert);
            myEmitVertex(v_vertex[1], v_color[1], -g_vertex_normal_horz_head, vb_head);
            myEmitVertex(v_vertex[1], v_color[1], g_vertex_normal_horz, vb_p_horz);

            EndPrimitive();
        }

        if ((u_show_starts == 1) && (v_prev_line_type[0] != 1) && (v_line_type[0] == 1)) {
            float w = size_x;
            float h = size_y;

            myEmitVertex(v_vertex[0] + vec3( w,  h,  w), u_starts_color, normalize(vec3( 1.0,  1.0,  1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4( w,  h,  w, 0.0))); // Front-top-left
            myEmitVertex(v_vertex[0] + vec3(-w,  h,  w), u_starts_color, normalize(vec3(-1.0,  1.0,  1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4(-w,  h,  w, 0.0))); // Front-top-right
            myEmitVertex(v_vertex[0] + vec3( w, -h,  w), u_starts_color, normalize(vec3( 1.0, -1.0,  1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4( w, -h,  w, 0.0))); // Front-bottom-left
            myEmitVertex(v_vertex[0] + vec3(-w, -h,  w), u_starts_color, normalize(vec3(-1.0, -1.0,  1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4(-w, -h,  w, 0.0))); // Front-bottom-right
            myEmitVertex(v_vertex[0] + vec3(-w, -h, -w), u_starts_color, normalize(vec3(-1.0, -1.0, -1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4(-w, -h, -w, 0.0))); // Back-bottom-right
            myEmitVertex(v_vertex[0] + vec3(-w,  h,  w), u_starts_color, normalize(vec3(-1.0,  1.0,  1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4(-w,  h,  w, 0.0))); // Front-top-right
            myEmitVertex(v_vertex[0] + vec3(-w,  h, -w), u_starts_color, normalize(vec3(-1.0,  1.0, -1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4(-w,  h, -w, 0.0))); // Back-top-right
            myEmitVertex(v_vertex[0] + vec3( w,  h,  w), u_starts_color, normalize(vec3( 1.0,  1.0,  1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4( w,  h,  w, 0.0))); // Front-top-left
            myEmitVertex(v_vertex[0] + vec3( w,  h, -w), u_starts_color, normalize(vec3( 1.0,  1.0, -1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4( w,  h, -w, 0.0))); // Back-top-left
            myEmitVertex(v_vertex[0] + vec3( w, -h,  w), u_starts_color, normalize(vec3( 1.0, -1.0,  1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4( w, -h,  w, 0.0))); // Front-bottom-left
            myEmitVertex(v_vertex[0] + vec3( w, -h, -w), u_starts_color, normalize(vec3( 1.0, -1.0, -1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4( w, -h, -w, 0.0))); // Back-bottom-left
            myEmitVertex(v_vertex[0] + vec3(-w, -h, -w), u_starts_color, normalize(vec3(-1.0, -1.0, -1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4(-w, -h, -w, 0.0))); // Back-bottom-right
            myEmitVertex(v_vertex[0] + vec3( w,  h, -w), u_starts_color, normalize(vec3( 1.0,  1.0, -1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4( w,  h, -w, 0.0))); // Back-top-left
            myEmitVertex(v_vertex[0] + vec3(-w,  h, -w), u_starts_color, normalize(vec3(-1.0,  1.0, -1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4(-w,  h, -w, 0.0))); // Back-top-right

            EndPrimitive();
        }
    }

fragment41core =
    #version 410
    in lowp vec4 f_color;
    in lowp vec3 f_normal;
    in lowp vec3 f_vertex;

    out vec4 frag_color;

    uniform mediump vec4 u_ambientColor;
    uniform mediump vec4 u_minimumAlbedo;
    uniform highp vec3 u_lightPosition;

    void main()
    {
        mediump vec4 finalColor = vec4(0.0);
        float alpha = f_color.a;

        finalColor.rgb += f_color.rgb * 0.2 + u_minimumAlbedo.rgb;

        highp vec3 normal = normalize(f_normal);
        highp vec3 light_dir = normalize(u_lightPosition - f_vertex);

        // Diffuse Component
        highp float NdotL = clamp(dot(normal, light_dir), 0.0, 1.0);
        finalColor += (NdotL * f_color);
        finalColor.a = alpha;  // Do not change alpha in any way

        frag_color = finalColor;
    }


[defaults]
u_active_extruder = 0.0
u_layer_view_type = 0
u_extruder_opacity = [[1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0]]

u_specularColor = [0.4, 0.4, 0.4, 1.0]
u_ambientColor = [0.3, 0.3, 0.3, 0.0]
u_diffuseColor = [1.0, 0.79, 0.14, 1.0]
u_minimumAlbedo = [0.1, 0.1, 0.1, 1.0]
u_shininess = 20.0

u_starts_color = [1.0, 1.0, 1.0, 1.0]

u_show_travel_moves = 0
u_show_helpers = 1
u_show_skin = 1
u_show_infill = 1
u_show_starts = 1

u_min_feedrate = 0
u_max_feedrate = 1

u_min_thickness = 0
u_max_thickness = 1

[bindings]
u_modelMatrix = model_matrix
u_viewMatrix = view_matrix
u_projectionMatrix = projection_matrix
u_normalMatrix = normal_matrix
u_lightPosition = light_0_position

[attributes]
a_vertex = vertex
a_color = color
a_normal = normal
a_line_dim = line_dim
a_extruder = extruder
a_material_color = material_color
a_prev_line_type = prev_line_type
a_line_type = line_type
a_feedrate = feedrate
a_thickness = thickness