layers3d.shader 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447
  1. [shaders]
  2. vertex41core =
  3. #version 410
  4. uniform highp mat4 u_modelMatrix;
  5. uniform highp mat4 u_viewMatrix;
  6. uniform highp mat4 u_projectionMatrix;
  7. uniform lowp float u_active_extruder;
  8. uniform lowp float u_max_feedrate;
  9. uniform lowp float u_min_feedrate;
  10. uniform lowp float u_max_thickness;
  11. uniform lowp float u_min_thickness;
  12. uniform lowp float u_max_line_width;
  13. uniform lowp float u_min_line_width;
  14. uniform lowp float u_max_flow_rate;
  15. uniform lowp float u_min_flow_rate;
  16. uniform lowp int u_layer_view_type;
  17. uniform lowp mat4 u_extruder_opacity; // currently only for max 16 extruders, others always visible
  18. uniform highp mat4 u_normalMatrix;
  19. in highp vec4 a_vertex;
  20. in lowp vec4 a_color;
  21. in lowp vec4 a_material_color;
  22. in highp vec4 a_normal;
  23. in highp vec2 a_line_dim; // line width and thickness
  24. in highp float a_extruder;
  25. in highp float a_prev_line_type;
  26. in highp float a_line_type;
  27. in highp float a_feedrate;
  28. in highp float a_thickness;
  29. out lowp vec4 v_color;
  30. out highp vec3 v_vertex;
  31. out highp vec3 v_normal;
  32. out lowp vec2 v_line_dim;
  33. out highp int v_extruder;
  34. out highp mat4 v_extruder_opacity;
  35. out float v_prev_line_type;
  36. out float v_line_type;
  37. out lowp vec4 f_color;
  38. out highp vec3 f_vertex;
  39. out highp vec3 f_normal;
  40. vec4 feedrateGradientColor(float abs_value, float min_value, float max_value)
  41. {
  42. float value;
  43. if(abs(max_value - min_value) < 0.0001) //Max and min are equal (barring floating point rounding errors).
  44. {
  45. value = 0.5; //Pick a colour in exactly the middle of the range.
  46. }
  47. else
  48. {
  49. value = (abs_value - min_value) / (max_value - min_value);
  50. }
  51. float red = value;
  52. float green = 1-abs(1-4*value);
  53. if (value > 0.375)
  54. {
  55. green = 0.5;
  56. }
  57. float blue = max(1-4*value, 0);
  58. return vec4(red, green, blue, 1.0);
  59. }
  60. vec4 layerThicknessGradientColor(float abs_value, float min_value, float max_value)
  61. {
  62. float value;
  63. if(abs(max_value - min_value) < 0.0001) //Max and min are equal (barring floating point rounding errors).
  64. {
  65. value = 0.5; //Pick a colour in exactly the middle of the range.
  66. }
  67. else
  68. {
  69. value = (abs_value - min_value) / (max_value - min_value);
  70. }
  71. float red = min(max(4*value-2, 0), 1);
  72. float green = min(1.5*value, 0.75);
  73. if (value > 0.75)
  74. {
  75. green = value;
  76. }
  77. float blue = 0.75-abs(0.25-value);
  78. return vec4(red, green, blue, 1.0);
  79. }
  80. vec4 lineWidthGradientColor(float abs_value, float min_value, float max_value)
  81. {
  82. float value;
  83. if(abs(max_value - min_value) < 0.0001) //Max and min are equal (barring floating point rounding errors).
  84. {
  85. value = 0.5; //Pick a colour in exactly the middle of the range.
  86. }
  87. else
  88. {
  89. value = (abs_value - min_value) / (max_value - min_value);
  90. }
  91. float red = value;
  92. float green = 1 - abs(1 - 4 * value);
  93. if(value > 0.375)
  94. {
  95. green = 0.5;
  96. }
  97. float blue = max(1 - 4 * value, 0);
  98. return vec4(red, green, blue, 1.0);
  99. }
  100. float clamp(float v)
  101. {
  102. float t = v < 0 ? 0 : v;
  103. return t > 1.0 ? 1.0 : t;
  104. }
  105. // Inspired by https://stackoverflow.com/a/46628410
  106. vec4 flowRateGradientColor(float abs_value, float min_value, float max_value)
  107. {
  108. float t;
  109. if(abs(min_value - max_value) < 0.0001)
  110. {
  111. t = 0;
  112. }
  113. else
  114. {
  115. t = 2.0 * ((abs_value - min_value) / (max_value - min_value)) - 1;
  116. }
  117. float red = clamp(1.5 - abs(2.0 * t - 1.0));
  118. float green = clamp(1.5 - abs(2.0 * t));
  119. float blue = clamp(1.5 - abs(2.0 * t + 1.0));
  120. return vec4(red, green, blue, 1.0);
  121. }
  122. void main()
  123. {
  124. vec4 v1_vertex = a_vertex;
  125. v1_vertex.y -= a_line_dim.y / 2; // half layer down
  126. vec4 world_space_vert = u_modelMatrix * v1_vertex;
  127. gl_Position = world_space_vert;
  128. // shade the color depending on the extruder index stored in the alpha component of the color
  129. switch (u_layer_view_type) {
  130. case 0: // "Material color"
  131. v_color = a_material_color;
  132. break;
  133. case 1: // "Line type"
  134. v_color = a_color;
  135. break;
  136. case 2: // "Speed", or technically 'Feedrate'
  137. v_color = feedrateGradientColor(a_feedrate, u_min_feedrate, u_max_feedrate);
  138. break;
  139. case 3: // "Layer thickness"
  140. v_color = layerThicknessGradientColor(a_line_dim.y, u_min_thickness, u_max_thickness);
  141. break;
  142. case 4: // "Line width"
  143. v_color = lineWidthGradientColor(a_line_dim.x, u_min_line_width, u_max_line_width);
  144. break;
  145. case 5: // "Flow"
  146. float flow_rate = a_line_dim.x * a_line_dim.y * a_feedrate;
  147. v_color = flowRateGradientColor(flow_rate, u_min_flow_rate, u_max_flow_rate);
  148. break;
  149. }
  150. v_vertex = world_space_vert.xyz;
  151. v_normal = (u_normalMatrix * normalize(a_normal)).xyz;
  152. v_line_dim = a_line_dim;
  153. v_extruder = int(a_extruder);
  154. v_prev_line_type = a_prev_line_type;
  155. v_line_type = a_line_type;
  156. v_extruder_opacity = u_extruder_opacity;
  157. // for testing without geometry shader
  158. f_color = v_color;
  159. f_vertex = v_vertex;
  160. f_normal = v_normal;
  161. }
  162. geometry41core =
  163. #version 410
  164. uniform highp mat4 u_modelMatrix;
  165. uniform highp mat4 u_viewMatrix;
  166. uniform highp mat4 u_projectionMatrix;
  167. uniform lowp vec4 u_starts_color;
  168. uniform int u_show_travel_moves;
  169. uniform int u_show_helpers;
  170. uniform int u_show_skin;
  171. uniform int u_show_infill;
  172. uniform int u_show_starts;
  173. layout(lines) in;
  174. layout(triangle_strip, max_vertices = 40) out;
  175. in vec4 v_color[];
  176. in vec3 v_vertex[];
  177. in vec3 v_normal[];
  178. in lowp vec2 v_line_dim[];
  179. in int v_extruder[];
  180. in mat4 v_extruder_opacity[];
  181. in float v_prev_line_type[];
  182. in float v_line_type[];
  183. out vec4 f_color;
  184. out vec3 f_normal;
  185. out vec3 f_vertex;
  186. // Set the set of variables and EmitVertex
  187. void myEmitVertex(vec3 vertex, vec4 color, vec3 normal, vec4 pos) {
  188. f_vertex = vertex;
  189. f_color = color;
  190. f_normal = normal;
  191. gl_Position = pos;
  192. EmitVertex();
  193. }
  194. void main()
  195. {
  196. highp mat4 viewProjectionMatrix = u_projectionMatrix * u_viewMatrix;
  197. vec4 g_vertex_delta;
  198. vec3 g_vertex_normal_horz; // horizontal and vertical in respect to layers
  199. vec4 g_vertex_offset_horz; // vec4 to match gl_in[x].gl_Position
  200. vec3 g_vertex_normal_vert;
  201. vec4 g_vertex_offset_vert;
  202. vec3 g_vertex_normal_horz_head;
  203. vec4 g_vertex_offset_horz_head;
  204. float size_x;
  205. float size_y;
  206. 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)) {
  207. return;
  208. }
  209. // See LayerPolygon; 8 is MoveCombingType, 9 is RetractionType
  210. if ((u_show_travel_moves == 0) && ((v_line_type[0] == 8) || (v_line_type[0] == 9))) {
  211. return;
  212. }
  213. 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)) {
  214. return;
  215. }
  216. if ((u_show_skin == 0) && ((v_line_type[0] == 1) || (v_line_type[0] == 2) || (v_line_type[0] == 3))) {
  217. return;
  218. }
  219. if ((u_show_infill == 0) && (v_line_type[0] == 6)) {
  220. return;
  221. }
  222. if ((v_line_type[0] == 8) || (v_line_type[0] == 9)) {
  223. // fixed size for movements
  224. size_x = 0.05;
  225. } else {
  226. size_x = v_line_dim[1].x / 2 + 0.01; // radius, and make it nicely overlapping
  227. }
  228. size_y = v_line_dim[1].y / 2 + 0.01;
  229. g_vertex_delta = gl_in[1].gl_Position - gl_in[0].gl_Position; //Actual movement exhibited by the line.
  230. g_vertex_normal_horz_head = normalize(vec3(-g_vertex_delta.x, -g_vertex_delta.y, -g_vertex_delta.z)); //Lengthwise normal vector pointing backwards.
  231. g_vertex_offset_horz_head = vec4(g_vertex_normal_horz_head * size_x, 0.0); //Lengthwise offset vector pointing backwards.
  232. g_vertex_normal_horz = normalize(vec3(g_vertex_delta.z, g_vertex_delta.y, -g_vertex_delta.x)); //Normal vector pointing right.
  233. g_vertex_offset_horz = vec4(g_vertex_normal_horz * size_x, 0.0); //Offset vector pointing right.
  234. g_vertex_normal_vert = vec3(0.0, 1.0, 0.0); //Upwards normal vector.
  235. g_vertex_offset_vert = vec4(g_vertex_normal_vert * size_y, 0.0); //Upwards offset vector. Goes up by half the layer thickness.
  236. if ((v_line_type[0] == 8) || (v_line_type[0] == 9)) { //Travel or retraction moves.
  237. vec4 va_head = viewProjectionMatrix * (gl_in[0].gl_Position + g_vertex_offset_horz_head + g_vertex_offset_vert);
  238. vec4 va_up = viewProjectionMatrix * (gl_in[0].gl_Position + g_vertex_offset_horz + g_vertex_offset_vert);
  239. vec4 va_down = viewProjectionMatrix * (gl_in[0].gl_Position - g_vertex_offset_horz + g_vertex_offset_vert);
  240. vec4 vb_head = viewProjectionMatrix * (gl_in[1].gl_Position - g_vertex_offset_horz_head + g_vertex_offset_vert);
  241. vec4 vb_down = viewProjectionMatrix * (gl_in[1].gl_Position - g_vertex_offset_horz + g_vertex_offset_vert);
  242. vec4 vb_up = viewProjectionMatrix * (gl_in[1].gl_Position + g_vertex_offset_horz + g_vertex_offset_vert);
  243. // Travels: flat plane with pointy ends
  244. myEmitVertex(v_vertex[0], v_color[1], g_vertex_normal_vert, va_up);
  245. myEmitVertex(v_vertex[0], v_color[1], g_vertex_normal_vert, va_head);
  246. myEmitVertex(v_vertex[0], v_color[1], g_vertex_normal_vert, va_down);
  247. myEmitVertex(v_vertex[0], v_color[1], g_vertex_normal_vert, va_up);
  248. myEmitVertex(v_vertex[1], v_color[1], g_vertex_normal_vert, vb_down);
  249. myEmitVertex(v_vertex[1], v_color[1], g_vertex_normal_vert, vb_up);
  250. myEmitVertex(v_vertex[1], v_color[1], g_vertex_normal_vert, vb_head);
  251. //And reverse so that the line is also visible from the back side.
  252. myEmitVertex(v_vertex[1], v_color[1], g_vertex_normal_vert, vb_up);
  253. myEmitVertex(v_vertex[1], v_color[1], g_vertex_normal_vert, vb_down);
  254. myEmitVertex(v_vertex[0], v_color[1], g_vertex_normal_vert, va_up);
  255. myEmitVertex(v_vertex[0], v_color[1], g_vertex_normal_vert, va_down);
  256. myEmitVertex(v_vertex[0], v_color[1], g_vertex_normal_vert, va_head);
  257. myEmitVertex(v_vertex[0], v_color[1], g_vertex_normal_vert, va_up);
  258. EndPrimitive();
  259. } else {
  260. vec4 va_m_horz = viewProjectionMatrix * (gl_in[0].gl_Position - g_vertex_offset_horz); //Line start, left vertex.
  261. vec4 vb_m_horz = viewProjectionMatrix * (gl_in[1].gl_Position - g_vertex_offset_horz); //Line end, left vertex.
  262. vec4 va_p_vert = viewProjectionMatrix * (gl_in[0].gl_Position + g_vertex_offset_vert); //Line start, top vertex.
  263. vec4 vb_p_vert = viewProjectionMatrix * (gl_in[1].gl_Position + g_vertex_offset_vert); //Line end, top vertex.
  264. vec4 va_p_horz = viewProjectionMatrix * (gl_in[0].gl_Position + g_vertex_offset_horz); //Line start, right vertex.
  265. vec4 vb_p_horz = viewProjectionMatrix * (gl_in[1].gl_Position + g_vertex_offset_horz); //Line end, right vertex.
  266. vec4 va_m_vert = viewProjectionMatrix * (gl_in[0].gl_Position - g_vertex_offset_vert); //Line start, bottom vertex.
  267. vec4 vb_m_vert = viewProjectionMatrix * (gl_in[1].gl_Position - g_vertex_offset_vert); //Line end, bottom vertex.
  268. vec4 va_head = viewProjectionMatrix * (gl_in[0].gl_Position + g_vertex_offset_horz_head); //Line start, tip.
  269. vec4 vb_head = viewProjectionMatrix * (gl_in[1].gl_Position - g_vertex_offset_horz_head); //Line end, tip.
  270. // All normal lines are rendered as 3d tubes.
  271. myEmitVertex(v_vertex[0], v_color[1], -g_vertex_normal_horz, va_m_horz);
  272. myEmitVertex(v_vertex[1], v_color[1], -g_vertex_normal_horz, vb_m_horz);
  273. myEmitVertex(v_vertex[0], v_color[1], g_vertex_normal_vert, va_p_vert);
  274. myEmitVertex(v_vertex[1], v_color[1], g_vertex_normal_vert, vb_p_vert);
  275. myEmitVertex(v_vertex[0], v_color[1], g_vertex_normal_horz, va_p_horz);
  276. myEmitVertex(v_vertex[1], v_color[1], g_vertex_normal_horz, vb_p_horz);
  277. myEmitVertex(v_vertex[0], v_color[1], -g_vertex_normal_vert, va_m_vert);
  278. myEmitVertex(v_vertex[1], v_color[1], -g_vertex_normal_vert, vb_m_vert);
  279. myEmitVertex(v_vertex[0], v_color[1], -g_vertex_normal_horz, va_m_horz);
  280. myEmitVertex(v_vertex[1], v_color[1], -g_vertex_normal_horz, vb_m_horz);
  281. EndPrimitive();
  282. // left side
  283. myEmitVertex(v_vertex[0], v_color[1], -g_vertex_normal_horz, va_m_horz);
  284. myEmitVertex(v_vertex[0], v_color[1], g_vertex_normal_vert, va_p_vert);
  285. myEmitVertex(v_vertex[0], v_color[1], g_vertex_normal_horz_head, va_head);
  286. myEmitVertex(v_vertex[0], v_color[1], g_vertex_normal_horz, va_p_horz);
  287. EndPrimitive();
  288. myEmitVertex(v_vertex[0], v_color[1], g_vertex_normal_horz, va_p_horz);
  289. myEmitVertex(v_vertex[0], v_color[1], -g_vertex_normal_vert, va_m_vert);
  290. myEmitVertex(v_vertex[0], v_color[1], g_vertex_normal_horz_head, va_head);
  291. myEmitVertex(v_vertex[0], v_color[1], -g_vertex_normal_horz, va_m_horz);
  292. EndPrimitive();
  293. // right side
  294. myEmitVertex(v_vertex[1], v_color[1], g_vertex_normal_horz, vb_p_horz);
  295. myEmitVertex(v_vertex[1], v_color[1], g_vertex_normal_vert, vb_p_vert);
  296. myEmitVertex(v_vertex[1], v_color[1], -g_vertex_normal_horz_head, vb_head);
  297. myEmitVertex(v_vertex[1], v_color[1], -g_vertex_normal_horz, vb_m_horz);
  298. EndPrimitive();
  299. myEmitVertex(v_vertex[1], v_color[1], -g_vertex_normal_horz, vb_m_horz);
  300. myEmitVertex(v_vertex[1], v_color[1], -g_vertex_normal_vert, vb_m_vert);
  301. myEmitVertex(v_vertex[1], v_color[1], -g_vertex_normal_horz_head, vb_head);
  302. myEmitVertex(v_vertex[1], v_color[1], g_vertex_normal_horz, vb_p_horz);
  303. EndPrimitive();
  304. }
  305. if ((u_show_starts == 1) && (v_prev_line_type[0] != 1) && (v_line_type[0] == 1)) {
  306. float w = size_x;
  307. float h = size_y;
  308. 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
  309. 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
  310. 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
  311. 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
  312. 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
  313. 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
  314. 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
  315. 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
  316. 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
  317. 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
  318. 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
  319. 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
  320. 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
  321. 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
  322. EndPrimitive();
  323. }
  324. }
  325. fragment41core =
  326. #version 410
  327. in lowp vec4 f_color;
  328. in lowp vec3 f_normal;
  329. in lowp vec3 f_vertex;
  330. out vec4 frag_color;
  331. uniform mediump vec4 u_ambientColor;
  332. uniform mediump vec4 u_minimumAlbedo;
  333. uniform highp vec3 u_lightPosition;
  334. void main()
  335. {
  336. mediump vec4 finalColor = vec4(0.0);
  337. float alpha = f_color.a;
  338. finalColor.rgb += f_color.rgb * 0.2 + u_minimumAlbedo.rgb;
  339. highp vec3 normal = normalize(f_normal);
  340. highp vec3 light_dir = normalize(u_lightPosition - f_vertex);
  341. // Diffuse Component
  342. highp float NdotL = clamp(dot(normal, light_dir), 0.0, 1.0);
  343. finalColor += (NdotL * f_color);
  344. finalColor.a = alpha; // Do not change alpha in any way
  345. frag_color = finalColor;
  346. }
  347. [defaults]
  348. u_active_extruder = 0.0
  349. u_layer_view_type = 0
  350. 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]]
  351. u_specularColor = [0.4, 0.4, 0.4, 1.0]
  352. u_ambientColor = [0.3, 0.3, 0.3, 0.0]
  353. u_diffuseColor = [1.0, 0.79, 0.14, 1.0]
  354. u_minimumAlbedo = [0.1, 0.1, 0.1, 1.0]
  355. u_shininess = 20.0
  356. u_starts_color = [1.0, 1.0, 1.0, 1.0]
  357. u_show_travel_moves = 0
  358. u_show_helpers = 1
  359. u_show_skin = 1
  360. u_show_infill = 1
  361. u_show_starts = 1
  362. u_min_feedrate = 0
  363. u_max_feedrate = 1
  364. u_min_thickness = 0
  365. u_max_thickness = 1
  366. [bindings]
  367. u_modelMatrix = model_matrix
  368. u_viewMatrix = view_matrix
  369. u_projectionMatrix = projection_matrix
  370. u_normalMatrix = normal_matrix
  371. u_lightPosition = light_0_position
  372. [attributes]
  373. a_vertex = vertex
  374. a_color = color
  375. a_normal = normal
  376. a_line_dim = line_dim
  377. a_extruder = extruder
  378. a_material_color = material_color
  379. a_prev_line_type = prev_line_type
  380. a_line_type = line_type
  381. a_feedrate = feedrate
  382. a_thickness = thickness