Package com.jme3.material

Examples of com.jme3.material.Material


    tex_Clouds = assetManager.loadTexture(cloudsMap);
    tex_Clouds.setMinFilter(MinFilter.BilinearNoMipMaps);
    tex_Clouds.setMagFilter(MagFilter.Bilinear);
    tex_Clouds.setWrap(WrapMode.Repeat);
   
    mat_Sky = new Material(assetManager, "tonegod/skydome/shaders/SkyDome.j3md");
    mat_Sky.setTexture("SkyNightMap", tex_Sky);
    if (moonMap != null) {
      mat_Sky.setTexture("SunMap", tex_Sun);
      mat_Sky.setTexture("MoonMap", tex_Moon);
    //  mat_Sky.setFloat("MoonDirection", moonRotation);
View Full Code Here


        model.tileTypes = new LinkedHashMap<>();
        model.tileTypes.put("floor", assetManager.loadModel("terrain/floor.obj"));
        model.tileTypes.put("wall", assetManager.loadModel("terrain/wall.obj"));
        model.materials = new LinkedHashMap<>();

        Material floor = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        floor.setTexture("ColorMap", assetManager.loadTexture("terrain/floor.jpg"));
        model.materials.put("floor", floor);
        Material wall = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        wall.setTexture("ColorMap", assetManager.loadTexture("terrain/wall.jpg"));
        model.materials.put("wall", wall);
    }
View Full Code Here

        return tile;
    }

    @Deprecated
    private Geometry createObject(String key, int x, int y) {
        Material material = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        material.setColor("Color", ColorRGBA.Orange);

        Geometry geometry = new Geometry("x" + key, new Box(0.3f, 1, 0.3f));
        geometry.move(x, 1, y);
        geometry.setMaterial(material);
        return geometry;
View Full Code Here

                    }
                }

                filter.postFrame(renderManager, viewPort, buff, sceneFb);

                Material mat = filter.getMaterial();
                if (msDepth && filter.isRequiresDepthTexture()) {
                    mat.setInt("NumSamplesDepth", depthTexture.getImage().getMultiSamples());
                }

                if (filter.isRequiresSceneTexture()) {
                    mat.setTexture("Texture", tex);
                    if (tex.getImage().getMultiSamples() > 1) {
                        mat.setInt("NumSamples", tex.getImage().getMultiSamples());
                    } else {
                        mat.clearParam("NumSamples");
                    }
                }

                buff = outputBuffer;
                if (i != lastFilterIndex) {
View Full Code Here

        Geometry sky = new Geometry("Sky", sphereMesh);
        sky.setQueueBucket(Bucket.Sky);
        sky.setCullHint(Spatial.CullHint.Never);
        sky.setModelBound(new BoundingSphere(Float.POSITIVE_INFINITY, Vector3f.ZERO));

        Material skyMat = new Material(assetManager, "Common/MatDefs/Misc/Sky.j3md");

        skyMat.setVector3("NormalScale", normalScale);
        if (sphereMap) {
            skyMat.setBoolean("SphereMap", sphereMap);
        } else if (!(texture instanceof TextureCubeMap)) {
            // make sure its a cubemap
            Image img = texture.getImage();
            texture = new TextureCubeMap();
            texture.setImage(img);
        }
        skyMat.setTexture("Texture", texture);
        sky.setMaterial(skyMat);

        return sky;
    }
View Full Code Here

        cubeMap.setAnisotropicFilter(0);
        cubeMap.setMagFilter(Texture.MagFilter.Bilinear);
        cubeMap.setMinFilter(Texture.MinFilter.NearestNoMipMaps);
        cubeMap.setWrap(Texture.WrapMode.EdgeClamp);

        Material skyMat = new Material(assetManager, "Common/MatDefs/Misc/Sky.j3md");
        skyMat.setTexture("Texture", cubeMap);
        skyMat.setVector3("NormalScale", normalScale);
        sky.setMaterial(skyMat);

        return sky;
    }
View Full Code Here

            maxVertCount = 0;
        }
       
        for (Map.Entry<Material, List<Geometry>> entry : matMap.entrySet()) {
            Mesh m = new Mesh();
            Material material = entry.getKey();
            List<Geometry> list = entry.getValue();
            nbGeoms += list.size();
            String batchName = name + "-batch" + batches.size();
            Batch batch;
            if (!needsFullRebatch) {
View Full Code Here

    public Picture createDisplayQuad(/*int mode, Texture tex*/){
        if (scene64 == null)
            return null;

        Material mat = new Material(manager, "Common/MatDefs/Hdr/LogLum.j3md");
//        if (mode == LUMMODE_ENCODE_LUM)
//            mat.setBoolean("EncodeLum", true);
//        else if (mode == LUMMODE_DECODE_LUM)
            mat.setBoolean("DecodeLum", true);
            mat.setTexture("Texture", scene64);
//        mat.setTexture("Texture", tex);
       
        Picture dispQuad = new Picture("Luminance Display");
        dispQuad.setMaterial(mat);
        return dispQuad;
View Full Code Here

        return dispQuad;
    }

    private Material createLumShader(int srcW, int srcH, int bufW, int bufH, int mode,
                                int iters, Texture tex){
        Material mat = new Material(manager, "Common/MatDefs/Hdr/LogLum.j3md");
       
        Vector2f blockSize = new Vector2f(1f / bufW, 1f / bufH);
        Vector2f pixelSize = new Vector2f(1f / srcW, 1f / srcH);
        Vector2f blocks = new Vector2f();
        float numPixels = Float.POSITIVE_INFINITY;
        if (iters != -1){
            do {
                pixelSize.multLocal(2);
                blocks.set(blockSize.x / pixelSize.x,
                           blockSize.y / pixelSize.y);
                numPixels = blocks.x * blocks.y;
            } while (numPixels > iters);
        }else{
            blocks.set(blockSize.x / pixelSize.x,
                       blockSize.y / pixelSize.y);
            numPixels = blocks.x * blocks.y;
        }

        mat.setBoolean("Blocks", true);
        if (mode == LUMMODE_ENCODE_LUM)
            mat.setBoolean("EncodeLum", true);
        else if (mode == LUMMODE_DECODE_LUM)
            mat.setBoolean("DecodeLum", true);

        mat.setTexture("Texture", tex);
        mat.setVector2("BlockSize", blockSize);
        mat.setVector2("PixelSize", pixelSize);
        mat.setFloat("NumPixels", numPixels);

        return mat;
    }
View Full Code Here

        tempData.put(imageData).flip();
        return new Image(Format.RGB8, 4, 4, tempData);
    }
   
    public static Material getPlaceholderMaterial(AssetManager assetManager){
        Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        mat.setColor("Color", ColorRGBA.Red);
        return mat;
    }
View Full Code Here

TOP

Related Classes of com.jme3.material.Material

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.