important fix, texture manager

This commit is contained in:
2023-02-07 18:11:06 +03:00
parent 9cc870c996
commit 4e62165c80
15 changed files with 401 additions and 20 deletions

View File

@@ -119,7 +119,7 @@ void Renderer::reloadShaders() {
shader_fxaa = nullptr;
if (tone_proc.shader_sum) delete tone_proc.shader_sum;
tone_proc.shader_sum = nullptr;
QString dir = ":/shaders/";
QString dir = "./shaders/";
while (it.hasNext()) {
it.next();
loadShadersMulti(shaders[it.key()], dir + it.value(), true, shader_defines.value(it.key()));
@@ -409,21 +409,22 @@ void Renderer::renderScene() {
fbo_out.bindColorTexture(obrSolidSpot, 2);
fbo_out.bindColorTexture(obrTransparentOmni, 3);
fbo_out.bindColorTexture(obrTransparentSpot, 4);
fbo_out.setWriteBuffer(obrGeneral0);
fbo_out.setWriteBuffer(obrLighting);
renderQuad(prog, quad);
}
phase.end();
cur_write_plane = obrGeneral0;
fbo_out.bind();
cur_write_plane = obrLighting;
/// tonemapping
phase.begin("tonemap");
tone_proc.process();
auto free = getFreePlanes(0);
if (bindShader(srTonemapPass, &prog)) {
fbo_out.bind();
prog->setUniformValue("gamma", gamma_);
prog->setUniformValue("frame_max", tone_proc.frameMax());
// qDebug() << tone_proc.frameMax();
fbo_out.bindColorTexture(prev_write_plane, 0);
renderQuad(prog, quad);
} else {