Skip to content

Instantly share code, notes, and snippets.

@jtomori
Last active December 22, 2018 20:59
Show Gist options
  • Save jtomori/69d3c4aa59a77c1270e33a301cc64225 to your computer and use it in GitHub Desktop.
Save jtomori/69d3c4aa59a77c1270e33a301cc64225 to your computer and use it in GitHub Desktop.
float dist = chf("dist");
int voxels = chi("voxels");
int mode = chi("voxels_dist_mode");
float voxel_size = volumevoxeldiameter(0, 0) / sqrt(3);
float val;
if (mode)
val = dist;
else
val = voxel_size * voxels;
f@surface = clamp(f@surface, -val, val);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment