UNPKG

@woosh/meep-engine

Version:

Pure JavaScript game engine. Fully featured and production ready.

24 lines (19 loc) 604 B
import { LinearEncoding, LinearFilter, LinearMipmapLinearFilter, sRGBEncoding } from "three"; /** * * @param {Texture} texture * @param {string} attachment_name */ export function prepare_atlas_texture(texture, attachment_name) { switch (attachment_name) { case 'diffuse': texture.encoding = sRGBEncoding; break; default: texture.encoding = LinearEncoding; } texture.anisotropy = 4; texture.minFilter = LinearMipmapLinearFilter; texture.magFilter = LinearFilter; texture.generateMipmaps = true; }