aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorraysan5 <raysan5@gmail.com>2015-06-22 19:59:55 +0200
committerraysan5 <raysan5@gmail.com>2015-06-22 19:59:55 +0200
commit1ec87f79908c2dce8c454de7b79bc7111edb1e46 (patch)
tree9b02cf61dd7d6b08d33f4aa82496a2ead11f192e /src
parentbae1bf7b0a4758996cd2373367e712089dded221 (diff)
downloadraylib-1ec87f79908c2dce8c454de7b79bc7111edb1e46.tar.gz
raylib-1ec87f79908c2dce8c454de7b79bc7111edb1e46.zip
Moved postpro texture to shader
Diffstat (limited to 'src')
-rw-r--r--src/rlgl.c17
1 files 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)