Bomb Rush Cyberfunk – Hippie Bands

Inspired by the shaders in the game “Bomb Rush Cyberfunk”, this shader is a groovy trip of moving, swirling colours.

Shader code
shader_type spatial;
render_mode unshaded;

// In the style of "Bomb Rush Cyberfunk" loading screen, and the memory sequences
// Creates moving bands and shifts them with movement

// How many banding lines to draw
uniform float line_scale = 1.0;
// This shader maps to a (1,1) uv square. Change these values accordingly to stretch it over different sizes
uniform vec2 uv_scale = vec2(1., 1.);
// How fast it moves and animates overall
uniform float time_scale = 0.5;
// Another controller for how fast it moves, this one controlling the rate of motion more
uniform float velocity = 3.0;
// Phase of the noise
uniform float warp_phase = 5.1123314;
#define NUM_COLS 4
// The 4 colours to band between
uniform vec4 colours[NUM_COLS] : source_color;
// The values of the banding to change from one to the next
uniform float val_stops[NUM_COLS - 1]; // 1 less that the number of colours, these are where the edges between the colours are

float lines(vec2 pos, float b) {
	pos *= line_scale;
	return smoothstep(	0.0, 
						0.5 + b * 0.1,
						abs(sin(pos.x * 3.1415) + b * 2.0) * 0.5);
}

float bands(vec2 pos) {
	pos *= line_scale;
	return abs(sin(pos.x * 3.1415));
}

// Map black-white intensity into colour
vec4 color_in(float val) {
	for (int i = 0; i < NUM_COLS-1; i++) {
		if (val < val_stops[i])
			return colours[i];
	}
	return colours[NUM_COLS-1];
}

void fragment() {
	vec2 uv = UV * uv_scale;
	
	vec2 pos = uv;
	float pattern = pos.x;
	
	float speed = TIME * time_scale;
	vec2 uv2 = vec2(pos.x + pos.y);
	for (int i = 0; i < 5; i++) {
		pos += 0.5 * vec2(
			cos(warp_phase + 0.353 * uv2.y + speed * 0.131121) - speed * velocity,
			sin(uv2.x - 0.113 * speed)
		);
		pos -= 1.0 * cos(pos.x + pos.y) - 1. * cos(pos.x * 0.0711 - pos.y);
	}
	
	
	pattern = bands(pos);
	
	ALBEDO = color_in(pattern).rgb;
}
Live Preview
The shader code and all code snippets in this post are under CC0 license and can be used freely without the author's permission. Images and videos, and assets depicted in those, do not fall under this license. For more info, see our License terms.

Related shaders

guest

1 Comment
Oldest
Newest Most Voted
rng_
rng_
9 hours ago

Wonderful shader! Been trying to make something like this myself for a while, thank you!