RetroArch
modern_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_modern = GLSL(
4  in vec3 VertexCoord;
5  uniform float time;
6  out 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 height(vec3 pos )
26  {
27  const float twoPi = 2.0 * 3.14159;
28  float k = twoPi / 20.0;
29  float omega = twoPi / 15.0;
30  float y = sin( k * pos.x - omega * time );
31  y += noise( vec3(0.27) * vec3( 0.4 * pos.x, 3.0, 2.0 * pos.z - 0.5 * time ) );
32  return y;
33  }
34 
35  void main()
36  {
37  vec3 pos = VertexCoord;
38  pos.y = height( pos );
39  gl_Position = vec4(pos, 1.0);
40  fragVertexEc =pos;
41  }
42 );
GLfloat f
Definition: glext.h:8207
struct passwd out
Definition: missing_libc_functions.c:51
#define floor(x)
Definition: math.h:25
#define GLSL(src)
Definition: shaders_common.h:10
GLint GLint GLint GLint GLint GLint y
Definition: glext.h:6295
time_t time(time_t *timer)
GLint GLint GLint GLint GLint x
Definition: glext.h:6295
GLuint in
Definition: glext.h:10523
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
static const char * stock_vertex_xmb_ribbon_modern
Definition: modern_pipeline_xmb_ribbon.glsl.vert.h:3
#define gl_Position
Definition: internal_interface.hpp:385
GLdouble n
Definition: glext.h:8396
GLint GLint GLsizei GLsizei height
Definition: glext.h:6293