Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //MagicaVoxel shader by foreheadmelon
- //Set a specific voxel to a specific color
- //xs setvox [x] [y] [z] [color]
- //example: 'xs setvox 10 20 50'
- //color defaults to the selected color, otherwise use 1-255 for the palette index or negative values for air
- float map(vec3 v) {
- float orig = voxel(v);
- float mat = iArgs[3];
- if(mat==0) mat = iColorIndex;
- if(mat<0) mat = 0;
- if(v==vec3(iArgs[0], iArgs[1], iArgs[2])) return mat;
- return orig;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement