The things of a level view as upright pictures for the graphics card, one instance a thing, kept under the thing's id so the renderer moves it smoothly between ticks.
{changes, live, sprites} = ElixirDoom.Gpu.Sprites.changes(view, live, target, sprites, camera, look)Each thing stands on its feet with its picture's offsets, mirrored where the view says,
turned to face the view as Doom's sprites do, its see-through texels cut out. It
stands in its sector (CauldronGPU.Instance's standing): its sector's own floor and
ceiling heights do not hide it, so it shows whole where it sinks into them, while walls
and the raised floors and lowered ceilings of other sectors in front of it do; things
are drawn farthest first. It is lit as the software view lights it: by its sector's
light (plus the view's extra light) at its distance from the eye, fully when bright,
through the fixed light table when one is in force. A shimmering thing is drawn as
ElixirDoom.Gpu.Shimmer draws it.
sprites is what the last call returned (nil the first time): each picture's quad
mesh and the ids placed. look is %{first_id:, stretch:, fixed:, extra_light:}: the
instance id of a thing with id 0 (a thing's instance is that plus its id), how many
times taller than wide a unit is drawn, the fixed light table or nil, and the light
added.
Summary
Functions
The changes that draw view's things, with the live map and the sprites to keep.
Types
@type look() :: %{ first_id: pos_integer(), stretch: number(), fixed: non_neg_integer() | nil, extra_light: integer() }
@type t() :: %{ meshes: %{required({non_neg_integer(), boolean()}) => CauldronGPU.Handle.t()}, placed: MapSet.t() }
Functions
@spec changes( map(), CauldronGPU.Sectors.Live.t(), CauldronGPU.Target.t(), t() | nil, CauldronGPU.Camera.t(), look() ) :: {[CauldronGPU.Stream.change()], CauldronGPU.Sectors.Live.t(), t()}
The changes that draw view's things, with the live map and the sprites to keep.