Package com.jme3.material

Examples of com.jme3.material.Material


  private Material matBones;
 
    public void simpleInitApp() {
      Singleton.get().init(null);
        matBones = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        matBones.getAdditionalRenderState().setWireframe(true);
        matBones.setColor("Color", ColorRGBA.Red);
        matBones.getAdditionalRenderState().setDepthTest(false);
     
        matWireframe = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        matWireframe.setColor("Color", ColorRGBA.Green);
        matWireframe.getAdditionalRenderState().setWireframe(true);
        man = Singleton.get().getPartManager();
      man.loadParts("megaset.csv");
      templates = man.getTemplates();
View Full Code Here


      }
     
     
      Box b = new Box(.5f,1f,.5f);
      Geometry walker = new Geometry("wakler", b);
      Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        mat.setColor("Color", ColorRGBA.Red);
        walker.setMaterial(mat);
//        269.5173, -284.07605, 87.175156 to 476.54184, -171.21466, 454.62576
        Entity e = placeObject(new Vector3f(270f,-280f,90f), new Vector3f(375f,-170f,455f));
        if(e != null){
          e.attachChild(walker);
          rootNode.attachChild(e);
          this.walker = e;
        }

     
      Box b2 = new Box(.6f, .3f, .6f);
      Geometry g2 = new Geometry("tgt", b2);
      Material mat2 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        mat2.setColor("Color", ColorRGBA.Green);
        g2.setMaterial(mat2);
        Vector3f p = new Vector3f(375f,-170f,455f);
        enm.snapToGround(p);
        g2.setLocalTranslation(p);
      rootNode.attachChild(g2);
View Full Code Here

        // TERRAIN TEXTURE material
//        matTerrain = new Material(assetManager, "Common/MatDefs/Terrain/TerrainLighting.j3md");//yellow
//      matTerrain = new Material(assetManager, "com/l2client/materials/TerrainLightingParallax0.j3md");//nearly black
//      matTerrain = new Material(assetManager, "com/l2client/materials/TerrainLighting4.j3md");//wrong yellow
//      matTerrain = new Material(assetManager, "com/l2client/materials/TLP.j3md");//OK, but to light
      matTerrain = new Material(assetManager, "com/l2client/materials/TLP2.j3md");//OK, but to light
//        matTerrain = new Material(assetManager, "com/l2client/materials/TLP2.j3md");//quite dark
//      matTerrain = new Material(assetManager, "com/l2client/materials/TerrainLightingParallax.j3md");//mate painting, wrong but somewhat interresting

      // ALPHA map (for splat textures) Red = dif0, Green= dif1, Blue=dif2 Alpha=dif3
      matTerrain.setTexture("AlphaMap", assetManager.loadTexture("com/l2client/test/material/splat.png"));
View Full Code Here

     
      System.out.println("EntityNavManager finished");
     
      Box b2 = new Box(.3f, 1.3f, .3f);
      Geometry g2 = new Geometry("tgt", b2);
      Material mat2 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        mat2.setColor("Color", ColorRGBA.Green);
        g2.setMaterial(mat2);
        Vector3f p = new Vector3f(-9979.581f, 28.097652f, 8380.083f);
        enm.snapToGround(p);
        g2.setLocalTranslation(p);
      rootNode.attachChild(g2);
      System.out.println("Target placed at:"+p);
     
     
      Box b = new Box(.5f,1f,.5f);
      Geometry walker = new Geometry("wakler", b);
      Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        mat.setColor("Color", ColorRGBA.Red);
        walker.setMaterial(mat);
//        269.5173, -284.07605, 87.175156 to 476.54184, -171.21466, 454.62576
        //Entity e = placeObject(new Vector3f(-9969.057f, 15.097652f, 8429.296f), new Vector3f(-9979.581f, 28.097652f, 8420.083f));
        Entity e = placeObject(new Vector3f(-9890.341f, 14.610833f, 8302.891f), p.clone());
        if(e != null){
          e.attachChild(walker);
          rootNode.attachChild(e);
          this.walker = e;
        }
        System.out.println("Entity placed");
       
        inputManager.addListener(this, "print_scenegraph", "print_cam_location", "print_bboxes", "toggle_navmesh");
        inputManager.addMapping("print_scenegraph", new KeyTrigger(KeyInput.KEY_F6));
        inputManager.addMapping("print_cam_location", new KeyTrigger(KeyInput.KEY_F1));
        inputManager.addMapping("print_bboxes", new KeyTrigger(KeyInput.KEY_F7));
        inputManager.addMapping("toggle_navmesh", new KeyTrigger(KeyInput.KEY_F8));
       
    if(pc.path != null)
      NavTestHelper.debugShowPath(assetManager, debugNodes, pc.path);
   

      for(TiledNavMesh mesh : enm.getNavMeshes()){
        NavTestHelper.debugShowBox(assetManager, debugNodes, mesh.getPosition(), ColorRGBA.White, 128f,0.5f,128f);
      }
     
     
        matWireframe = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        matWireframe.setColor("Color", ColorRGBA.Green);
        matWireframe.getAdditionalRenderState().setWireframe(true);

    }
View Full Code Here

//        ts.setTexture( texture );
//        this.setRenderState( ts );


        AssetManager assetManager = JmeSystem.newAssetManager(Thread.currentThread().getContextClassLoader().getResource("com/jme3/asset/Desktop.cfg"));
        Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        mat.setTransparent(true);
        mat.getAdditionalRenderState().setBlendMode(com.jme3.material.RenderState.BlendMode.Alpha);
        mat.selectTechnique("Default",renderer);
        mat.getActiveTechnique().getDef().setLightMode(LightMode.Disable);
        mat.setTexture("ColorMap", texture);
        setMaterial(mat);
        setQueueBucket(com.jme3.renderer.queue.RenderQueue.Bucket.Gui);
//setQueueBucket(com.jme3.renderer.queue.RenderQueue.Bucket.Transparent);
//getLocalScale().set(new Vector3f(0.5f,0.5f,0.5f)); //Nur zum Testen
View Full Code Here

    singles.getNavManager().USE_OPTIMZED_PATH = true;
    singles.init(tm);
    this.initGui();
   
   
        matWireframe = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        matWireframe.setColor("Color", ColorRGBA.Green);
        matWireframe.getAdditionalRenderState().setWireframe(true);
        rootNode.attachChild(bboxes);
        rootNode.attachChild(navs);
  }
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

   * JME specific
   */
  private void initDummyTexture() {
    com.jme3.asset.AssetManager assetManager = Singleton.get().getAssetManager().getJmeAssetMan();
    // TERRAIN TEXTURE material
    material = new Material(assetManager, "Common/MatDefs/Terrain/Terrain.j3md");
        material.setBoolean("useTriPlanarMapping", false);

    // ALPHA map (for splat textures)
    material.setTexture("Alpha", assetManager.loadTexture("Textures/Terrain/splat/alphamap.png"));

View Full Code Here

    for (File name : fList) {
      try {
       
        MaterialList mats = (MaterialList) assetMan.loadAsset(name.getAbsolutePath());
        for(String id : mats.keySet()){
          Material m = mats.get(id);
          m.setName(id);
          String ass = "mats/"+file.getName()+"/"+id+ ".j3o";
//          m.setAssetName(ass);
        BinaryExporter.getInstance().save(m,
            new File(path + File.separatorChar + file.getName() + File.separatorChar + id+ ".j3o"));
        //Special handling of onyl one material! this one must be named "default"!
View Full Code Here

  }
 
  public static void debugShowCell(AssetManager assetMan, com.jme3.scene.Node root, Cell c,
      ColorRGBA color, boolean doLinkVis) {
    Geometry geom = getLine(c.m_Vertex[0], c.m_Vertex[1])
    Material mat = new Material(assetMan, "Common/MatDefs/Misc/Unshaded.j3md");
    mat.setColor("Color", color);
    geom.setMaterial(mat);
    root.attachChild(geom);   
    geom = getLine(c.m_Vertex[1], c.m_Vertex[2]);
    geom.setMaterial(mat);
    root.attachChild(geom);
    geom = getLine(c.m_Vertex[2], c.m_Vertex[0]);
    geom.setMaterial(mat);
    root.attachChild(geom);
    if(doLinkVis){
    if(c.m_Link[0] != null){
    geom = getLine(c.m_WallMidpoint[0],c.m_Link[0].m_CenterPoint, 0.5f);
    mat = new Material(assetMan, "Common/MatDefs/Misc/Unshaded.j3md");
    mat.setColor("Color", ColorRGBA.Blue);
    geom.setMaterial(mat);
    root.attachChild(geom);
    }
    if(c.m_Link[1] != null){
    geom = getLine(c.m_WallMidpoint[1],c.m_Link[1].m_CenterPoint, 0.5f);
    mat = new Material(assetMan, "Common/MatDefs/Misc/Unshaded.j3md");
    mat.setColor("Color", ColorRGBA.Red);
    geom.setMaterial(mat);
    root.attachChild(geom);
    }
    if(c.m_Link[2] != null){
    geom = getLine(c.m_WallMidpoint[2],c.m_Link[2].m_CenterPoint, 0.5f);
    mat = new Material(assetMan, "Common/MatDefs/Misc/Unshaded.j3md");
    mat.setColor("Color", ColorRGBA.Green);
    geom.setMaterial(mat);
    root.attachChild(geom);
    }}
  }
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.