How to use the babylonjs-gltf2interface.TextureMinFilter.LINEAR function in babylonjs-gltf2interface

To help you get started, we’ve selected a few babylonjs-gltf2interface examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github BabylonJS / Babylon.js / loaders / src / glTF / 2.0 / glTFLoader.ts View on Github external
private static _GetTextureSamplingMode(context: string, sampler: ISampler): number {
        // Set defaults if undefined
        const magFilter = sampler.magFilter == undefined ? TextureMagFilter.LINEAR : sampler.magFilter;
        const minFilter = sampler.minFilter == undefined ? TextureMinFilter.LINEAR_MIPMAP_LINEAR : sampler.minFilter;

        if (magFilter === TextureMagFilter.LINEAR) {
            switch (minFilter) {
                case TextureMinFilter.NEAREST: return Texture.LINEAR_NEAREST;
                case TextureMinFilter.LINEAR: return Texture.LINEAR_LINEAR;
                case TextureMinFilter.NEAREST_MIPMAP_NEAREST: return Texture.LINEAR_NEAREST_MIPNEAREST;
                case TextureMinFilter.LINEAR_MIPMAP_NEAREST: return Texture.LINEAR_LINEAR_MIPNEAREST;
                case TextureMinFilter.NEAREST_MIPMAP_LINEAR: return Texture.LINEAR_NEAREST_MIPLINEAR;
                case TextureMinFilter.LINEAR_MIPMAP_LINEAR: return Texture.LINEAR_LINEAR_MIPLINEAR;
                default:
                    Logger.Warn(`${context}/minFilter: Invalid value (${minFilter})`);
                    return Texture.LINEAR_LINEAR_MIPLINEAR;
            }
        }
        else {
            if (magFilter !== TextureMagFilter.NEAREST) {
                Logger.Warn(`${context}/magFilter: Invalid value (${magFilter})`);
            }

            switch (minFilter) {
                case TextureMinFilter.NEAREST: return Texture.NEAREST_NEAREST;
github BabylonJS / Babylon.js / loaders / src / glTF / 2.0 / glTFLoader.ts View on Github external
private static _GetTextureSamplingMode(context: string, sampler: ISampler): number {
        // Set defaults if undefined
        const magFilter = sampler.magFilter == undefined ? TextureMagFilter.LINEAR : sampler.magFilter;
        const minFilter = sampler.minFilter == undefined ? TextureMinFilter.LINEAR_MIPMAP_LINEAR : sampler.minFilter;

        if (magFilter === TextureMagFilter.LINEAR) {
            switch (minFilter) {
                case TextureMinFilter.NEAREST: return Texture.LINEAR_NEAREST;
                case TextureMinFilter.LINEAR: return Texture.LINEAR_LINEAR;
                case TextureMinFilter.NEAREST_MIPMAP_NEAREST: return Texture.LINEAR_NEAREST_MIPNEAREST;
                case TextureMinFilter.LINEAR_MIPMAP_NEAREST: return Texture.LINEAR_LINEAR_MIPNEAREST;
                case TextureMinFilter.NEAREST_MIPMAP_LINEAR: return Texture.LINEAR_NEAREST_MIPLINEAR;
                case TextureMinFilter.LINEAR_MIPMAP_LINEAR: return Texture.LINEAR_LINEAR_MIPLINEAR;
                default:
                    Tools.Warn(`${context}/minFilter: Invalid value (${minFilter})`);
                    return Texture.LINEAR_LINEAR_MIPLINEAR;
            }
        }
        else {
            if (magFilter !== TextureMagFilter.NEAREST) {
                Tools.Warn(`${context}/magFilter: Invalid value (${magFilter})`);
            }

            switch (minFilter) {
                case TextureMinFilter.NEAREST: return Texture.NEAREST_NEAREST;
github BabylonJS / Babylon.js / serializers / src / glTF / 2.0 / glTFMaterialExporter.ts View on Github external
private _getGLTFTextureSampler(texture: BaseTexture): ISampler {
        const sampler = this._getGLTFTextureWrapModesSampler(texture);

        let samplingMode = texture instanceof Texture ? texture.samplingMode : null;
        if (samplingMode != null) {
            switch (samplingMode) {
                case Texture.LINEAR_LINEAR: {
                    sampler.magFilter = TextureMagFilter.LINEAR;
                    sampler.minFilter = TextureMinFilter.LINEAR;
                    break;
                }
                case Texture.LINEAR_NEAREST: {
                    sampler.magFilter = TextureMagFilter.LINEAR;
                    sampler.minFilter = TextureMinFilter.NEAREST;
                    break;
                }
                case Texture.NEAREST_LINEAR: {
                    sampler.magFilter = TextureMagFilter.NEAREST;
                    sampler.minFilter = TextureMinFilter.LINEAR;
                    break;
                }
                case Texture.NEAREST_LINEAR_MIPLINEAR: {
                    sampler.magFilter = TextureMagFilter.NEAREST;
                    sampler.minFilter = TextureMinFilter.LINEAR_MIPMAP_LINEAR;
                    break;