Examples of TextureKey


Examples of com.ardor3d.util.TextureKey

        try {
            ret = (TextureState) readSavableFromCurrentElem(null);
            final Savable[] savs = readSavableArray("texture", new Texture[0]);
            for (int i = 0; i < savs.length; i++) {
                Texture t = (Texture) savs[i];
                final TextureKey tKey = t.getTextureKey();
                t = TextureManager.loadFromKey(tKey, null, t);
                ret.setTexture(t, i);
            }
        } catch (final Exception e) {
            Logger.getLogger(DOMInputCapsule.class.getName()).log(Level.SEVERE, null, e);
View Full Code Here

Examples of com.ardor3d.util.TextureKey

        _minificationFilter = capsule.readEnum("minificationFilter", MinificationFilter.class,
                MinificationFilter.NearestNeighborNoMipMaps);
        _image = (Image) capsule.readSavable("image", null);

        // pull our key, if exists
        final TextureKey key = (TextureKey) capsule.readSavable("textureKey", null);
        if (key != null) {
            _key = TextureKey.getKey(key.getSource(), key.isFlipped(), key.getFormat(), key.getId(),
                    key.getMinificationFilter());
        } else {
            // none set, so pop in a generated key
            _key = TextureKey.getRTTKey(_minificationFilter);
        }
View Full Code Here

Examples of com.ardor3d.util.TextureKey

            magFilter = Texture.MagnificationFilter.Bilinear;
            minFilter = Texture.MinificationFilter.BilinearNoMipMaps;
            if (_useMipMaps) {
                minFilter = Texture.MinificationFilter.Trilinear;
            }
            final TextureKey tkey = TextureKey.getKey(texSrc, false, TextureStoreFormat.GuessNoCompressedFormat,
                    minFilter);
            _pageTexture = TextureManager.loadFromKey(tkey, null, null);
            _pageTexture.setMagnificationFilter(magFilter);

            // Add a touch higher mipmap selection.
View Full Code Here

Examples of com.ardor3d.util.TextureKey

                return 1;
            }

            for (int x = 0, maxIndex = Math.min(ts1.getMaxTextureIndexUsed(), ts2.getMaxTextureIndexUsed()); x <= maxIndex; x++) {

                final TextureKey key1 = ts1.getTextureKey(x);
                final TextureKey key2 = ts2.getTextureKey(x);

                if (key1 == null) {
                    if (key2 == null) {
                        continue;
                    } else {
                        return -1;
                    }
                } else if (key2 == null) {
                    return 1;
                }

                final int tid1 = key1.hashCode();
                final int tid2 = key2.hashCode();

                if (tid1 == tid2) {
                    continue;
                } else if (tid1 < tid2) {
                    return -1;
View Full Code Here

Examples of com.ardor3d.util.TextureKey

        // Create the texture...
        if (texture.getTextureKey() != null) {

            // Look for a texture in the cache just like ours
            final TextureKey texKey = texture.getTextureKey();
            final Texture cached = TextureManager.findCachedTexture(texKey);

            if (cached == null) {
                TextureManager.addToCache(texture);
            } else {
View Full Code Here

Examples of com.ardor3d.util.TextureKey

     */
    public static final Texture loadTexture(final BufferedImage image, final Texture.MinificationFilter minFilter,
            final TextureStoreFormat storeFormat, final boolean flipVertically) {
        final Image imageData = AWTImageLoader.makeArdor3dImage(image, flipVertically);
        final String fileType = (image != null) ? "" + image.hashCode() : null;
        final TextureKey tkey = TextureKey.getKey(null, flipVertically, storeFormat, fileType, minFilter);
        return TextureManager.loadFromKey(tkey, imageData, null);
    }
View Full Code Here

Examples of com.jme.util.TextureKey

    }


    private TextureKey createTextureKey( final int imageHashcode )
    {
        final TextureKey tkey = new TextureKey( null, Texture.MM_LINEAR, Texture.FM_LINEAR,
                                                DEFAULT_ANISO_LEVEL, false, DEFAULT_TEXTURE_IMAGE_FORMAT );
        tkey.setFileType( "" + imageHashcode );
        return tkey;
    }
View Full Code Here

Examples of com.jme3.asset.TextureKey

    //bgNode.attachChild(sky);

    sphere.updateModelBound();
    sphere.setQueueBucket(Bucket.Sky);
    Material sky = new Material(assetManager, "Common/MatDefs/Misc/Sky.j3md");
    TextureKey key = new TextureKey("Textures/Sky/Stars.dds", true);
    key.setGenerateMips(true);
    key.setAsCube(true);
    Texture tex = assetManager.loadTexture(key);
    sky.setTexture("m_Texture", tex);
    sky.setVector3("m_NormalScale", Vector3f.UNIT_XYZ);
    sphere.setMaterial(sky);
    sphere.setCullHint(Spatial.CullHint.Never);
View Full Code Here

Examples of com.jme3.asset.TextureKey

    public static Spatial createSky(AssetManager assetManager, Texture texture, boolean sphereMap) {
        return createSky(assetManager, texture, Vector3f.UNIT_XYZ, sphereMap);
    }

    public static Spatial createSky(AssetManager assetManager, String textureName, boolean sphereMap) {
        TextureKey key = new TextureKey(textureName, true);
        key.setGenerateMips(true);
        key.setAsCube(!sphereMap);
        Texture tex = assetManager.loadTexture(key);
        return createSky(assetManager, tex, sphereMap);
    }
View Full Code Here

Examples of com.jme3.asset.TextureKey

        //BufferedImage im = null;
       
        try {
            String name = namer.getName(x, z);
            logger.log(Level.FINE, "Loading heightmap from file: {0}", name);
            final Texture texture = assetManager.loadTexture(new TextureKey(name));
           
            // CREATE HEIGHTMAP
            heightmap = new ImageBasedHeightMap(texture.getImage());
           
            heightmap.setHeightScale(1);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.