Package com.jme3.material

Examples of com.jme3.material.Material


  @Override
  public Node create(AssetManager assetManager, Camera cam) {
        Quad q = new Quad(20, 10);
        Geometry g = new Geometry("quad", q);
        g.setLocalTranslation(-10, -5, -0.0001f);
        Material bg = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        bg.setColor("Color", ColorRGBA.Black);
        g.setMaterial(bg);
        sceneNode.attachChild(g);

        Quad q_small = new Quad(9.0f, 3.0f);
        Geometry logo = new Geometry("quad", q_small);
        logo.setLocalTranslation(-4.5f, -1.5f, 1);
        Material logo_mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        Texture logo_tex = assetManager.loadTexture("Textures/pollux.jpg");
        logo_mat.setTexture("ColorMap", logo_tex);
        logo.setMaterial(logo_mat);
        sceneNode.attachChild(logo);
       
       
        BitmapFont fnt = assetManager.loadFont("Interface/Fonts/Default.fnt");
View Full Code Here


    }
   
    private void createGround(String groundTexture) {
        Spatial geom = createSphere();
        geom.scale(getInnerRadius());
        mPlanetGround = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
        mPlanetGround.setTexture("DiffuseMap", assetManager.loadTexture(groundTexture));
        mPlanetGround.setTexture("GlowMap", assetManager.loadTexture("Textures/Planets/Earth/Earthlights2_1280.jpg"));
        mPlanetGround.setFloat("Shininess", 0.01f); // [1,128]
        geom.setMaterial(mPlanetGround);
        geom.setLocalTranslation(getPosition());
View Full Code Here

    }
   
    private void createClouds(String cloudTexture) {
        Spatial geom = createSphere();
        geom.scale(getCloudRadius());
        Material mClouds = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
        mClouds.setTexture("DiffuseMap", assetManager.loadTexture(cloudTexture));
        mClouds.setFloat("Shininess", 0.01f); // [1,128]
        mClouds.getAdditionalRenderState().setBlendMode(BlendMode.AlphaAdditive);
        geom.setMaterial(mClouds);
        geom.setLocalTranslation(getPosition());
        TangentBinormalGenerator.generate(geom);
        geom.updateModelBound();
        clouds = geom;
View Full Code Here

      atmosphere.setMaterial(mAtmosphere);
        TangentBinormalGenerator.generate(atmosphere);
        atmosphere.updateModelBound();
       
        //create the material
        mAtmosphere = new Material(assetManager, "MatDefs/Atmosphere.j3md");
        mAtmosphere.setVector3("v3LightPos", new Vector3f(1,0,0));
        mAtmosphere.setVector3("v3Center", position);
        mAtmosphere.setVector3("v3InvWavelength", this.getInvWavelength4());
        mAtmosphere.setFloat("fKrESun", this.getKrESun());
        mAtmosphere.setFloat("fKmESun", this.getKmESun());
View Full Code Here

    return light;
  }
 
  private void genSunClickGeo() {
    Sphere s = new Sphere(16, 16, size);
    Material mat = new Material(assetManager, "Common/MatDefs/Misc/SolidColor.j3md");
    mat.setColor("Color", ColorRGBA.Yellow);
    mat.getAdditionalRenderState().setFaceCullMode(FaceCullMode.FrontAndBack);
      sun = new Geometry("geo_"+name, s);
      sun.setMaterial(mat);
      sun.setShadowMode(ShadowMode.Off);
     
  }
View Full Code Here

        flame.setInitialVelocity(new Vector3f(0, 3, 0));
        //flame.setVelocityVariation(1f);
        flame.setVelocityVariation(1.5f);
        flame.setImagesX(8);
        flame.setImagesY(1);
        Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
        //mat.setTexture("Texture", assetManager.loadTexture("Effects/Explosion/flame.png"));
        mat.setTexture("Texture", assetManager.loadTexture("Textures/d3.png"));
        mat.setBoolean("PointSprite", true);
        flame.setMaterial(mat);
        //flame.setLocalTranslation(100, 0, 0);
        return flame;
  }
View Full Code Here

      js = JmeUpdateSystem.get();
      ps = sin.getPosSystem();
    tm.update(cam.getLocation());
      rootNode.attachChild(debugNodes);
     
        matWireframe = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        matWireframe.setColor("Color", ColorRGBA.Green);
        matWireframe.getAdditionalRenderState().setWireframe(true);

//        //Sky adds one anyway
//        DirectionalLight light = new DirectionalLight();
View Full Code Here

  private void toggelNavBorderMeshes() {
      if(navs.getChild("NavBorderMeshes") != null){
        navs.detachChildNamed("NavBorderMeshes");
      } else {
        Node node = new Node("NavBorderMeshes");
        Material mat = matWireframe.clone();
            mat.setColor("Color", ColorRGBA.Blue);
        TiledNavMesh[] array = Singleton.get().getNavManager().getNavMeshes();
        for(TiledNavMesh t : array){
          Geometry g = t.getDebugBorderMesh();
          g.setMaterial(mat);
          node.attachChild(g);
View Full Code Here

      cam.setFrustumFar(1000f);
      cam.setFrustumNear(1f);
//      cam.lookAt(new Vector3f(-9902.244f, 19.241596f, 8288.143f), Vector3f.UNIT_Y);
      flyCam.setMoveSpeed(50f);
     
        matWireframe = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        matWireframe.setColor("Color", ColorRGBA.Green);
        matWireframe.getAdditionalRenderState().setWireframe(true);

        DirectionalLight light = new DirectionalLight();
        light.setDirection((new Vector3f(-0.5f, -1f, -0.5f)).normalize());
View Full Code Here

  private void toggelNavBorderMeshes() {
      if(border.getChildren().size() > 0){
        border.detachAllChildren();
      } else {
        if(navMesh != null) {
            Material mat = matWireframe.clone();
                mat.setColor("Color", ColorRGBA.Blue);
          Geometry db = navMesh.getDebugBorderMesh();
          //we just put it slightly off to beter see the border
          db.setLocalTranslation(new Vector3f(0f, 0.5f, 0f).addLocal(db.getLocalTranslation()));
          System.out.println("Border has "+db.getVertexCount()+" vertices");
          db.setMaterial(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.