wonkey_monkey
9th March 2025, 02:36
I feel like I'm going to go nuts trying to find information about the ins and outs of OpenGL. It seems like it's really difficult to get a decent answer on anything.
Anyway, right now I'm playing with compute shaders. I can generate a texture like this:
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
and do compute shader stuff on it, but what I really want to do is get gamma correction automatically. On another project, not using compute shaders but writing to a window's framebuffer, I was able to use GL_SRGB instead of GL_RGBA8 to work in SRGB and get gamma correction, but if I do that in my compute shader project, I just get a black output.
Is GL_SRGB incompatible with compute shaders, or something? :confused:
Anyway, right now I'm playing with compute shaders. I can generate a texture like this:
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
and do compute shader stuff on it, but what I really want to do is get gamma correction automatically. On another project, not using compute shaders but writing to a window's framebuffer, I was able to use GL_SRGB instead of GL_RGBA8 to work in SRGB and get gamma correction, but if I do that in my compute shader project, I just get a black output.
Is GL_SRGB incompatible with compute shaders, or something? :confused: