Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/client/StarClientApplication.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/client/StarClientApplication.cpp')
-rw-r--r--source/client/StarClientApplication.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/source/client/StarClientApplication.cpp b/source/client/StarClientApplication.cpp
index 5f3d119..80f0e01 100644
--- a/source/client/StarClientApplication.cpp
+++ b/source/client/StarClientApplication.cpp
@@ -400,6 +400,17 @@ void ClientApplication::render() {
});
LogMap::set("client_render_world_painter", strf(u8"{:05d}\u00b5s", Time::monotonicMicroseconds() - paintStart));
LogMap::set("client_render_world_total", strf(u8"{:05d}\u00b5s", Time::monotonicMicroseconds() - totalStart));
+
+ auto size = Vec2F(renderer->screenSize());
+ auto quad = renderFlatRect(RectF::withSize(size/-2, size), Vec4B(0.0f,0.0f,0.0f,0.0f), 0.0f);
+ for (auto& layer : m_postProcessLayers) {
+ for(unsigned i = 0; i < layer.passes; i++) {
+ for (auto& effect : layer.effects) {
+ renderer->switchEffectConfig(effect);
+ renderer->render(quad);
+ }
+ }
+ }
}
renderer->switchEffectConfig("interface");
auto start = Time::monotonicMicroseconds();
@@ -449,8 +460,20 @@ void ClientApplication::renderReload() {
};
renderer->loadConfig(assets->json("/rendering/opengl.config"));
-
+
loadEffectConfig("world");
+
+ m_postProcessLayers.clear();
+ auto postProcessLayers = assets->json("/client.config:postProcessLayers").toArray();
+ for (auto& layer : postProcessLayers) {
+ List<String> effects;
+ for (auto& effect : layer.getArray("effects")) {
+ auto effectStr = effect.toString();
+ loadEffectConfig(effectStr);
+ effects.append(effectStr);
+ }
+ m_postProcessLayers.append(PostProcessLayer{effects,layer.getUInt("passes",1)});
+ }
loadEffectConfig("interface");
}