Skip to content

Instantly share code, notes, and snippets.

@sakura-crowd
Created May 1, 2023 02:42
Show Gist options
  • Save sakura-crowd/4dd62157e0c14b809b772ac977dc697b to your computer and use it in GitHub Desktop.
Save sakura-crowd/4dd62157e0c14b809b772ac977dc697b to your computer and use it in GitHub Desktop.
ボクセルエディター MagicaVoxel で用いる自作 Shader です。 box シェーダーは指定された直方体範囲を指定された色のボクセルで塗りつぶします。
// xs_begin
// author : 'SakuraCrowd'
// xs_end
//===== built-in args =====
// uniform float i_color_index; // current color index [0-255]
//===== built-in functions =====
// 範囲内全てに対して選択しているカラーインデックスを返し、選択範囲の直方体をその色のボクセルで塗りつぶします。
float map( vec3 v ) {
return i_color_index;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment