@fleabay @warp9
I tried the following for drawing each part of the terrain:
uniform float colorValues[256] =
{
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
};
It worked, but it runs slowly due to this:
for(int i = 0; i < (pass_textureCoords.x * 16); i++)
{
for(int j = 0; j < (pass_textureCoords.y * 16); j++)
{
if(colorValues[i + j*16] == 0)
{
blendMapColor.r = 0;
blendMapColor.g = 0;
blendMapColor.b = 0;
}
if(colorValues[i + j*16] == 1)
{
blendMapColor.r = 0;
blendMapColor.g = 1;
blendMapColor.b = 0;
}
if(colorValues[i + j*16] == 2)
{
blendMapColor.r = 0;
blendMapColor.g = 0;
blendMapColor.b = 1;
}
}
}
Because of these for loops, the game has quite a few issues running at a playable speed.