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


Java Texture.setMinFilter方法代码示例

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


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

示例1: simpleInitApp

import com.jme3.texture.Texture; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
    Cylinder t = new Cylinder(20, 50, 1, 2, true);
    Geometry geom = new Geometry("Cylinder", t);

    Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    TextureKey key = new TextureKey("Interface/Logo/Monkey.jpg", true);
    key.setGenerateMips(true);
    Texture tex = assetManager.loadTexture(key);
    tex.setMinFilter(Texture.MinFilter.Trilinear);
    mat.setTexture("ColorMap", tex);

    geom.setMaterial(mat);
    
    rootNode.attachChild(geom);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:17,代码来源:TestCylinder.java

示例2: setupFloor

import com.jme3.texture.Texture; //导入方法依赖的package包/类
public void setupFloor() {
    Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    TextureKey key = new TextureKey("Interface/Logo/Monkey.jpg", true);
    key.setGenerateMips(true);
    Texture tex = assetManager.loadTexture(key);
    tex.setMinFilter(Texture.MinFilter.Trilinear);
    mat.setTexture("ColorMap", tex);

    Box floor = new Box(Vector3f.ZERO, 100, 1f, 100);
    Geometry floorGeom = new Geometry("Floor", floor);
    floorGeom.setMaterial(mat);
    floorGeom.setLocalTranslation(new Vector3f(0f, -3, 0f));

    floorGeom.addControl(new RigidBodyControl(new MeshCollisionShape(floorGeom.getMesh()), 0));
    rootNode.attachChild(floorGeom);
    getPhysicsSpace().add(floorGeom);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:18,代码来源:TestAttachDriver.java

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: simpleInitApp

import com.jme3.texture.Texture; //导入方法依赖的package包/类
@Override
    public void simpleInitApp() {
        BitmapText txt = guiFont.createLabel("Left: HW Mips");
        txt.setLocalTranslation(0, settings.getHeight() - txt.getLineHeight() * 4, 0);
        guiNode.attachChild(txt);

        txt = guiFont.createLabel("Right: AWT Mips");
        txt.setLocalTranslation(0, settings.getHeight() - txt.getLineHeight() * 3, 0);
        guiNode.attachChild(txt);

        // create a simple plane/quad
        Quad quadMesh = new Quad(1, 1);
        quadMesh.updateGeometry(1, 1, false);
        quadMesh.updateBound();

        Geometry quad1 = new Geometry("Textured Quad", quadMesh);
        Geometry quad2 = new Geometry("Textured Quad 2", quadMesh);

        Texture tex = assetManager.loadTexture("Interface/Logo/Monkey.png");
        tex.setMinFilter(Texture.MinFilter.Trilinear);

        Texture texCustomMip = tex.clone();
        Image imageCustomMip = texCustomMip.getImage().clone();
        MipMapGenerator.generateMipMaps(imageCustomMip);
        texCustomMip.setImage(imageCustomMip);

        Material mat1 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        mat1.setTexture("ColorMap", tex);

        Material mat2 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        mat2.setTexture("ColorMap", texCustomMip);

        quad1.setMaterial(mat1);
//        quad1.setLocalTranslation(1, 0, 0);

        quad2.setMaterial(mat2);
        quad2.setLocalTranslation(1, 0, 0);

        rootNode.attachChild(quad1);
        rootNode.attachChild(quad2);
    }
 
开发者ID:mleoking,项目名称:PhET,代码行数:42,代码来源:TestMipMapGen.java

示例8: 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

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