FaultFractalHeightMap bad normals?

Hey, I'm trying to render a terrain (using FaultFractalHeightMap), but my results are very…bad looking. Seems that the heightmap doesn't have correct normals, I assume it does the normals automatically?



I'm basically doing this:

      FaultFractalHeightMap heightMap = new FaultFractalHeightMap(257, 1000, -10, 10, 0.3f);
      TerrainPage tb = new TerrainPage("Terrain", 10, heightMap.getSize(), new Vector3f(10,0.3f,10), heightMap.getHeightMap(), true);



My results:

the heightmap has no normal-computing functionality.



the normal-generation is implemented in terrainpage/terrainblock.



setup a texturestate for the terrainpage, apply it and look again.

I found out what was wrong, my blockSize in the TerrainPage was wrong. :slight_smile:

Now I see some flaws in the terrain from some angles:







ideas?

Looks like a missing/incorrect zbufferstate issue to me.

Thanks :slight_smile:



Sorry for my newbie questions, 1st day of jME :slight_smile:

No prob, that's what the forum and wiki are here for.

@renanse:



Temporary, the normals on a terrainpage are broken at the edges from a terrainblock to a other terrainblock.

This results in a hard edge, while texturing.



Any reason for this?

There's a method for that, I think in terrainpage (fixnormals or something like that). Just browse through the method list.

hm. this method does't fix the hard edges in my demo. :frowning:

Well you're right, if you turn on normal debugging you can see it doesn't work for some normals.

llama said:

Well you're right, if you turn on normal debugging you can see it doesn't work for some normals.


Did I just hear someone say "Bug Hunter" points!

Well considered it confirmed by me… now you need another dev.



Of course you should go for the extra points and fix it too :wink:

Remember to post it in the tracker on Dec 1. :slight_smile:

Yup… after using the Heightmaps correct (finally) I see that it's not as smooth as a demo I did using raw opengl code. (which btw is running the exact same heightmap and texture, and color and light!). Will try to post screenies sometime soon (not at home now).



Would also be good to get a function into the heightmaps so I can apply some smoothing-operation on it… map.smooth(someFactor);

hey! this is not fair! :slight_smile:

you're giving away points even before the contest starts  :x  :wink:

By default Abstractmaps use a normalization range of only 0-255. You can change this through the static field AbstractMap.NORMALIZE_RANGE. Also, there's a method in AbstractMap erodeTerrain that can smooth the terrain a bit.