diff --git a/data/tr1/ship/shaders/sprites.glsl b/data/tr1/ship/shaders/sprites.glsl index 8a13dfb6f..e816f549b 100644 --- a/data/tr1/ship/shaders/sprites.glsl +++ b/data/tr1/ship/shaders/sprites.glsl @@ -12,12 +12,14 @@ layout(location = 1) in vec2 inDisplacement; layout(location = 2) in int inUVWIdx; layout(location = 3) in float inShade; +out vec4 gWorldPos; out vec2 gTexUV; flat out int gTexLayer; out float gShade; void main(void) { vec4 centerEyeSpace = uMatModelView * vec4(inPosition, 1.0); + gWorldPos = centerEyeSpace; centerEyeSpace.xy += inDisplacement; gl_Position = uMatProjection * centerEyeSpace; @@ -39,7 +41,9 @@ uniform sampler2D uTexEnvMap; uniform bool uSmoothingEnabled; uniform float uBrightnessMultiplier; uniform vec3 uGlobalTint; +uniform vec2 uFog; // x = fog start, y = fog end +in vec4 gWorldPos; in vec2 gTexUV; flat in int gTexLayer; in float gShade; @@ -56,9 +60,11 @@ void main(void) { discard; } - texColor.rgb *= 2.0 - (gShade / NEUTRAL_SHADE); - texColor.rgb *= uBrightnessMultiplier; + float shade = gShade; + shade = shadeFog(shade, gWorldPos.z, uFog); + texColor.rgb = applyShade(texColor.rgb, shade); texColor.rgb *= uGlobalTint; + texColor.rgb *= uBrightnessMultiplier; outColor = vec4(texColor.rgb, 1.0); } #endif diff --git a/docs/tr1/CHANGELOG.md b/docs/tr1/CHANGELOG.md index 24fe5eb7e..2bb666641 100644 --- a/docs/tr1/CHANGELOG.md +++ b/docs/tr1/CHANGELOG.md @@ -12,6 +12,7 @@ - fixed being stuck on the Restart Level page if using save crystals and F5 is pressed when no saves are present (#2700, regression from 4.8.2) - fixed being stuck on the Exit to Title page if using save crystals and a new save is made when there were previously none, and then F5 is pressed (#2700, regression from 4.9) - fixed the sprite UVs to restore the right and bottom edge pixels (#2672, regression from 4.8) +- fixed sprites missing the fog effect (regression from 4.9) - improved bubble appearance (#2672) - improved rendering performance - removed the pretty pixels options (it's now always enabled, #2258)