Techart, VFX
Point Clouds Scattering Tool
Integration of point data, its configuration and shading, as well as the generation of new point clouds based on meshes
Description

Project: RnD
Instruments used: Houdini, UE5, Krakatoa, PCG, Blueprints, Niagara, Megascans
Working with point clouds in computer graphics is becoming increasingly relevant. In almost any 3D software, whether it’s a game engine or DCC, there’s the capability to integrate and work with point cloud data. Usually, there’s no issue if we just want to visualize point clouds obtained from real-world scans like Lidar or photogrammetry or even import gaussian splatting data. For instance, in UE5, working with point clouds and gaussian splatts can be done using different plug-ins or Niagara. To achieve a flexible customization and handling of animated points, the Houdini-Niagara workflow is suitable. But what if we want to generate point clouds based on virtual geometry, such as meshes or 3D scenes, to create beautiful effects, transitions, or for any other purposes?
Firstly, of course, we can take photographs of a mesh from different angles in virtual space, creating a sequence of shots and generating point clouds based on them as if it were a real object. However, this approach seems to be redundant and prone to data loss. We already have all the necessary information about vertices (and even each pixel) in 3D space such as position, color, illumination, etc. All we need to do is scatter points on the geometry first, then obtain this data as specific values, storing them as attributes for each point.

So I started to test different approaches of generating point clouds from geometry with internal Unreal instruments: PCG and Blueprints.
A big advantage of this method is that we can create point clouds without help of any other applications. However, the generation process turned out to be very time-consuming, and the point clouds we got were not very flexible in terms of animation ans fx. It’s possible that spending more time on it, especially using C++, could lead to more flexible adjustments and improve the tool’s performance.

Next, I tried an old-school method using the Krakatoa plugin for 3ds Max. The results were great: the point cloud creation process was very easy and fast, and moreover, I could easily bake lighting information to an attribute of each point. The biggest disadvantage of this workflow is that it’s not procedural, and if we needed to prepare a large number of assets, it could take a lot of time.
Finally, continuing the topic of proceduralism, I turned to Houdini, of course. I created an HDA for scattering points on meshes, considering alpha and transferring diffuse color information from the texture via UV to point attributes.
The tool allows scattering points on surfaces considering the material types masked and/or opaque. The color value from the diffuse texture is transferred to the Cd attribute, which Unreal interprets as vertex color.
Then, the attribute table which contains point coordinates (P) and their color (Cd) can be easily exported to a .csv file. Using CloudCompare, it can be converted to any other format, such as .las for use with the LiDAR Point Cloud Plugin. Additionally, CloudCompare has a great function allowing one-click generation of ambient occlusion (AO) for point clouds. Since objects made of points with a single diffuse color look rather flat, multiplying the color by AO adds significant volume and shading to the objects.
If we intend to use points in Niagara, Houdini allows exporting .ply files, including multi-frame sequences for animated point clouds (Labs Niagara ROP).

Shader and effector tool
Additionally, to integrate the result into UE5, visualize and configure point clouds for future immersive usage, I created a shader with radial and planar effectors which enable control over point size, color, emission, etc. With that, we can crop point clouds, apply fade-out effects, add animated noise to enhance reveal and emission effects, etc.
The Material and Material Function take parameters from a material parameters collection, which are set in a blueprint or configured manually for global usage in the scene.

Conclusions
There are a variety of tools available for working with point clouds and scattering points on geometry. In a short time, it was necessary to explore as many tools as possible and devise an optimal pipeline for scattering points with color and lighting information. Although the goal was achieved, this pipeline cannot be considered very flexible or universal; it can certainly be greatly optimized depending on the specific goals.
<
>
MMSHVYREV@GMAIL.COM
+381 62 9758559
Novi Sad, Serbia
© 2024 Maksim Shvyrev
CV
Made on
Tilda