Archived post by SniperJake945

you can get some neat effects by adjusting the above code too, like a weighted max, with just a constant y value for the gradient can give you this like pillars rising up effect: “`c vector g = volumegradient(1, 0, @P); //taking the gradient from the second input,
float intensity = ch(“intensity”); float dx = length(v@dPdx); //voxel size; g *= dx; //scale our vector by voxel size float samples = chi(“samples”); float out_val = @density; float weights = 1.0; for(int i = 0; i <= samples; i++){ float u = i / float(samples); //0 -> 1 vector sample_p = v@P + g * u * intensity; float value = volumesample(0, 0, sample_p); float w = smooth(-.1, 1, 1 – u); //in theory this should be a gaussian, because its a better falloff, but yolo out_val = max(out_val,value * w); //weighted max
} @density = out_val;// / weights; “`

Attachments in this post:
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20222908/22/22/unknown.png