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;
}
