Skip to content

Commit

Permalink
Improve sand coloring
Browse files Browse the repository at this point in the history
  • Loading branch information
io12 committed Jan 14, 2019
1 parent 8ef1b88 commit 52563e2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/shaders/voxel_vert.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ void main(void) {
gl_Position = matrix * vec4(pos, 1.0);
switch (voxel_type) {
case 1u: // Sand
v_color = vec4(0.926, 0.785, 0.684, 1.0);
if (int(pos.x) % 2 == 0) {
v_color = vec4(0.926, 0.785, 0.684, 1.0);
} else if (int(pos.z) % 2 == 0) {
v_color = vec4(0.626, 0.585, 0.484, 1.0);
} else {
v_color = vec4(0.426, 0.385, 0.284, 1.0);
}
break;
default:
v_color = vec4(1.0, 1.0, 1.0, 1.0);
Expand Down

0 comments on commit 52563e2

Please sign in to comment.