Hello Gallo,
With DAT and SOP you will have a very poor framerate, depending of the density of the points. The best way would be to transform the file to 32 bits texture, as in kinect point cloud and use shader where the graphic card do all the big job. The Markus Berlin Tuto is a must for that.
Cheers, Jacques
thanks for the feedback.
I have thought about converting the points position and color into a texture but with a big set of points it seems i need to use a texture array type inside the GLSL TOP.
While i don’t quite understand how to use it yet, it seems i need a superior openGL version to use this feature ?
Using macOS Mojave here (…yes… i know…)
Anyone can confirm this feature is compatible with macOS ?
I have set up a project that does just what you want. Right now I’m struggling with getting the point color values in the right place, but otherwise it works pretty well with 1000 000 points at 60 fps. I Generate the texture an save it to a .tiff or .exr file, this ways the pointcloud is loaded super fast.
i have tried on a windows computer and while the computer is a capable i7 CPU with AMD FirePro W7100 GPU so it seems ok on GLSL version side, it keeps complaining with the following message :
Yes but i think this won’t work on macOS anyway : macOS seems limited to openGL 4.1 and Texture Buffer and Atomic Counter are features of openGL 4.2+
I have read somewhere one can activate an extension in GLSL but pre-processor doesn’t seem to be authorized.
i don’t understand why it doesn’t work on Windows though… but the issues seems unrelated to GLSL version but more to openGL/Hardware limitations ?
Ok, I see. I could help with texturising a few cloud files if you want?
I’m planning to use a Mac with windows for TD in the next weeks. Bit curious to see what will work and what will not. Have you tried the RealSense cameras on your Mac?
Thanks for your help but no real project for now, i am just trying some techniques just in case…
I would rather understand what’s wrong and where so i am very interested in your feedback about this issue.
Never used Realsense camera, only played with Kinect V1 till now
Hello Martial,
I looked very briefly at your project, unfortunately I have a very busy moment and not so many time to help you but I would make some remarks:
– If possible, Its easier to use the point cloud, so you pass directly image to shader, easier to manage. You cannot transform your Chop to a Top directly because its greater than the TOP limit.
– if you want to visualise your structure, you need a GLSL MAT, not a GLSL TOP. The TOP can only manipulate a 2D image, not a 3D structure
– In the GLSL MAT you will work mainly with Vertex shader, using each pixel color to move each point to the right position, after that you can use the Pixel shader to give color for each point.
– you dont need atomic counter, the best solution is to create one point with the add SOP and to duplicate it with instancing in Geometry, so you can us TDInstanceID to give different position to different points, not needing Atomic Counter. So I think you can use GLSL 4.10, its possible on MacOs.
Starting from where you are, a solution could be:
– shuffle CHOP after the pos CHOP to divide the length by 16 to go under the 32768 limit, then CHOP to TOP to obtain a 32 bits texture.
– create a one point polygon with add, convert it to particle (Convert SOP), instance it to the number of pixel (Geometry COMP)
– use the texture as sampler in GLSL MAT
use the GLSL MAT as material in your Geometry
– use Vertex shader to analyse the texture (you need to use divide and modulo to sample each pixel) with TDInstanceID to number the point.
I will try tonight to translate that into reality…
Jacques
Thanks for this long and useful list of tips !
Though the goal of the project i sent is to convert the point cloud to textures : one texture representing point positions, and one texture representing the colors of points.
I would then use those textures to instantiate vertices in a geo or use the add sop
Ok, I have a better understanding of what you want.
I think you dont need GLSL TOP for that.
First you have to decide the dimensions of your texture, unfortunately 329897 is not a great multiple… So you will have some dead pixels. You can choose 400 as divider and use shuffle and CHOP to TOP to obtain textures.
Here is one example.
All the best from Nation…
Jacques ply2tex.toe (5.15 MB)
and, “pour le plaisir du geste”, the same with visualization of colored point cloud, using GLSL MAT.
It can work on MacOs (GLSL 3.30).
See you,
Jacques ply2tex.toe (5.15 MB)
thanks for all the ressources, these are really helpful !
Behind all this i intend to convert point cloud to a texture (inside of touch or with another app) to optimize point cloud loading and manipulation.
So yeah, no need to convert the point cloud from DAT on the same network, but i was more thinking about saving the point cloud in a texture that i could re-load when needed.
I was initially trying to achieve that using GLSL Top (which would be great, but problematic under macOS. Your idea with ToptoChop is great in that way.
One notice though, in your last example, the point cloud is not right, this is not the original shape from the loaded .ply
see attached file i figured. I have managed to create the texture from the .ply point cloud from a small app i have made under openFrameworks. I then load this texture into TD instead of the .ply pointCloudFromTexture.tox (395 KB)
The result is not right because I made it very quickly to show the principles, I will try better. Concerning storing the texture, you can do it but you need 32bits RGB texture, even PSD doesn’t do it.
The only way is to use the Pack TOP, transforming 1x 32bits pixel to 4x 8 bits pixel, un packing it when you use it.
I use it to record kinect skeleton movements.
Jacques
I am not sure i understand the 32bits thing. Is it for accuracy purpose ? it is possible to code each position with one pixel in 8 bits / color right ?
its possible to encode position in 8bits but you have only 256 possible step, not so nice…
Its really important to encode it in 32 bits. You can make a test with noise and GLSL, with 8 bits you have blocked positions.
Use Houdini to translate the point position, normals, and Cd and bake to a 32 bit .exr. That’s what I do and it it works great. Then you can use the kinect point cloud workflow.