separate shaders, RGBA16F doesn’t work with picking in iOS

This commit is contained in:
2018-08-08 11:09:35 +02:00
parent f941fc4254
commit 9cccecd381
7 changed files with 45 additions and 17 deletions

View File

@@ -55,14 +55,13 @@ ui::Image ui::Image::resize(int w, int h)
auto pixels = (glm::u8vec4*)data();
float x_ratio = ((float)(width - 1)) / w;
float y_ratio = ((float)(height - 1)) / h;
float x_diff, y_diff, ya, yb;
int offset = 0;
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
int x = (int)(x_ratio * j);
int y = (int)(y_ratio * i);
x_diff = (x_ratio * j) - x;
y_diff = (y_ratio * i) - y;
float x_diff = (x_ratio * j) - x;
float y_diff = (y_ratio * i) - y;
int index = y * width + x;
// range is 0 to 255 thus bitwise AND with 0xff