RetroArch
core_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_core = GLSL(
4  uniform float time;
5  uniform vec2 OutputSize;
6  out vec4 FragColor;
7 
8  void main(void)
9  {
10  float speed = time * 4.0;
11  vec2 uv = -1.0 + 2.0 * gl_FragCoord.xy / OutputSize.xy;
12  uv.x *= OutputSize.x / OutputSize.y;
13  vec3 color = vec3(0.0);
14 
15  for( int i=0; i < 8; i++ )
16  {
17  float pha = sin(float(i) * 546.13 + 1.0) * 0.5 + 0.5;
18  float siz = pow(sin(float(i) * 651.74 + 5.0) * 0.5 + 0.5, 4.0);
19  float pox = sin(float(i) * 321.55 + 4.1) * OutputSize.x / OutputSize.y;
20  float rad = 0.1 + 0.5 * siz + sin(pha + siz) / 4.0;
21  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)));
22  float dis = length(uv - pos);
23  if(dis < rad)
24  {
25  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)));
26  color += col.zyx * (1.0 - smoothstep(rad * 0.15, rad, dis));
27  }
28  }
29  color *= sqrt(1.5 - 0.5 * length(uv));
30  FragColor = vec4(color.r, color.g, color.b , 0.5);
31  }
32 
33 );
struct passwd out
Definition: missing_libc_functions.c:51
#define sqrt(x)
Definition: math.h:26
#define GLSL(src)
Definition: shaders_common.h:10
#define gl_FragCoord
Definition: internal_interface.hpp:357
static const char * stock_fragment_xmb_bokeh_core
Definition: core_pipeline_bokeh.glsl.frag.h:3
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