saumwacht-godot/scripts/presentation/stone_floor.gdshader
Martin Stickelbroeck c2b447610c Baseline: Saumwacht 0.15.0 (Phase 20A) vor dem Umbau zu Champions of Luneraria
Unveränderter Ausgangsstand inklusive Masterprompt und Konzeptbildern
unter assets/. .godot/ und docs/screenshots/ bleiben laut .gitignore
unversioniert; letztere sind unter ../backups gesichert.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-27 20:00:36 +02:00

32 lines
1,011 B
Text

shader_type spatial;
render_mode diffuse_burley, specular_disabled;
uniform sampler2D limestone : source_color, filter_linear_mipmap_anisotropic, repeat_enable;
uniform vec3 stone_color : source_color = vec3(.23, .24, .27);
uniform bool build_tile = false;
varying vec3 world_position;
float grain(vec2 p) {
return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453);
}
void vertex() {
world_position = (MODEL_MATRIX * vec4(VERTEX, 1.0)).xyz;
}
void fragment() {
vec2 p = world_position.xz;
float fine = grain(floor(p * 38.0));
float slabs = grain(floor(p / 2.0));
vec2 cell = abs(fract(p / 2.0) - .5);
float seam = smoothstep(.478, .498, max(cell.x, cell.y));
vec2 edge = min(UV, 1.0 - UV);
float rim = 1.0 - smoothstep(.008, .025, min(edge.x, edge.y));
vec3 surface = texture(limestone, p * .26).rgb;
ALBEDO = stone_color * (.73 + surface * .6 + slabs * .08);
ALBEDO *= 1.0 - seam * (build_tile ? .06 : .35);
if (build_tile) {
ALBEDO += vec3(.045, .055, .040) * rim;
}
ROUGHNESS = .93;
}