fix quality profile water/shadows
authorhgn <hgodden00@gmail.com>
Tue, 30 Jan 2024 04:30:51 +0000 (04:30 +0000)
committerhgn <hgodden00@gmail.com>
Tue, 30 Jan 2024 04:30:51 +0000 (04:30 +0000)
shaders/scene_water_fast.fs
world_gen.c
world_render.c
world_water.c

index 77aa569dd3dd7121345bfa1fb6c5ac78eee58720..f89cee55ead0ab3e9da1b8305b43605261f6b854 100644 (file)
@@ -55,4 +55,5 @@ void main()
    vec4 vsurface = water_surf( halfview, surfnorm, depthvalue );
    vsurface.a -= fdist;
    oColour = mix( vsurface, vec4(1.0,1.0,1.0,0.5), fband );
+   oColour.rgb = scene_compute_lighting( oColour.rgb, aNorm.xyz, aWorldCo );
 }
index 6572876b15eb80e2c45084480f2c01424df26e05..1bbc2ca21a7f52a6219e1cef80fdd36bad20480a 100644 (file)
@@ -109,7 +109,8 @@ static void world_apply_procedural_foliage( world_instance *world,
                                                scene_context *scene,
                                                struct world_surface *mat )
 {
-   if( vg.quality_profile == k_quality_profile_low )
+   if( (vg.quality_profile == k_quality_profile_low) ||
+       (vg.quality_profile == k_quality_profile_min) )
       return;
 
    vg_info( "Applying foliage (%u)\n", mat->info.pstr_name );
index 9eac40e3eda13e2c8bcc3acb94f48cb007aa8039..e675abf96501afcebf59316c57e3f0150bf0deda 100644 (file)
@@ -858,6 +858,13 @@ static void world_prerender( world_instance *world ){
    state->g_debug_complexity = k_debug_light_complexity;
    state->g_time_of_day = vg_fractf( world->time );
 
+   if( vg.quality_profile == k_quality_profile_high )
+      state->g_shadow_samples = 8;
+   else if( vg.quality_profile == k_quality_profile_low )
+      state->g_shadow_samples = 2;
+   else
+      state->g_shadow_samples = 0;
+
    state->g_day_phase   = cosf( state->g_time_of_day * VG_PIf * 2.0f );
    state->g_sunset_phase= cosf( state->g_time_of_day * VG_PIf * 4.0f + VG_PIf );
 
index 085e25250ac8217ea746c97bdf918c67105f79f6..62e133d72d7cd31181621dae41668e32378a0645 100644 (file)
@@ -170,7 +170,8 @@ static void render_water_surface( world_instance *world, camera *cam ){
 
       glDisable(GL_BLEND);
    }
-   else if( vg.quality_profile == k_quality_profile_low ){
+   else if( (vg.quality_profile == k_quality_profile_low) ||
+            (vg.quality_profile == k_quality_profile_min) ){
       shader_scene_water_fast_use();
 
       glActiveTexture( GL_TEXTURE1 );