Thursday 11 April 2024

culling stuff camera

 string camera=chs("../camera");

vector campos=toNDC(camera,@P);



vector2 padding =chu("../padding");


if((campos.x+padding.x)<0||(campos.x-padding.x)>1||(campos.y+padding.y)||(campos.y-padding.y)){

        i@group_kill=1;}


matrix cam=optransform(camera);


vector camera_position=cracktransform(0,0,0,{0,0,0}, cam);


float distance =distance (camera_position,@P);


float threshold=chf("../distance");

if(distance>threshold){

        i@group_kill=1;}

Tuesday 9 April 2024

instance ass files (not paths)

use instancefile to access geo saved somewhere...

in a point wrangle - 


  s@instancefile=chs("path");


now with the geo node, you gotta add the instance tab and turn on fast instancing.





Wednesday 20 March 2024

resource - projecting curve onto heightfield with control

 Projecting a Road Curve onto a Heightfield - procegen - Procedural Content Generation (konstantinmagnus.de)


some of the newer tools in Houdini might do this, but it's quite nice to see how to do it manually.

point wrangle the curve, with heightfield in input 1..

float lift = chf('lift'); f@height = volumesample(1, 'height', v@P) + lift;


then plug that into a volume wrangle (input 1), heightfield in input 0 

float width_min = chf('min_width'); float width_max = chf('max_width'); float ease = chf('roll_off'); int prim; vector uvw; float dist_crv = xyzdist(1, v@P, prim, uvw); float height_crv = primuv(1, 'height', prim, uvw); float mask = 1.0 - smooth(width_min, width_max, dist_crv, ease); f@height = lerp(f@height, height_crv, mask); f@mask = mask;


You can control the height with the "lift" slider made in the point wrangle, and the width/falloff in the sliders made in the volume wrangle.

Friday 2 February 2024

simple rigging setups using kinefx

 

typical basic kinefx rigging for organicish shapes


simple rigid body FK rig. Key points are packing each rigid part, and using the capture packed geo node. make sure the skeleton points are at the desired pivot points.


basic setup here - line as a skeleton, isolate the FBIK controller points. the MATCH BY ATTRIBUTE setting is usually what makes things work! Also on the FBIK node, you might need to tweak the tolerance parameter.

look at constraint but only in the X or Y etc

 


There's a Look At Constraint, in the Constraints tab, however if you only want this aim to work on the X, or maybe just the Y, you have to dig into the constraint, then go to the Common Tab (see top screenshot) and then only specify the rx or ry in the scope.

Remember to use Nulls to set custom pivots etc, then parent your desired geometry to the null.

Monday 25 September 2023

resolving intersections between multiple closed objects (like cushions)

to summarise - convert to vdb, do a volume point sample. multiply the normal of the geo by the volume sample and then add back to the original position. It should push in -or out- for a packed cushiony effect.

nicely demo'd here by Emīls Geršinskis - Ješinskis
https://www.youtube.com/watch?v=2yGxLHSYf8I

Tuesday 28 March 2023

fusing geo using uv attribute (eg. separated head from neck)

Lets say you've separated the head geo from the body for rigging purposes or otherwise.
How do you glue it back together reliably, without resorting to many individual vertex pair selections and fusing each?
UV's! As long as your mesh has good non overlapping UV's (which existed before you chopped it), you can promote them from vertex to point (might as well give it a new name, and keep the originals for actual texture use) then specify this new attribute at the Match Attribute (see below). Turn off Snap Distance, as the UV data is what will snap vertices/points together (in this case I've called it fuse_uv). I've left everything else in the Fuse node as default.
This is super handy especially if your model's point count is not fixed (eg you're not sure where you're cutting the model yet)