Normals don't seem quite right on this Terrain

I’m using FaultFractalHeightMap, and I’m using TerrainPage.



This simply doesn’t look very smooth to me. I think the normals for the heightmaps are messed up in jME  :roll:



Hm… I think this has to do with smoothing. Perhapse a smoothing functionality needs to be added to the AbstractHeightMap.

appel said:

I'm using FaultFractalHeightMap, and I'm using TerrainPage.

This simply doesn't look very smooth to me. I think the normals for the heightmaps are messed up in jME

terrain normals aren't the best part in jme, but they're not really the cause of that effect.

the effect usually appears because of the terrain values being in a small the range (like [0 - 255])

FaultFractalHeightMap by default "normalizes" the generated values in the range of 0 - 255 (which imho should not happen).



you'll get much better results with 16 bit raw images.



http://www.jmonkeyengine.com/jmeforum/index.php?topic=4039.0

Yes, and that default (255) can be changed with NORMALIZE_RANGE. Not really a very clean API eh? But I hacked it in cause other users had the same problem.

is there a reason why the default value is 255?

Thanks, I got it working.

sfera said:

is there a reason why the default value is 255?


No clue, but changing it changes the scale if I recall correctly, so that broke some examples. I just made it into a static field instead of hardcoded at the time.

as far as i can tell it breaks HillHeightMap and MidPointHeightMap.

but i see no reason for that normalizeTerrain(float[][]) method to be used in FaultFractalHeightMap.