Forum

DX11.Particles export to PLY

How can I export particles to PLY format? (for further manipulation in Houdini, for example). I would like to store color data, so AsGeometry node doesn’t work for me.

Well there is an obj exporter on forums available on search.

If you want color information you can assign uv coord to each particle and export that as mesh. Then bake color to texture.

There is no ply format exporter out of the box, but you can assemble something with VL or vvvv yourself.

If you need further help upload your patch or an object with an explanation what you want as result… there are ways to read your own structures from let’s say an txt file

Im trying to export my kinect2 pointcloud to Houdini with 2 Point Attributes: Cd 3flt (Vec) , P 3flt (Pos).

These may be static points, but ideally I’d like to record animations (I do various particle manipulations with vr headset, it would be cool to record them).

I can assume that VL will be the most effective solution, but I haven’t found time to understand it yet).

Kinect2_PC_to_obj.v4p (58.7 KB)

Well if you want to record that, I would build an texture with each pixel assigned to a particle uv, then I would record the xyz world position of that particle to rgb colors of texture and then i’ve would save the mesh and did the record on texture…

Otherwise you can directly write position to a texture and read it back in hudini instead

just for the reference how long you would like to do the record?
there are two ways, write to GPU mem, and save after, otherewise async writer, but it would do realtime with low res tex…

ply text format is a pretty easy format, http://paulbourke.net/dataformats/ply/ you can probably patch something pretty quickly, whether its fast enough to record animations is another thing! Maybe you can queue them, and write out sequences post record?

Thanks for the tips!

I’ll try it this week, but I guess there will be questions along the way. Some of theese things are too technical for me.

300 frames can be enough.

All these texture recordings are still beyond my vvvv skills. Сan I ask you for help on this?

Hi, so, dunno about time it would take, i’m on vacation at the moment.
Maybe you can screen grab small vid of what you have in the renderer right now, or few pictures… so questions are:

How many particles you have

Witch data you would like to record Position and Color, or something else?

The total amount of particles is about 10-15M
I need just Position and Color, that’s it

Ok, so if we try to render 15m particles to texture it would need about 4096x4096 pixels 32bits float rgb and 8bits rgb color texture. I have serious doubts it would be possible to stream that 25fps even if scramble all the rgb8bit color in to 32bits alpha of that texture.

How much ram you have on the video card?
With direct write to disk think we can have about 4-5 fps, so the proper way would be to record in to gpu mem and then write to disk all at once…

11Gb of RAM

10-15 million particles is not a mandatory requirement. I think that it is possible to reduce the number of particles by 5 times, if it will give a significant increase in speed

here you can test thatParticles2Tex.zip (39.4 KB)

sory didn’t had much time to write the instructions but at list it looks working

In any case beware if you overflow GPU mem with high values (long duration, higher resolution, high FPS), you gonna get crash that might prevent your patch from starting so do the backup

2 Likes

Thank you!
It seems that I still need some explanation of the principle of the patch.

I may be using the record buttons in the wrong order or resolution. In both sequences, it turns out some strange result. It is not very clear what to do next :/

Well the idea is that first button writes to gpu array of images in desired resolution. The resolution should be a sqr of your amount of particles rounded to Pow2 (256,512,1024,2048,4096) , then the second button writes that array to disk. The amount of pixels on that texture is an amount of slots for particles you can have totally, so basically then each pixels will be a position of your particle… I did you small example whit overwriting position by value coming from texture…

1 Like

I’m actually thinking that we can write thouse particles to obj sequence, using the queue method, would need to build that other way around tho… and it would consume more memory…

Everything works fine! Thank you

The last thing remaining: how to export this recorded data to obj sequence?

Hi,did’t forget, but this needs a plugin and plugins needs some time

Hi so, i’m trying to find an example with working pointcloud saved as obj, so far no luck, already starting to look in to building an PLY exporter…

Anyways here is my test file, if you can fix mistakes and make it open then i’ll llok more in to it
test obj points.zip (272 Bytes)

Looks like this:

Points: 8
Primitives: 0
Vertices: 0

Center: -0.1785, 0.03585, 0.53915
Min: -0.2454, 0, 0.4866
Max: -0.1116, 0.0717, 0.5917
Size: 0.1338, 0.0717, 0.1051

Ok so if it works wouldn’t take much time to compile ;)

1 Like