From 3f9906a918036dafbf0ff40f84e9cfaf383705e9 Mon Sep 17 00:00:00 2001 From: veclavtalica Date: Mon, 20 Jan 2025 19:29:57 +0300 Subject: [PATCH] remove fog start and fog end parameters --- apps/demos/scenery/scenes/ingame.c | 5 ++--- include/twn_context.h | 2 +- share/twn_api.json | 2 -- src/rendering/twn_gl_15_rendering.c | 2 -- src/twn_loop.c | 1 - 5 files changed, 3 insertions(+), 9 deletions(-) diff --git a/apps/demos/scenery/scenes/ingame.c b/apps/demos/scenery/scenes/ingame.c index e3e14c9..2925ebe 100644 --- a/apps/demos/scenery/scenes/ingame.c +++ b/apps/demos/scenery/scenes/ingame.c @@ -13,7 +13,7 @@ #define TERRAIN_FREQUENCY 0.15f -#define TERRAIN_DISTANCE 32 +#define TERRAIN_DISTANCE 64 #define HALF_TERRAIN_DISTANCE ((float)TERRAIN_DISTANCE / 2) #define PLAYER_HEIGHT 0.6f @@ -225,8 +225,7 @@ static void ingame_tick(State *state) { draw_skybox("/assets/miramar/miramar_*.tga"); ctx.fog_color = (Color){ 140, 147, 160, 255 }; - ctx.fog_start = 0.9f; - ctx.fog_density = 0.05f; + ctx.fog_density = 0.03f; } diff --git a/include/twn_context.h b/include/twn_context.h index a057c45..8cdb342 100644 --- a/include/twn_context.h +++ b/include/twn_context.h @@ -24,7 +24,7 @@ typedef struct Context { float frame_duration; /* it is disabled by having fog_density approximately equal to zero */ - float fog_start, fog_end, fog_density; + float fog_density; Color fog_color; /* resolution is set from config and dictates both logical and drawing space, as they're related */ diff --git a/share/twn_api.json b/share/twn_api.json index 52010e2..59469fa 100644 --- a/share/twn_api.json +++ b/share/twn_api.json @@ -281,8 +281,6 @@ "fields": [ { "name": "frame_number", "type": "float" }, { "name": "frame_duration", "type": "float" }, - { "name": "fog_start", "type": "float" }, - { "name": "fog_end", "type": "float" }, { "name": "fog_density", "type": "float" }, { "name": "fog_color", "type": "Color" }, { "name": "resolution", "type": "Vec2" }, diff --git a/src/rendering/twn_gl_15_rendering.c b/src/rendering/twn_gl_15_rendering.c index 35e8913..f650d76 100644 --- a/src/rendering/twn_gl_15_rendering.c +++ b/src/rendering/twn_gl_15_rendering.c @@ -454,8 +454,6 @@ void finally_draw_command(DeferredCommandDraw command) { ctx.game_copy.fog_density = clampf(ctx.game_copy.fog_density, 0.0, 1.0); glFogf(GL_FOG_DENSITY, ctx.game_copy.fog_density); - glFogf(GL_FOG_START, ctx.game_copy.fog_start); - glFogf(GL_FOG_END, ctx.game_copy.fog_end); float color_conv[4]; color_conv[0] = (float)ctx.game_copy.fog_color.r / UINT8_MAX; diff --git a/src/twn_loop.c b/src/twn_loop.c index c959d73..a812167 100644 --- a/src/twn_loop.c +++ b/src/twn_loop.c @@ -604,7 +604,6 @@ static bool initialize(void) { ctx.window_mouse_resident = true; ctx.game.fog_color = (Color){ 255, 255, 255, 255 }; /* TODO: pick some grey? */ - ctx.game.fog_end = 1.0f; update_viewport();