/** * <code>setImage</code> sets the image object that defines the texture. * * @param image * the image that defines the texture. */ public void setImage(Image image) { this.image = image; // Test if mipmap generation required. setMinFilter(getMinFilter()); }
@Override public void applyToTexture(final String option, final Texture texture) { texture.setMinFilter(Texture.MinFilter.valueOf(option)); } },
private static Material createCheckerBoardMaterial(AssetManager assetManager) { Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); Texture tex = createCheckerBoardTexture(); // assetManager.loadTexture("Textures/Terrain/BrickWall/BrickWall.dds"); tex.setMagFilter(Texture.MagFilter.Bilinear); tex.setMinFilter(Texture.MinFilter.Trilinear); tex.setWrap(Texture.WrapMode.Repeat); mat.setTexture("ColorMap", tex); return mat; }
/** Retrieve a basic clone of this Texture (ie, clone everything but the * image data, which is shared) * * @return Texture * * @deprecated Use {@link Texture#clone()} instead. */ @Deprecated public Texture createSimpleClone(Texture rVal) { rVal.setMinFilter(minificationFilter); rVal.setMagFilter(magnificationFilter); rVal.setShadowCompareMode(shadowCompareMode); rVal.setAnisotropicFilter(anisotropicFilter); rVal.setImage(image); // NOT CLONED. rVal.setKey(key); rVal.setName(name); return rVal; }
tex = assetManager.loadTexture(key); tex.setMagFilter(Texture.MagFilter.Bilinear); tex.setMinFilter(Texture.MinFilter.BilinearNoMipMaps);
textures[texUnit].setMinFilter(loadedTexture.getMinFilter()); textures[texUnit].setMagFilter(loadedTexture.getMagFilter()); textures[texUnit].setAnisotropicFilter(loadedTexture.getAnisotropicFilter());
@Test public void newStyleTextureParameters_shouldBeSupported() throws Exception { when(assetInfo.openStream()).thenReturn(J3MLoader.class.getResourceAsStream("/texture-parameters-newstyle.j3m")); final Texture textureNoParameters = Mockito.mock(Texture.class); final Texture textureFlip = Mockito.mock(Texture.class); final Texture textureRepeat = Mockito.mock(Texture.class); final Texture textureRepeatAxis = Mockito.mock(Texture.class); final Texture textureMin = Mockito.mock(Texture.class); final Texture textureMag = Mockito.mock(Texture.class); final Texture textureCombined = Mockito.mock(Texture.class); final Texture textureLooksLikeOldStyle = Mockito.mock(Texture.class); final TextureKey textureKeyNoParameters = setupMockForTexture("Empty", "empty.png", false, textureNoParameters); final TextureKey textureKeyFlip = setupMockForTexture("Flip", "flip.png", true, textureFlip); setupMockForTexture("Repeat", "repeat.png", false, textureRepeat); setupMockForTexture("RepeatAxis", "repeat-axis.png", false, textureRepeatAxis); setupMockForTexture("Min", "min.png", false, textureMin); setupMockForTexture("Mag", "mag.png", false, textureMag); setupMockForTexture("Combined", "combined.png", true, textureCombined); setupMockForTexture("LooksLikeOldStyle", "oldstyle.png", true, textureLooksLikeOldStyle); j3MLoader.load(assetInfo); verify(assetManager).loadTexture(textureKeyNoParameters); verify(assetManager).loadTexture(textureKeyFlip); verify(textureRepeat).setWrap(Texture.WrapMode.Repeat); verify(textureRepeatAxis).setWrap(Texture.WrapAxis.T, Texture.WrapMode.Repeat); verify(textureMin).setMinFilter(Texture.MinFilter.Trilinear); verify(textureMag).setMagFilter(Texture.MagFilter.Bilinear); verify(textureCombined).setMagFilter(Texture.MagFilter.Nearest); verify(textureCombined).setMinFilter(Texture.MinFilter.BilinearNoMipMaps); verify(textureCombined).setWrap(Texture.WrapMode.Repeat); }
@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); }
result.setMinFilter(MinFilter.Trilinear); break; case NEVER_GENERATE: case GENERATE_WHEN_NEEDED: if ((imaflag & 0x04) != 0) { result.setMinFilter(MinFilter.Trilinear);
resultTexture.setMinFilter(MinFilter.NearestNoMipMaps);
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(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); }
texture.setMinFilter(Texture.MinFilter.BilinearNoMipMaps); texture.setAnisotropicFilter(0); texture.setWrap(Texture.WrapMode.EdgeClamp);
tex.setMinFilter(Texture.MinFilter.Trilinear);
private void convertAndPutImage(Image image, float posX, float posY) { Texture tex = new Texture2D(image); tex.setMagFilter(MagFilter.Nearest); tex.setMinFilter(MinFilter.NearestNoMipMaps); tex.setAnisotropicFilter(16); Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); mat.setTexture("ColorMap", tex); Quad q = new Quad(5, 5); Geometry g = new Geometry("quad", q); g.setLocalTranslation(posX, posY - 5, -0.0001f); g.setMaterial(mat); rootNode.attachChild(g); BitmapFont fnt = assetManager.loadFont("Interface/Fonts/Default.fnt"); BitmapText txt = new BitmapText(fnt); txt.setBox(new Rectangle(0, 0, 5, 5)); txt.setQueueBucket(RenderQueue.Bucket.Transparent); txt.setSize(0.5f); txt.setText(image.getFormat().name()); txt.setLocalTranslation(posX, posY, 0); rootNode.attachChild(txt); }
tex.setMinFilter(Texture.MinFilter.BilinearNoMipMaps); tex.setWrap(Texture.WrapAxis.S, Texture.WrapMode.Repeat); tex.setWrap(Texture.WrapAxis.T, Texture.WrapMode.MirroredRepeat);
tex.setMinFilter(Texture.MinFilter.Trilinear);
/** * <code>setImage</code> sets the image object that defines the texture. * * @param image * the image that defines the texture. */ public void setImage(Image image) { this.image = image; // Test if mipmap generation required. setMinFilter(getMinFilter()); }
@Override public void applyToTexture(final String option, final Texture texture) { texture.setMinFilter(Texture.MinFilter.valueOf(option)); } },
/** Retrieve a basic clone of this Texture (ie, clone everything but the * image data, which is shared) * * @return Texture * * @deprecated Use {@link Texture#clone()} instead. */ @Deprecated public Texture createSimpleClone(Texture rVal) { rVal.setMinFilter(minificationFilter); rVal.setMagFilter(magnificationFilter); rVal.setShadowCompareMode(shadowCompareMode); rVal.setAnisotropicFilter(anisotropicFilter); rVal.setImage(image); // NOT CLONED. rVal.setKey(key); rVal.setName(name); return rVal; }
/** Retrieve a basic clone of this Texture (ie, clone everything but the * image data, which is shared) * * @return Texture */ public Texture createSimpleClone(Texture rVal) { rVal.setMinFilter(minificationFilter); rVal.setMagFilter(magnificationFilter); rVal.setShadowCompareMode(shadowCompareMode); // rVal.setHasBorder(hasBorder); rVal.setAnisotropicFilter(anisotropicFilter); rVal.setImage(image); // NOT CLONED. // rVal.memReq = memReq; rVal.setKey(key); rVal.setName(name); // rVal.setBlendColor(blendColor != null ? blendColor.clone() : null); // if (getTextureKey() != null) { // rVal.setTextureKey(getTextureKey()); // } if (original != null) { rVal.original = original; } else { rVal.original = this; } return rVal; }