question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Points (point cloud) materials

See original GitHub issue

Although primitives with mode POINTS (point clouds) are loaded properly, the materials created (for URP, HDRP and BiRP) do not render points properly.

Points should be rendered as mentioned in the glTF spec.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
attenedercommented, Oct 18, 2022

Update: PR #495 brought the necessary API change to create material generators with point cloud material support!

1reaction
attenedercommented, Jun 2, 2022

Ah. Does this mean normal HLSL shaders?

Yes!

If so, here are two that might be a useful starting point: https://gist.github.com/camnewnham/290fd777d7b04775f7ad98bbd3ced40f

* Billboard geometry shader that renders uniform screen size points and vertex colors

* Basic vertex color shader that renders pixel sized points on the platforms I've tested; but since gl_PointSize is not supported and generally seems to be considered legacy this size doesn't appear modifiable.

The basic vertex shader is of course much faster to run than the geometry shader.

Thanks for the reference. Those won’t work on platforms without geometry shader support though. Also it’s just a solution for Unlit materials (glTF spec says full pbrMetallicRougness should work with points/lines as well).

I’ve also found that for points to render they seem to need an identity index buffer [ 0, 1, 2, 3, 4, 5, … ].

True, if you use the shaders you proposed.

Step one would be to extend IMaterialGenerator.GenerateMaterial with a parameter that depicts the targeted mesh topology (or alternatively add a IMaterialGenerator.GeneratePointMaterial). The respective MaterialGenerator can then pick another shader, based on platform. Now this is a bit impure, as primitive to material is a many-to-one relation (you could theoretically use a glTF material on both a triangluar primitive and a point primitive), but I’d ignore this special case. Its a rare corner-case and one can easily sail around it by not re-using materials in that way.

I’ll schedule this API change, but not sure when/if I’ll find time to implement and test the shaders.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Point Cloud Data
Point clouds are collections of 3D points located randomly in space. ... geometry and material composition of the reflecting surface.
Read more >
Point Cloud System
A points cloud particle system (PCS) is a single updatable mesh with the the PointsCloud property of its material set to true ....
Read more >
Point Clouds generated from Lidar for Beginners | ARTICLE
A point cloud is a collection of points of data plotted in 3D space, using a 3D laser scanner. If you're scanning a...
Read more >
Point cloud rendering with Unity
Point cloud rendering with Unity ... In summary, Point Clouds are a series of points in space that are presented visually instead of...
Read more >
Point Cloud Object - 3ds Max 2023 Help
The Point Cloud object lets you create precise, three-dimensional models from real-world references by importing large datasets captured from reality as ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found