diff --git a/Effects/display.eff b/Effects/display.eff
index 395a344e4..3aaa20cc6 100644
--- a/Effects/display.eff
+++ b/Effects/display.eff
@@ -13,6 +13,13 @@
repeat
normalized
+
+ Textures\film-dirt.png
+ linear-mipmap-linear
+ repeat
+ repeat
+ normalized
+
@@ -26,6 +33,7 @@
+
@@ -157,6 +165,14 @@
buffer
bloom-3
+
+ 2
+
+
+
+
+
+
Shaders/fullscreen.vert
@@ -172,6 +188,11 @@
sampler-2d
1
+
+ film_tex
+ sampler-2d
+ 2
+
bloomEnabled
@@ -246,6 +267,12 @@
float
+
+
+ filmWear
+ bool
+
+
diff --git a/Shaders/cinema.frag b/Shaders/cinema.frag
index f906e46cc..a1ab1bf85 100644
--- a/Shaders/cinema.frag
+++ b/Shaders/cinema.frag
@@ -1,5 +1,6 @@
uniform sampler2D lighting_tex;
uniform sampler2D bloom_tex;
+uniform sampler2D film_tex;
uniform bool colorShift;
uniform vec3 redShift;
@@ -16,8 +17,10 @@ uniform vec3 distortionFactor;
uniform bool colorFringe;
uniform float colorFringeFactor;
+uniform bool filmWear;
+
uniform vec2 fg_BufferSize;
-// uniform float osg_SimulationTime;
+uniform float osg_SimulationTime;
// uniform float shutterFreq;
// uniform float shutterDuration;
@@ -54,6 +57,11 @@ void main() {
}
}
+ vec3 dirt = vec3(1.0);
+ if (filmWear) {
+ dirt = texture2D(film_tex, initialCoords + vec2(0.0, osg_SimulationTime * 7.7)).rgb;
+ }
+
vec4 color = texture2D( lighting_tex, c1 );
if (bloomEnabled && bloomBuffers)
color += bloomStrength * texture2D( bloom_tex, c1 );
@@ -77,10 +85,10 @@ void main() {
c = c * vec2( 1.0, fg_BufferSize.y / fg_BufferSize.x );
float l = length(c);
float f = smoothstep( innerCircle, innerCircle * outerCircle, l );
- color.rgb = (1 - f) * color.rgb;
+ color.rgb = (1.0 - f) * color.rgb;
}
// if ((osg_FrameNumber % 6) == 0)
// f = 1.0;
- gl_FragColor = color;
+ gl_FragColor = color * vec4(dirt, 1.0);
}
diff --git a/Textures/film-dirt.png b/Textures/film-dirt.png
new file mode 100644
index 000000000..06e28cb3f
Binary files /dev/null and b/Textures/film-dirt.png differ
diff --git a/gui/dialogs/rembrandt.xml b/gui/dialogs/rembrandt.xml
index dcba9f678..79b7d0135 100644
--- a/gui/dialogs/rembrandt.xml
+++ b/gui/dialogs/rembrandt.xml
@@ -1007,6 +1007,31 @@
+
+ hbox
+ left
+
+
+ left
+
+ film-wear
+ /sim/rendering/rembrandt/cinema/film-wear
+
+ dialog-apply
+ film-wear
+
+
+
+ /sim/rendering/rembrandt/night-vision
+
+ /sim/rendering/rembrandt/cinema/vignette
+ /sim/rendering/rembrandt/cinema/color-shift
+
+
+
+
+
+
diff --git a/preferences.xml b/preferences.xml
index 86450ca0c..3ce1c0cd8 100644
--- a/preferences.xml
+++ b/preferences.xml
@@ -101,6 +101,7 @@ Started September 2000 by David Megginson, david@megginson.com
false
1.0
+ false
1.0
false