Java Code Examples for com.jme3.texture.Texture#MagFilter

The following examples show how to use com.jme3.texture.Texture#MagFilter . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GltfLoader.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
public Texture2D readSampler(int samplerIndex, Texture2D texture) throws IOException {
    if (samplers == null) {
        throw new AssetLoadException("No samplers defined");
    }
    JsonObject sampler = samplers.get(samplerIndex).getAsJsonObject();
    Texture.MagFilter magFilter = getMagFilter(getAsInteger(sampler, "magFilter"));
    Texture.MinFilter minFilter = getMinFilter(getAsInteger(sampler, "minFilter"));
    Texture.WrapMode wrapS = getWrapMode(getAsInteger(sampler, "wrapS"));
    Texture.WrapMode wrapT = getWrapMode(getAsInteger(sampler, "wrapT"));

    if (magFilter != null) {
        texture.setMagFilter(magFilter);
    }
    if (minFilter != null) {
        texture.setMinFilter(minFilter);
    }
    texture.setWrap(Texture.WrapAxis.S, wrapS);
    texture.setWrap(Texture.WrapAxis.T, wrapT);

    texture = customContentManager.readExtensionAndExtras("texture.sampler", sampler, texture);

    return texture;
}
 
Example 2
Source File: GltfUtils.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public static Texture.MagFilter getMagFilter(Integer value) {
    if (value == null) {
        return null;
    }
    switch (value) {
        case 9728:
            return Texture.MagFilter.Nearest;
        case 9729:
            return Texture.MagFilter.Bilinear;
    }
    return null;
}
 
Example 3
Source File: GLRenderer.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private int convertMagFilter(Texture.MagFilter filter) {
    switch (filter) {
        case Bilinear:
            return GL.GL_LINEAR;
        case Nearest:
            return GL.GL_NEAREST;
        default:
            throw new UnsupportedOperationException("Unknown mag filter: " + filter);
    }
}
 
Example 4
Source File: GdxRenderer.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private int convertMagFilter(Texture.MagFilter filter) {
    switch (filter) {
        case Bilinear:
            return GL20.GL_LINEAR;
        case Nearest:
            return GL20.GL_NEAREST;
        default:
            throw new UnsupportedOperationException("Unknown mag filter: " + filter);
    }
}
 
Example 5
Source File: JoglRenderer.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private int convertMagFilter(Texture.MagFilter filter) {
    switch (filter) {
        case Bilinear:
            return gl.GL_LINEAR;
        case Nearest:
            return gl.GL_NEAREST;
        default:
            throw new UnsupportedOperationException("Unknown mag filter: " + filter);
    }
}
 
Example 6
Source File: OGLESShaderRenderer.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private int convertMagFilter(Texture.MagFilter filter) {
    switch (filter) {
        case Bilinear:
            return GLES20.GL_LINEAR;
        case Nearest:
            return GLES20.GL_NEAREST;
        default:
            throw new UnsupportedOperationException("Unknown mag filter: " + filter);
    }
}
 
Example 7
Source File: AbstractRenderer.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
protected int convertMagFilter(Texture.MagFilter filter) {
    switch (filter) {
        case Bilinear:
            return Helper.Filter.LINEAR.getGLConstant();
        case Nearest:
            return Helper.Filter.NEAREST.getGLConstant();
        default:
            throw new UnsupportedOperationException("Unknown mag filter: " + filter);
    }
}
 
Example 8
Source File: LwjglRenderer.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private int convertMagFilter(Texture.MagFilter filter) {
    switch (filter) {
        case Bilinear:
            return GL_LINEAR;
        case Nearest:
            return GL_NEAREST;
        default:
            throw new UnsupportedOperationException("Unknown mag filter: " + filter);
    }
}