feat(rendering): on-screen debug overlay showing current biome and coordinates

Asset-free bitmap-text overlay: a 5x7 font (glyphs defined as verifiable ASCII-art) drawn as solid quads through a tiny 2D shader, white text with a drop shadow for legibility over any background. Renders 'BIOME: <name>' and 'XYZ: x, y, z' top-left, updating live. Adds Shader.SetVector2 and WorldGenerator.BiomeNameAt support; text scale and spawn-height offset read from Configuration.
This commit is contained in:
MDietermann
2026-06-03 16:27:15 +02:00
parent e034d10339
commit 689536348b
5 changed files with 206 additions and 4 deletions

View File

@@ -10,8 +10,8 @@ public sealed class Shader : IDisposable
public Shader(string vertexPath, string fragmentPath)
{
int vertex = Shader.CompileFromFile(ShaderType.VertexShader, vertexPath);
int fragment = Shader.CompileFromFile(ShaderType.FragmentShader, fragmentPath);
int vertex = CompileFromFile(ShaderType.VertexShader, vertexPath);
int fragment = CompileFromFile(ShaderType.FragmentShader, fragmentPath);
this._handle = GL.CreateProgram();
GL.AttachShader(this._handle, vertex);
@@ -42,6 +42,9 @@ public sealed class Shader : IDisposable
public void SetVector3(string name, Vector3 value) =>
GL.Uniform3(this.Location(name), value.X, value.Y, value.Z);
public void SetVector2(string name, Vector2 value) =>
GL.Uniform2(this.Location(name), value.X, value.Y);
private int Location(string name)
{
if (this._uniforms.TryGetValue(name, out int location)) return location;