public void createAtlases(final AtlasTextureParameter atlasTextureParameter) { for (final ByteBuffer data : dataBuffers) { data.rewind(); final ImageDataFormat fmt = useAlpha ? ImageDataFormat.RGBA : ImageDataFormat.RGB; final Image image = new Image(fmt, PixelDataType.UnsignedByte, atlasWidth, atlasHeight, data, null); final TextureStoreFormat format = atlasTextureParameter.compress ? TextureStoreFormat.GuessCompressedFormat : TextureStoreFormat.GuessNoCompressedFormat; final Texture texture = TextureManager.loadFromImage(image, atlasTextureParameter.minificationFilter, format); texture.setMagnificationFilter(atlasTextureParameter.magnificationFilter); texture.setWrap(atlasTextureParameter.wrapMode); textures.add(texture); } for (final List<TextureParameter> paramList : cachedAtlases.values()) { for (final TextureParameter param : paramList) { final Texture texture = textures.get(param.getAtlasIndex()); final TextureState ts = (TextureState) param.getMesh().getLocalRenderState(StateType.Texture); ts.setTexture(texture, param.getTargetTextureIndex()); ts.setNeedsRefresh(true); } } TexturePacker.logger.info(nrTextures + " textures packed into " + packers.size() + " atlases."); }
minFilter); _pageTexture = TextureManager.loadFromKey(tkey, null, null); _pageTexture.setMagnificationFilter(magFilter);
minFilter); _pageTexture = TextureManager.loadFromKey(tkey, null, null); _pageTexture.setMagnificationFilter(magFilter);
private void applySampler(final Element sampler, final Texture texture) { if (sampler.getChild("minfilter") != null) { final String minfilter = sampler.getChild("minfilter").getText(); texture.setMinificationFilter(Enum.valueOf(SamplerTypes.MinFilterType.class, minfilter).getArdor3dFilter()); } if (sampler.getChild("magfilter") != null) { final String magfilter = sampler.getChild("magfilter").getText(); texture.setMagnificationFilter( Enum.valueOf(SamplerTypes.MagFilterType.class, magfilter).getArdor3dFilter()); } if (sampler.getChild("wrap_s") != null) { final String wrapS = sampler.getChild("wrap_s").getText(); texture.setWrap(Texture.WrapAxis.S, Enum.valueOf(SamplerTypes.WrapModeType.class, wrapS).getArdor3dWrapMode()); } if (sampler.getChild("wrap_t") != null) { final String wrapT = sampler.getChild("wrap_t").getText(); texture.setWrap(Texture.WrapAxis.T, Enum.valueOf(SamplerTypes.WrapModeType.class, wrapT).getArdor3dWrapMode()); } if (sampler.getChild("border_color") != null) { texture.setBorderColor(_colladaDOMUtil.getColor(sampler.getChild("border_color").getText())); } }
/** * Retrieve a basic clone of this Texture (ie, clone everything but the image data, which is shared) * * @return Texture */ public Texture createSimpleClone(final Texture rVal) { rVal.setAnisotropicFilterPercent(_anisotropicFilterPercent); rVal.setBorderColor(_borderColor); rVal.setDepthCompareFunc(_depthCompareFunc); rVal.setDepthCompareMode(_depthCompareMode); rVal.setHasBorder(_hasBorder); rVal.setTextureStoreFormat(_storeFormat); rVal.setRenderedTexturePixelDataType(_rttPixelDataType); rVal.setImage(_image); // NOT CLONED. rVal.setLodBias(_lodBias); rVal.setMinificationFilter(_minificationFilter); rVal.setMagnificationFilter(_magnificationFilter); rVal.setStoreImage(_storeImage); if (getTextureKey() != null) { rVal.setTextureKey(getTextureKey()); } return rVal; }
rVal.setMagnificationFilter(_magnificationFilter); rVal.setStoreImage(_storeImage); rVal.setTextureMatrix(_texMatrix);