Mabey global warming
![Wink :wink:](./images/smilies/icon_wink.gif)
A couple of shots with the spec map toggled on and off.
![Image](http://img130.imageshack.us/img130/9238/18pj4.th.jpg)
![Image](http://img162.imageshack.us/img162/9463/30lu1.th.jpg)
![Image](http://img162.imageshack.us/img162/8947/11sp4.th.jpg)
![Image](http://img50.imageshack.us/img50/9098/28fz1.th.jpg)
Do they look accurate or way off? There are many areas in question.
cartrite
cartrite wrote:Details are lost when comparing a 2k map to a 64k map. If the topo map is accurate then there is probally a lot of areas with 0 elevation along the coastlines that have been drained. Like the salt hay feilds along the Delaware Bay.
In spots it lines up perfectly ( where mountains meet the sea )but in low areas the map seems to go to far. Anyhow mabey it shows the future, after a 100 more years or so of glacial melting.![]()
cartrite
Again, I don't understand: in the BMNG-arctic server you find a 84k oceanmap and a 84k water body map and also smaller versions thereof. They should have a comparable amount of detail to your custom spec map.
-- you searched for zero elevations in the 84k SRTM_ramp2.bin file using simple custom code?
-- you replaced the zero elevations by 0xff (white) and every other 2 byte elevation by 0x00 (black)?
I live in the Netherlands, and the green land areas that turn sort of light cyan in Holland and Northern Germany with the spec map switched on, are wrong. Most, if not al of those areas are dry land.
It looks very good. I checked a paper Atlas of the Chesapeake Bay and
at the scale shown on your images, everything matches very well. There
will always be swamps and tidal flats that are variable. Some flat lands
may be dry in one year, and they will be wet in other years. After a
heavy rainstorm, flat land can reflect with significant brightness, even if it
is not a lake. Dry lakes can be flooded by a wet season.
I have just quickly coded a similar custom spec tool that is however much simpler than what you described. It writes directly a pgm graymap (1byte's) with a magic number = P5. You don't need to first write rgb format and then convert it to grapmap.
just for comparison: on my machine the complete generation of a 64k specmap (value 0 + taking care of antarctica problem) takes only 4min 33sec with my tool.
cartrite wrote:
Are you saying that you can fix the Antartica problem?
Code: Select all
h[j] = readRowS16(stdin, width0);
for (int i = 0; i < width0; i++)
{
hs[i] = 0x00;
if (h[j][i] == 0 || (j > (int) (0.83252f * height0 ) && h[j][i] <= 40))
hs[i] = 0xff;
}
fwrite(hs, width0, 1, stdout);
And another thing. There is a small island off the coast of Baja California a liitle south of the US border. That island seems shifted to the left a little from the base texture.
cartrite
t00fri wrote:first let me show a comparison of the "official" 64k
watermask (left) and my new 64k custom mask (right)
extracted from the srtm elevation data with my new tool
Fightspit wrote:t00fri wrote:first let me show a comparison of the "official" 64k
watermask (left) and my new 64k custom mask (right)
extracted from the srtm elevation data with my new tool
Sorry but what do you mean "official" ? Does it concern my 64k spec ?
Actually, I am always reading a whole row [j], examine it and write the new specmap pixels of that row as a whole with fwrite. You can also see what I did against the antarctica problem: nothing fancy, but more or less OK.
Code: Select all
for (int x = 0; x < width; x++)
{
int g;
float a;
a = pixel[y][x];
if ( a == 0.0f )
g = 255;
else
g = 0;
gray[x] = (unsigned char) (g);
}
fwrite(gray, width, 1, stdout);
Code: Select all
for (int x = 0; x < width; x++)
{
float a;
a = pixel[y][x];
gray[x] = 0x00;
if (a == 0.0f || (y > 0.83252f * height && a <= 40))
gray[x] = 0xff;
}
fwrite(gray, width, 1, stdout);
Code: Select all
for (int x = 0; x < width; x++)
{
int r;
int g;
int b;
float a;
a = pixel[y][x];
if ( a == 0.0f )
r = 255,
g = 255,
b = 255;
else
r = 0,
g = 0,
b = 0;
rgb[x * 3 + 0] = (unsigned char) (r);
rgb[x * 3 + 1] = (unsigned char) (g);
rgb[x * 3 + 2] = (unsigned char) (b);
}
fwrite(rgb, width * 3, 1, stdout);
Consider e.g. rivers
Let me start with an arbitrary pixel in the elevation
map and examine all 8 nearst neighbor pixels around
the reference pixel. Then a reliable criterion is to
proceed towards that pixel (or those pixels) where the
gray value difference
|p - p'|
is MINIMAL! Rivers flow in
beds and the elevation increase is naturally much
higher orthogonal to the flowing direction than along it.
That allows to trace out the rivers independent of its
absolute elevation!
The same algorithm can be easily extended to include
the oceans and lakes.
Code: Select all
unsigned char* gray = new unsigned char[width0];
Code: Select all
short readRGB(FILE *in)
{
unsigned char c[2];
fread(c, 2, 1, in);
//fscanf(stdin, %s, &c );
return (short) ((int) c[0] | (int) c[1]);
//return c[0];
}