Jump to content

I let AI write my scatter VEX — instances stop looking identical (quick demo)


Recommended Posts

Quick one. Scattering rocks (or any asset) on terrain and every copy comes out facing the same way at the same size — that fake, stamped-out look. The fix is a proper orient setup so each instance gets its own rotation and scale without flipping.

The tricky part is the orient quaternion — do it from N alone and instances flip. The clean way is a full stable orient (Shoemake uniform rotation) plus a random uniform scale, exposed as sliders:

    // Point Wrangle between Scatter and Copy to Points, run over Points
    int   seed = chi("seed");
    float smin = ch("scale_min");
    float smax = ch("scale_max");

    vector u = rand(set(@ptnum, seed, 0));
    float r1 = sqrt(1.0 - u.x);
    float r2 = sqrt(u.x);
    float t1 = 2.0 * PI * u.y;
    float t2 = 2.0 * PI * u.z;

    p@orient = set(sin(t1)*r1, cos(t1)*r1, sin(t2)*r2, cos(t2)*r2);

    float s = rand(set(@ptnum, seed, 1));
    @pscale = fit01(s, smin, smax);

I made a short video walking through it end to end (build the scatter, hit the problem, generate the VEX, paste, done):
https://www.youtube.com/watch?v=0FxEAaKmLBU

The VEX in the video was generated by a Houdini skill I built for AI agents — it's on my Gumroad if useful, but the code above is the whole fix, free. Feedback welcome.

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...