fuck intel

This commit is contained in:
Jarcode
2017-12-04 16:15:43 -08:00
parent 1d0734be67
commit 304cf222a3
2 changed files with 14 additions and 14 deletions

View File

@@ -34,25 +34,25 @@ void main() {
dy = gl_FragCoord.y - (screen.y / 2); dy = gl_FragCoord.y - (screen.y / 2);
float theta = atan(dy, dx); /* fragment angle with the center of the screen as the origin */ float theta = atan(dy, dx); /* fragment angle with the center of the screen as the origin */
float d = sqrt((dx * dx) + (dy * dy)); /* distance */ float d = sqrt((dx * dx) + (dy * dy)); /* distance */
if (d > C_RADIUS - (float(C_LINE) / 2F) && d < C_RADIUS + (float(C_LINE) / 2F)) { if (d > C_RADIUS - (float(C_LINE) / 2.0F) && d < C_RADIUS + (float(C_LINE) / 2.0F)) {
fragment = OUTLINE; fragment = OUTLINE;
return; return;
} else if (d > C_RADIUS) { } else if (d > C_RADIUS) {
const float section = (TWOPI / NBARS); /* range (radians) for each bar */ const float section = (TWOPI / NBARS); /* range (radians) for each bar */
const float center = ((TWOPI / NBARS) / 2F); /* center line angle */ const float center = ((TWOPI / NBARS) / 2.0F); /* center line angle */
float m = mod(theta, section); /* position in section (radians) */ float m = mod(theta, section); /* position in section (radians) */
float ym = d * sin(center - m); /* distance from center line (cartesian coords) */ float ym = d * sin(center - m); /* distance from center line (cartesian coords) */
if (abs(ym) < BAR_WIDTH / 2) { /* if within width, draw audio */ if (abs(ym) < BAR_WIDTH / 2) { /* if within width, draw audio */
float idx = theta + ROTATE; /* position (radians) in texture */ float idx = theta + ROTATE; /* position (radians) in texture */
float dir = mod(abs(idx), TWOPI); /* absolute position, [0, 2pi) */ float dir = mod(abs(idx), TWOPI); /* absolute position, [0, 2pi) */
if (dir > PI) if (dir > PI)
idx = -sign(idx) * (TWOPI - dir); /* Re-correct position values to [-pi, pi) */ idx = -sign(idx) * (TWOPI - dir); /* Re-correct position values to [-pi, pi) */
if (INVERT > 0) if (INVERT > 0)
idx = -idx; /* Invert if needed */ idx = -idx; /* Invert if needed */
float pos = int(abs(idx) / section) / float(NBARS / 2); float pos = int(abs(idx) / section) / float(NBARS / 2);
float v = smooth_audio(idx > 0 ? audio_l : audio_r, audio_sz, pos, SMOOTH) * AMPLIFY * (1 + pos); float v = smooth_audio(idx > 0 ? audio_l : audio_r, audio_sz, pos, SMOOTH) * AMPLIFY * (1 + pos);
d -= C_RADIUS + (float(C_LINE) / 2F); /* offset to fragment distance from inner circle */ d -= C_RADIUS + (float(C_LINE) / 2.0F); /* offset to fragment distance from inner circle */
if (d <= v - BAR_OUTLINE_WIDTH) { if (d <= v - BAR_OUTLINE_WIDTH) {
#if BAR_OUTLINE_WIDTH > 0 #if BAR_OUTLINE_WIDTH > 0
if (abs(ym) < (BAR_WIDTH / 2) - BAR_OUTLINE_WIDTH) if (abs(ym) < (BAR_WIDTH / 2) - BAR_OUTLINE_WIDTH)

View File

@@ -13,7 +13,7 @@ out vec4 fragment;
#include "../wave.glsl" #include "../wave.glsl"
#define index(offset) ((texture(audio_l, (gl_FragCoord.x + offset) / screen.x).r - 0.5) * AMPLIFY) + 0.5f #define index(offset) ((texture(audio_l, (gl_FragCoord.x + offset) / screen.x).r - 0.5) * AMPLIFY) + 0.5F
void main() { void main() {
float float
@@ -27,11 +27,11 @@ void main() {
dmax = max(s0, s1), dmax = max(s0, s1),
dmin = min(s0, s1); dmin = min(s0, s1);
float s = (os + (screen.y * 0.5f) - 0.5f); /* center to screen coords */ float s = (os + (screen.y * 0.5F) - 0.5F); /* center to screen coords */
float diff = gl_FragCoord.y - s; float diff = gl_FragCoord.y - s;
if (abs(diff) < clamp(abs(s - (screen.y * 0.5)) * 6, MIN_THICKNESS, MAX_THICKNESS) if (abs(diff) < clamp(abs(s - (screen.y * 0.5)) * 6, MIN_THICKNESS, MAX_THICKNESS)
|| (diff <= dmax && diff >= dmin)) { || (diff <= dmax && diff >= dmin)) {
fragment = BASE_COLOR + (abs((screen.y * 0.5f) - s) * 0.02); fragment = BASE_COLOR + (abs((screen.y * 0.5F) - s) * 0.02);
} else { } else {
fragment = vec4(0, 0, 0, 0); fragment = vec4(0, 0, 0, 0);
} }