layers3d.shader 20 KB

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