Renderer · interface
SurfaceTextureOptions
Explained in Hello world.
interface SurfaceTextureOptionsimport type { SurfaceTextureOptions } from '@driftengine/core';Properties
| Name | Type | Description |
|---|---|---|
effectsoptional | readonly (SurfaceLayerEffect | undefined)[] | What each layer does beyond its picture — rooms behind windows, windows lit by night, wear,
animation, staying dry — one entry a layer, undefined for a layer with none. Read only where
this texture is a material's albedo. See surfaceEffects.ts. |
wrapoptional | 'repeat' | 'clamp' | repeat tiles the image, clamp stretches its edge texels.MoreRepeat is the default because the case this exists for is a wall: one small image
covering a large surface, with |
colorSpaceoptional | 'linear' | 'srgb' | How the image's values are encoded, so the shader can sample light rather than pixels.More
|
filteroptional | 'linear' | 'nearest' | How a texel is chosen when the image is magnified: smoothed between texels, or taken whole.More
Minification still blends between mip levels, and that is not the option being ignored. A tiled floor at a grazing angle minifies far past one texel per pixel, which is what mips exist for; taking the nearest level as well would trade a smear for a visible pop as the camera pulls back. So the choice applies where it was asked about, and within a level either way.
|
mipmapoptional | boolean | Build a mip chain. On by default, and it is not a quality preference.MoreA tiled surface seen at a grazing angle — which is every floor and every corridor wall — minifies far past one texel per pixel, and without mips that undersampling is aliasing that crawls as the camera moves. It is the single most visible artefact a textured world can have. Off is for a texture drawn at roughly its own size, where the chain is memory spent on levels nothing will sample. |
anisotropyoptional | number | Anisotropic samples, when the extension is present. 1 disables it.MoreMips fix the crawling and cost sharpness: a floor stretching to the horizon picks its mip from the worse of the two axes, so it blurs along the one that was still well sampled. Anisotropy is the standard repair, it is cheap at these sizes, and on a machine without the extension the clamp below silently leaves it at 1. |