Skip to content
Snippets Groups Projects
Commit 808a1f27 authored by Sebastian Pape's avatar Sebastian Pape
Browse files

Fixed LUT rendering

parent 27f5f1d6
No related branches found
No related tags found
No related merge requests found
...@@ -313,7 +313,8 @@ void RayPass::createTarget() { ...@@ -313,7 +313,8 @@ void RayPass::createTarget() {
auto color = lut_img->GetPixelColor({0, 0}); auto color = lut_img->GetPixelColor({0, 0});
for (auto i = 0u; i < 256u; i++) { for (auto i = 0u; i < 256u; i++) {
color = lut_img->GetPixelColor({i, 0}); color = lut_img->GetPixelColor({i, 0});
LUT[i] = glm::vec3(color[0], color[1], color[2]); LUT[i] = glm::vec3((float)color[0] / 255.0f, (float)color[1] / 255.0f,
(float)color[2] / 255.0f);
} }
// Material // Material
...@@ -411,7 +412,7 @@ void RayPass::copyAndScaleTargetData() { ...@@ -411,7 +412,7 @@ void RayPass::copyAndScaleTargetData() {
curr_val = buffer_data[i] / max; curr_val = buffer_data[i] / max;
// LUT // LUT
curr_color = &LUT[(int)(255 * curr_val)]; curr_color = &LUT[(int)(255.0f * curr_val)];
// color highest values red // color highest values red
textureDataBuffer[i * 3] = curr_color->x; textureDataBuffer[i * 3] = curr_color->x;
......
resources/models/opticalBench/laser/Target_LUT.png

128 B | W: | H:

resources/models/opticalBench/laser/Target_LUT.png

128 B | W: | H:

resources/models/opticalBench/laser/Target_LUT.png
resources/models/opticalBench/laser/Target_LUT.png
resources/models/opticalBench/laser/Target_LUT.png
resources/models/opticalBench/laser/Target_LUT.png
  • 2-up
  • Swipe
  • Onion skin
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment