From 1ec87f79908c2dce8c454de7b79bc7111edb1e46 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 22 Jun 2015 19:59:55 +0200 Subject: [PATCH] Moved postpro texture to shader --- src/rlgl.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/rlgl.c b/src/rlgl.c index 02776995..efb23856 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -1045,12 +1045,7 @@ void rlglInitPostpro(void) postproQuad = rlglLoadModel(quadData); - Texture2D texture; - texture.id = fboColorTexture; - texture.width = w; - texture.height = h; - - SetModelTexture(&postproQuad, texture); + // NOTE: fboColorTexture id must be assigned to postproQuad model shader #endif } @@ -1060,6 +1055,13 @@ void rlglSetPostproShader(Shader shader) #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) rlglSetModelShader(&postproQuad, shader); + Texture2D texture; + texture.id = fboColorTexture; + texture.width = GetScreenWidth(); + texture.height = GetScreenHeight(); + + SetShaderMapDiffuse(&postproQuad.shader, texture); + //TraceLog(INFO, "Postproquad texture id: %i", postproQuad.texture.id); //TraceLog(INFO, "Postproquad shader diffuse map id: %i", postproQuad.shader.texDiffuseId); //TraceLog(INFO, "Shader diffuse map id: %i", shader.texDiffuseId); @@ -1369,8 +1371,7 @@ void rlglDrawModel(Model model, Vector3 position, float rotationAngle, Vector3 r // Set shader textures (diffuse, normal, specular) glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, model.texture.id); - //glBindTexture(GL_TEXTURE_2D, model.shader.texDiffuseId); + glBindTexture(GL_TEXTURE_2D, model.shader.texDiffuseId); //glUniform1i(model.shader.mapDiffuseLoc, 0); // Diffuse texture fits in texture unit 0 if (vaoSupported)