// The pixel shader of the old film post screen shader effect
ps.1.4

// The color that is to be applied to the picture
def c1, 0.8f, 0.65f, 0.5f, 1.0f
// A summand that is added to the color to reach worse contrasts
def c2, 0.15f, 0.05f, 0.05f, 1.0f
// The strength of the color in this very early color film
def c3, 0.3f, 0.3f, 0.3f, 1.0f

// Get a texel from the scene texture
texld r0, t0
// Get a texel from the dark borders texture
texld r1, t1
// Get a texel from the ugly stripes texture
texld r2, t2
// Get a texel from the ugly spots texture
texld r3, t3

// Compute the brightness of the texel from the scene texture
dp3 r4.rgb, r0, c0
// Combine the color part and the gray scale part
mad r0.rgb, r0, c3, r4
// Apply the beige color factor and the contrast weakening summand
mad r0.rgb, r0, c1, c2
// Apply the dark border texture
mul r0.rgb, r0, r1
// Apply the ugly stripes texture
mul r0.rgb, r0, r2
// Apply the ugly spots texture
mul r0.rgb, r0, r3
+mov r0.a, c1
