summaryrefslogtreecommitdiff
path: root/shaders/vcr.kage
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2024-04-22 14:55:24 +0100
committerdavidovski <david@davidovski.xyz>2024-04-22 14:55:24 +0100
commiteeca23dc59e60def65dfefc28b69d6cfc85467ff (patch)
treed875998b4d335e766cf7a4dce0421705a638837e /shaders/vcr.kage
parentca826dfbc5d0e39e2fc96a4fb13565d82ad81cf5 (diff)
add clouds in bg
Diffstat (limited to 'shaders/vcr.kage')
-rw-r--r--shaders/vcr.kage12
1 files changed, 6 insertions, 6 deletions
diff --git a/shaders/vcr.kage b/shaders/vcr.kage
index fd555d8..45a543e 100644
--- a/shaders/vcr.kage
+++ b/shaders/vcr.kage
@@ -13,7 +13,7 @@ const noiseY = 100.0
const colorOffsetIntensity = 1.2
func rand(co vec2) float {
- return fract(sin(dot(co.xy, vec2(12.9898,78.233))) * 43758.5453);
+ return fract(sin(dot(co.xy, vec2(12.9898,78.233))) * 43758.5453)
}
func Fragment(dstPos vec4, srcPos vec2, color vec4) vec4 {
@@ -21,7 +21,7 @@ func Fragment(dstPos vec4, srcPos vec2, color vec4) vec4 {
uv := srcPos / imageSrc0Size()
uv.x = uv.x + (rand(vec2(Time,srcPos.y)) - 0.5) / (noiseX);
- uv.y = uv.y + (rand(vec2(Time))-0.5) / (noiseY);
+ uv.y = uv.y + (rand(vec2(Time))-0.5) / (noiseY)
whiteNoise := rand(vec2(floor(uv.y*80.0),floor(uv.x*50.0))+vec2(Time,0))
off := 1.0 - mod(uv.y - NoiseOffset / 7, 1)
@@ -29,15 +29,15 @@ func Fragment(dstPos vec4, srcPos vec2, color vec4) vec4 {
if (whiteNoise > 11.5-30.0*(off)) || whiteNoise < 1.5-2.0*(off) {
// Sample the texture.
- offsetR := vec2(0.006 * sin(Time), 0.0) * colorOffsetIntensity;
- offsetG := vec2(0.0073 * (cos(Time * 0.97)), 0.0) * colorOffsetIntensity;
+ offsetR := vec2(0.006 * sin(Time), 0.0) * colorOffsetIntensity
+ offsetG := vec2(0.0073 * (cos(Time * 0.97)), 0.0) * colorOffsetIntensity
r := imageSrc0UnsafeAt((uv+offsetR) * imageSrc0Size()).r
g := imageSrc0UnsafeAt((uv+offsetG) * imageSrc0Size()).g
b := imageSrc0UnsafeAt(uv * imageSrc0Size()).b
return vec4(r, g, b, 1.0)
} else {
- col = imageSrc2UnsafeAt(uv * imageSrc0Size());
- return col + vec4(0.8);
+ col = imageSrc2UnsafeAt(uv * imageSrc0Size())
+ return col + vec4(0.8)
}
}