OpenGL_state.cpp 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2014 Daniele Panozzo <daniele.panozzo@gmail.com>
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public License
  6. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. // obtain one at http://mozilla.org/MPL/2.0/.
  8. #include "OpenGL_state.h"
  9. IGL_INLINE void igl::OpenGL_state::init_buffers()
  10. {
  11. // Mesh: Vertex Array Object & Buffer objects
  12. glGenVertexArrays(1, &vao_mesh);
  13. glBindVertexArray(vao_mesh);
  14. glGenBuffers(1, &vbo_V);
  15. glGenBuffers(1, &vbo_V_normals);
  16. glGenBuffers(1, &vbo_V_ambient);
  17. glGenBuffers(1, &vbo_V_diffuse);
  18. glGenBuffers(1, &vbo_V_specular);
  19. glGenBuffers(1, &vbo_V_uv);
  20. glGenBuffers(1, &vbo_F);
  21. glGenTextures(1, &vbo_tex);
  22. // Line overlay
  23. glGenVertexArrays(1, &vao_overlay_lines);
  24. glBindVertexArray(vao_overlay_lines);
  25. glGenBuffers(1, &vbo_lines_F);
  26. glGenBuffers(1, &vbo_lines_V);
  27. glGenBuffers(1, &vbo_lines_V_colors);
  28. // Point overlay
  29. glGenVertexArrays(1, &vao_overlay_points);
  30. glBindVertexArray(vao_overlay_points);
  31. glGenBuffers(1, &vbo_points_F);
  32. glGenBuffers(1, &vbo_points_V);
  33. glGenBuffers(1, &vbo_points_V_colors);
  34. dirty = ViewerData::DIRTY_ALL;
  35. }
  36. IGL_INLINE void igl::OpenGL_state::free_buffers()
  37. {
  38. glDeleteVertexArrays(1, &vao_mesh);
  39. glDeleteVertexArrays(1, &vao_overlay_lines);
  40. glDeleteVertexArrays(1, &vao_overlay_points);
  41. glDeleteBuffers(1, &vbo_V);
  42. glDeleteBuffers(1, &vbo_V_normals);
  43. glDeleteBuffers(1, &vbo_V_ambient);
  44. glDeleteBuffers(1, &vbo_V_diffuse);
  45. glDeleteBuffers(1, &vbo_V_specular);
  46. glDeleteBuffers(1, &vbo_V_uv);
  47. glDeleteBuffers(1, &vbo_F);
  48. glDeleteBuffers(1, &vbo_lines_F);
  49. glDeleteBuffers(1, &vbo_lines_V);
  50. glDeleteBuffers(1, &vbo_lines_V_colors);
  51. glDeleteBuffers(1, &vbo_points_F);
  52. glDeleteBuffers(1, &vbo_points_V);
  53. glDeleteBuffers(1, &vbo_points_V_colors);
  54. glDeleteTextures(1, &vbo_tex);
  55. }
  56. IGL_INLINE void igl::OpenGL_state::set_data(const igl::ViewerData &data, bool invert_normals)
  57. {
  58. bool per_corner_uv = (data.F_uv.rows() == data.F.rows());
  59. bool per_corner_normals = (data.F_normals.rows() == 3 * data.F.rows());
  60. dirty |= data.dirty;
  61. if (!data.face_based)
  62. {
  63. if (!per_corner_uv)
  64. {
  65. // Vertex positions
  66. if (dirty & ViewerData::DIRTY_POSITION)
  67. V_vbo = (data.V.transpose()).cast<float>();
  68. // Vertex normals
  69. if (dirty & ViewerData::DIRTY_NORMAL)
  70. {
  71. V_normals_vbo = (data.V_normals.transpose()).cast<float>();
  72. if (invert_normals)
  73. V_normals_vbo = -V_normals_vbo;
  74. }
  75. // Per-vertex material settings
  76. if (dirty & ViewerData::DIRTY_AMBIENT)
  77. V_ambient_vbo = (data.V_material_ambient.transpose()).cast<float>();
  78. if (dirty & ViewerData::DIRTY_DIFFUSE)
  79. V_diffuse_vbo = (data.V_material_diffuse.transpose()).cast<float>();
  80. if (dirty & ViewerData::DIRTY_SPECULAR)
  81. V_specular_vbo = (data.V_material_specular.transpose()).cast<float>();
  82. // Face indices
  83. if (dirty & ViewerData::DIRTY_FACE)
  84. F_vbo = (data.F.transpose()).cast<unsigned>();
  85. // Texture coordinates
  86. if (dirty & ViewerData::DIRTY_UV)
  87. V_uv_vbo = (data.V_uv.transpose()).cast<float>();
  88. }
  89. else
  90. {
  91. // Per vertex properties with per corner UVs
  92. if (dirty & ViewerData::DIRTY_POSITION)
  93. {
  94. V_vbo.resize(3,data.F.rows()*3);
  95. for (unsigned i=0; i<data.F.rows();++i)
  96. for (unsigned j=0;j<3;++j)
  97. V_vbo.col(i*3+j) = data.V.row(data.F(i,j)).transpose().cast<float>();
  98. }
  99. if (dirty & ViewerData::DIRTY_AMBIENT)
  100. {
  101. V_ambient_vbo.resize(3,data.F.rows()*3);
  102. for (unsigned i=0; i<data.F.rows();++i)
  103. for (unsigned j=0;j<3;++j)
  104. V_ambient_vbo.col (i*3+j) = data.V_material_ambient.row(data.F(i,j)).transpose().cast<float>();
  105. }
  106. if (dirty & ViewerData::DIRTY_DIFFUSE)
  107. {
  108. V_diffuse_vbo.resize(3,data.F.rows()*3);
  109. for (unsigned i=0; i<data.F.rows();++i)
  110. for (unsigned j=0;j<3;++j)
  111. V_diffuse_vbo.col (i*3+j) = data.V_material_diffuse.row(data.F(i,j)).transpose().cast<float>();
  112. }
  113. if (dirty & ViewerData::DIRTY_SPECULAR)
  114. {
  115. V_specular_vbo.resize(3,data.F.rows()*3);
  116. for (unsigned i=0; i<data.F.rows();++i)
  117. for (unsigned j=0;j<3;++j)
  118. V_specular_vbo.col(i*3+j) = data.V_material_specular.row(data.F(i,j)).transpose().cast<float>();
  119. }
  120. if (dirty & ViewerData::DIRTY_NORMAL)
  121. {
  122. V_normals_vbo.resize(3,data.F.rows()*3);
  123. for (unsigned i=0; i<data.F.rows();++i)
  124. for (unsigned j=0;j<3;++j)
  125. V_normals_vbo.col (i*3+j) = data.V_normals.row(data.F(i,j)).transpose().cast<float>();
  126. if (invert_normals)
  127. V_normals_vbo = -V_normals_vbo;
  128. }
  129. if (dirty & ViewerData::DIRTY_FACE)
  130. {
  131. F_vbo.resize(3,data.F.rows());
  132. for (unsigned i=0; i<data.F.rows();++i)
  133. F_vbo.col(i) << i*3+0, i*3+1, i*3+2;
  134. }
  135. if (dirty & ViewerData::DIRTY_UV)
  136. {
  137. V_uv_vbo.resize(2,data.F.rows()*3);
  138. for (unsigned i=0; i<data.F.rows();++i)
  139. for (unsigned j=0;j<3;++j)
  140. V_uv_vbo.col(i*3+j) = data.V_uv.row(data.F(i,j)).transpose().cast<float>();
  141. }
  142. }
  143. }
  144. else
  145. {
  146. if (dirty & ViewerData::DIRTY_POSITION)
  147. {
  148. V_vbo.resize(3,data.F.rows()*3);
  149. for (unsigned i=0; i<data.F.rows();++i)
  150. for (unsigned j=0;j<3;++j)
  151. V_vbo.col(i*3+j) = data.V.row(data.F(i,j)).transpose().cast<float>();
  152. }
  153. if (dirty & ViewerData::DIRTY_AMBIENT)
  154. {
  155. V_ambient_vbo.resize(3,data.F.rows()*3);
  156. for (unsigned i=0; i<data.F.rows();++i)
  157. for (unsigned j=0;j<3;++j)
  158. V_ambient_vbo.col (i*3+j) = data.F_material_ambient.row(i).transpose().cast<float>();
  159. }
  160. if (dirty & ViewerData::DIRTY_DIFFUSE)
  161. {
  162. V_diffuse_vbo.resize(3,data.F.rows()*3);
  163. for (unsigned i=0; i<data.F.rows();++i)
  164. for (unsigned j=0;j<3;++j)
  165. V_diffuse_vbo.col (i*3+j) = data.F_material_diffuse.row(i).transpose().cast<float>();
  166. }
  167. if (dirty & ViewerData::DIRTY_SPECULAR)
  168. {
  169. V_specular_vbo.resize(3,data.F.rows()*3);
  170. for (unsigned i=0; i<data.F.rows();++i)
  171. for (unsigned j=0;j<3;++j)
  172. V_specular_vbo.col(i*3+j) = data.F_material_specular.row(i).transpose().cast<float>();
  173. }
  174. if (dirty & ViewerData::DIRTY_NORMAL)
  175. {
  176. V_normals_vbo.resize(3,data.F.rows()*3);
  177. for (unsigned i=0; i<data.F.rows();++i)
  178. for (unsigned j=0;j<3;++j)
  179. V_normals_vbo.col (i*3+j) =
  180. per_corner_normals ?
  181. data.F_normals.row(i*3+j).transpose().cast<float>() :
  182. data.F_normals.row(i).transpose().cast<float>();
  183. if (invert_normals)
  184. V_normals_vbo = -V_normals_vbo;
  185. }
  186. if (dirty & ViewerData::DIRTY_FACE)
  187. {
  188. F_vbo.resize(3,data.F.rows());
  189. for (unsigned i=0; i<data.F.rows();++i)
  190. F_vbo.col(i) << i*3+0, i*3+1, i*3+2;
  191. }
  192. if (dirty & ViewerData::DIRTY_UV)
  193. {
  194. V_uv_vbo.resize(2,data.F.rows()*3);
  195. for (unsigned i=0; i<data.F.rows();++i)
  196. for (unsigned j=0;j<3;++j)
  197. V_uv_vbo.col(i*3+j) = data.V_uv.row(per_corner_uv ? data.F_uv(i,j) : data.F(i,j)).transpose().cast<float>();
  198. }
  199. }
  200. if (dirty & ViewerData::DIRTY_TEXTURE)
  201. {
  202. tex_u = data.texture_R.rows();
  203. tex_v = data.texture_R.cols();
  204. tex.resize(data.texture_R.size()*3);
  205. for (unsigned i=0;i<data.texture_R.size();++i)
  206. {
  207. tex(i*3+0) = data.texture_R(i);
  208. tex(i*3+1) = data.texture_G(i);
  209. tex(i*3+2) = data.texture_B(i);
  210. }
  211. }
  212. if (dirty & ViewerData::DIRTY_OVERLAY_LINES)
  213. {
  214. lines_V_vbo.resize(3, data.lines.rows()*2);
  215. lines_V_colors_vbo.resize(3, data.lines.rows()*2);
  216. lines_F_vbo.resize(1, data.lines.rows()*2);
  217. for (unsigned i=0; i<data.lines.rows();++i)
  218. {
  219. lines_V_vbo.col(2*i+0) = data.lines.block<1, 3>(i, 0).transpose().cast<float>();
  220. lines_V_vbo.col(2*i+1) = data.lines.block<1, 3>(i, 3).transpose().cast<float>();
  221. lines_V_colors_vbo.col(2*i+0) = data.lines.block<1, 3>(i, 6).transpose().cast<float>();
  222. lines_V_colors_vbo.col(2*i+1) = data.lines.block<1, 3>(i, 6).transpose().cast<float>();
  223. lines_F_vbo(2*i+0) = 2*i+0;
  224. lines_F_vbo(2*i+1) = 2*i+1;
  225. }
  226. }
  227. if (dirty & ViewerData::DIRTY_OVERLAY_POINTS)
  228. {
  229. points_V_vbo.resize(3, data.points.rows());
  230. points_V_colors_vbo.resize(3, data.points.rows());
  231. points_F_vbo.resize(1, data.points.rows());
  232. for (unsigned i=0; i<data.points.rows();++i)
  233. {
  234. points_V_vbo.col(i) = data.points.block<1, 3>(i, 0).transpose().cast<float>();
  235. points_V_colors_vbo.col(i) = data.points.block<1, 3>(i, 3).transpose().cast<float>();
  236. points_F_vbo(i) = i;
  237. }
  238. }
  239. }
  240. IGL_INLINE void igl::OpenGL_state::bind_mesh()
  241. {
  242. glBindVertexArray(vao_mesh);
  243. shader_mesh.bind();
  244. shader_mesh.bindVertexAttribArray("position", vbo_V, V_vbo, dirty & ViewerData::DIRTY_POSITION);
  245. shader_mesh.bindVertexAttribArray("normal", vbo_V_normals, V_normals_vbo, dirty & ViewerData::DIRTY_NORMAL);
  246. shader_mesh.bindVertexAttribArray("Ka", vbo_V_ambient, V_ambient_vbo, dirty & ViewerData::DIRTY_AMBIENT);
  247. shader_mesh.bindVertexAttribArray("Kd", vbo_V_diffuse, V_diffuse_vbo, dirty & ViewerData::DIRTY_DIFFUSE);
  248. shader_mesh.bindVertexAttribArray("Ks", vbo_V_specular, V_specular_vbo, dirty & ViewerData::DIRTY_SPECULAR);
  249. shader_mesh.bindVertexAttribArray("texcoord", vbo_V_uv, V_uv_vbo, dirty & ViewerData::DIRTY_UV);
  250. glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vbo_F);
  251. if (dirty & ViewerData::DIRTY_FACE)
  252. glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(unsigned)*F_vbo.size(), F_vbo.data(), GL_DYNAMIC_DRAW);
  253. glActiveTexture(GL_TEXTURE0);
  254. glBindTexture(GL_TEXTURE_2D, vbo_tex);
  255. if (dirty & ViewerData::DIRTY_TEXTURE)
  256. {
  257. glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
  258. glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
  259. glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
  260. glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
  261. glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, tex_u, tex_v, 0, GL_RGB, GL_UNSIGNED_BYTE, tex.data());
  262. }
  263. glUniform1i(shader_mesh.uniform("tex"), 0);
  264. dirty &= ~ViewerData::DIRTY_MESH;
  265. }
  266. IGL_INLINE void igl::OpenGL_state::bind_overlay_lines()
  267. {
  268. bool is_dirty = dirty & ViewerData::DIRTY_OVERLAY_LINES;
  269. glBindVertexArray(vao_overlay_lines);
  270. shader_overlay_lines.bind();
  271. shader_overlay_lines.bindVertexAttribArray("position", vbo_lines_V, lines_V_vbo, is_dirty);
  272. shader_overlay_lines.bindVertexAttribArray("color", vbo_lines_V_colors, lines_V_colors_vbo, is_dirty);
  273. glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vbo_lines_F);
  274. if (is_dirty)
  275. glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(unsigned)*lines_F_vbo.size(), lines_F_vbo.data(), GL_DYNAMIC_DRAW);
  276. dirty &= ~ViewerData::DIRTY_OVERLAY_LINES;
  277. }
  278. IGL_INLINE void igl::OpenGL_state::bind_overlay_points()
  279. {
  280. bool is_dirty = dirty & ViewerData::DIRTY_OVERLAY_POINTS;
  281. glBindVertexArray(vao_overlay_points);
  282. shader_overlay_points.bind();
  283. shader_overlay_points.bindVertexAttribArray("position", vbo_points_V, points_V_vbo, is_dirty);
  284. shader_overlay_points.bindVertexAttribArray("color", vbo_points_V_colors, points_V_colors_vbo, is_dirty);
  285. glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vbo_points_F);
  286. if (is_dirty)
  287. glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(unsigned)*points_F_vbo.size(), points_F_vbo.data(), GL_DYNAMIC_DRAW);
  288. dirty &= ~ViewerData::DIRTY_OVERLAY_POINTS;
  289. }
  290. IGL_INLINE void igl::OpenGL_state::draw_mesh(bool solid)
  291. {
  292. glPolygonMode(GL_FRONT_AND_BACK, solid ? GL_FILL : GL_LINE);
  293. /* Avoid Z-buffer fighting between filled triangles & wireframe lines */
  294. if (solid)
  295. {
  296. glEnable(GL_POLYGON_OFFSET_FILL);
  297. glPolygonOffset(1.0, 1.0);
  298. }
  299. glDrawElements(GL_TRIANGLES, 3*F_vbo.cols(), GL_UNSIGNED_INT, 0);
  300. glDisable(GL_POLYGON_OFFSET_FILL);
  301. glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
  302. }
  303. IGL_INLINE void igl::OpenGL_state::draw_overlay_lines()
  304. {
  305. glDrawElements(GL_LINES, lines_F_vbo.cols(), GL_UNSIGNED_INT, 0);
  306. }
  307. IGL_INLINE void igl::OpenGL_state::draw_overlay_points()
  308. {
  309. glDrawElements(GL_POINTS, points_F_vbo.cols(), GL_UNSIGNED_INT, 0);
  310. }
  311. IGL_INLINE void igl::OpenGL_state::init()
  312. {
  313. std::string mesh_vertex_shader_string =
  314. "#version 150\n"
  315. "uniform mat4 model;"
  316. "uniform mat4 view;"
  317. "uniform mat4 proj;"
  318. "in vec3 position;"
  319. "in vec3 normal;"
  320. "out vec3 position_eye;"
  321. "out vec3 normal_eye;"
  322. "in vec3 Ka;"
  323. "in vec3 Kd;"
  324. "in vec3 Ks;"
  325. "in vec2 texcoord;"
  326. "out vec2 texcoordi;"
  327. "out vec3 Kai;"
  328. "out vec3 Kdi;"
  329. "out vec3 Ksi;"
  330. "void main()"
  331. "{"
  332. " position_eye = vec3 (view * model * vec4 (position, 1.0));"
  333. " normal_eye = vec3 (view * model * vec4 (normal, 0.0));"
  334. " normal_eye = normalize(normal_eye);"
  335. " gl_Position = proj * vec4 (position_eye, 1.0);" //proj * view * model * vec4(position, 1.0);"
  336. " Kai = Ka;"
  337. " Kdi = Kd;"
  338. " Ksi = Ks;"
  339. " texcoordi = texcoord;"
  340. "}";
  341. std::string mesh_fragment_shader_string =
  342. "#version 150\n"
  343. "uniform mat4 model;"
  344. "uniform mat4 view;"
  345. "uniform mat4 proj;"
  346. "uniform vec4 fixed_color;"
  347. "in vec3 position_eye;"
  348. "in vec3 normal_eye;"
  349. "uniform vec3 light_position_world;"
  350. "vec3 Ls = vec3 (1, 1, 1);"
  351. "vec3 Ld = vec3 (1, 1, 1);"
  352. "vec3 La = vec3 (1, 1, 1);"
  353. "in vec3 Ksi;"
  354. "in vec3 Kdi;"
  355. "in vec3 Kai;"
  356. "in vec2 texcoordi;"
  357. "uniform sampler2D tex;"
  358. "uniform float specular_exponent;"
  359. "uniform float lighting_factor;"
  360. "uniform float texture_factor;"
  361. "out vec4 outColor;"
  362. "void main()"
  363. "{"
  364. "vec3 Ia = La * Kai;" // ambient intensity
  365. "vec3 light_position_eye = vec3 (view * vec4 (light_position_world, 1.0));"
  366. "vec3 vector_to_light_eye = light_position_eye - position_eye;"
  367. "vec3 direction_to_light_eye = normalize (vector_to_light_eye);"
  368. "float dot_prod = dot (direction_to_light_eye, normal_eye);"
  369. "float clamped_dot_prod = max (dot_prod, 0.0);"
  370. "vec3 Id = Ld * Kdi * clamped_dot_prod;" // Diffuse intensity
  371. "vec3 reflection_eye = reflect (-direction_to_light_eye, normal_eye);"
  372. "vec3 surface_to_viewer_eye = normalize (-position_eye);"
  373. "float dot_prod_specular = dot (reflection_eye, surface_to_viewer_eye);"
  374. "dot_prod_specular = float(abs(dot_prod)==dot_prod) * max (dot_prod_specular, 0.0);"
  375. "float specular_factor = pow (dot_prod_specular, specular_exponent);"
  376. "vec3 Is = Ls * Ksi * specular_factor;" // specular intensity
  377. "vec4 color = vec4(lighting_factor * (Is + Id) + Ia, 1.0) + vec4((1.0-lighting_factor) * Kdi,1.0);"
  378. "outColor = mix(vec4(1,1,1,1), texture(tex, texcoordi), texture_factor) * color;"
  379. "if (fixed_color != vec4(0.0)) outColor = fixed_color;"
  380. "}";
  381. std::string overlay_vertex_shader_string =
  382. "#version 150\n"
  383. "uniform mat4 model;"
  384. "uniform mat4 view;"
  385. "uniform mat4 proj;"
  386. "in vec3 position;"
  387. "in vec3 color;"
  388. "out vec3 color_frag;"
  389. "void main()"
  390. "{"
  391. " gl_Position = proj * view * model * vec4 (position, 1.0);"
  392. " color_frag = color;"
  393. "}";
  394. std::string overlay_fragment_shader_string =
  395. "#version 150\n"
  396. "in vec3 color_frag;"
  397. "out vec4 outColor;"
  398. "void main()"
  399. "{"
  400. " outColor = vec4(color_frag, 1.0);"
  401. "}";
  402. std::string overlay_point_fragment_shader_string =
  403. "#version 150\n"
  404. "in vec3 color_frag;"
  405. "out vec4 outColor;"
  406. "void main()"
  407. "{"
  408. " if (length(gl_PointCoord - vec2(0.5)) > 0.5)"
  409. " discard;"
  410. " outColor = vec4(color_frag, 1.0);"
  411. "}";
  412. init_buffers();
  413. shader_mesh.init(mesh_vertex_shader_string,
  414. mesh_fragment_shader_string, "outColor");
  415. shader_overlay_lines.init(overlay_vertex_shader_string,
  416. overlay_fragment_shader_string, "outColor");
  417. shader_overlay_points.init(overlay_vertex_shader_string,
  418. overlay_point_fragment_shader_string, "outColor");
  419. }
  420. IGL_INLINE void igl::OpenGL_state::free()
  421. {
  422. shader_mesh.free();
  423. shader_overlay_lines.free();
  424. shader_overlay_points.free();
  425. free_buffers();
  426. }