#!/bin/bash # Regenerate the level texture set via Cloudflare FLUX (see flux_texture.sh). # Usage: gen_textures.sh [name ...] (no args = every texture below) # # Cloudflare's safety classifier throws occasional false positives on innocuous # masonry prompts ("kerb stone" tripped it once), so each texture carries a # reworded fallback prompt and we retry with that before giving up. set -uo pipefail cd "$(dirname "$0")/.." OUT=assets/textures mkdir -p "$OUT" # name|size|prompt|fallback prompt|target mean luma (0 = as generated) SPECS=$(cat <<'EOF' pavers|512|seamless tiling top down texture of a pedestrian mall floor paved in grey and buff granite blocks laid in a herringbone pattern, fine stone grain, flat overcast lighting, no shadows, no objects|overhead repeating pattern of pale grey granite paving blocks in herringbone layout, even light|165 asphalt|512|seamless tiling top down texture of worn dark grey asphalt road surface, fine aggregate, subtle tyre polishing, flat even lighting, no markings, no shadows|repeating overhead texture of grey bitumen pavement, fine gravel aggregate, even light|0 footpath|512|seamless tiling top down texture of a clean city concrete footpath, a dense regular grid of small square pale grey slabs, at least ten slabs across the image, very fine light grey joint lines, low contrast, subtle and uniform, no cracks, no dark seams, flat even lighting, no shadows|overhead repeating grid of many small pale grey concrete paving squares with faint thin joints, low contrast, even light|160 concrete_ground|512|seamless tiling top down texture of a medium grey concrete surface, fine even sandy aggregate grain, uniform and subtle, light patchy staining, no cracks, no large marks, flat even lighting, no shadows|overhead repeating fine grained mid grey concrete surface, uniform subtle speckle, no cracks, even light|150 facade_glass|768|seamless tiling texture of a modern office tower curtain wall, regular grid of desaturated slate grey blue reflective glazing panels with slim dark bronze mullions, panels vary slightly in tone as they reflect an overcast sky, muted and understated, not saturated, flat frontal view, even lighting|repeating grid of muted grey blue office window panels with thin dark frames, subtle tonal variation, desaturated, frontal view|0 facade_concrete|768|seamless tiling texture of a 1970s concrete office building facade, horizontal window bands with deep precast concrete spandrels, pale grey, flat frontal view, even lighting|repeating pattern of grey precast concrete building front with horizontal rows of windows, frontal view|150 facade_brick|768|seamless tiling texture of a red brick commercial building facade with regular rectangular sash windows and pale rendered sills, flat frontal view, even lighting|repeating pattern of red brick wall with evenly spaced windows, frontal view, even light|0 facade_heritage|768|seamless tiling texture of an ornate Australian Federation era painted render facade, arched upper windows, moulded cornices and pilasters, cream and sage green paint, flat frontal view, even lighting|repeating pattern of ornate old painted plaster building front with arched windows and decorative mouldings, cream colour, frontal view|170 shopfront|768|seamless tiling texture, daylight photograph of a row of retail shop windows, medium grey green tinted glass panes in slim dark aluminium frames, bright daytime scene, clearly lit, mid tone not dark, flat frontal view, no floor no sky|repeating grid of grey green shop window glass panels with thin metal frames, bright daylight, mid grey tone, frontal view|0 sandstone|768|seamless tiling texture of a warm honey brown sandstone building facade, regular rows of tall arched windows with dark glazing and carved stone surrounds, ashlar block courses between them, weathered and soot stained, flat frontal view, even lighting|repeating pattern of tan sandstone building front with rows of arched windows and stone block courses, frontal view, even light|175 awning_green|512|seamless tiling texture of taut dark bottle green canvas awning fabric, muted and desaturated, subtle woven weave, flat even lighting|repeating muted dark green heavy canvas cloth texture, woven weave, even light|0 awning_grey|512|seamless tiling texture of taut charcoal grey canvas awning fabric, subtle woven weave, flat even lighting|repeating dark grey heavy canvas cloth texture, woven weave, even light|0 awning_cream|512|seamless tiling texture of taut sand beige canvas awning fabric, mid tone tan colour not white, weathered and slightly dirty, visible woven weave, flat even lighting|repeating tan beige heavy canvas cloth texture with visible weave, dirty, even light|175 planter|512|seamless tiling texture of weathered rust orange corten steel plate, mottled oxide patina, flat even lighting, no shadows|repeating rusty orange brown oxidised steel sheet texture, mottled, even light|0 roof_deck|512|seamless tiling top down texture of a commercial building rooftop, dark weathered grey ribbed metal decking with seams, rust streaks and dirt, mid to dark grey not white, flat even lighting, no shadows|repeating overhead dirty dark grey corrugated metal roof sheeting with rust marks, even light|0 bark|512|seamless tiling texture of grey brown fig tree bark, smooth with shallow vertical furrows, flat even lighting, no shadows|repeating grey brown tree trunk bark surface texture, even light|0 foliage|512|seamless tiling texture of a dense mass of glossy dark green fig leaves seen from outside the canopy, overlapping leaves, flat even lighting|repeating pattern of dense dark green broad leaves overlapping, even light|0 grass|512|seamless tiling top down texture of mown subtropical lawn, dense green blades, slight colour variation, flat even lighting, no shadows|repeating overhead green cut grass lawn texture, even light|0 water|512|seamless tiling top down texture of murky brown green river water, gentle ripples, flat even lighting, no reflections of objects|repeating overhead calm muddy river surface with small ripples, even light|0 rock|512|seamless tiling texture of a rough volcanic cliff face, grey brown fractured rock with vertical jointing, flat even lighting|repeating rough grey brown broken rock cliff surface texture, even light|0 steel|512|seamless tiling texture of painted structural steel plate, medium battleship grey, rows of rivets, rust bleed and weathering streaks, darker not pale, flat even lighting|repeating mid grey painted steel bridge plate with rivets and rust streaks, even light|0 panel_white|512|seamless tiling texture of a light warm grey painted aluminium architectural panel, subtle brushed finish, faint panel joint lines, light grey not white, flat even lighting|repeating smooth light grey painted metal sheet texture with faint seams, even light|195 EOF ) want=("$@") ok=0; fail=0 while IFS='|' read -r name size prompt alt luma; do [ -z "$name" ] && continue if [ ${#want[@]} -gt 0 ]; then hit=0 for w in "${want[@]}"; do [ "$w" = "$name" ] && hit=1; done [ $hit -eq 1 ] || continue fi if ./tools/flux_texture.sh "$prompt" "$OUT/$name.jpg" "$size" "$luma" >/dev/null 2>&1; then echo "ok $name"; ok=$((ok+1)) elif ./tools/flux_texture.sh "$alt" "$OUT/$name.jpg" "$size" "$luma" >/dev/null 2>&1; then echo "ok(alt) $name"; ok=$((ok+1)) else echo "FAILED $name"; fail=$((fail+1)) fi done <<< "$SPECS" echo "textures: $ok ok, $fail failed"