Last active
December 22, 2018 20:59
-
-
Save jtomori/69d3c4aa59a77c1270e33a301cc64225 to your computer and use it in GitHub Desktop.
Clamping Houdini native SDF fields, for https://jurajtomori.wordpress.com/2018/07/09/houdini-tip-houdini-native-volume-sdf-into-vdb-conversion/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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