Skip to content
Snippets Groups Projects
Commit 15107caf authored by Sindre Eiklid's avatar Sindre Eiklid
Browse files

Added colors according to depth

parent a773da4e
No related branches found
No related tags found
No related merge requests found
......@@ -255,6 +255,23 @@ GLuint loadHeightMap(const std::string& filepath, const GLuint slot) {
size_t index = RGBA * (i * width + j);
color = static_cast<int>(pixels[index]);
arr.push_back(color);
if(color < 40) {
pixels[index + 0] = 255;
pixels[index + 1] = 208;
pixels[index + 2] = 89;
} else if(color < 60) {
pixels[index + 0] = 35;
pixels[index + 1] = 145;
pixels[index + 2] = 20;
} else if(color < 100) {
pixels[index + 0] = 158;
pixels[index + 1] = 158;
pixels[index + 2] = 158;
} else {
pixels[index + 0] = 227;
pixels[index + 1] = 227;
pixels[index + 2] = 227;
}
}
pixelDepth.push_back(arr);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment