RetroArch
pipeline_bokeh.glsl.frag.h
Go to the documentation of this file.
1 #include "shaders_common.h"
2 
3 static const char* stock_fragment_xmb_bokeh = GLSL(
4  uniform float time;
5  uniform vec2 OutputSize;
6 
7  void main(void)
8  {
9  float speed = time * 4.0;
10  vec2 uv = -1.0 + 2.0 * gl_FragCoord.xy / OutputSize.xy;
11  uv.x *= OutputSize.x / OutputSize.y;
12  vec3 color = vec3(0.0);
13 
14  for( int i=0; i < 8; i++ )
15  {
16  float pha = sin(float(i) * 546.13 + 1.0) * 0.5 + 0.5;
17  float siz = pow(sin(float(i) * 651.74 + 5.0) * 0.5 + 0.5, 4.0);
18  float pox = sin(float(i) * 321.55 + 4.1) * OutputSize.x / OutputSize.y;
19  float rad = 0.1 + 0.5 * siz + sin(pha + siz) / 4.0;
20  vec2 pos = vec2(pox + sin(speed / 15. + pha + siz), - 1.0 - rad + (2.0 + 2.0 * rad) * fract(pha + 0.3 * (speed / 7.) * (0.2 + 0.8 * siz)));
21  float dis = length(uv - pos);
22  if(dis < rad)
23  {
24  vec3 col = mix(vec3(0.194 * sin(speed / 6.0) + 0.3, 0.2, 0.3 * pha), vec3(1.1 * sin(speed / 9.0) + 0.3, 0.2 * pha, 0.4), 0.5 + 0.5 * sin(float(i)));
25  color += col.zyx * (1.0 - smoothstep(rad * 0.15, rad, dis));
26  }
27  }
28  color *= sqrt(1.5 - 0.5 * length(uv));
29  gl_FragColor = vec4(color.r, color.g, color.b , 0.5);
30  }
31 
32 );
static const char * stock_fragment_xmb_bokeh
Definition: pipeline_bokeh.glsl.frag.h:3
#define sqrt(x)
Definition: math.h:26
#define GLSL(src)
Definition: shaders_common.h:10
#define gl_FragCoord
Definition: internal_interface.hpp:357
time_t time(time_t *timer)
#define sin(x)
Definition: math.h:23
int main(int argc, char *argv[])
Definition: send-presence.c:197
#define pow(x, y)
Definition: math.h:22
u32 col
Definition: gx_regdef.h:5093
GLuint color
Definition: glext.h:6883
GLenum GLuint GLenum GLsizei length
Definition: glext.h:6233