Aktualisierungen Januar, 2012 Kommentarverlauf ein-/ausschalten | Tastaturkürzel

  • Andreas Höhmann 0:10 am Monday, 23. January 2012 Permalink |
    Tags: , github,   

    jmonkey maven support next round 

    jmonkey have no maven support … here is my solution 🙂

    1. clone jme3-thirdparty from git, mvn install … done
    2. clone jme3-buildhelper, copy pom.xml into jmonkey-engine … done
    3. start hacking your jmonkey game with maven build support 🙂


  • Andreas Höhmann 2:41 am Wednesday, 2. March 2011 Permalink |  

    Next video from bloxel 0.2.0 

    Some facts:
    – heightmap based terrain generation 1024 x 1024
    – 3 different textures (grass, sand and water)
    – hardware :  Intel Core2 2.66 GHz, Nvidia GeForce Go 7950 GTX, 2GB RAM, Windows7 64bit


    Video #1

    Video #2

  • Andreas Höhmann 0:38 am Wednesday, 2. March 2011 Permalink |
    Tags: , mesh, multitexture   

    MultiFaceBox mesh for bloxel 

    News from bloxel …

    Last days I spend a couple of hours creating a box mesh for our game bloxel which have different textures for each side … like this one …

    … without success … until now *g*

    First of all jmonkey rocks … but the multi texture support is not easy to use/understand for a rookie like me.

    Here the thinks I checked out:

    • http://jmonkeyengine.org/groups/general-2/forum/topic/box-with-multiple-textures/
      • the idea here was to create a box in a editor, and generate mapping coordinates for it, then  import it into JME with the ogre xml importer
      • paddy (bloxel team member) tried this approach with blender, the result was an .obj file with two geometries inside a) the grass geo on top and b) the dirt geos on the other sides
      • long story short end … this doesn’t work very well
    • then I tried the jme3 sky material
      • this material use a TextureCubeMap (multiple images for cube sides)
      • not working for me … sky material is only for sky-boxes I guess
    • then I want use shaders (glsl) to get the different textures on the box
      • but my knowledge about glsl is near zero *gg* … so I tried to find shader-code with google … no success
    • then I found the jme2 class MultiFaceBox
      • ported to jme3 was quite simple
      • play a little bit with the right texture
      • and voilà … here we are
    public class MultiFaceBox extends Box {
      public MultiFaceBox() {
      public MultiFaceBox(final Vector3f center, final float xExtent, final float yExtent, final float zExtent) {
        super(center, xExtent, yExtent, zExtent);
      public MultiFaceBox(final Vector3f min, final Vector3f max) {
        super(min, max);
      private void remap() {
        final FloatBuffer fb = getFloatBuffer(Type.TexCoord);
        for (int i = 0; i < 6; i++) {
          final float top = i / 8f;
          final float bottom = (i + 1) / 8f;
          final float[] tex = new float[] { 1, bottom, 0, bottom, 0, top, 1, top };

    This works for me … now I can remove the unused two empty areas in the texture …

  • Andreas Höhmann 22:05 am Saturday, 19. February 2011 Permalink |
    Tags: , heightmap,   

    Heightmap based terrain loading for bloxel 

    Last night I finished the first prototype of a heightmap based TerrainLoader.

    • I’m using a com.jme3.terrain.heightmap.HillHeightMap to create a 512×512 2D heightmap
    • our 3D TerrainChunkLoader (our manager for infinite worlds) map a TerrainChunk (x,y,z) to a region of this 2D map
    • here I had some problems to transform the 512×512 heightmap (2D) to the 4×4 terrain-chunks (3D) … but now it works 🙂




    Update 20.02.2011 – better textures for grass and dirt

  • Andreas Höhmann 11:37 am Thursday, 17. February 2011 Permalink |  

    Early tec video from the bloxel 0.2.0 

    Some facts:
    – round about 1,5 million Boxes
    – 2 different textures (grass, pond)
    – memory : 1,5 GB used
    – hardware : Q9450, GTX280, 4GB RAM, Windows7 64bit
    – 60fps with vsync (fraps reduced to 30fps)


  • Andreas Höhmann 3:26 am Tuesday, 15. February 2011 Permalink |
    Tags: ,   

    Bloxel 0.2.0 with better performance 

    To handle scenes with many elements you have to „merge“ identical objects (Geometry’s) … I did it for bloxel 0.2.0 and the performance is now much better … here are two brand new screenshots :


    JMonkey contains a class for that :  jme3tools.optimize.GeometryBatchFactory. This forum entry shows me the way : http://jmonkeyengine.org/groups/general/forum/topic/how-to-useoptimize-pvs-or-octree

    FYI: our main application loop contains a „updateTerrain“ method:

    // near elements ... player can add/remove such elements ...
    final TerrainElementsResult result = terrainManager.getTerrainElements(thePlayerPosition, theWalkDirection);
    final Set<TerrainElement> currentElements = Sets.newLinkedHashSet(currentTerrainElements);
    final Set<TerrainElement> elementsToAdd = Sets.difference(new HashSet(result.getNearElements()), currentElements);
    final Set<TerrainElement> elementsToRemove = Sets.difference(currentTe, new HashSet(result.getNearElements()));
    // ... add new elements to scene, physics, cache etc ...
    // ... remove old elements from scene, physics, cache etc ...
    // far elements
    final Iterator<TerrainElement> iterator = result.getFarElements().iterator();
    final List<Geometry> geos = Lists.newArrayList();
    while (iterator.hasNext()) {
      final TerrainElement te = iterator.next();
      Bloxel bloxel = bloxelCache.getFromCache(te.getCenter());
      if (bloxel == null) {
        bloxel = bloxelFactory.create(te.getBloxelType());
    final List<Geometry> makeBatches = GeometryBatchFactory.makeBatches(geos);
    final Material material = new Material(assetManager, "Common/MatDefs/Misc/WireColor.j3md");
    material.setColor("Color", ColorRGBA.White);
    for (final Geometry geometry : makeBatches) {
      // for debugging
      // geometry.setMaterial(material);
    System.out.println("update far terrain time: " + (System.currentTimeMillis() - start));

    Good night 😉

Neuen Beitrag erstellen
nächster Beitrag/nächster Kommentar
vorheriger Beitrag/vorheriger Kommentar
zeige/verstecke Kommentare
Zum Anfang gehen
zum Login
Zeige/Verberge Hilfe
Shift + ESC