/** * Convenience method for setting texture without managing TextureState. * * @param texture * the new texture to set on unit 0. */ public void setTexture(final Texture2D texture) { TextureState ts = (TextureState) getLocalRenderState(RenderState.StateType.Texture); if (ts == null) { ts = new TextureState(); ts.setEnabled(true); setRenderState(ts); } ts.setTexture(texture, 0); }
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; }
break; newTState.setEnabled(foundEnabled); return newTState;
break; newTState.setEnabled(foundEnabled); return newTState;
screen.setEnabled(true);
/** * 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); }
public void resetTexture() { _texture.setWrap(Texture.WrapMode.EdgeClamp); _texture.setMinificationFilter(Texture.MinificationFilter.BilinearNoMipMaps); _texture.setMagnificationFilter(Texture.MagnificationFilter.Bilinear); _texture.setTextureStoreFormat(TextureStoreFormat.RGBA8); _tRenderer.setupTexture(_texture); final TextureState ts = new TextureState(); ts.setEnabled(true); ts.setTexture(_texture, 0); _imposterQuad.setRenderState(ts); // Add a blending mode... This is so the background of the texture is // transparent. final BlendState as1 = new BlendState(); as1.setBlendEnabled(true); as1.setSourceFunction(BlendState.SourceFunction.SourceAlpha); as1.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha); as1.setTestEnabled(true); as1.setTestFunction(BlendState.TestFunction.GreaterThan); as1.setEnabled(true); _imposterQuad.setRenderState(as1); }
public void resetTexture() { _texture.setWrap(Texture.WrapMode.EdgeClamp); _texture.setMinificationFilter(Texture.MinificationFilter.BilinearNoMipMaps); _texture.setMagnificationFilter(Texture.MagnificationFilter.Bilinear); _texture.setTextureStoreFormat(TextureStoreFormat.RGBA8); _tRenderer.setupTexture(_texture); final TextureState ts = new TextureState(); ts.setEnabled(true); ts.setTexture(_texture, 0); _imposterQuad.setRenderState(ts); // Add a blending mode... This is so the background of the texture is // transparent. final BlendState as1 = new BlendState(); as1.setBlendEnabled(true); as1.setSourceFunction(BlendState.SourceFunction.SourceAlpha); as1.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha); as1.setTestEnabled(true); as1.setTestFunction(BlendState.TestFunction.GreaterThan); as1.setEnabled(true); _imposterQuad.setRenderState(as1); }
ts.setEnabled(true); fullScreenQuad.setRenderState(ts);
public OutlinePass(final boolean antialiased) { _wireframeState = new WireframeState(); _wireframeState.setFace(WireframeState.Face.FrontAndBack); _wireframeState.setLineWidth(DEFAULT_LINE_WIDTH); _wireframeState.setEnabled(true); _frontCull = new CullState(); _frontCull.setCullFace(Face.Front); _backCull = new CullState(); _backCull.setCullFace(Face.Back); _wireframeState.setAntialiased(antialiased); _noLights = new LightState(); _noLights.setGlobalAmbient(DEFAULT_OUTLINE_COLOR); _noLights.setEnabled(true); _noTexture = new TextureState(); _noTexture.setEnabled(true); _blendState = new BlendState(); _blendState.setSourceFunction(BlendState.SourceFunction.SourceAlpha); _blendState.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha); _blendState.setBlendEnabled(true); _blendState.setEnabled(true); }
textureState.setEnabled(true);
_noTexture.setEnabled(false); _colorDisabled = new ColorMaskState(); _colorDisabled.setAll(false);
_noClip.setEnabled(false); _noTexture = new TextureState(); _noTexture.setEnabled(false); _colorDisabled = new ColorMaskState(); _colorDisabled.setAll(false);
textureState.setEnabled(true);