Jump to content

Making a True 3D Cellular Noise


Recommended Posts

I really like the cellular noise node that can be used inside a point VOP, as it yields good borders compared to trying to remap worley/voronoi patterns. The downside is that it can only be used on a 2D uv map. How would one go about getting the same results with a vector 3/3D input? Similar to the 3D outputs of Unified Static, Turbulent, AA noise, etc. I've tried searching, but haven't really found anything directly addressing the issue. Thanks!

Screenshot 2026-06-04 193655.png

Edited by EH_Studio
Needed clarification.
Link to comment
Share on other sites

vector p = @P;

// Center control, optional
p -= chv("pivot");

// Scale the cellular pattern
p *= chf("scale");

// Rotation controls in degrees
float rx = radians(chf("rotate_x"));
float ry = radians(chf("rotate_y"));
float rz = radians(chf("rotate_z"));

matrix3 m = ident();

rotate(m, rx, {1, 0, 0});
rotate(m, ry, {0, 1, 0});
rotate(m, rz, {0, 0, 1});

// Rotate the cellular noise space
p *= m;

// Directional stretch makes the rotation visible
p.x *= chf("stretch_x");
p.y *= chf("stretch_y");
p.z *= chf("stretch_z");

float f1, f2;
vector pos1, pos2;

vnoise(
    p,
    chf("jitter"),
    chi("seed"),
    f1,
    f2,
    pos1,
    pos2
);

// Border calculation
float edge = f2 - f1;

float border = 1.0 - smooth(
    chf("border_width"),
    chf("border_width") + chf("softness"),
    edge
);

// Cell color value
float cell = rand(pos1 + chi("seed"));

// Final result
float result = lerp(cell * chf("cell_brightness"), 1.0, border);

@Cd = set(result, result, result);

f@cell_border = border;
f@cell_value = cell;
f@cell_result = result;

 

image.png

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...