mirror of
https://github.com/JoeyDeVries/LearnOpenGL.git
synced 2026-01-30 20:13:22 +08:00
Deferred Shading: Fixed bug with the normal texture component of the
gBuffer. The texture was being set up as GL_RGB instead of GL_RGB16F which caused negative components of normals to be set to 0.
This commit is contained in:
@@ -134,7 +134,7 @@ int main()
|
||||
// - Normal color buffer
|
||||
glGenTextures(1, &gNormal);
|
||||
glBindTexture(GL_TEXTURE_2D, gNormal);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, SCR_WIDTH, SCR_HEIGHT, 0, GL_RGB, GL_FLOAT, NULL);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB16F, SCR_WIDTH, SCR_HEIGHT, 0, GL_RGB, GL_FLOAT, NULL);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, GL_TEXTURE_2D, gNormal, 0);
|
||||
|
||||
Reference in New Issue
Block a user