Skip to content

Commit

Permalink
Revert shader version for Mac compatability
Browse files Browse the repository at this point in the history
  • Loading branch information
VixidDev committed Mar 14, 2024
1 parent 36bba09 commit 8dd20d3
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions src/main/resources/assets/skyhanni/shaders/rounded_rect.fsh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#version 130
#version 120

uniform float scaleFactor;
uniform float radius;
uniform float smoothness;
uniform vec2 halfSize;
uniform vec2 centerPos;

in vec4 color;
varying vec4 color;

// From https://www.shadertoy.com/view/WtdSDs
float roundedRectSDF(vec2 center, vec2 halfSize, float radius) {
Expand All @@ -31,4 +31,4 @@ void main() {
float distance = roundedRectSDF(gl_FragCoord.xy - newCenterPos, newHalfSize, radius);
float smoothed = 1.0 - smoothstep(0.0, smoothness, distance);
gl_FragColor = color * vec4(1.0, 1.0, 1.0, smoothed);
}
}
6 changes: 3 additions & 3 deletions src/main/resources/assets/skyhanni/shaders/rounded_rect.vsh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#version 130
#version 120

out vec4 color;
varying vec4 color;

void main() {
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
color = gl_Color;
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// Chroma Fragment Shader
// (Same as textured_chroma.fsh but isn't restricted to textured elements)

#version 130
#version 120

uniform float chromaSize;
uniform float timeOffset;
uniform float saturation;
uniform bool forwardDirection;

in vec4 originalColor;
varying vec4 originalColor;

float rgb2b(vec3 rgb) {
return max(max(rgb.r, rgb.g), rgb.b);
Expand All @@ -34,4 +34,4 @@ void main() {

// Set the color to use the new hue & original saturation/value/alpha values
gl_FragColor = vec4(hsb2rgb_smooth(vec3(hue, saturation, rgb2b(originalColor.rgb))), originalColor.a);
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Chroma Vertex Shader
// (Same as textured_chroma.vsh but isn't restricted to only texture elements)

#version 130
#version 120

out vec4 originalColor;
varying vec4 originalColor;

void main() {
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;

// Pass original color to fragment
originalColor = gl_Color;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Modified from SkyblockAddons
// Credit: https://github.com/BiscuitDevelopment/SkyblockAddons/blob/main/src/main/resources/assets/skyblockaddons/shaders/program/chroma_screen_textured.fsh

#version 130
#version 120

uniform float chromaSize;
uniform float timeOffset;
Expand All @@ -11,8 +11,8 @@ uniform bool forwardDirection;

uniform sampler2D outTexture;

in vec2 outTextureCoords;
in vec4 outColor;
varying vec2 outTextureCoords;
varying vec4 outColor;

float rgb2b(vec3 rgb) {
return max(max(rgb.r, rgb.g), rgb.b);
Expand Down Expand Up @@ -40,4 +40,4 @@ void main() {

// Set the color to use the new hue & original saturation/value/alpha values
gl_FragColor = vec4(hsb2rgb_smooth(vec3(hue, saturation, rgb2b(originalColor.rgb))), originalColor.a);
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Textured Chroma Vertex Shader
// Credit: https://github.com/BiscuitDevelopment/SkyblockAddons/blob/main/src/main/resources/assets/skyblockaddons/shaders/program/chroma_screen_textured.vsh

#version 130
#version 120

out vec2 outTextureCoords;
out vec4 outColor;
varying vec2 outTextureCoords;
varying vec4 outColor;

void main() {
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;

// Pass the color & texture coords to the fragment shader
outColor = gl_Color;
outTextureCoords = gl_MultiTexCoord0.st;
}
}

0 comments on commit 8dd20d3

Please sign in to comment.