From 763952de21e9f3854a70954f6e6e5f45a53d51a0 Mon Sep 17 00:00:00 2001 From: schmelczerandras Date: Mon, 19 Oct 2020 11:47:27 +0200 Subject: [PATCH] Add quality scaling settings --- .../settings/default-runtime-settings.ts | 2 ++ .../rendering/settings/runtime-settings.ts | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/graphics/rendering/settings/default-runtime-settings.ts b/src/graphics/rendering/settings/default-runtime-settings.ts index bf75fa3..025ed71 100644 --- a/src/graphics/rendering/settings/default-runtime-settings.ts +++ b/src/graphics/rendering/settings/default-runtime-settings.ts @@ -9,6 +9,8 @@ export const defaultRuntimeSettings: RuntimeSettings = { tileMultiplier: 8, isWorldInverted: false, lightCutoffDistance: 400, + distanceRenderScale: 0.5, + lightsRenderScale: 1, colorPalette: [], ambientLight: vec3.fromValues(0.25, 0.15, 0.25), textures: {}, diff --git a/src/graphics/rendering/settings/runtime-settings.ts b/src/graphics/rendering/settings/runtime-settings.ts index f086c16..8dc3eb2 100644 --- a/src/graphics/rendering/settings/runtime-settings.ts +++ b/src/graphics/rendering/settings/runtime-settings.ts @@ -48,6 +48,23 @@ export interface RuntimeSettings { */ colorPalette: Array; + /** + * The resolution of the distance field rendering will be scaled up or down with this value. + * + * Because of interpolation, this can be set much lower than the `lightsRenderScale`, while + * maintaining closely the same perceived quality. + * + * Setting this is a great way to balance quality and performance. + */ + distanceRenderScale: number; + + /** + * The resolution of the final frame will be scaled by this value. + * + * Setting this is a great way to balance quality and performance. + */ + lightsRenderScale: number; + /** * It is possible to use your own textures in your SDF definitions. *