From 363a362ddcaa7a9c77dacc323bb12524dfacedd8 Mon Sep 17 00:00:00 2001 From: Luke Lau Date: Sun, 9 Feb 2020 23:53:59 +0000 Subject: [PATCH] Fix skybox images not using the right data layout Something changed in ImageIO or OpenGL that caused UNSIGNED_SHORTS to be treated differently from GL_HALF_FLOAT --- skybox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skybox.cpp b/skybox.cpp index 5c510e5..d668d76 100644 --- a/skybox.cpp +++ b/skybox.cpp @@ -95,7 +95,7 @@ Skybox::Skybox(const Image img): program("skyboxvert.glsl", "skyboxfrag.glsl") { glBindTexture(GL_TEXTURE_2D, hdrTexId); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB16, img.width(), img.height(), 0, GL_RGB, GL_UNSIGNED_SHORT, (unsigned short*)img.data()); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB16F, img.width(), img.height(), 0, GL_RGB, GL_HALF_FLOAT, (uint16_t*)img.data()); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); -- 2.30.2