diff --git a/resources/backing.fs b/resources/backing.fs new file mode 100755 index 0000000..fcbebd0 --- /dev/null +++ b/resources/backing.fs @@ -0,0 +1,12 @@ +#version 330 core +out vec4 FragColor; + +in vec2 TexCoords; + +uniform sampler2D screenTexture; + +void main() +{ + vec3 col = texture(screenTexture, TexCoords).rgb; + FragColor = vec4(col, 1.0); +} \ No newline at end of file diff --git a/resources/backing.vs b/resources/backing.vs new file mode 100755 index 0000000..f35dcae --- /dev/null +++ b/resources/backing.vs @@ -0,0 +1,11 @@ +#version 330 core +layout (location = 0) in vec2 aPos; +layout (location = 1) in vec2 aTexCoords; + +out vec2 TexCoords; + +void main() +{ + TexCoords = aTexCoords; + gl_Position = vec4(aPos.x, aPos.y, 0.0, 1.0); +} diff --git a/resources/console_no_bg.fs b/resources/console_no_bg.fs new file mode 100755 index 0000000..0dae487 --- /dev/null +++ b/resources/console_no_bg.fs @@ -0,0 +1,17 @@ +#version 330 core +out vec4 FragColor; + +in vec3 ourColor; +in vec2 TexCoord; +in vec3 ourBackground; + +// texture sampler +uniform sampler2D texture1; + +void main() +{ + vec4 original = texture(texture1, TexCoord); + if (original.r < 0.1f || original.g < 0.1f || original.b < 0.1f) discard; + vec4 fg = original * vec4(ourColor, 1.f); + FragColor = fg; +} diff --git a/resources/console_no_bg.vs b/resources/console_no_bg.vs new file mode 100755 index 0000000..3185e65 --- /dev/null +++ b/resources/console_no_bg.vs @@ -0,0 +1,17 @@ +#version 330 core +layout (location = 0) in vec3 aPos; +layout (location = 1) in vec3 aColor; +layout (location = 2) in vec3 bColor; +layout (location = 3) in vec2 aTexCoord; + +out vec3 ourColor; +out vec3 ourBackground; +out vec2 TexCoord; + +void main() +{ + gl_Position = vec4(aPos, 1.0); + ourColor = aColor; + ourBackground = bColor; + TexCoord = vec2(aTexCoord.x, aTexCoord.y); +} \ No newline at end of file diff --git a/resources/console_with_bg.fs b/resources/console_with_bg.fs new file mode 100755 index 0000000..ae9e4fd --- /dev/null +++ b/resources/console_with_bg.fs @@ -0,0 +1,16 @@ +#version 330 core +out vec4 FragColor; + +in vec3 ourColor; +in vec2 TexCoord; +in vec3 ourBackground; + +// texture sampler +uniform sampler2D texture1; + +void main() +{ + vec4 original = texture(texture1, TexCoord); + vec4 fg = original.r > 0.1f || original.g > 0.1f || original.b > 0.1f ? original * vec4(ourColor, 1.f) : vec4(ourBackground, 1.f); + FragColor = fg; +} diff --git a/resources/console_with_bg.vs b/resources/console_with_bg.vs new file mode 100755 index 0000000..3185e65 --- /dev/null +++ b/resources/console_with_bg.vs @@ -0,0 +1,17 @@ +#version 330 core +layout (location = 0) in vec3 aPos; +layout (location = 1) in vec3 aColor; +layout (location = 2) in vec3 bColor; +layout (location = 3) in vec2 aTexCoord; + +out vec3 ourColor; +out vec3 ourBackground; +out vec2 TexCoord; + +void main() +{ + gl_Position = vec4(aPos, 1.0); + ourColor = aColor; + ourBackground = bColor; + TexCoord = vec2(aTexCoord.x, aTexCoord.y); +} \ No newline at end of file diff --git a/resources/example_tiles.jpg b/resources/example_tiles.jpg new file mode 100755 index 0000000..ca8aecd Binary files /dev/null and b/resources/example_tiles.jpg differ diff --git a/resources/example_tiles.xcf b/resources/example_tiles.xcf new file mode 100755 index 0000000..e663f66 Binary files /dev/null and b/resources/example_tiles.xcf differ diff --git a/resources/mltest.xp b/resources/mltest.xp new file mode 100755 index 0000000..640adc7 Binary files /dev/null and b/resources/mltest.xp differ diff --git a/resources/nyan.xp b/resources/nyan.xp new file mode 100755 index 0000000..f27c58d Binary files /dev/null and b/resources/nyan.xp differ diff --git a/resources/scanlines.fs b/resources/scanlines.fs new file mode 100755 index 0000000..fe509f4 --- /dev/null +++ b/resources/scanlines.fs @@ -0,0 +1,26 @@ +#version 330 core +out vec4 FragColor; + +in vec2 TexCoords; + +uniform sampler2D screenTexture; +uniform vec3 screenSize; +uniform bool screenBurn; + +void main() +{ + vec3 col = texture(screenTexture, TexCoords).rgb; + float scanLine = mod(gl_FragCoord.y, 2.0) * 0.25; + vec3 scanColor = col.rgb - scanLine; + + if (col.r < 0.1f && col.g < 0.1f && col.b < 0.1f) { + if (screenBurn) { + float dist = (1.0 - distance(vec2(gl_FragCoord.x / screenSize.x, gl_FragCoord.y / screenSize.y), vec2(0.5,0.5))) * 0.2; + FragColor = vec4(0.0, dist, dist, 1.0); + } else { + FragColor = vec4(0.0, 0.0, 0.0, 1.0); + } + } else { + FragColor = vec4(scanColor, 1.0); + } +} \ No newline at end of file diff --git a/resources/scanlines.vs b/resources/scanlines.vs new file mode 100755 index 0000000..f35dcae --- /dev/null +++ b/resources/scanlines.vs @@ -0,0 +1,11 @@ +#version 330 core +layout (location = 0) in vec2 aPos; +layout (location = 1) in vec2 aTexCoords; + +out vec2 TexCoords; + +void main() +{ + TexCoords = aTexCoords; + gl_Position = vec4(aPos.x, aPos.y, 0.0, 1.0); +} diff --git a/resources/terminal8x8.jpg b/resources/terminal8x8.jpg new file mode 100755 index 0000000..13e393d Binary files /dev/null and b/resources/terminal8x8.jpg differ diff --git a/resources/vga8x16.jpg b/resources/vga8x16.jpg new file mode 100755 index 0000000..291a37c Binary files /dev/null and b/resources/vga8x16.jpg differ