Pcx icon indicating copy to clipboard operation
Pcx copied to clipboard

Ply norm consideration

Open shayazar opened this issue 6 years ago • 11 comments

I noticed that while parsing the PLY meta data, the norm is not taken into consideration explicitly (only through a generic Data32 type). Later, after parsing the data, only the vertices and colors (rgba) are moved on to the shader.

I have a PLY with norm i need to take into consideration. How do i implement using it in the shader? (point/disk)

Thanks

shayazar avatar Jul 28 '19 08:07 shayazar

I have never seen a point cloud that has normals. How did you create it?

keijiro avatar Jul 28 '19 14:07 keijiro

Meshlab produced it for me, and i don't want to ignore / disregard them. I saw some mentions on Unity forums and such about it as well.

shayazar avatar Jul 28 '19 14:07 shayazar

Could you provide a .ply point cloud data file with normals?

keijiro avatar Jul 29 '19 02:07 keijiro

Sure, I imported an example PLY from your project, and exported it through meshlab Guanyin2.zip

Because it was created from a PLY without normals originally, the normals don't add information, but taking a PLY with normal information and disregarding it affects the lighting from different camera angles and different lightings.

shayazar avatar Jul 29 '19 08:07 shayazar

I realized that it needs some changes in the basic design of the importer. It requires some amount of time to support it.

I'd like to add this to the to-do list of the project. Unfortunately, I can't afford time for it at the moment. I'll revisit it when I get free time.

keijiro avatar Jul 30 '19 02:07 keijiro

Sure, I get it. Any chance you can give a brief explanation about how to use the norms in the shader? Maybe this can help me proceed, and perhaps contribute.

shayazar avatar Jul 30 '19 07:07 shayazar

Add float3 normal : NORMAL; to Attributes.

https://github.com/keijiro/Pcx/blob/master/Assets/Pcx/Runtime/Shaders/Point.shader#L30

Then you can use the normal in the vertex shader.

keijiro avatar Jul 30 '19 08:07 keijiro

Thanks The trouble I had was the math of how to use the values of the normals :)

shayazar avatar Jul 30 '19 08:07 shayazar

I have PLY with normals as well. Perhaps I could help get this working?

djzielin avatar Aug 16 '19 18:08 djzielin

I would also love to use ply normals in the VFX graph, in the same way you would with a pcache file

cpkcpkcpk avatar Mar 22 '21 19:03 cpkcpkcpk

It would be great to use normals from the .ply file to set the particle direction in VFX graph. Would this require generating a normals texture, in addition to colour and position maps?

gradeeterna avatar May 20 '23 16:05 gradeeterna