Skip to main content
deleted 40 characters in body
Source Link
Kromster
  • 10.7k
  • 4
  • 54
  • 67

I'm making some tests with rendering stuff and I'm wondering how to design my Geometry class. For the moment, here is how I do:

  • Init: Stock array with positions, array with colors, array with normals, … has attributsattributes.
  • Just before rendering, if my geometry have changed, I update his vertex buffer and index buffer. To do that, I compute interleaved array here and send it to my vertex buffer.

I've made some tests with particles (10000 on ipadiPad), the heaviest function is "Geometry::computeInterleavedArray.

So, I would like to know, How can I avoid this part? Is it better to stock geometry's data inside a single array with all data already interleaved?

Thanks you.

I'm making some tests with rendering stuff and I'm wondering how to design my Geometry class. For the moment, here is how I do:

  • Init: Stock array with positions, array with colors, array with normals, … has attributs.
  • Just before rendering, if my geometry have changed, I update his vertex buffer and index buffer. To do that, I compute interleaved array here and send it to my vertex buffer.

I've made some tests with particles (10000 on ipad), the heaviest function is "Geometry::computeInterleavedArray.

So, I would like to know, How can I avoid this part? Is it better to stock geometry's data inside a single array with all data already interleaved?

Thanks you.

I'm making some tests with rendering stuff and I'm wondering how to design my Geometry class. For the moment, here is how I do:

  • Init: Stock array with positions, array with colors, array with normals, … has attributes.
  • Just before rendering, if my geometry have changed, I update his vertex buffer and index buffer. To do that, I compute interleaved array here and send it to my vertex buffer.

I've made some tests with particles (10000 on iPad), the heaviest function is "Geometry::computeInterleavedArray.

How can I avoid this part? Is it better to stock geometry's data inside a single array with all data already interleaved?

Source Link
user30088
  • 353
  • 1
  • 4
  • 14

Geometry design and buffers

I'm making some tests with rendering stuff and I'm wondering how to design my Geometry class. For the moment, here is how I do:

  • Init: Stock array with positions, array with colors, array with normals, … has attributs.
  • Just before rendering, if my geometry have changed, I update his vertex buffer and index buffer. To do that, I compute interleaved array here and send it to my vertex buffer.

I've made some tests with particles (10000 on ipad), the heaviest function is "Geometry::computeInterleavedArray.

So, I would like to know, How can I avoid this part? Is it better to stock geometry's data inside a single array with all data already interleaved?

Thanks you.