From fc6bd8e784e97373dce8b0424f47dc722ce793a8 Mon Sep 17 00:00:00 2001 From: Lazaroth Date: Tue, 3 Feb 2015 00:23:30 +0100 Subject: [PATCH 1/4] Water tweaks As per https://forum.openmw.org/viewtopic.php?f=3&t=2492 Also did a quick remove trailing spaces. --- files/materials/water.shader | 101 +++++++++++++++++------------------ 1 file changed, 50 insertions(+), 51 deletions(-) diff --git a/files/materials/water.shader b/files/materials/water.shader index 4dec57276..99a52c801 100644 --- a/files/materials/water.shader +++ b/files/materials/water.shader @@ -4,7 +4,7 @@ #define SIMPLE_WATER @shGlobalSettingBool(simple_water) #if SIMPLE_WATER - // --------------------------------------- SIMPLE WATER --------------------------------------------------- + // --------------------------------------- SIMPLE WATER --------------------------------------------------- #define FOG @shGlobalSettingBool(fog) @@ -42,7 +42,7 @@ { shOutputColour(0).xyz = shSample(animatedTexture, UV * float2(15.0, 15.0)).xyz * float3(1.0, 1.0, 1.0); shOutputColour(0).w = 0.7; - + #if FOG float fogValue = shSaturate((depth - fogParams.y) * fogParams.w); shOutputColour(0).xyz = shLerp (shOutputColour(0).xyz, fogColor, fogValue); @@ -71,7 +71,7 @@ SH_BEGIN_PROGRAM shUniform(float4x4, wvp) @shAutoConstant(wvp, worldviewproj_matrix) - + shOutput(float3, screenCoordsPassthrough) shOutput(float4, position) shOutput(float, depthPassthrough) @@ -96,25 +96,25 @@ SH_START_PROGRAM { shOutputPosition = shMatrixMult(wvp, shInputPosition); - - + + #if !SH_GLSL float4x4 scalemat = float4x4( 0.5, 0.0, 0.0, 0.5, 0.0, -0.5, 0.0, 0.5, 0.0, 0.0, 0.5, 0.5, 0.0, 0.0, 0.0, 1.0 ); - #else - mat4 scalemat = mat4(0.5, 0.0, 0.0, 0.0, + #else + mat4 scalemat = mat4(0.5, 0.0, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.5, 0.5, 0.5, 1.0); #endif - + float4 texcoordProj = shMatrixMult(scalemat, shOutputPosition); screenCoordsPassthrough = float3(texcoordProj.x, texcoordProj.y, texcoordProj.w); - + position = shInputPosition; - + depthPassthrough = shOutputPosition.z; @@ -135,29 +135,28 @@ #define VISIBILITY 1500.0 // how far you can look through water - #define BIG_WAVES_X 0.3 // strength of big waves - #define BIG_WAVES_Y 0.3 - - #define MID_WAVES_X 0.3 // strength of middle sized waves - #define MID_WAVES_Y 0.15 - - #define SMALL_WAVES_X 0.15 // strength of small waves - #define SMALL_WAVES_Y 0.1 - - #define WAVE_CHOPPYNESS 0.15 // wave choppyness - #define WAVE_SCALE 75.0 // overall wave scale + #define BIG_WAVES_X 0.1 // strength of big waves + #define BIG_WAVES_Y 0.1 - #define BUMP 1.5 // overall water surface bumpiness - #define REFL_BUMP 0.08 // reflection distortion amount + #define MID_WAVES_X 0.1 // strength of middle sized waves + #define MID_WAVES_Y 0.1 + + #define SMALL_WAVES_X 0.1 // strength of small waves + #define SMALL_WAVES_Y 0.1 + + #define WAVE_CHOPPYNESS 0.05 // wave choppyness + #define WAVE_SCALE 75.0 // overall wave scale + + #define BUMP 0.5 // overall water surface bumpiness + #define REFL_BUMP 0.15 // reflection distortion amount #define REFR_BUMP 0.06 // refraction distortion amount #define SCATTER_AMOUNT 0.3 // amount of sunlight scattering #define SCATTER_COLOUR float3(0.0,1.0,0.95) // colour of sunlight scattering - #define SUN_EXT float3(0.45, 0.55, 0.68) //sunlight extinction - - #define SPEC_HARDNESS 256.0 // specular highlights hardness - + #define SUN_EXT float3(0.45, 0.55, 0.68) //sunlight extinction + + #define SPEC_HARDNESS 256.0 // specular highlights hardness // --------------------------------------------------------------- @@ -192,9 +191,9 @@ shUniform(float3, rippleCenter) @shSharedParameter(rippleCenter, rippleCenter) shUniform(float, rippleAreaLength) @shSharedParameter(rippleAreaLength, rippleAreaLength) #endif - + shUniform(float, far) @shAutoConstant(far, far_clip_distance) - + shSampler2D(reflectionMap) #if REFRACTION shSampler2D(refractionMap) @@ -207,23 +206,23 @@ #if RIPPLES shSampler2D(rippleNormalMap) #endif - + shUniform(float3, windDir_windSpeed) @shSharedParameter(windDir_windSpeed) #define WIND_SPEED windDir_windSpeed.z #define WIND_DIR windDir_windSpeed.xy - + shUniform(float, waterTimer) @shSharedParameter(waterTimer) shUniform(float2, waterSunFade_sunHeight) @shSharedParameter(waterSunFade_sunHeight) - + shUniform(float4, sunPosition) @shAutoConstant(sunPosition, light_position, 0) shUniform(float4, sunSpecular) @shAutoConstant(sunSpecular, light_specular_colour, 0) - + shUniform(float, renderTargetFlipping) @shAutoConstant(renderTargetFlipping, render_target_flipping) - - + + shUniform(float3, fogColor) @shAutoConstant(fogColor, fog_colour) shUniform(float4, fogParams) @shAutoConstant(fogParams, fog_params) - + shUniform(float4, cameraPos) @shAutoConstant(cameraPos, camera_position_object_space) @@ -244,7 +243,7 @@ #if SHADOWS || SHADOWS_PSSM shUniform(float4, shadowFar_fadeStart) @shSharedParameter(shadowFar_fadeStart) #endif - + SH_START_PROGRAM { @@ -279,19 +278,19 @@ float3 normal0 = 2.0 * shSample(normalMap, nCoord + float2(-waterTimer*0.015,-waterTimer*0.005)).rgb - 1.0; nCoord = UV * (WAVE_SCALE * 0.1) + WIND_DIR * waterTimer * (WIND_SPEED*0.08)-(normal0.xy/normal0.zz)*WAVE_CHOPPYNESS; float3 normal1 = 2.0 * shSample(normalMap, nCoord + float2(+waterTimer*0.020,+waterTimer*0.015)).rgb - 1.0; - + nCoord = UV * (WAVE_SCALE * 0.25) + WIND_DIR * waterTimer * (WIND_SPEED*0.07)-(normal1.xy/normal1.zz)*WAVE_CHOPPYNESS; float3 normal2 = 2.0 * shSample(normalMap, nCoord + float2(-waterTimer*0.04,-waterTimer*0.03)).rgb - 1.0; nCoord = UV * (WAVE_SCALE * 0.5) + WIND_DIR * waterTimer * (WIND_SPEED*0.09)-(normal2.xy/normal2.z)*WAVE_CHOPPYNESS; float3 normal3 = 2.0 * shSample(normalMap, nCoord + float2(+waterTimer*0.03,+waterTimer*0.04)).rgb - 1.0; - + nCoord = UV * (WAVE_SCALE* 1.0) + WIND_DIR * waterTimer * (WIND_SPEED*0.4)-(normal3.xy/normal3.zz)*WAVE_CHOPPYNESS; - float3 normal4 = 2.0 * shSample(normalMap, nCoord + float2(-waterTimer*0.02,+waterTimer*0.1)).rgb - 1.0; + float3 normal4 = 2.0 * shSample(normalMap, nCoord + float2(-waterTimer*0.02,+waterTimer*0.1)).rgb - 1.0; nCoord = UV * (WAVE_SCALE * 2.0) + WIND_DIR * waterTimer * (WIND_SPEED*0.7)-(normal4.xy/normal4.zz)*WAVE_CHOPPYNESS; float3 normal5 = 2.0 * shSample(normalMap, nCoord + float2(+waterTimer*0.1,-waterTimer*0.06)).rgb - 1.0; - - + + float3 normal = (normal0 * BIG_WAVES_X + normal1 * BIG_WAVES_Y + normal2 * MID_WAVES_X + normal3 * MID_WAVES_Y + normal4 * SMALL_WAVES_X + normal5 * SMALL_WAVES_Y); @@ -304,25 +303,25 @@ normal = normalize(float3(normal.x * BUMP + normal_ripple.x, normal.y * BUMP + normal_ripple.y, normal.z)); normal = float3(normal.x, normal.y, -normal.z); - // normal for sunlight scattering + // normal for sunlight scattering float3 lNormal = (normal0 * BIG_WAVES_X*0.5 + normal1 * BIG_WAVES_Y*0.5 + normal2 * MID_WAVES_X*0.2 + normal3 * MID_WAVES_Y*0.2 + normal4 * SMALL_WAVES_X*0.1 + normal5 * SMALL_WAVES_Y*0.1).xyz; lNormal = normalize(float3(lNormal.x * BUMP, lNormal.y * BUMP, lNormal.z)); lNormal = float3(lNormal.x, lNormal.y, -lNormal.z); - + float3 lVec = normalize(sunPosition.xyz); float3 vVec = normalize(position.xyz - cameraPos.xyz); - - + + float isUnderwater = (cameraPos.z > 0.0) ? 0.0 : 1.0; - + // sunlight scattering float3 pNormal = float3(0,0,1); float3 lR = reflect(lVec, lNormal); float3 llR = reflect(lVec, pNormal); - + float s = shSaturate(dot(lR, vVec)*2.0-1.2); float lightScatter = shadow * shSaturate(dot(-lVec,lNormal)*0.7+0.3) * s * SCATTER_AMOUNT * waterSunFade_sunHeight.x * shSaturate(1.0-exp(-waterSunFade_sunHeight.y)); float3 scatterColour = shLerp(float3(SCATTER_COLOUR)*float3(1.0,0.4,0.0), SCATTER_COLOUR, shSaturate(1.0-exp(-waterSunFade_sunHeight.y*SUN_EXT))); @@ -330,12 +329,12 @@ // fresnel float ior = (cameraPos.z>0.0)?(1.333/1.0):(1.0/1.333); //air to water; water to air float fresnel = fresnel_dielectric(-vVec, normal, ior); - + fresnel = shSaturate(fresnel); - + // reflection float3 reflection = shSample(reflectionMap, screenCoords+(normal.xy*REFL_BUMP)).rgb; - + // refraction float3 R = reflect(vVec, normal); From 7aa5dbc27e7eabcc6e510cd2aa027db6892a55d4 Mon Sep 17 00:00:00 2001 From: Lazaroth Date: Tue, 3 Feb 2015 02:31:03 +0100 Subject: [PATCH 2/4] Default sound level tweak These settings closer match vanilla relative sound levels. --- files/settings-default.cfg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/files/settings-default.cfg b/files/settings-default.cfg index 064c34d9c..19b570e2a 100644 --- a/files/settings-default.cfg +++ b/files/settings-default.cfg @@ -173,9 +173,9 @@ device = # Volumes. master volume affects all other volumes. master volume = 1.0 sfx volume = 1.0 -music volume = 0.4 -footsteps volume = 0.15 -voice volume = 1.0 +music volume = 0.5 +footsteps volume = 0.2 +voice volume = 0.8 [Input] From 7685de1d50845668adfe6736ea8de96f104d0dc9 Mon Sep 17 00:00:00 2001 From: Lazaroth Date: Tue, 3 Feb 2015 08:13:29 +0100 Subject: [PATCH 3/4] MyGUI tweaks Feedback / testing is needed on this. Some small button location tweaks and more importantly, some changes to bring consistency between the Potion maker screen (already in openmw), Trading screen (already in openmw), Spellmaker screen, Travel screen and Training screen. It's mainly the top bar I'm talking about and resizability. It is not 1:1 towards vanilla, but looks better (IMO) and again, creates some consistency. This can probably be expanded to the remaining screens such as Enchanting and Spell and perhaps even the save/load screen to have OpenMW wide consistency. --- files/mygui/openmw_enchanting_dialog.layout | 2 +- files/mygui/openmw_merchantrepair.layout | 21 +++++++-------- files/mygui/openmw_spell_buying_window.layout | 25 +++++++---------- .../mygui/openmw_spellcreation_dialog.layout | 5 ++-- files/mygui/openmw_trade_window.layout | 5 ++-- files/mygui/openmw_trainingwindow.layout | 20 ++++++-------- files/mygui/openmw_travel_window.layout | 27 +++++++++---------- 7 files changed, 45 insertions(+), 60 deletions(-) diff --git a/files/mygui/openmw_enchanting_dialog.layout b/files/mygui/openmw_enchanting_dialog.layout index 4fdb91602..ed62c8dc6 100644 --- a/files/mygui/openmw_enchanting_dialog.layout +++ b/files/mygui/openmw_enchanting_dialog.layout @@ -117,7 +117,7 @@ - + diff --git a/files/mygui/openmw_merchantrepair.layout b/files/mygui/openmw_merchantrepair.layout index 360f5f4f0..da7f37fe7 100644 --- a/files/mygui/openmw_merchantrepair.layout +++ b/files/mygui/openmw_merchantrepair.layout @@ -1,29 +1,26 @@ - + + + - - + - - - - - - - + + + - + - + diff --git a/files/mygui/openmw_spell_buying_window.layout b/files/mygui/openmw_spell_buying_window.layout index b24a476c4..73820c3d4 100644 --- a/files/mygui/openmw_spell_buying_window.layout +++ b/files/mygui/openmw_spell_buying_window.layout @@ -1,31 +1,26 @@ - + + + - - + - - - - - - - - + + + - - - + + - + diff --git a/files/mygui/openmw_spellcreation_dialog.layout b/files/mygui/openmw_spellcreation_dialog.layout index fac0497db..90b95b2f4 100644 --- a/files/mygui/openmw_spellcreation_dialog.layout +++ b/files/mygui/openmw_spellcreation_dialog.layout @@ -70,7 +70,7 @@ - + @@ -83,9 +83,8 @@ - - + diff --git a/files/mygui/openmw_trade_window.layout b/files/mygui/openmw_trade_window.layout index b2017661b..8668243cc 100644 --- a/files/mygui/openmw_trade_window.layout +++ b/files/mygui/openmw_trade_window.layout @@ -29,10 +29,10 @@ - + - + @@ -63,6 +63,7 @@ + diff --git a/files/mygui/openmw_trainingwindow.layout b/files/mygui/openmw_trainingwindow.layout index c58bd0ab3..d6cea8727 100644 --- a/files/mygui/openmw_trainingwindow.layout +++ b/files/mygui/openmw_trainingwindow.layout @@ -1,26 +1,22 @@ - + + + + - - - - - + + - - - - - + - + diff --git a/files/mygui/openmw_travel_window.layout b/files/mygui/openmw_travel_window.layout index 30b470e08..4b383ee7c 100644 --- a/files/mygui/openmw_travel_window.layout +++ b/files/mygui/openmw_travel_window.layout @@ -1,31 +1,28 @@ - + + + - - - + + - - - - + - - - + + + - - - + + - + From 42363191a41a30833247fbfe9eba634e8f035a3a Mon Sep 17 00:00:00 2001 From: Lazaroth Date: Tue, 3 Feb 2015 15:25:36 +0100 Subject: [PATCH 4/4] Layout tweaks --- files/mygui/openmw_enchanting_dialog.layout | 2 -- files/mygui/openmw_merchantrepair.layout | 20 ++++++++------- files/mygui/openmw_persuasion_dialog.layout | 14 +++++------ files/mygui/openmw_spell_buying_window.layout | 22 ++++++++-------- .../mygui/openmw_spellcreation_dialog.layout | 14 ++++------- files/mygui/openmw_trade_window.layout | 5 ++-- files/mygui/openmw_trainingwindow.layout | 20 +++++++++------ files/mygui/openmw_travel_window.layout | 25 ++++++++++--------- 8 files changed, 62 insertions(+), 60 deletions(-) diff --git a/files/mygui/openmw_enchanting_dialog.layout b/files/mygui/openmw_enchanting_dialog.layout index ed62c8dc6..b90fc7a77 100644 --- a/files/mygui/openmw_enchanting_dialog.layout +++ b/files/mygui/openmw_enchanting_dialog.layout @@ -141,8 +141,6 @@ - - diff --git a/files/mygui/openmw_merchantrepair.layout b/files/mygui/openmw_merchantrepair.layout index da7f37fe7..23ab6008f 100644 --- a/files/mygui/openmw_merchantrepair.layout +++ b/files/mygui/openmw_merchantrepair.layout @@ -1,26 +1,28 @@ - + - - - + + + + + - - - + + + - + - + diff --git a/files/mygui/openmw_persuasion_dialog.layout b/files/mygui/openmw_persuasion_dialog.layout index 87851b479..6fb298914 100644 --- a/files/mygui/openmw_persuasion_dialog.layout +++ b/files/mygui/openmw_persuasion_dialog.layout @@ -1,17 +1,13 @@ - + - + - - - - @@ -39,7 +35,11 @@ - + + + + + diff --git a/files/mygui/openmw_spell_buying_window.layout b/files/mygui/openmw_spell_buying_window.layout index 73820c3d4..0350f1e27 100644 --- a/files/mygui/openmw_spell_buying_window.layout +++ b/files/mygui/openmw_spell_buying_window.layout @@ -1,26 +1,28 @@ - + - - - + + + + + - - - + + + - - + + - + diff --git a/files/mygui/openmw_spellcreation_dialog.layout b/files/mygui/openmw_spellcreation_dialog.layout index 90b95b2f4..11197bf2a 100644 --- a/files/mygui/openmw_spellcreation_dialog.layout +++ b/files/mygui/openmw_spellcreation_dialog.layout @@ -1,10 +1,9 @@ - + - @@ -16,9 +15,7 @@ - - - + @@ -33,7 +30,6 @@ - @@ -46,7 +42,6 @@ - @@ -70,7 +65,7 @@ - + @@ -83,8 +78,9 @@ + + - diff --git a/files/mygui/openmw_trade_window.layout b/files/mygui/openmw_trade_window.layout index 8668243cc..b2017661b 100644 --- a/files/mygui/openmw_trade_window.layout +++ b/files/mygui/openmw_trade_window.layout @@ -29,10 +29,10 @@ - + - + @@ -63,7 +63,6 @@ - diff --git a/files/mygui/openmw_trainingwindow.layout b/files/mygui/openmw_trainingwindow.layout index d6cea8727..c58bd0ab3 100644 --- a/files/mygui/openmw_trainingwindow.layout +++ b/files/mygui/openmw_trainingwindow.layout @@ -1,22 +1,26 @@ - - - - + - + + + + + - - + + + + + - + diff --git a/files/mygui/openmw_travel_window.layout b/files/mygui/openmw_travel_window.layout index 4b383ee7c..3603f7dcb 100644 --- a/files/mygui/openmw_travel_window.layout +++ b/files/mygui/openmw_travel_window.layout @@ -1,28 +1,29 @@ - + - - - - + + + + + + - - - - + + + - - + + - +