refactor & fix random deleting texture

This commit is contained in:
MihailRis
2025-05-10 16:13:06 +03:00
parent e158b384fa
commit 8bb03a004f
7 changed files with 65 additions and 64 deletions
+6 -5
View File
@@ -135,20 +135,21 @@ void PostProcessing::render(
const auto& vp = context.getViewport();
refreshFbos(vp.x, vp.y);
glActiveTexture(GL_TEXTURE4);
glBindTexture(GL_TEXTURE_2D, shadowMap);
if (gbuffer) {
gbuffer->bindBuffers();
glActiveTexture(GL_TEXTURE3);
glBindTexture(GL_TEXTURE_2D, noiseTexture);
glActiveTexture(GL_TEXTURE4);
glBindTexture(GL_TEXTURE_2D, shadowMap);
glActiveTexture(GL_TEXTURE0);
} else {
glActiveTexture(GL_TEXTURE0);
fbo->getTexture()->bind();
}
glActiveTexture(GL_TEXTURE0);
if (totalPasses == 0) {
auto& effect = assets.require<PostEffect>("default");
auto& shader = effect.use();