Class PointRenderer
Renders point clouds using a custom shader and generated textures. This component is designed to work on all Unity platforms. It creates textures from the mesh’s vertex colors and positions and uses them to render the point cloud via a custom material.
Inherited Members
Namespace: TriLibCore.Extras
Assembly: Assembly-CSharp.dll
Syntax
public class PointRenderer : MonoBehaviour
Fields
PointSize
The size of each rendered point in world units.
Declaration
public float PointSize
Field Value
Type | Description |
---|---|
float |
Properties
Material
Gets the material used to render the point cloud.
Declaration
public Material Material { get; }
Property Value
Type | Description |
---|---|
Material |
Mesh
Gets the generated mesh that is used to draw the point cloud. This mesh is required to simulate DrawProceduralNow because WebGL does not support the SV_VertexID semantic.
Declaration
public Mesh Mesh { get; }
Property Value
Type | Description |
---|---|
Mesh |
Methods
Initialize(Mesh)
Initializes the point renderer with the given mesh data. This method creates two textures from the mesh (one for vertex colors and one for vertex positions), configures the rendering material, and creates a compatible mesh for rendering the point cloud.
Declaration
public void Initialize(Mesh mesh)
Parameters
Type | Name | Description |
---|---|---|
Mesh | mesh | The source mesh whose vertex data (positions and colors) will be used to render the point cloud. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if the provided |