18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-20 22:04:59 +01:00

Improved water shader

This commit is contained in:
2026-11-16 22:55:33 +01:00
parent b8815a2455
commit 9071d3f4d3
12 changed files with 512 additions and 5 deletions

View File

@@ -2109,6 +2109,7 @@ global_settings::ConfigParse_gfx_sky( cParser &Parser, std::string_view const To
else if( Token == "gfx.cabprobe.reflections" ) { readswitch( gfx_cabprobe_reflections ); }
else if( Token == "gfx.cabprobe.sun" ) { readvalue( gfx_cabprobe_sun, 0.f, 4.f ); }
else if( Token == "gfx.interior.bounce" ) { readvalue( gfx_interior_bounce, 0.f, 1.f ); }
else if( Token == "gfx.water.realistic" ) { readswitch( gfx_water_realistic ); }
else if( Token == "gfx.skyvisibility" ) {
// no/low/medium/high, or the number of the level
Parser.getTokens( 1 );
@@ -2636,6 +2637,7 @@ global_settings::export_as_text( std::ostream &Output ) const {
export_as_text( Output, "gfx.cabprobe.reflections", gfx_cabprobe_reflections );
export_as_text( Output, "gfx.cabprobe.sun", gfx_cabprobe_sun );
export_as_text( Output, "gfx.interior.bounce", gfx_interior_bounce );
export_as_text( Output, "gfx.water.realistic", gfx_water_realistic );
export_as_text( Output, "gfx.skyvisibility", std::string{ gfx_skyvisibility == 3 ? "high" : gfx_skyvisibility == 2 ? "medium" : gfx_skyvisibility == 1 ? "low" : "no" } );
export_as_text( Output, "gfx.skyvisibility.sun", gfx_skyvisibility_sun );
export_as_text( Output, "gfx.skyvisibility.fog", gfx_skyvisibility_fog );

View File

@@ -552,6 +552,10 @@ struct global_settings {
// the light of the sun coming in through the windows of the low poly interiors of the vehicles and of the cab without its probe,
// bounced around them, as a share of the light of the sun on a surface facing it; 0 for none
float gfx_interior_bounce { 0.1f };
// the water of the scenery (the materials of the water shader, opengl 4.6 and vulkan, shaders/*/water_surface.glsl): rippled by
// layers of its normal map, reflecting the scene and the sky with the fresnel of water, seen through as deep as it is and fading
// out at the shore. off: the water drawn as before
bool gfx_water_realistic { false };
// the occlusion of the sky and of the sun by the scenery around the camera (opengl 4.6 and vulkan, gfx::sky_occlusion, the track T):
// tunnels, the ground under bridges and roofs, cuttings and the foot of slopes are dark by their geometry, worked out in the
// background from the scenery seen from above. 0 off (nothing is occluded), 1 low (256 m around the camera, texels of 1 m),