Generate Array
This example demonstrates procedural 3D geometry generation by computing an array of values from a mathematical expression and converting it into a renderable point cloud.
Overview
An Arraygen process generates arbitrary values. The resulting array is converted to a GPU buffer, then to a point cloud mesh rendered in Lines mode. An LFO rotates the geometry, and the output passes through bloom and long exposure shaders for a glowing trail effect.
Key concepts
-
Array Generator: Computes an array of values from an ExprTK expression each frame, where
iiterates over the array andpostracks playback position. - Array to Buffer: Converts a CPU-side array into a GPU buffer suitable for rendering.
- Pointcloud to Mesh: Interprets a GPU buffer as XYZ vertex coordinates and produces renderable geometry.
- Post-processing: Bloom adds glow to bright areas, while long exposure creates persistent motion trails through a feedback buffer.
Data flow
- Arraygen evaluates the expression for 300 elements
- Array to Buffer sends the data to the GPU
- Pointcloud to Mesh builds geometry from the XYZ buffer
- A sine warp gradient provides procedural texturing
- Model display renders the geometry in Lines mode
- Bloom and long exposure ISF Shaders are applied as post-processing
Try it
Open this example to see a procedurally generated point cloud animated in real-time.
Learn more
- Math expressions - Expression-based value generation
- ISF Shaders - Interactive Shader Format for GPU effects
- LFO - Low-frequency oscillator for animation
- Model display - 3D mesh rendering process
- Graphics pipeline - How rendering works in ossia score