luv

Workshop wiki

gazetteer.lisp

luvcraft/gazetteer.lisp

system luvcraft/core · 19 definitions · on GitHub

Named screenshot views for semantic luvcraft visual checks.

in-package#:luvcraft
defmethodabsent-chunk-light-semantics
declare
ignoresourceworldchunk-key
cond
plusp
voxel-direction-dydirection
:open-sky
minusp
voxel-direction-dydirection
:closed
t:unknown
defclassluvcraft-gazetteer-view
name:initarg:name:readerluvcraft-gazetteer-view-name
description:initarg:description:readerluvcraft-gazetteer-view-description
title:initarg:title:readerluvcraft-gazetteer-view-title
world-factory:initarg:world-factory:readerluvcraft-gazetteer-view-world-factory
camera-factory:initarg:camera-factory:readerluvcraft-gazetteer-view-camera-factory
sky-clock-factory:initarg:sky-clock-factory:readerluvcraft-gazetteer-view-sky-clock-factory
sky-profile-factory:initarg:sky-profile-factory:readerluvcraft-gazetteer-view-sky-profile-factory
critter-factory:initarg:critter-factory:readerluvcraft-gazetteer-view-critter-factory
width:initarg:width:initformnil:readerluvcraft-gazetteer-view-width
height:initarg:height:initformnil:readerluvcraft-gazetteer-view-height
defunmake-gazetteer-floor-world
&key
chunk-count1
crystal-x8
crystal-y1
crystal-z8
let
dotimes
chunk-xchunk-count
ensure-world-chunkworldchunk-x00
loopforxfrom
*chunk-x16
below
*
1+chunk-x
16
do
loopforzbelow16do
setf*stone-block*
setf
world-block-atworldcrystal-xcrystal-ycrystal-z
*crystal-block*
world
defunmake-gazetteer-shadow-yard-world

A deliberately artificial yard for checking legible cast shadows.

let
loopforxbelow16do
loopforzbelow16do
setf*snow-block*

A tall simple pillar should cast an unmistakable pillar-shaped shadow across the bright receiver under the pinned low sun.

loopforyfrom1to8do
setf*stone-block*
world-block-atworld10y10
*stone-block*
world
defunmake-gazetteer-meadow-world

A small open grass meadow with a sandy patch, for looking at animals.

let
loopforxbelow16do
loopforzbelow16do
setf*dirt-block*
if
and
<=9x14
<=2z7
*sand-block**grass-block*

A couple of blocks for scale, and something for a turtle to walk around.

setf*stone-block**stone-block**stone-block*
world
defunmake-gazetteer-turtle
xyzyawgait-phase&keyresting-p
seed7

Pose one turtle for a still photograph rather than letting it wander.

let
turtle
make-instance'turtle:seedseed:position:yawyaw:headingyaw
setf
turtle-gait-phaseturtle
gait-phase
turtle-resting-pturtle
resting-p
critter-grounded-pturtle
t
turtle
defunmake-gazetteer-turtle-population

Three turtles posed across the meadow: mid-stride, turning, and resting.

let
population
make-instance'critter-population
dolist
turtle
list
make-gazetteer-turtle7.8d02d06.7d02.15d01.1d0:seed11
make-gazetteer-turtle10.4d02d08.4d04.90d03.9d0:seed12
make-gazetteer-turtle5.0d02d08.0d00.90d00d0:resting-pt:seed13
population
defunmake-pinned-sky-clock
make-instance'sky-clock:pinned-day-fractionday-fraction
defunmake-shadow-yard-sky-profile

A single-frame high-contrast profile for visual shadow inspection.

make-sky-profile
list
make-sky-keyframe:day-fraction0.36:zenith-color
0.280.520.88
:horizon-color
0.720.840.96
:sun-color
2.202.051.70
:ambient-color
0.060.080.12
:fog-color
0.500.720.94
:sun-angular-width0.006
defunmake-luvcraft-gazetteer-view
namedescriptiontitleworld-factorycamera-factoryday-fraction&keywidthheightsky-profile-factorycritter-factory
make-instance'luvcraft-gazetteer-view:namename:descriptiondescription:titletitle:world-factoryworld-factory:camera-factorycamera-factory:sky-clock-factory:sky-profile-factory
orsky-profile-factory#'make-default-sky-profile
:critter-factory
orcritter-factory
lambda
make-instance'critter-population
:widthwidth:heightheight
defparameter*luvcraft-gazetteer-views*
list
make-luvcraft-gazetteer-view:little-world-noon"Generated terrain, ordinary play camera, pinned noon.""luvcraft gazetteer - little world noon"
lambda
make-instance'fly-camera:position
make-vec38d016d0-18d0
:yaw0.0d0:pitch-0.42d0
0.50
make-luvcraft-gazetteer-view:little-world-dusk"Generated terrain under a warm low sky.""luvcraft gazetteer - little world dusk"
lambda
make-instance'fly-camera:position
make-vec3-7d012d0-8d0
:yaw0.42d0:pitch-0.30d0
0.74
make-luvcraft-gazetteer-view:shadow-forest"Generated terrain for representative cast-shadow inspection in motion.""luvcraft gazetteer - shadow forest"
lambda
make-instance'fly-camera:position
make-vec38d016d0-18d0
:yaw0.0d0:pitch-0.42d0
0.42:width1512:height982
make-luvcraft-gazetteer-view:glow-floor"A placed emitter proving material emission and blocklight under a dark sky.""luvcraft gazetteer - glow floor"
lambda
make-instance'fly-camera:position
make-vec38d04d01.5d0
:yaw0.0d0:pitch-0.28d0
0.90
make-luvcraft-gazetteer-view:crystal-seam"A crystal on a chunk seam, lighting both sides of the boundary.""luvcraft gazetteer - crystal seam"
lambda
make-gazetteer-floor-world:chunk-count2:crystal-x16:crystal-y1:crystal-z8
lambda
make-instance'fly-camera:position
make-vec315.5d04.2d01.2d0
:yaw0.05d0:pitch-0.28d0
0.90
make-luvcraft-gazetteer-view:turtle-meadow"Three posed turtles on a grass meadow: model, materials, and cast shadow.""luvcraft gazetteer - turtle meadow"
lambda
make-instance'fly-camera:position
make-vec37.4d02.85d03.4d0
:yaw0.10d0:pitch-0.20d0
0.42:width960:height640:critter-factory#'make-gazetteer-turtle-population
make-luvcraft-gazetteer-view:shadow-yard"A low sun over a flat receiver with elevated block casters.""luvcraft gazetteer - shadow yard"
lambda
make-instance'fly-camera:position
make-vec37.5d09.5d0-7d0
:yaw0.10d0:pitch-0.50d0
0.36:width960:height640:sky-profile-factory#'make-shadow-yard-sky-profile
defunluvcraft-gazetteer-views

Return the semantic screenshot views captured by the luvcraft gazetteer.

defunnormalize-luvcraft-gazetteer-view-name
name
etypecasename
keywordname
symbol
intern
string-upcase
symbol-namename
:keyword
string
intern
string-upcasename
:keyword
defunfind-luvcraft-gazetteer-view
name&key
errorpt
let*
view
findnormalized*luvcraft-gazetteer-views*:key#'luvcraft-gazetteer-view-name
cond
viewview
errorp
error"No luvcraft gazetteer view named ~S."name
tnil
defunluvcraft-gazetteer-view-pathname
directoryview
merge-pathnames
formatnil"~(~A~).png"
luvcraft-gazetteer-view-nameview
uiop:ensure-directory-pathnamedirectory
defuncapture-luvcraft-gazetteer-view
viewdirectory&keywidthheight

Capture one gazetteer view into directory and return the PNG pathname.

let*
world
funcall
luvcraft-gazetteer-view-world-factoryview
camera
funcall
luvcraft-gazetteer-view-camera-factoryview
sky-clock
funcall
luvcraft-gazetteer-view-sky-clock-factoryview
sky-profile
funcall
luvcraft-gazetteer-view-sky-profile-factoryview
critters
funcall
luvcraft-gazetteer-view-critter-factoryview
capture-hidden-luvcraft-screenshotpathname:title
luvcraft-gazetteer-view-titleview
:width
orwidth
luvcraft-gazetteer-view-widthview
960
:height
orheight
luvcraft-gazetteer-view-heightview
640
:providerprovider:worldworld:cameracamera:critterscritters:sky-clocksky-clock:sky-profilesky-profile
pathname
defuncapture-luvcraft-gazetteer
directory&keyviewswidthheight

Capture views, or every known gazetteer view, into directory.

let
loopforviewinviewscollect
capture-luvcraft-gazetteer-viewviewdirectory:widthwidth:heightheight:providerprovider
defuncapture-luvcraft-gazetteer-sequence
viewdirectory&key
count4
forward-step0.2
yaw-step0.0
day-start
day-step0.0
difference-scaleshadow-diagnostic-pwidthheight

Capture one gazetteer view as a consecutive spatial or temporal sequence.

let*
world
funcall
luvcraft-gazetteer-view-world-factoryview
camera
funcall
luvcraft-gazetteer-view-camera-factoryview
sky-clock
funcall
luvcraft-gazetteer-view-sky-clock-factoryview
sky-profile
funcall
luvcraft-gazetteer-view-sky-profile-factoryview
critters
funcall
luvcraft-gazetteer-view-critter-factoryview
capture-hidden-luvcraft-framesdirectory:critterscritters:countcount:forward-stepforward-step:yaw-stepyaw-step:day-startday-start:day-stepday-step:difference-scaledifference-scale:shadow-diagnostic-pshadow-diagnostic-p:providerprovider:pathname-prefix
string-downcase
symbol-name
luvcraft-gazetteer-view-nameview
:title
luvcraft-gazetteer-view-titleview
:width
orwidth
luvcraft-gazetteer-view-widthview
960
:height
orheight
luvcraft-gazetteer-view-heightview
640
:worldworld:cameracamera:sky-clocksky-clock:sky-profilesky-profile