RetroArch
pipeline_xmb_ribbon_simple.cg.h
Go to the documentation of this file.
1 #include "shaders_common.h"
2 
3 static const char *stock_xmb_ribbon_simple = CG(
4  struct input
5  {
6  float time;
7  };
8 
9  float iqhash(float n)
10  {
11  return frac(sin(n)*43758.5453);
12  }
13 
14  float noise(float3 x)
15  {
16  float3 p = floor(x);
17  float3 f = frac(x);
18  f = f * f * (3.0 - 2.0 * f);
19  float n = p.x + p.y * 57.0 + 113.0 * p.z;
20  return lerp(lerp(lerp(iqhash(n+0.0), iqhash(n+1.0), f.x),
21  lerp(iqhash(n+57.0), iqhash(n+58.0), f.x), f.y),
22  lerp(lerp(iqhash(n+113.0), iqhash(n+114.0), f.x),
23  lerp(iqhash(n+170.0), iqhash(n+171.0), f.x), f.y), f.z);
24  }
25 
26  void main_vertex
27  (
28  float2 position : POSITION,
29  float4 color : COLOR,
30  float2 texCoord : TEXCOORD0,
31 
32  uniform input IN,
33 
34  out float4 oPosition : POSITION,
35  out float4 oColor : COLOR,
36  out float2 otexCoord : TEXCOORD
37  )
38  {
39  float3 v = float3(position.x, 0.0, position.y);
40  float3 v2 = v;
41  v2.x = v2.x + IN.time / 2.0;
42  v2.z = v.z * 3.0;
43  v.y = -cos((v.x + v.z / 3.0 + IN.time) * 2.0) / 10.0 - noise(v2.xyz) / 3.0;
44  oPosition = float4(v, 1.0);
45  oColor = color;
46  otexCoord = texCoord;
47  }
48 
49  struct output
50  {
51  float4 color : COLOR;
52  };
53 
54  output main_fragment(uniform input IN)
55  {
56  output OUT;
57  OUT.color = float4(0.05, 0.05, 0.05, 1.0);
58  return OUT;
59  }
60 );
GLfloat f
Definition: glext.h:8207
struct passwd out
Definition: missing_libc_functions.c:51
#define floor(x)
Definition: math.h:25
GLenum GLenum GLenum input
Definition: glext.h:9938
GLfloat GLfloat GLfloat v2
Definition: glext.h:6703
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
const GLdouble * v
Definition: glext.h:6391
std::string output
Definition: Config.FromFile.cpp:44
GLuint color
Definition: glext.h:6883
#define CG(src)
Definition: shaders_common.h:9
#define cos(x)
Definition: math.h:21
Definition: glslang_tab.cpp:198
static const char * stock_xmb_ribbon_simple
Definition: pipeline_xmb_ribbon_simple.cg.h:3
GLdouble n
Definition: glext.h:8396
Definition: glslang_tab.cpp:197