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

summaryrefslogtreecommitdiff
path: root/source/client
diff options
context:
space:
mode:
authorBottinator22 <59987380+Bottinator22@users.noreply.github.com>2024-08-21 19:22:25 -0700
committerGitHub <noreply@github.com>2024-08-21 19:22:25 -0700
commitb0d3c88834c2c73732b1850ab2415dc2d7637e4b (patch)
tree22a79e99bde1e057e4ad96f75d1d3e564d2a8057 /source/client
parent8937f0d816b30b113c6042213a317ba143ea151b (diff)
Update StarClientApplication.cpp
Diffstat (limited to 'source/client')
-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");
}