RetroArch
legacy_pipeline_xmb_ribbon.glsl.vert.h
Go to the documentation of this file.
1 #include "shaders_common.h"
2 
3 static const char *stock_vertex_xmb_ribbon_legacy = GLSL(
4  attribute vec3 VertexCoord;
5  uniform float time;
6  varying vec3 fragVertexEc;
7 
8  float iqhash( float n )
9  {
10  return fract(sin(n)*43758.5453);
11  }
12 
13  float noise( vec3 x )
14  {
15  vec3 p = floor(x);
16  vec3 f = fract(x);
17  f = f*f*(3.0-2.0*f);
18  float n = p.x + p.y*57.0 + 113.0*p.z;
19  return mix(mix(mix( iqhash(n+0.0 ), iqhash(n+1.0 ),f.x),
20  mix( iqhash(n+57.0 ), iqhash(n+58.0 ),f.x),f.y),
21  mix(mix( iqhash(n+113.0), iqhash(n+114.0),f.x),
22  mix( iqhash(n+170.0), iqhash(n+171.0),f.x),f.y),f.z);
23  }
24 
25  float xmb_noise2( vec3 x )
26  {
27  return cos(x.z*4.0)*cos(x.z+time/10.0+x.x);
28  }
29 
30  void main()
31  {
32  vec3 v = vec3(VertexCoord.x, 0.0, VertexCoord.y);
33  vec3 v2 = v;
34  vec3 v3 = v;
35 
36  v.y = xmb_noise2(v2)/8.0;
37 
38  v3.x = v3.x + time/5.0;
39  v3.x = v3.x / 4.0;
40 
41  v3.z = v3.z + time/10.0;
42  v3.y = v3.y + time/100.0;
43 
44  v.z = v.z + noise(v3*7.0)/15.0;
45  v.y = v.y + noise(v3*7.0)/15.0 + cos(v.x*2.0-time/2.0)/5.0 - 0.3;
46 
47  gl_Position = vec4(v, 1.0);
48  fragVertexEc = gl_Position.xyz;
49  }
50 );
GLfloat f
Definition: glext.h:8207
#define floor(x)
Definition: math.h:25
#define GLSL(src)
Definition: shaders_common.h:10
GLfloat GLfloat GLfloat v2
Definition: glext.h:6703
static const char * stock_vertex_xmb_ribbon_legacy
Definition: legacy_pipeline_xmb_ribbon.glsl.vert.h:3
time_t time(time_t *timer)
GLint GLint GLint GLint GLint x
Definition: glext.h:6295
GLfloat GLfloat p
Definition: glext.h:9809
#define sin(x)
Definition: math.h:23
int main(int argc, char *argv[])
Definition: send-presence.c:197
const GLdouble * v
Definition: glext.h:6391
#define cos(x)
Definition: math.h:21
GLfloat GLfloat GLfloat GLfloat v3
Definition: glext.h:6704
#define gl_Position
Definition: internal_interface.hpp:385
GLdouble n
Definition: glext.h:8396