Alternative terrain texturing

Hello,



here is a first screen of my alternative terrain (texturing) demo (early stage at this moment).  The mapping is randomly generated an no heightfield is given.



Goals:

  • procedural mapping over terrain (done!)
  • more then one detail texture
  • without shader code for basic texturing :wink:
  • conversion from TerrainPage in my TerrainObject
  • overhang texturing


  • simply to use like the TerrainPage-Stuff



looks promising. Keep the updates coming.

WebStart demo online



http://jxg-tech.mi-studios.de/testTiles.jnlp

Looks good, what is the technique you are using?

Great stuff! I'm looking forward to that overhang texturing, how are you going to do it?

Hi mojo,


Looks good, what is the technique you are using?


I'm using tile mapping based on Wang. he implementation is done by a util-class for vitual tilemap generation and a gridmesh for tilemapping. If the code is cleaned, it will posted here later. (this week i hope)

Future work:
The virtualmap generator are enough abstract, to implement different versions of generators. A Random generator is done today and seen in the demo.
Future versions are imagebased or hightmap -generators, to exactly texture the grid.

many work todo ^^..

edit:
The grid is to big today. It needs split of in a quadtree or octree for speedup. For testing only ^^

It will be incompatible to terrain PAGE, since its cannot take up enough texture data. A clear interface for a terrain would be good. (for spezial data methods etc.)
like getHeightAt(), setHeightAt(...)



hi Gaheris


Gaheris said:

Great stuff! I'm looking forward to that overhang texturing, how are you going to do it?


Ok, this is a bit tricky.
I need a little bit more grid for the overhang. For the grid i use subdivision on there faces. The data is given by a map for shifting the vertex of the heightfield in heigher regions.

This is the theory. ^^ You can help?

cool! how do you construct the basic wang tileset in your app?

MrCoder said:

cool! how do you construct the basic wang tileset in your app?


Follow this paper here:
http://wwwisg.cs.uni-magdeburg.de/~spindler/wiki/ShaderSeminar2005/index.php?n=Projects.TileBasedRendering

and this for more detail:
http://www.cgmi.inf.uni-konstanz.de/publications/pdf/wang_tiles_for_image_and_texture_generation.pdf

currently using two color packed tiles like this:


and a hand made texture for paint.


but did you paint the input tiles interactively or did you generate them automatically?

don't you just love papers in german :slight_smile:

MrCoder said:

don't you just love papers in german :)


I'm a german. i  love papers written in german. 
But it's spare contents for germans on the web. XD
MrCoder said:

but did you paint the input tiles interactively or did you generate them automatically?


The tiles are mapped on the mesh with precomputed texturecoordinates.

Code follows here today:

OK here the code from my test:



TestTiles.java


// ### orginal package
//package de.mistudios.test;

import java.nio.FloatBuffer;
import java.nio.IntBuffer;

import com.jme.app.SimpleGame;
import com.jme.bounding.BoundingBox;
import com.jme.image.Texture;
import com.jme.input.NodeHandler;
import com.jme.light.DirectionalLight;
import com.jme.math.Vector2f;
import com.jme.math.Vector3f;
import com.jme.renderer.ColorRGBA;
import com.jme.renderer.Renderer;
import com.jme.scene.CameraNode;
import com.jme.scene.TriMesh;
import com.jme.scene.VBOInfo;
import com.jme.scene.batch.TriangleBatch;
import com.jme.scene.state.CullState;
import com.jme.scene.state.TextureState;
import com.jme.util.TextureManager;
import com.jme.util.geom.BufferUtils;

// ### orginal package
//import de.mistudios.jxg.engine.corex.terrain.RandomTileTextureGenerator;
//import de.mistudios.jxg.engine.corex.terrain.TileTextureGenerator;

/**
 * <h4>TestTiles</h4><br>
 * Test for a random tile mapping based on Wang.
 *
 * @author Lutz G

Here an other screenshot from textured terrain.

2 detail textures mapped.











looking forward… 

You are not using shader, do you?

  • first post = no shader used.
  • last post = yes  :smiley:



    future work to do: combine the two in a terrain-shader for HQ-detail-texturing

That's very interesting.

We (Galun und me http://www.world-of-mystery.de/client/) also using shader for terrain texturing. We are using a splatting shader but i'm not very satisfied with the result. It looks not really nice. The texture repetition is to clear.

http://fishheadsoftware.de/jme/TerrainShader01.png

http://fishheadsoftware.de/jme/TerrainShader02.png

http://fishheadsoftware.de/jme/TerrainShader03.png

http://www.world-of-mystery.de/download/screen00045.png



What are you using? Also a splatting shader? Wang-tiles?

Please more info. ^^

better textures(not programmer art) + more differences in the splatting(more textures and more complex splat-alpha) really help removing the visual repetition…as does objects like vegetation etc

Yes of course better textures reduces the effect.



More different textures means that more texture units have to be used. I don't kown if multiple renderpasses is an option here. My experience is that they lead to a noticeable slowdown.



I really have no clue what you mean with "complex splat-alpha" and in what way it would help.

Is this meant in combination with more textures?



Right objects like vegetation will hide this effect.