Browse Source

Fix glsl 330 shaders for osx

tags/v1.0-RC2
Jens Pitkänen 3 months ago
parent
commit
0dd05e93e9
1 changed files with 10 additions and 2 deletions
  1. 10
    2
      src/shaders/sdf.glsl

+ 10
- 2
src/shaders/sdf.glsl View File

@@ -511,10 +511,18 @@ vec4 get_color(vec2 screenPosition, vec3 position, vec3 rotation) {
}
}

#if __VERSION__ == 330
out vec4 out_color;
#endif

void main() {
// NOTE: The y coordinate is flipped because we're rendering to a render texture
vec2 pixelCoords = vec2((gl_FragCoord.x - resolution.x / 2.0) / resolution.y,
(gl_FragCoord.y - resolution.y / 2.0) / resolution.y * -1.0);

gl_FragColor = get_color(pixelCoords, cameraPosition, cameraRotation);
vec4 finalColor = get_color(pixelCoords, cameraPosition, cameraRotation);
#if __VERSION__ == 330
out_color = finalColor;
#else
gl_FragColor = finalColor;
#endif
}

Loading…
Cancel
Save