当前位置: 首页>>代码示例>>Java>>正文


Java Texture.MinFilter方法代码示例

本文整理汇总了Java中com.jme3.texture.Texture.MinFilter方法的典型用法代码示例。如果您正苦于以下问题:Java Texture.MinFilter方法的具体用法?Java Texture.MinFilter怎么用?Java Texture.MinFilter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.jme3.texture.Texture的用法示例。


在下文中一共展示了Texture.MinFilter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: openSettings

import com.jme3.texture.Texture; //导入方法依赖的package包/类
/**
 * Process to open texture's settings.
 */
@FXThread
protected void openSettings() {

    final Texture2D texture = notNull(getPropertyValue());
    final TextureKey key = (TextureKey) texture.getKey();
    final boolean flipY = key.isFlipY();
    final Texture.WrapMode wrapS = texture.getWrap(Texture.WrapAxis.S);
    final Texture.WrapMode wrapT = texture.getWrap(Texture.WrapAxis.T);
    final Texture.MagFilter magFilter = texture.getMagFilter();
    final Texture.MinFilter minFilter = texture.getMinFilter();

    final Array<PropertyDefinition> properties = ArrayFactory.newArray(PropertyDefinition.class);
    properties.add(new PropertyDefinition(EditablePropertyType.BOOLEAN, Messages.MATERIAL_MODEL_PROPERTY_CONTROL_FLIP_Y, PROP_FLIP, flipY));
    properties.add(new PropertyDefinition(EditablePropertyType.ENUM, Messages.MATERIAL_MODEL_PROPERTY_CONTROL_WRAP_MODE_S, PROP_WRAP_MODE_S, wrapS));
    properties.add(new PropertyDefinition(EditablePropertyType.ENUM, Messages.MATERIAL_MODEL_PROPERTY_CONTROL_WRAP_MODE_T, PROP_WRAP_MODE_T, wrapT));
    properties.add(new PropertyDefinition(EditablePropertyType.ENUM, Messages.MATERIAL_MODEL_PROPERTY_CONTROL_MAG_FILTER, PROP_MAG_FILTER, magFilter));
    properties.add(new PropertyDefinition(EditablePropertyType.ENUM, Messages.MATERIAL_MODEL_PROPERTY_CONTROL_MIN_FILTER, PROP_MIN_FILTER, minFilter));

    final GenericFactoryDialog dialog = new GenericFactoryDialog(properties, this::applyChanges);
    dialog.setTitle(Messages.MATERIAL_MODEL_PROPERTY_CONTROL_TEXTURE_SETTINGS);
    dialog.setButtonOkText(Messages.SIMPLE_DIALOG_BUTTON_APPLY);
    dialog.setButtonCloseText(Messages.SIMPLE_DIALOG_BUTTON_CANCEL);
    dialog.configureSize(DIALOG_SIZE);
    dialog.show();
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:29,代码来源:Texture2DPropertyControl.java

示例2: convertMinFilter

import com.jme3.texture.Texture; //导入方法依赖的package包/类
private int convertMinFilter(Texture.MinFilter filter) {
    switch (filter) {
        case Trilinear:
            return GL_LINEAR_MIPMAP_LINEAR;
        case BilinearNearestMipMap:
            return GL_LINEAR_MIPMAP_NEAREST;
        case NearestLinearMipMap:
            return GL_NEAREST_MIPMAP_LINEAR;
        case NearestNearestMipMap:
            return GL_NEAREST_MIPMAP_NEAREST;
        case BilinearNoMipMaps:
            return GL_LINEAR;
        case NearestNoMipMaps:
            return GL_NEAREST;
        default:
            throw new UnsupportedOperationException("Unknown min filter: " + filter);
    }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:19,代码来源:LwjglRenderer.java

示例3: applyChanges

import com.jme3.texture.Texture; //导入方法依赖的package包/类
/**
 * Apple new changes if need.
 *
 * @param varTable the var table.
 */
@FXThread
private void applyChanges(@NotNull final VarTable varTable) {

    final Texture2D texture = notNull(getPropertyValue());
    final TextureKey key = (TextureKey) texture.getKey();
    final boolean flipY = key.isFlipY();
    final Texture.WrapMode wrapS = texture.getWrap(Texture.WrapAxis.S);
    final Texture.WrapMode wrapT = texture.getWrap(Texture.WrapAxis.T);
    final Texture.MagFilter magFilter = texture.getMagFilter();
    final Texture.MinFilter minFilter = texture.getMinFilter();

    final boolean needFlipY = varTable.getBoolean(PROP_FLIP);
    final Texture.WrapMode needWrapS = varTable.getEnum(PROP_WRAP_MODE_S, Texture.WrapMode.class);
    final Texture.WrapMode needWrapT = varTable.getEnum(PROP_WRAP_MODE_T, Texture.WrapMode.class);
    final Texture.MagFilter needMagFilter = varTable.getEnum(PROP_MAG_FILTER, Texture.MagFilter.class);
    final Texture.MinFilter needMinFilter = varTable.getEnum(PROP_MIN_FILTER, Texture.MinFilter.class);

    if (flipY == needFlipY && wrapS == needWrapS && wrapT == needWrapT && magFilter == needMagFilter &&
            minFilter == needMinFilter) {
        return;
    }

    final TextureKey newKey = new TextureKey(key.getName());
    newKey.setFlipY(needFlipY);

    final AssetManager assetManager = EDITOR.getAssetManager();
    assetManager.deleteFromCache(key);

    final Texture2D loadedTexture = (Texture2D) assetManager.loadTexture(newKey);
    loadedTexture.setWrap(Texture.WrapAxis.S, needWrapS);
    loadedTexture.setWrap(Texture.WrapAxis.T, needWrapT);
    loadedTexture.setMagFilter(needMagFilter);
    loadedTexture.setMinFilter(needMinFilter);

    changed(loadedTexture, texture);
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:42,代码来源:Texture2DPropertyControl.java


注:本文中的com.jme3.texture.Texture.MinFilter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。