#Copying array of float to shader, does indexing work the same?

2 messages · Page 1 of 1 (latest)

hasty hamlet
#
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)
#

here you can see it only lights up the first column of the 16 chunks columns, perhaps the fault is in the way i sample my coordinates before i index. been stuck at this for days, need an extra set of eyes here 👁️