shapeCircle
Procedurally generates a perfect, anti-aliased circle directly on the GPU without using any texture files, saving memory and ensuring infinite sharpness.
Core Advantages
Being procedurally generated, it requires no texture files and maintains perfectly sharp edges at any zoom level, avoiding the blurriness or pixelation of bitmap textures, while also featuring built-in anti-aliasing.
Common Uses
Creating circular masks for clipping objects or blending textures
As a high-performance shape for particle systems, replacing textured quads
Procedurally generating UI elements (like buttons, indicators) or decals on surfaces
How to adjust
Adjust by applying math transformations to the input `coord` node (defaults to `uv()`). For example, `uv().mul(2)` shrinks the circle, `uv().sub(vec2(...))` moves it, and `uv().mul(N).fract()` can create an N x N tiled effect.
Code Examples
1// Create a node material and make it transparent
2const circleMaterial = new MeshStandardNodeMaterial();
3circleMaterial.transparent = true;
4
5// Connect the output of shapeCircle (a 0-1 mask) to the material's alpha channel
6circleMaterial.alphaNode = shapeCircle();