Implement basic sRGB. Include frambuffers and postprocessing.

This commit is contained in:
4VRDriver
2020-09-20 16:45:41 +02:00
parent a5818dfd04
commit d641944119
15 changed files with 172 additions and 29 deletions

View File

@@ -28,7 +28,10 @@ Texture::Texture(const char* texturePath, uint8_t textureType) {
return;
}
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, textureWidth, textureHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, textureBuffer);
if(textureType == texture_diffuse)
glTexImage2D(GL_TEXTURE_2D, 0, GL_SRGB8_ALPHA8, textureWidth, textureHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, textureBuffer);
else
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, textureWidth, textureHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, textureBuffer);
//glGenerateMipmap(GL_TEXTURE_2D);
stbi_image_free(textureBuffer);
@@ -102,7 +105,7 @@ CubeMap::CubeMap(const char* texturePseudoPath) {
return;
}
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, GL_RGBA8, textureWidth, textureHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, textureBuffer);
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, GL_SRGB8_ALPHA8, textureWidth, textureHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, textureBuffer);
stbi_image_free(textureBuffer);