Terrain smoothing/LOD query
Terrain smoothing/LOD query
Hi all,
Popping aside, the terrain LOD in demo 12 is pretty nice.
I'm having trouble getting the LOD to work correctly when using heightmaps larger than 256 x 256 though.
I want to load a 1024 x 1024 heightmap, scaled (1, 1, 1). It looks great at further-away distances but when very close to the terrain (nearest or 2nd-nearest LOD) the terrain becomes very blocky, as though the other LODs are interpolating between vertices correctly but the closest LOD isn't.
Has anyone experienced this or found a way around it? I'll post a screenshot if I'm not making myself clear.
Many thanks for any help.
Popping aside, the terrain LOD in demo 12 is pretty nice.
I'm having trouble getting the LOD to work correctly when using heightmaps larger than 256 x 256 though.
I want to load a 1024 x 1024 heightmap, scaled (1, 1, 1). It looks great at further-away distances but when very close to the terrain (nearest or 2nd-nearest LOD) the terrain becomes very blocky, as though the other LODs are interpolating between vertices correctly but the closest LOD isn't.
Has anyone experienced this or found a way around it? I'll post a screenshot if I'm not making myself clear.
Many thanks for any help.
www.coldcity.com|ninjastyle
That may help if the issue was memory utilisation... In any case, I don't have any better results using 512 x 512, and it just seems a lot effort to get a paging loader on the go when I should be able to find the right tweaks to make this work... anyone got any ideas?
www.coldcity.com|ninjastyle
Spintz,
Here's some 1024x1024 terrain that illustrates the problem. The top and bottom shots show the same terrain at two different LODs.
The top looks great, and you can see from the wireframe that it's interpolating between vertices nicely.
The bottom is the closest LOD, and shows the stepping effect I'm trying to get rid of.
Any ideas? I'm not scaling the terrain at all.
Here's some 1024x1024 terrain that illustrates the problem. The top and bottom shots show the same terrain at two different LODs.
The top looks great, and you can see from the wireframe that it's interpolating between vertices nicely.
The bottom is the closest LOD, and shows the stepping effect I'm trying to get rid of.
Any ideas? I'm not scaling the terrain at all.
www.coldcity.com|ninjastyle
This is a problem with the heightmap. Others have had this problem and it was always caused by a bad heightmap.
My best guess would be that this happens when you resize a heightmap in a picture editor. For instance, when I use Freeworld3D to generate my heightmaps, it's smooth, but if I resize the heightmap in IrfanView or Photoshop, it comes out with those kinds of jagged edges. If you want to alter the heightmap, do it in a proper terrain editor or resize the terrain by scaling it in Irrlicht.
My best guess would be that this happens when you resize a heightmap in a picture editor. For instance, when I use Freeworld3D to generate my heightmaps, it's smooth, but if I resize the heightmap in IrfanView or Photoshop, it comes out with those kinds of jagged edges. If you want to alter the heightmap, do it in a proper terrain editor or resize the terrain by scaling it in Irrlicht.
Hi guys,
Thanks a lot for taking a look.
The wierd thing is that I'm just exporting the heightmap from the terrain editor I'm using (the wonderful L3DT). I tried exporting as a JPG instead of a BMP and the problem was lessened to some extent but was still evident.
Will try a different editor and compare results - really want to use L3DT
Midnight: Thanks Yup, it's for the GameDev zombie thing - KNEW I should have disabled my zombies before taking the screenshot
Thanks a lot for taking a look.
The wierd thing is that I'm just exporting the heightmap from the terrain editor I'm using (the wonderful L3DT). I tried exporting as a JPG instead of a BMP and the problem was lessened to some extent but was still evident.
Will try a different editor and compare results - really want to use L3DT
Midnight: Thanks Yup, it's for the GameDev zombie thing - KNEW I should have disabled my zombies before taking the screenshot
www.coldcity.com|ninjastyle
I'am using Pnp-TerrainCreator which look good but was not succesful importing BMP from it. I've tried different rendering scale but I always have this stepping issue at ground level. Is it due to the way the editor do the BMP, the rendering technic, or something else ?
Any help appreciated.
ps I'am using irrlicht + newton
thx
Any help appreciated.
ps I'am using irrlicht + newton
thx
Hmmm - posted on the L3DT forum and got this response:
I would have thought that the 8-bit values could still be interpolated between, as the more distance LODs seem to do?
Or am I missing something?
To test further I manually made some heightmaps with the airbrush tool in a range of programs - Photoshop, Graphics Gale and MS Paint - and I still can't get rid of the stepping, even on what I'm sure are pristine bitmaps.
JPGs behaved better - the steps are smaller (due to the greater bitdepth as Aaron suggests?), but still present, which makes me think I need to tweak the terrain scene node to get it interpolating nicely, but I haven't dived in there yet.
Does this sound correct, Spintz?Hi Iain,
The bitmap exports are only 8-bit greyscales, so what you're seeing is
the 256 steps in altitude. The only way to fix this problem, as far as
I know, is to use a format with a greater precision, such as 16-bits
(TER, BT, HFF, PGM, RAW) or 32-bits (BT, HFF, X). If you have another
preferred format, I'll be happy to add it to my 'to-do' list.
Cheers,
Aaron.
--- In L3DT_users_group@yahoogroups.com, "SNIPPED"
<SNIPPED> wrote:
> Hi all,
>
> With reference to a thread on the Irrlicht forum:
> http://irrlicht.sourceforge.net/phpBB2/ ... hp?p=45261
>
> I'm having trouble getting L3DT heightmaps to load nicely in Irrlicht.
> Has anyone seen a similar problem when using L3DT terrain exported as
> a .BMP heightfield?
>
> I really, really want to use L3DT for my project so I want to make
> sure I can get a usable workflow.
>
> Many thanks for any help anyone can offer.
>
> Best,
> IainC
I would have thought that the 8-bit values could still be interpolated between, as the more distance LODs seem to do?
Or am I missing something?
To test further I manually made some heightmaps with the airbrush tool in a range of programs - Photoshop, Graphics Gale and MS Paint - and I still can't get rid of the stepping, even on what I'm sure are pristine bitmaps.
JPGs behaved better - the steps are smaller (due to the greater bitdepth as Aaron suggests?), but still present, which makes me think I need to tweak the terrain scene node to get it interpolating nicely, but I haven't dived in there yet.
www.coldcity.com|ninjastyle
Yes, that's your problem. Although in the editor the terrain looks smooth, if it's only exporting 8 bit greyscale images, you have only 256 levels of height available. So let's say you have terrain with a delta of low/high height of 512 units. the bitmap generator for the heightmap will round values out to make the heightmap fit into the 256 units, so unit 0 and 1 would be 0, 2 and 3 would be 1, etc.
Try generating a terrain that doesn't have a large height difference between then lowest and highest points and see what happens.
Try generating a terrain that doesn't have a large height difference between then lowest and highest points and see what happens.
Sorry to resurrect an old thread, but I found this with a search, and it still seems to be an issue. I got around it by generating a 1024^2 heightmap, exporting it (as 256 colors), and upping the color depth to 16M, then resizing it down to 256^2 in Paint Shop Pro using Smart Size, which interpolated the colors.
It seems to have worked okay. Is there a better solution?
It seems to have worked okay. Is there a better solution?