Skip to content
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
36 changes: 17 additions & 19 deletions assets/shaders/world2d.frag.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,23 @@ vec2 uv = vec2(
void main() {
vec4 tex_val = texture(tex, uv);
int alpha = int(round(tex_val.a * 255));
switch (alpha) {
case 0:
col = tex_val;
discard;

// do not save the ID
return;
case 254:
col = vec4(1.0f, 0.0f, 0.0f, 1.0f);
break;
case 252:
col = vec4(0.0f, 1.0f, 0.0f, 1.0f);
break;
case 250:
col = vec4(0.0f, 0.0f, 1.0f, 1.0f);
break;
default:
col = tex_val;
break;
// Apple's OpenGL shader compiler crashes on the switch statement that
// used to be here (glpLLVMCGSwitchStatement), so use if/else instead.
if (alpha == 0) {
col = tex_val;
discard;
}
else if (alpha == 254) {
col = vec4(1.0f, 0.0f, 0.0f, 1.0f);
}
else if (alpha == 252) {
col = vec4(0.0f, 1.0f, 0.0f, 1.0f);
}
else if (alpha == 250) {
col = vec4(0.0f, 0.0f, 1.0f, 1.0f);
}
else {
col = tex_val;
}
id = u_id;
}
1 change: 1 addition & 0 deletions copying.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ _the openage authors_ are:
| Nicolas Sanchez | nicolassanchez02 | nicolasjpsanchez à gmail dawt com |
| Manas Pradhan | manas-maker | manasmpradhan5 à gmail dawt com |
| Jason Lu | jasonlu, lugt | lu.gt à 163 dawt com |
| Rana Waqas | ranawaqas-ai | waqaskhan137 à gmail dawt com |

If you're a first-time committer, add yourself to the above list. This is not
just for legal reasons, but also to keep an overview of all those nicknames.
Expand Down