[Bf-committers] Surface from particles (Farsthary)

Nicholas Bishop nicholasbishop at gmail.com
Thu Jan 21 20:56:33 CET 2010

In general the fastest way to draw an array of triangles in OpenGL is
with a VBO (vertex buffer object.) You can find examples of how to do
this in source/blender/gpu/intern/gpu_buffers.c. (I think the VBO code
was merged maybe two or three months ago? So your sources would need
to be at least that recent in order to see the VBO code there.)

The basic idea is that you set set up a buffer to hold your vertices
(including at least vertex coordinates, plus optional normal and color
data) using glGenBuffers and glBufferData, then set up a separate
buffer object to hold the vertex indices that make up each triangle.
Then you can draw using glDrawElements. (Buffer objects are pretty
flexible, so you have a lot of control over how you split up your data
into different VBOs; for example you don't have to use an index buffer
object if you didn't have a lot of vertices used by multiple


On Thu, Jan 21, 2010 at 2:24 PM, Raul Fernandez Hernandez
<raulf at info.upr.edu.cu> wrote:
> Hi all :)
>  I have started to implement the surface generator from the particles,
> currently I'm on early stages and I get pretty crude and slow results,
> but is working :) There's a lot of things that I need to investigate also
> so will be very wellcome papers and resources.(for example fast surfacing
> methods, etc.) since for particle methods there's no much public aviable
> information (at last for me).
>  I also need to learn more OpenGL and how it works with Blender methods,
> for example:
>  what is the best/fastest way to display an array of triangles?
>  I think Blender uses displist? but how does they works?
>  what I'm doing rigth now is iterating over the triangle list and draw
> each one...
> This is a valuable skill when I tackle Voxel Sculpting again since that
> part will be central to the voxel scuplting method.
>                As soon as I get better results I will post them :)
>                                     Cheers   Raul
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers

More information about the Bf-committers mailing list