DetailLook beta
Interface of @v12-engine/client
export interface DetailLookHow much detail things are drawn with by their distance, as a game says (GameView.world.detail): levels for every model that says none of its own, levels by model, a scale, and code that picks thing by thing. The map's say is over it (MapEnvironment.detail), a doodad's and a unit type's look over that (MapDoodad.detail, UnitLook.detail), the game's pick over all
Members
budgetMB
budgetMB?: number;How much the levels' files and the pictures of the distance may take on the graphics card, in megabytes, before what nothing has wanted for a minute is let go, the farthest first: 256 when left out
cull
cull?: number;Past this far from the camera, in cells, no scenery, tree or mine is drawn at all. None when left out
important
important?: (entity: EntityView) => boolean;Whether an entity is always at full, as what is selected and hovered are: heroes, a boss
levels
levels?: DetailLevel[];The levels of every model that has none said of it: [{}, { draw: 'none', from: 220 }] draws nothing past 220 cells
models
models?: Record<string, DetailLevel[]>;A model's levels, by its path in models/, over its own (ModelDef.detail)
pick
pick?: (context: DetailContext, picked: number) => number | undefined;The level a thing is drawn at, in code: given what the picker knows and what it picked, the index of the level wanted, or nothing to keep what was picked. Asked for every thing as it is looked at (about six times a second)
preload
preload?: number;How many cells past the edges of the view what is there is drawn already (MapDetail.preload): its pictures and shaders made and its scenery merged before the camera brings it in, so that trees do not come in as the view moves. Costs drawing a little more off the screen. 0 (what is in view alone) when left out
scale
scale?: number;Every from times this: under 1 lighter sooner. 1 when left out
shadowBias
shadowBias?: number;How many levels coarser than it is drawn at a thing casts its shadow, where its level does not say (DetailLevel.shadow): 1 draws a tree's shadow at its next lighter level. 0 when left out
simplify
simplify?: boolean;A lighter level (ratio) of a model with no file made of it (npm run lod) is made in the page: its triangles simplified as the game runs, kept in the browser. No when left out: those draw at full. A game ships its levels as files; this is for its own models dropped on the editor, a map's own, what has none yet