summaryrefslogtreecommitdiff
path: root/new_shader_selection.gdshader
blob: 513ee921db1ba4296461130f4f27b3927d5f1e2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
shader_type spatial;

uniform sampler2DArray textures : filter_nearest, source_color;
uniform int elements_per_row;

varying float is_block;

void vertex() {
	// Called for every vertex the material is visible on.
}

void fragment() {
	// Called for every pixel the material is visible on.
	int index = int(UV2.y) * elements_per_row + int(UV2.x);
	vec4 element = texture(textures, vec3(UV, float(index)));
	ALBEDO = element.rgb;
	ALPHA = element.a;
}

//void light() {
	// Called for every pixel for every light affecting the material.
	// Uncomment to replace the default light processing function with this one.
//}