Skip to content

remove deprecated gl_FragColor api that made compiling impossible #82

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions ded.dSYM/Contents/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleIdentifier</key>
<string>com.apple.xcode.dsym.ded</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>dSYM</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
4 changes: 3 additions & 1 deletion shaders/simple_color.frag
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@

#version 330 core

in vec4 out_color;
out vec4 FragColor;

void main() {
gl_FragColor = out_color;
FragColor = out_color;
}
6 changes: 4 additions & 2 deletions shaders/simple_epic.frag
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ uniform sampler2D image;

in vec2 out_uv;

out vec4 out_color;

vec3 hsl2rgb(vec3 c) {
vec3 rgb = clamp(abs(mod(c.x*6.0+vec3(0.0,4.0,2.0),6.0)-3.0)-1.0, 0.0, 1.0);
return c.z + c.y * (rgb-0.5)*(1.0-abs(2.0*c.z-1.0));
Expand All @@ -16,7 +18,7 @@ void main() {
float d = tc.r;
float aaf = fwidth(d);
float alpha = smoothstep(0.5 - aaf, 0.5 + aaf, d);
vec2 frag_uv = gl_FragCoord.xy / resolution;
vec2 frag_uv = out_uv;
vec4 rainbow = vec4(hsl2rgb(vec3((time + frag_uv.x + frag_uv.y), 0.5, 0.5)), 1.0);
gl_FragColor = vec4(rainbow.rgb, alpha);
out_color = vec4(rainbow.rgb, alpha);
}
3 changes: 2 additions & 1 deletion shaders/simple_image.frag
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
uniform sampler2D image;

in vec2 out_uv;
out vec4 FragColor;

void main() {
gl_FragColor = texture(image, out_uv);
FragColor = texture(image, out_uv);
}
8 changes: 7 additions & 1 deletion shaders/simple_text.frag
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@ uniform sampler2D image;

in vec4 out_color;
in vec2 out_uv;
out vec4 FragColor;

void main() {
float d = texture(image, out_uv).r;
float aaf = fwidth(d);
float alpha = smoothstep(0.5 - aaf, 0.5 + aaf, d);
gl_FragColor = vec4(out_color.rgb, alpha);
FragColor = vec4(out_color.rgb, alpha);
}