Lately I've been building my 2D tile rendering engine. The current plan is for square tiles and each tile can be composed of 8 or more layers. Also, I'll do something similar to how the current Dwarf Fortress does it: I'll render a few Z levels below with increasing opacity. I'll add animation too, but overall it's going to be as simple and straightforward as possible so that I can jump into the actual game logic ASAP.

My plan was to use array textures, but since I'm targeting OpenGL 3.3, I'm only guaranteed GL_MAX_ARRAY_TEXTURE_LAYERS of 256 or more, so I guess I'll stick to using a good old texture atlas.

This is the first time I've done any graphics programming, so it's a bit of a learning curve for me. In the meantime I've made a little recording of my title screen mock-up.

YouTube video is located here.

That's just a simple little proof of concept that uses egui, glow, and winit for cross-platform compatibility.

The background fragment shader is ported from this ShaderToy submission to GLSL.

Background vertex shader:

const VERTEX_SHADER_SOURCE: &str = r#"#version 130
const vec2 coords[] = vec2[3] (
    vec2(-1., -1.),
    vec2(3., -1.),
    vec2(-1., 3.)
);
void main()
{
    gl_Position = vec4(coords[gl_VertexID], 0., 1.);
}
"#;

The vertex shader source code is from this page about full screen triangle optimization, ported to GLSL.