Playstation Waves

shader port of “Playstation Waves” by sangwhan on ShaderToy
source: https://www.shadertoy.com/view/XdtfRB#

Shader code
shader_type canvas_item;
// sweetbabyalaska shader port of "Playstation Waves" by sangwhan on ShaderToy
// source: https://www.shadertoy.com/view/XdtfRB#

uniform vec3 background_color : source_color = vec3(0.25, 0.0, 0.2);
uniform float GWM = 2.05;
uniform float TM = 0.25;
uniform sampler2D tex;

float getAmp(float frequency) {
	return texture(tex, vec2(frequency / 512.0, 0)).x;
}

float getWeight(float f) {
	return (getAmp(f - 2.0) + getAmp(f - 1.0) +
			getAmp(f + 2.0) + getAmp(f + 1.0) +
			getAmp(f)) / 5.0;
}

void fragment() {
	vec3 backdrop = mix(background_color, background_color, background_color);
	vec2 uvTrue =  FRAGCOORD.xy / (1.0 / SCREEN_PIXEL_SIZE);
	vec2 uv = 2.0 * uvTrue - 1.0;

	float li;
	float gw;
	float ts;

	vec3 color = vec3(0.0);

	for(float i = 0.0; i < 5.0; i++) {
		uv.y += (0.2 * sin(uv.x + i / 7.0 - TIME * 0.6));
		float Y = uv.y + getWeight(pow(i, 2.0) * 20.0) * (texture(tex, vec2(uvTrue.x, 1)).x - 0.5);
		li = 0.4 + pow(1.6 * abs(mod(uvTrue.x + i / 1.1 + TIME, 2.0) - 1.0), 2.0);
		gw = abs(li / (150.0 * Y));

        ts = gw * (GWM + sin(TIME * TM));
		color += vec3(ts, ts, ts);
	}

	COLOR = vec4(color + backdrop, 0.5);
}
Live Preview
Tags
canvas, light, playstation, ps3, waves
This shader is a port from an existing Shadertoy project. Shadertoy shaders are by default protected under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0) license unless anything else has been stated by the author. For more info, see our License terms.

More from sweetbabyalaska

Related shaders

guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments