Game Development Community

Atlas blended lightmap problem

by Kenneth Baird · in Torque Game Engine Advanced · 05/21/2007 (9:39 pm) · 11 replies

I've got a bit of a problem using blended atlas. I get strange light map alignment. Hard to explain so here are some screenies:


This is a 1024 terrain with data grabbed from USGS. Not sure if this will show up in the post or just be a link.

http://webpages.charter.net/kharza/gack.png


This is a L3DT generated 8k by 8k terrain that shows it a bit better

http://webpages.charter.net/kharza/gack2.png


It's probably something stupid I'm overlooking :D

Getting the obvious stuff out of the way, I'm using 1025 heightmap on image one, and 8193 for two, then the rest of the maps are based on 1024 and 8192. Only the heightmap is power of 2 + 1.

I mosaiced the light and alpha maps. 2x2 for image one and 16x16 for image 2.

BTW if anyone wants the code to convert USGS geotiff to 16 bit raw I'll post it.

edit - Generated another 8192 overnight, and this one displays quite well. The difference would be the new terrain only uses two textures, whereas the others use 4.

Kenneth

About the author

Recent Threads

  • TorqueX Support?

  • #1
    05/30/2007 (5:32 pm)
    Kenneth,
    I use GIS data, but I don't create blended terrain. I hate to ask, but why not create unique terrain?
    As for your problem, I can only guess. Your images are 512 x 512 and that is the default clipmap size. I would try using images at least 1024 x 1024 in size and see if that works better, but that is just a guess.
    And about converting GeoTiffs to RAWs, you do know that you can easily convert these using FTools and the GDAL library. Just run GDAL_translate.exe from a command line or batch file and set the output format to .BIL. If I need to cut out a heightmap from a GeoTiff, I just do it in Global Mapper, and export it as a BIL file. The Atlas processing functions don't care if the extension is .BIL or .RAW.

    Edit: OK, I'm assuming (and I shouldn't assume) the images are 512 x 512 because of the part about "2x2 for image one and 16x16 for image 2", but I still think this is related to the size of the clipmap.
    #2
    06/03/2007 (8:04 am)
    Kenneth, that doesn't look like a lightmap problem to me. The light and alpha maps have a 1:1 correspondence to the geometry. So if the lightmap isn't displaying properly you should have 512 x 512 areas that are wrong. Of course, this assumes that the lightmap generated properly and didn't get corrupted somehow.

    Textures, on the other hand, get repeated over the terrain at a rate specified in the code. Since the black areas repeat faster than expected you should look at your textures. Another reason to suspect textures is that the "grassy" texture looks black in gack2.png. In my experience when the engine can't find a texture the pixels assigned that texture (based on the alpha maps) display as black.
    #3
    06/03/2007 (2:17 pm)
    One thing to realize is that the Atlas blended terrain is still rather buggy last time i looked.

    Ben and i worked out a bunch of fixes, but i don't know if it's worked back into HEAD. I'll double check when 1.02 is out... ping me back here if i don't respond by then.
    #4
    06/03/2007 (11:40 pm)
    It's a bit more obvious when it's in motion, but the textures are definitely ok. I've since kinda been working on other things, but I'll get back to this eventually :D

    Mainly wanted blended to have things look nice up close. I had another thought about this that maybe there is a strict 4 material limit. I was thinking 4 textures + light but maybe it's 4 total. When I picture that in my head though I can't imagine it producing what I was seeing.

    And thanks for the tips on those terrain tools! I'll check that out. I had written some USGS tif to progressive mesh code about 4 years ago that I just retrofitted to convert to raw, so been using that.

    Kenneth
    #5
    06/06/2007 (5:47 pm)
    Yes, it is 4 textures + lightmap and alpha. As you already know the 4 textures are displayed based on the lightmap and the alpha channels. You should be able to get good quality without the artifacts that you mentioned Maybe the fixes that Tom mentions will help.

    These are examples of blended terrains that I've done recently. I would still like to see better close up detail but they are as good as I can get with consistent tree depths etc.

    i40.photobucket.com/albums/e216/zedd10/LoneOutpost2.jpg
    i40.photobucket.com/albums/e216/zedd10/SeasideBuildings2.jpg
    #6
    06/06/2007 (9:33 pm)
    Looks like detail textures aren't enabled/working on your terrain. Once you get those going you should have the close-up detail you're looking for.
    #7
    06/06/2007 (10:09 pm)
    Cool terrain - where did you get the heightmap? I know you said USGS - but do you have a specific link?
    #8
    06/07/2007 (3:55 pm)
    Mark, good point. There actually is a detail texture in this image but it is a very muted and doesn't show up too much at this altitude. The default texture is too heavy for my taste but I haven't had any time to look at it.

    Andy, this is the north west corner of the island of Maui.

    i40.photobucket.com/albums/e216/zedd10/Maui.jpg
    #9
    06/18/2007 (10:28 am)
    I use http://seamless.usgs.gov/ to grab terrain data.

    Kenneth
    #10
    06/18/2007 (11:35 am)
    As to the detail texture, have you tried implementing this resource? The settings it provides, combined with a different texture might give you the results you want.
    #11
    10/04/2012 (5:45 am)
    Kenneth, after downloading from seamless.usgs.gov/ how should I proceed to create heightmap with those ~10 images?
    Thanks for hints.