Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ply norm consideration #27

Open
shayazar opened this issue Jul 28, 2019 · 11 comments
Open

Ply norm consideration #27

shayazar opened this issue Jul 28, 2019 · 11 comments
Assignees

Comments

@shayazar
Copy link

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

@keijiro keijiro self-assigned this Jul 28, 2019
@keijiro
Copy link
Owner

keijiro commented Jul 28, 2019

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

@shayazar
Copy link
Author

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.

@keijiro
Copy link
Owner

keijiro commented Jul 29, 2019

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

@shayazar
Copy link
Author

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.

@keijiro
Copy link
Owner

keijiro commented Jul 30, 2019

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.

@shayazar
Copy link
Author

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.

@keijiro
Copy link
Owner

keijiro commented Jul 30, 2019

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.

@shayazar
Copy link
Author

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

@djzielin
Copy link

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

@cpkcpkcpk
Copy link

cpkcpkcpk commented Mar 22, 2021

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

@gradeeterna
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants