aboutsummaryrefslogtreecommitdiff
path: root/assets/shaders/plasma.frag.glsl
blob: 4a5ac3da834f9846c2f0ddefa4f3fdf52bc8025a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//
// Fragment shader for procedural bricks
//
// Authors: Dave Baldwin, Steve Koren, Randi Rost
//          based on a shader by Darwyn Peachey
//
// Copyright (c) 2002-2006 3Dlabs Inc. Ltd. 
//
// See 3Dlabs-License.txt for license information
//

#ifdef GL_ES
precision highp float;
#endif


varying vec2 	v_uv;
uniform float 	u_time;

uniform float u_wave;
uniform float u_wave1;
uniform float u_wave2;
uniform float u_speed;

void main(void)
{
	float x = v_uv.x ;
	float y = v_uv.y ;
	float time = u_time*u_speed;

	float wave =	(cos(time + y / (u_wave+0.2)  + cos(x / (u_wave+0.3) + cos((y / (u_wave+0.1))))));
	float wave1 =	(sin(abs(wave + y/u_wave1)));
	float wave2 =	(sin(abs(wave1 + y/u_wave2)));

	gl_FragColor = vec4( abs(vec3(wave2,wave1,wave)),1.0);
}