mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-27 21:48:31 +00:00
Moved postpro texture to shader
This commit is contained in:
17
src/rlgl.c
17
src/rlgl.c
@@ -1045,12 +1045,7 @@ void rlglInitPostpro(void)
|
|||||||
|
|
||||||
postproQuad = rlglLoadModel(quadData);
|
postproQuad = rlglLoadModel(quadData);
|
||||||
|
|
||||||
Texture2D texture;
|
// NOTE: fboColorTexture id must be assigned to postproQuad model shader
|
||||||
texture.id = fboColorTexture;
|
|
||||||
texture.width = w;
|
|
||||||
texture.height = h;
|
|
||||||
|
|
||||||
SetModelTexture(&postproQuad, texture);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1060,6 +1055,13 @@ void rlglSetPostproShader(Shader shader)
|
|||||||
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
|
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
|
||||||
rlglSetModelShader(&postproQuad, shader);
|
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 texture id: %i", postproQuad.texture.id);
|
||||||
//TraceLog(INFO, "Postproquad shader diffuse map id: %i", postproQuad.shader.texDiffuseId);
|
//TraceLog(INFO, "Postproquad shader diffuse map id: %i", postproQuad.shader.texDiffuseId);
|
||||||
//TraceLog(INFO, "Shader diffuse map id: %i", 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)
|
// Set shader textures (diffuse, normal, specular)
|
||||||
glActiveTexture(GL_TEXTURE0);
|
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
|
//glUniform1i(model.shader.mapDiffuseLoc, 0); // Diffuse texture fits in texture unit 0
|
||||||
|
|
||||||
if (vaoSupported)
|
if (vaoSupported)
|
||||||
|
Reference in New Issue
Block a user