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


Java Texture.setMagFilter方法代码示例

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


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

示例1: setBgMap

import com.jme3.texture.Texture; //导入方法依赖的package包/类
/**
 * Adds an background map to the Elements material
 * 
 * @param bgMap
 *            A String path to the background map
 */
public BaseElement setBgMap(String bgMap) {
	Texture bg = null;
	if (isAtlasTextureInUse()) {
		// TODO test
		throw new UnsupportedOperationException();
		// if (this.getElementTexture() != null)
		// alpha = getElementTexture();
		// else
		// alpha = screen.getAtlasTexture();
		// Vector2f alphaOffset =
		// getAtlasTextureOffset(screen.parseAtlasCoords(alphaMap));
		// mat.setVector2("OffsetAlphaTexCoord", alphaOffset);
	} else {
		bg = ToolKit.get().getApplication().getAssetManager().loadTexture(bgMap);
		bg.setMinFilter(Texture.MinFilter.BilinearNoMipMaps);
		bg.setMagFilter(Texture.MagFilter.Nearest);
		bg.setWrap(Texture.WrapMode.Repeat);
	}

	this.bgMap = bg;
	mat.setTexture("BgMap", bg);
	mat.setColor("BgMapColor", bgMapColor);
	return this;
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:31,代码来源:BaseElement.java

示例2: loadTexture

import com.jme3.texture.Texture; //导入方法依赖的package包/类
protected void loadTexture(String colorMap) {
	if (!Objects.equals(this.texturePath, colorMap)) {
		Texture color = null;
		this.texturePath = colorMap;
		if (this.texturePath != null) {
			// if (isAtlasTextureInUse()) {
			// if (this.getElementTexture() != null)
			// color = getElementTexture();
			// else
			// color = screen.getAtlasTexture();
			// } else {
			color = ToolKit.get().getApplication().getAssetManager().loadTexture(colorMap);
			color.setMinFilter(Texture.MinFilter.BilinearNoMipMaps);
			color.setMagFilter(Texture.MagFilter.Nearest);
			// color.setWrap(Texture.WrapMode.Clamp);
			// }
		}
		applyTexture(color);
	}
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:21,代码来源:BaseElement.java

示例3: 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);
}
 
开发者ID:DA-CS-Lab,项目名称:Victorum,代码行数:11,代码来源:WorldAppState.java

示例4: createNewTexture

import com.jme3.texture.Texture; //导入方法依赖的package包/类
public Texture createNewTexture(String texturePath) {
	Texture newTex = getApplication().getAssetManager().loadTexture(texturePath);
	newTex.setMinFilter(Texture.MinFilter.BilinearNearestMipMap);
	newTex.setMagFilter(Texture.MagFilter.Bilinear);
	newTex.setWrap(Texture.WrapMode.Clamp);
	return newTex;
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:8,代码来源:BaseScreen.java

示例5: createImage

import com.jme3.texture.Texture; //导入方法依赖的package包/类
protected Texture createImage(BaseElement el) {
	Texture color = el.getScreen().getApplication().getAssetManager().loadTexture(imageUri);
	color.setMinFilter(Texture.MinFilter.BilinearNoMipMaps);
	color.setMagFilter(Texture.MagFilter.Nearest);
	return color;
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:7,代码来源:CssEffect.java

示例6: setAlphaMap

import com.jme3.texture.Texture; //导入方法依赖的package包/类
/**
 * Adds an alpha map to the Elements material
 * 
 * @param alphaMap
 *            A String path to the alpha map
 */
public BaseElement setAlphaMap(String alphaMap) {
	Texture alpha = null;
	if (isAtlasTextureInUse()) {
		if (this.getElementTexture() != null)
			alpha = getElementTexture();
		else
			alpha = screen.getAtlasTexture();

		// TODO
		// Vector2f alphaOffset =
		// getAtlasTextureOffset(screen.parseAtlasCoords(alphaMap));
		// mat.setVector2("OffsetAlphaTexCoord", alphaOffset);
		throw new UnsupportedOperationException();
	} else {
		alpha = ToolKit.get().getApplication().getAssetManager().loadTexture(alphaMap);
		alpha.setMinFilter(Texture.MinFilter.BilinearNoMipMaps);
		alpha.setMagFilter(Texture.MagFilter.Nearest);
		alpha.setWrap(Texture.WrapMode.Clamp);
	}

	this.alphaMap = alpha;

	if (defaultTex == null) {
		if (!isAtlasTextureInUse()) {
			float imgWidth = alpha.getImage().getWidth();
			float imgHeight = alpha.getImage().getHeight();
			float pixelWidth = 1f / imgWidth;
			float pixelHeight = 1f / imgHeight;

			this.model = new ElementQuadGrid(dimensions.clone(), calcBorders(), imgWidth, imgHeight, pixelWidth,
					pixelHeight, 0, 0, imgWidth, imgHeight);

			geom.setMesh(model);
		} else {
			// TODO
			// float[] coords = screen.parseAtlasCoords(alphaMap);
			// float textureAtlasX = coords[0];
			// float textureAtlasY = coords[1];
			// float textureAtlasW = coords[2];
			// float textureAtlasH = coords[3];
			//
			// float imgWidth = alpha.getImage().getWidth();
			// float imgHeight = alpha.getImage().getHeight();
			// float pixelWidth = 1f / imgWidth;
			// float pixelHeight = 1f / imgHeight;
			//
			// textureAtlasY = imgHeight - textureAtlasY - textureAtlasH;
			//
			// model = new ElementQuadGrid(dimensions.clone(),
			// borders.clone(), imgWidth, imgHeight, pixelWidth,
			// pixelHeight, textureAtlasX, textureAtlasY, textureAtlasW,
			// textureAtlasH);
			//
			// geom.setMesh(model);
			// mat.setVector2("OffsetAlphaTexCoord", new Vector2f(0, 0));
			throw new UnsupportedOperationException();
		}
	}
	mat.setTexture("AlphaMap", alpha);
	return this;
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:68,代码来源:BaseElement.java


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