Terrain models and aliasing

Started by jknow, May 18, 2010, 08:45:38 PM

Previous topic - Next topic

jknow

Hi Folks. Following my previous thread I have a few questions which I hope you won't mind me asking.

I was thrilled and delighted to learn I could render a 32 bit depth map. It has made my life SO much easier. Thank you TG2!!!

The attached shows the idea that I'm exploring: I'm making sketch maps, the kind you see in guidebooks, to label the names of mountains. I start with a UK terrain model (a good one, better than SRTM), then I render the distance map in TG2 and save as .exr.

Then in a custom VB program I read in the distance map as a 2D image, and go down each column of the bitmap looking for abrupt changes in greyscale value. These signifiy silhouettes. By changing the threshold I can alter the map, as shown.

Now, there's two problems I need to ask about. The first is how to avoid antialiasing but still have a smooth terrain surface at the pixel level. With anti aliasing it's harder to detect the edges. But without it TG2 can produce quite a speckled layer in the distance map. I wonder if there's an easy way to smooth these rendered edges without smoothing the data?

Second, I haven't quite understood how much procedural stuff is added on the heightfield. I need to use my elevation models 'as is', I don't want extra fractal detail on top. But I don't know enough about how TG2 generates a mesh from the elevation model. Does is interpolate? If you feed it a coarse elevation raster will it produce a coarse mesh, or will the facet size in the mesh be the same, suggesting that TG2 fills in details?

The reason this is important is because I want to compare different elevation models (some 5m, some 50m, some 100m) to see how realistic or not they render real life features. This means I need to avoid as much as I can Terragen filling in extra terrain information which, while looking good in renders, could distort the validity of me elevation data comparisons. Does that make any sense? So the question really is how faithful is TG2 to the .ter rasters you chuck in, or how much does it smooth them and interpolate them and add fractal detail and whatnot.

Thanks ever so much, I'm still chuffed about getting depth maps. I'm a uni student by the way, I bought a TG2 full license a while ago but have only just got round to using it. Shocking!

old_blaggard

You might try just adding some contrast to your depth map shader, starting things closer to black and ending at closer to white. You could also try just running a slight gaussian blur over the top image in a program like photoshop, or just touch them up yourself in post if you're not doing too many of these for final production.
http://www.terragen.org - A great Terragen resource with models, contests, galleries, and forums.

gregsandor

"I need to use my elevation models 'as is', I don't want extra fractal detail on top. But I don't know enough about how TG2 generates a mesh from the elevation model. Does is interpolate? If you feed it a coarse elevation raster will it produce a coarse mesh, or will the facet size in the mesh be the same, suggesting that TG2 fills in details?"

Uncheck as shown to use your DEM as-is.

Oshyan

Note however that TG2 will still be doing interpolation on the heightfield data to avoid a jagged, pixelated look. I believe it's a basic bilinear (or similar) interpolation.

- Oshyan

Tangled-Universe

Yes, you can find the interpolation methods in the "displacement"-tab of the heightfieldshader.

jknow


Matt

#6
The default interpolation is Catmull-Rom. You can choose from a few others, but I don't think you would prefer them.

Matt
Just because milk is white doesn't mean that clouds are made of milk.

Matt

About the anti-aliasing problem, the only idea that comes to mind is to use the anti-aliased version but prefilter it before you scan so you can place more importance on changes that cross a few pixels, not just any old bump that happens on the hillside.
Just because milk is white doesn't mean that clouds are made of milk.

jknow

Thank you Matt. What I'm ultimately trying to do is to then render the abstracted lines on a mobile phone screen. So it would be nice to anti-alias the end result. My basic filter outputs a 1 bit bitmap, which I can then thin (I did this in ArcGIS, but there must be loads of other ways to thin a line I guess...) to look nice. The next step would be to vectorise those lines and then save them at a specified resolution with anti-aliasing which would look real nice on the mobile phone screen. Much nicer than at present.

Does anyone know any good (or free) ways to thin, vectorise and anti-alias simple line work? Thanks ever so much

leafspring

Since you use a custom VB program to process the depth map, you could probably incorporate OpenCV to do the actual processing. This library features edge detecting as well as thinning filters and I'd guess AA is possible too. I don't really know if it's able to vectorize an image, though.
Lang lang er vejen for Aslaug
Længe venter lykken på Kraka