void vertex() {
position = VERTEX;
face_normal = abs(NORMAL);
face_normal_non_abs = NORMAL;
int x = int(round(position.x));
int y = int(round(position.y));
int z = int(round(position.z));
int result = z * 17 * 257 + y * 17 + x;
brightness = lighting[result];
brightness = clamp(brightness, 0.0025, 1.0);
}
``` this is what i use to index the lighting array (the chunksize is 17 * 17 * 257 vertices)
#Copying array of float to shader, does indexing work the same?
2 messages · Page 1 of 1 (latest)