a5ec8db5f7
build / build (push) Failing after 5s
dependency (SDL2, SDL2_mixer, fluidsynth-lite, a MIDI soundfont) prebuilt, so compiling the engine needs no network access - just the image and the engine source. Add res/assets/extract_assets.sh to pull the game's data files out of a purchased GOG installer, and a Makefile that assembles a runnable dist/ from the two. Also add `make package`, which builds a redistributable tarball that omits the proprietary game assets (shipping res/GET_ASSETS.txt instead) plus license information for both the MIT tooling and the GPLv3 engine, and a Gitea Actions workflow that builds and publishes it to dl.ladkau.de on every push.
36 lines
1.1 KiB
GLSL
36 lines
1.1 KiB
GLSL
#version 110
|
|
|
|
// The texture alpha value has two separate functions in this shader:
|
|
// - Pixels with a zero alpha value are transparent.
|
|
// - Pixels with non-zero alpha are opaque, and the alpha value
|
|
// defines a minimum light level.
|
|
|
|
varying vec2 TexCoords;
|
|
varying float Light;
|
|
|
|
uniform sampler2D tex;
|
|
uniform bool nightsight;
|
|
uniform bool mutant;
|
|
|
|
void main() {
|
|
vec4 t = texture2D(tex, TexCoords);
|
|
|
|
// Alpha values > 0.5 are emissive
|
|
float alpha = t.a > 0.5 ? 1.0 : t.a * 2.0;
|
|
|
|
if (nightsight) {
|
|
// approximate the blue tint of palette colors 0xb0..0xbf
|
|
float gray = 0.40 * t.r + 0.59 * t.g + 0.11 * t.b;
|
|
float rg = 0.7 * gray;
|
|
float b = 0.75 * gray + 0.1;
|
|
gl_FragColor = vec4(rg, rg, b, (mutant ? 0.2 * alpha : alpha));
|
|
} else {
|
|
float emissive = t.a > 0.5 ? (t.a - 0.5) * 2.0 : 0.0;
|
|
float light = max(Light * Light, emissive);
|
|
if (mutant)
|
|
gl_FragColor = vec4(0.5 * t.r * light, 0.5 * t.r * light, 0.5 * t.r * light, 0.2 * alpha);
|
|
else
|
|
gl_FragColor = vec4(t.r * light, t.g * light, t.b * light, alpha);
|
|
}
|
|
}
|