|
|
@ -36,45 +36,45 @@ void main() {
|
|
|
|
uint idx = get_idx(0,0);
|
|
|
|
uint idx = get_idx(0,0);
|
|
|
|
|
|
|
|
|
|
|
|
ivec4 p = separate(read_buffer.buf[get_idx(0 , 0)]);
|
|
|
|
ivec4 p = separate(read_buffer.buf[get_idx(0 , 0)]);
|
|
|
|
// ivec4 p0 = separate(read_buffer.buf[get_idx(0 , 1)]);
|
|
|
|
ivec4 p0 = separate(read_buffer.buf[get_idx(0 , 1)]);
|
|
|
|
// ivec4 p1 = separate(read_buffer.buf[get_idx(0 ,-1)]);
|
|
|
|
ivec4 p1 = separate(read_buffer.buf[get_idx(0 ,-1)]);
|
|
|
|
// ivec4 p2 = separate(read_buffer.buf[get_idx(1 , 1)]);
|
|
|
|
ivec4 p2 = separate(read_buffer.buf[get_idx(1 , 1)]);
|
|
|
|
// ivec4 p3 = separate(read_buffer.buf[get_idx(-1,-1)]);
|
|
|
|
ivec4 p3 = separate(read_buffer.buf[get_idx(-1,-1)]);
|
|
|
|
// ivec4 p4 = separate(read_buffer.buf[get_idx(1 , 0)]);
|
|
|
|
ivec4 p4 = separate(read_buffer.buf[get_idx(1 , 0)]);
|
|
|
|
// ivec4 p5 = separate(read_buffer.buf[get_idx(-1, 0)]);
|
|
|
|
ivec4 p5 = separate(read_buffer.buf[get_idx(-1, 0)]);
|
|
|
|
// ivec4 p6 = separate(read_buffer.buf[get_idx(1 ,-1)]);
|
|
|
|
ivec4 p6 = separate(read_buffer.buf[get_idx(1 ,-1)]);
|
|
|
|
// ivec4 p7 = separate(read_buffer.buf[get_idx(-1, 1)]);
|
|
|
|
ivec4 p7 = separate(read_buffer.buf[get_idx(-1, 1)]);
|
|
|
|
|
|
|
|
|
|
|
|
// ivec3 d0 = abs(p0.xyz - p1.xyz);
|
|
|
|
ivec3 d0 = abs(p0.xyz - p1.xyz);
|
|
|
|
// ivec3 d1 = abs(p2.xyz - p3.xyz);
|
|
|
|
ivec3 d1 = abs(p2.xyz - p3.xyz);
|
|
|
|
// ivec3 d2 = abs(p4.xyz - p5.xyz);
|
|
|
|
ivec3 d2 = abs(p4.xyz - p5.xyz);
|
|
|
|
// ivec3 d3 = abs(p6.xyz - p7.xyz);
|
|
|
|
ivec3 d3 = abs(p6.xyz - p7.xyz);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ivec3 m = max(max(max(d0, d1), d2), d3);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ((m.x + m.y + m.z) > 975){
|
|
|
|
|
|
|
|
p.x = 0;
|
|
|
|
|
|
|
|
p.y = 0;
|
|
|
|
|
|
|
|
p.z = 255;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
|
|
|
|
// ivec3 m = max(max(max(d0, d1), d2), d3);
|
|
|
|
//p.w = 125;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// if ((m.x + m.y + m.z) > 275){
|
|
|
|
write_buffer.buf[idx] = (write_buffer.buf[idx] & (~0x000000FF) ) | (p.x);
|
|
|
|
// p.x = 0;
|
|
|
|
write_buffer.buf[idx] = (write_buffer.buf[idx] & (~0x0000FF00) ) | (p.y << 8);
|
|
|
|
// p.y = 0;
|
|
|
|
write_buffer.buf[idx] = (write_buffer.buf[idx] & (~0x00FF0000) ) | (p.z << 16);
|
|
|
|
// p.z = 255;
|
|
|
|
write_buffer.buf[idx] = (write_buffer.buf[idx] & (~0xFF000000) ) | (p.w << 24);
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// //p.z = max(p.z - (d0.x + d0.y + d0.z + d1.x + d1.y + d1.z)/5, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// write_buffer.buf[idx] = (write_buffer.buf[idx] & (~0x000000FF) ) | (p.x);
|
|
|
|
|
|
|
|
// write_buffer.buf[idx] = (write_buffer.buf[idx] & (~0x0000FF00) ) | (p.y << 8);
|
|
|
|
|
|
|
|
// write_buffer.buf[idx] = (write_buffer.buf[idx] & (~0x00FF0000) ) | (p.z << 16);
|
|
|
|
|
|
|
|
// write_buffer.buf[idx] = (write_buffer.buf[idx] & (~0xFF000000) ) | (p.w << 24);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// p.x = 70;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// write_buffer.buf[idx] = (write_buffer.buf[idx] & (~0x000000FF) ) | (p.x);
|
|
|
|
|
|
|
|
// write_buffer.buf[idx] = (write_buffer.buf[idx] & (~0x0000FF00) ) | (p.y << 8);
|
|
|
|
|
|
|
|
// write_buffer.buf[idx] = (write_buffer.buf[idx] & (~0x00FF0000) ) | (p.z << 16);
|
|
|
|
|
|
|
|
// write_buffer.buf[idx] = (write_buffer.buf[idx] & (~0xFF000000) ) | (p.w << 24);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Just gonna keep this around
|
|
|
|
// read_buffer.buf[idx] = (read_buffer.buf[idx] & (~0x000000FF) ) | (p.x);
|
|
|
|
// read_buffer.buf[idx] = (read_buffer.buf[idx] & (~0x000000FF) ) | (p.x);
|
|
|
|
// read_buffer.buf[idx] = (read_buffer.buf[idx] & (~0x0000FF00) ) | (p.y << 8);
|
|
|
|
// read_buffer.buf[idx] = (read_buffer.buf[idx] & (~0x0000FF00) ) | (p.y << 8);
|
|
|
|
// read_buffer.buf[idx] = (read_buffer.buf[idx] & (~0x00FF0000) ) | (p.z << 16);
|
|
|
|
// read_buffer.buf[idx] = (read_buffer.buf[idx] & (~0x00FF0000) ) | (p.z << 16);
|
|
|
|
// read_buffer.buf[idx] = (read_buffer.buf[idx] & (~0xFF000000) ) | (p.w << 24);
|
|
|
|
// read_buffer.buf[idx] = (read_buffer.buf[idx] & (~0xFF000000) ) | (p.w << 24);
|
|
|
|
}
|
|
|
|
|