本文整理汇总了Java中com.jme3.texture.Texture.setAnisotropicFilter方法的典型用法代码示例。如果您正苦于以下问题:Java Texture.setAnisotropicFilter方法的具体用法?Java Texture.setAnisotropicFilter怎么用?Java Texture.setAnisotropicFilter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.texture.Texture
的用法示例。
在下文中一共展示了Texture.setAnisotropicFilter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
import com.jme3.texture.Texture; //导入方法依赖的package包/类
@Override
protected void initialize(Application application){
chunkMaterial = new Material(getVictorum().getAssetManager(), "/Common/MatDefs/Misc/Unshaded.j3md");
Texture textureAtlas = getVictorum().getAssetManager().loadTexture(new TextureKey("/atlas.png", false));
textureAtlas.setMagFilter(Texture.MagFilter.Nearest);
textureAtlas.setMinFilter(Texture.MinFilter.BilinearNearestMipMap);
textureAtlas.setAnisotropicFilter(2);
chunkMaterial.setTexture("ColorMap", textureAtlas);
chunkMaterial.getAdditionalRenderState().setFaceCullMode(RenderState.FaceCullMode.Off);
}
示例2: updateTextures
import com.jme3.texture.Texture; //导入方法依赖的package包/类
public void updateTextures(){
int index = 0;
for (TerrainTexture tt : texturing) {
String indexHint = index == 0? "" : "_" + index;
Texture diffuse;
double scale;
if(tt == null){
diffuse = RendererPlatform.getAssetManager().loadTexture("textures/trans.png");
scale = 0;
} else{
try{
diffuse = RendererPlatform.getAssetManager().loadTexture(tt.getDiffuse());
} catch (Exception e) {
LogUtil.warning("Diffuse map was not found : " + tt.getDiffuse() + " in TerrainTexture #"+index);
diffuse = RendererPlatform.getAssetManager().loadTexture("textures/trans.png");
}
scale = tt.getScale();
if(tt.getNormal() != null && !tt.getNormal().isEmpty()){
Texture normal = RendererPlatform.getAssetManager().loadTexture(tt.getNormal());
normal.setAnisotropicFilter(8);
normal.setWrap(Texture.WrapMode.Repeat);
setTexture("NormalMap" + indexHint, normal);
}
}
diffuse.setWrap(Texture.WrapMode.Repeat);
diffuse.setAnisotropicFilter(8);
setTexture("DiffuseMap"+indexHint, diffuse);
setFloat("DiffuseMap_" + index + "_scale", (float)scale);
index++;
}
}