RetroArch
fft_fragment_program_resolve.glsl.frag.h
Go to the documentation of this file.
1 #include "shaders_common.h"
2 
4  precision mediump float;
5  precision highp int;
6  precision highp usampler2D;
7  precision highp isampler2D;
8  in vec2 vTex;
9  out vec4 FragColor;
10  uniform usampler2D sFFT;
11 
12  vec4 get_heights(highp uvec2 h) {
13  vec2 l = unpackHalf2x16(h.x);
14  vec2 r = unpackHalf2x16(h.y);
15  vec2 channels[4] = vec2[4](
16  l, 0.5 * (l + r), r, 0.5 * (l - r));
17  vec4 amps;
18  for (int i = 0; i < 4; i++)
19  amps[i] = dot(channels[i], channels[i]);
20 
21  return 9.0 * log(amps + 0.0001) - 22.0;
22  }
23 
24  void main() {
25  uvec2 h = textureLod(sFFT, vTex, 0.0).rg;
26  vec4 height = get_heights(h);
27  height = (height + 40.0) / 80.0;
28  FragColor = height;
29  }
30 );
static const char * fft_fragment_program_resolve
Definition: fft_fragment_program_resolve.glsl.frag.h:3
#define GLSL_300(src)
Definition: shaders_common.h:11
GLdouble GLdouble GLdouble r
Definition: glext.h:6406
struct passwd out
Definition: missing_libc_functions.c:51
GLenum GLint GLint * precision
Definition: glext.h:8206
sampler2DBase< glm::ivec4 > isampler2D
Definition: sampler.hpp:95
#define log(...)
Definition: spirv_cross.cpp:28
bool l
Definition: connect_wiiupro.c:37
std::shared_ptr< Ope > dot()
Definition: peglib.h:1603
GLuint in
Definition: glext.h:10523
int main(int argc, char *argv[])
Definition: send-presence.c:197
sampler2DBase< glm::uvec4 > usampler2D
Definition: sampler.hpp:96
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:8390
GLint GLint GLsizei GLsizei height
Definition: glext.h:6293