public ColorReplaceEffect(final Texture colorRampTexture) { _colorRampTexture = colorRampTexture; _colorRampTexture.setWrap(WrapMode.EdgeClamp); }
public ColorReplaceEffect(final Texture colorRampTexture) { _colorRampTexture = colorRampTexture; _colorRampTexture.setWrap(WrapMode.EdgeClamp); }
@Override public Texture createSimpleClone(final Texture rVal) { rVal.setWrap(WrapAxis.S, _wrapS); rVal.setWrap(WrapAxis.T, _wrapT); rVal.setWrap(WrapAxis.R, _wrapR); if (rVal instanceof TextureCubeMap) { ((TextureCubeMap) rVal).setCurrentRTTFace(_currentRTTFace); } return super.createSimpleClone(rVal); }
@Override public Texture createSimpleClone(final Texture rVal) { rVal.setWrap(WrapAxis.S, _wrapS); rVal.setWrap(WrapAxis.T, _wrapT); rVal.setWrap(WrapAxis.R, _wrapR); if (rVal instanceof TextureCubeMap) { ((TextureCubeMap) rVal).setCurrentRTTFace(_currentRTTFace); } return super.createSimpleClone(rVal); }
@Override public Texture createSimpleClone(final Texture rVal) { rVal.setWrap(WrapAxis.S, _wrapS); return super.createSimpleClone(rVal); }
@Override public Texture createSimpleClone(final Texture rVal) { rVal.setWrap(WrapAxis.S, _wrapS); return super.createSimpleClone(rVal); }
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."); }
private void loadApplyTexture() throws MalformedURLException { final TextureState ts = (TextureState) getEdittedParticles().getLocalRenderState(StateType.Texture); // XXX: Needed? // TextureManager.clearCache(); ts.setTexture(TextureManager.load(new URLResourceSource(_newTexture.toURI().toURL()), Texture.MinificationFilter.BilinearNearestMipMap, TextureStoreFormat.GuessCompressedFormat, true)); ts.getTexture().setWrap(WrapMode.BorderClamp); ts.setEnabled(true); getEdittedParticles().setRenderState(ts); _newTexture = null; }
/** * Set the texture to be displayed on the given side of the skybox. Only replaces the texture at the index specified * by textureUnit. * * @param face * the face to set * @param texture * The texture for that side to assume. * @param textureUnit * The texture unite of the given side's TextureState the texture will assume. */ public void setTexture(final Face face, final Texture texture, final int textureUnit) { // Validate if (face == null) { throw new IllegalArgumentException("Face can not be null."); } TextureState ts = (TextureState) _skyboxQuads[face.ordinal()] .getLocalRenderState(RenderState.StateType.Texture); if (ts == null) { ts = new TextureState(); } // Initialize the texture state ts.setTexture(texture, textureUnit); ts.setEnabled(true); texture.setWrap(WrapMode.EdgeClamp); // Set the texture to the quad _skyboxQuads[face.ordinal()].setRenderState(ts); return; }
/** * Set the texture to be displayed on the given side of the skybox. Only replaces the texture at the index specified * by textureUnit. * * @param face * the face to set * @param texture * The texture for that side to assume. * @param textureUnit * The texture unite of the given side's TextureState the texture will assume. */ public void setTexture(final Face face, final Texture texture, final int textureUnit) { // Validate if (face == null) { throw new IllegalArgumentException("Face can not be null."); } TextureState ts = (TextureState) _skyboxQuads[face.ordinal()] .getLocalRenderState(RenderState.StateType.Texture); if (ts == null) { ts = new TextureState(); } // Initialize the texture state ts.setTexture(texture, textureUnit); ts.setEnabled(true); texture.setWrap(WrapMode.EdgeClamp); // Set the texture to the quad _skyboxQuads[face.ordinal()].setRenderState(ts); return; }
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())); } }
/** * Create setup to use as fallback if fancy water is not supported. */ private void createFallbackData() { fallbackTextureState = new TextureState(); fallbackTextureState.setEnabled(true); fallbackTexture = TextureManager.load(fallbackMapTextureString, Texture.MinificationFilter.Trilinear, TextureStoreFormat.GuessCompressedFormat, true); fallbackTextureState.setTexture(fallbackTexture, 0); fallbackTexture.setWrap(Texture.WrapMode.Repeat); fallbackTextureStateMatrix = new Matrix4(); as1 = new BlendState(); as1.setBlendEnabled(true); as1.setTestEnabled(true); as1.setSourceFunction(BlendState.SourceFunction.SourceAlpha); as1.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha); as1.setEnabled(true); }
TextureStoreFormat.GuessCompressedFormat, true); textureState.setTexture(normalmapTexture, 0); normalmapTexture.setWrap(Texture.WrapMode.Repeat); TextureStoreFormat.GuessNoCompressedFormat, true); textureState.setTexture(dudvTexture, 2); dudvTexture.setWrap(Texture.WrapMode.Repeat); textureState.setTexture(foamTexture, 3); foamTexture.setWrap(Texture.WrapMode.Repeat);
TextureStoreFormat.GuessCompressedFormat, true); textureState.setTexture(normalmapTexture, 0); normalmapTexture.setWrap(Texture.WrapMode.Repeat); dudvTexture.setTextureMatrix(matrix); textureState.setTexture(dudvTexture, 2); dudvTexture.setWrap(Texture.WrapMode.Repeat); textureState.setTexture(foamTexture, 3); foamTexture.setWrap(Texture.WrapMode.Repeat);