Package com.ardor3d.renderer.state

Examples of com.ardor3d.renderer.state.TextureState


    /**
     * Force all of the textures to load. This prevents pauses later during the application as you pan around the world.
     */
    public void preloadTextures(final Renderer r) {
        for (int x = 0; x < 6; x++) {
            final TextureState ts = (TextureState) _skyboxQuads[x].getLocalRenderState(RenderState.StateType.Texture);
            if (ts != null) {
                r.applyState(StateType.Texture, ts);
            }
        }

View Full Code Here


        _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();
View Full Code Here

        _fakeTexture.setTextureStoreFormat(TextureStoreFormat.RGBA8);
        _fakeTexture.setWrap(WrapMode.EdgeClamp);
        UIContainer._textureRenderer.setupTexture(_fakeTexture);

        // Set a texturestate on the standin, using the fake texture
        final TextureState ts = new TextureState();
        ts.setTexture(_fakeTexture);
        _standin.setRenderState(ts);
    }
View Full Code Here

        return null;
    }

    public TextureState getTextureState() {
        if (map_Kd != null) {
            final TextureState tState = new TextureState();
            tState.setTexture(map_Kd, 0);
            return tState;
        }
        return null;
    }
View Full Code Here

     *
     * @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);
    }
View Full Code Here

                if (tex == null) {
                    tex = loadTexture(resource.getName());
                }

                if (tex != null) {
                    final TextureState ts = new TextureState();
                    ts.setTexture(tex);
                    mesh.setRenderState(ts);
                }
            }

            return store;
View Full Code Here

        final MaterialState material = _currentMaterial.getMaterialState();
        if (material != null) {
            target.setRenderState(material);
        }

        final TextureState tState = _currentMaterial.getTextureState();
        if (tState != null) {
            target.setRenderState(tState);
        }

        final BlendState blend = _currentMaterial.getBlendState();
View Full Code Here

        }

        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.");
    }
View Full Code Here

        buf.setEnabled(true);
        buf.setFunction(ZBufferState.TestFunction.LessThanOrEqualTo);
        _root.setRenderState(buf);

        // Create a texture from the Ardor3D logo.
        final TextureState ts = new TextureState();
        ts.setEnabled(true);
        ts.setTexture(TextureManager.load("images/ardor3d_white_256.jpg", Texture.MinificationFilter.Trilinear, true));
        _root.setRenderState(ts);

        // Set up a basic, default light.
        final PointLight light = new PointLight();
        light.setDiffuse(new ColorRGBA(0.75f, 0.75f, 0.75f, 0.75f));
View Full Code Here

        targetMesh.setModelBound(new BoundingBox());
        targetMesh.setTranslation(new Vector3(0, 0, -15));
        _root.attachChild(targetMesh);

        // Add a texture to the mesh.
        final TextureState ts = new TextureState();
        ts.setTexture(TextureManager.load("images/ardor3d_white_256.jpg", Texture.MinificationFilter.Trilinear, true));
        targetMesh.setRenderState(ts);
    }
View Full Code Here

TOP

Related Classes of com.ardor3d.renderer.state.TextureState

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.