|
|
@ -15,9 +15,13 @@ vec4 int2color(uint color_int) {
|
|
|
|
|
|
|
|
|
|
|
|
void main() {
|
|
|
|
void main() {
|
|
|
|
int region_index = gl_InstanceIndex/region_hex_count;
|
|
|
|
int region_index = gl_InstanceIndex/region_hex_count;
|
|
|
|
int hex_index = gl_InstanceIndex - (region_index*region_hex_count);
|
|
|
|
|
|
|
|
Region region = pc.context.regions[region_index];
|
|
|
|
Region region = pc.context.regions[region_index];
|
|
|
|
|
|
|
|
if(region.map == 0) {
|
|
|
|
|
|
|
|
gl_Position = vec4(0, 0, 0, 0);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int hex_index = gl_InstanceIndex - (region_index*region_hex_count);
|
|
|
|
vec2 region_qr = vec2(region.q, region.r);
|
|
|
|
vec2 region_qr = vec2(region.q, region.r);
|
|
|
|
|
|
|
|
|
|
|
|
vec4 region_pos = vec4(0, 0, 0, 0);
|
|
|
|
vec4 region_pos = vec4(0, 0, 0, 0);
|
|
|
@ -40,9 +44,9 @@ void main() {
|
|
|
|
region.hexes[hex_index].heights[2] +
|
|
|
|
region.hexes[hex_index].heights[2] +
|
|
|
|
region.hexes[hex_index].heights[3] +
|
|
|
|
region.hexes[hex_index].heights[3] +
|
|
|
|
region.hexes[hex_index].heights[4] +
|
|
|
|
region.hexes[hex_index].heights[4] +
|
|
|
|
region.hexes[hex_index].heights[5])/6;
|
|
|
|
region.hexes[hex_index].heights[5])/6 + region.y;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
position.y = region.hexes[hex_index].heights[indices[gl_VertexIndex]-1];
|
|
|
|
position.y = region.hexes[hex_index].heights[indices[gl_VertexIndex]-1] + region.y;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
color = int2color(region.hexes[hex_index].colors[indices[gl_VertexIndex]]);
|
|
|
|
color = int2color(region.hexes[hex_index].colors[indices[gl_VertexIndex]]);
|
|
|
|
|
|
|
|
|
|
|
|