Advertisement
Guest User

setvox.txt

a guest
Sep 22nd, 2019
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.45 KB | None | 0 0
  1. //MagicaVoxel shader by foreheadmelon
  2. //Set a specific voxel to a specific color
  3.  
  4. //xs setvox [x] [y] [z] [color]
  5. //example: 'xs setvox 10 20 50'
  6. //color defaults to the selected color, otherwise use 1-255 for the palette index or negative values for air
  7.  
  8. float map(vec3 v) {
  9.     float orig = voxel(v);
  10.     float mat = iArgs[3];
  11.  
  12.     if(mat==0) mat = iColorIndex;
  13.     if(mat<0) mat = 0;
  14.     if(v==vec3(iArgs[0], iArgs[1], iArgs[2])) return mat;
  15.  
  16.     return orig;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement