Hi All
I'm relatively new to all this (3-4 weeks under my belt) and can generate random worlds and colour shaders populated by objects dispersed across painted shaders quite successfully, however I now want to create a specific custom world and seemed to have entered a twilight zone trying to get it to work...
I want to create a customised part of an earth-sized world which is 2900km x 2900km covering roughly western Europe in tem of Lat/Long. The heightfield data for the area I want to read from a greyscale TIFF (or BMP or TGA - I have it in Photoshop). Ultimately I want to use different colour shaders on different parts of the map - eg the snowline at the pole will be much lower than that nearer the equator. I need a consistent level sea (or at least the appearance of one) covering what would be the atlantic/med sea and various large lakes.
I have Win 7, 4GB of memory (which I migh boost up in the next week or so) and an i7 CPU at 2.8GHz. My PC runs quite reliably....except when I use TG2 (the latest free version - but will upgrade to the bought version to get animation if I can get the darned thing to work!)
The TIFF file to be used for the heightfield is greyscale (white mountaintops, black sea also with rivers mapped out in Photoshop with a 1 pixel wide black brush) . The image measures 10287 x 9360 pixels (24bit depth - which I think is 8 bit x 3 channels?). Its 275MB in size.
The approach (and problems!) :
1) I start with the default project and generate random terrain in Heightfield shader 01. I have "Flatten surface first" in the Displacement shader unchecked so that the terrain doesn't jut out from the globe (thanks Cyphyr!). I set it to "Position centre" as this seems to work best when I put the sea on.
2) In 'heightfield generate 01' I have new heightfield checked (not sure if thats important or not - unchecking it seems to make no difference), number of points 1000x1000, size in metres 2900,000 x 2900,000. Feature scale set to 200m (to keep underlying random hills low so they don't distort MY heights for when I figure out how to add them in later for a bit of variety on the landscape). All other settings left default. I then "Generate Now", sometimes I get a progress bar when it generates, other times it just seems to adjust the view window without any apparent lag/progress bar in generation- either way I now have a 2900k square on my planet.
3) Now I load in my heightfield. I select "Add Operator>Heightfield Load" then read from file my TIFF specified above - all settings left at default. 80%-90% of the time TG2 crashes at this point...despite only using about 14% of the CPU (typically only 1 of the 8 CPUs fires up) and only 1.5GB of memory (I have the windows task manager>Performance tab open).
4) IF I've been lucky enough to load the heightfield it will usually crash when I try and add a lake large enough to cover the whole area.
5) If its managed to get through those two stages, it will usually crash when I try and run a standard erode (default settings) across it, if it doesnt fail then it will crash when I try and alter the erode settings.
6) To try and get around this (I assume the dimensions are just too large for TG2, which is disappointing if its supposed to deal with things on a world scale, but I understand heightfields are trickier/larger than fractals), I have tried various ways of segmenting the TIFF file into 3-5 chunks of varying sizes and then trying to stitch it all together, but no matter what I do, I either get one heightfield load obliterating the previous one (even though its offset dimensionally from the first one so the two should only abut and not overlap, and the guiding cube that shows the extents shows two separate abutting heightfields). Alternatively when I do do something right and get the two heightfields to show there is an ugly (usually flat or sloped) dip between the two heightfields. Ive checked at the pixel level in the abutting TIFFs are the same shade of grey at the edges so they should come in at the same height. Oddly enough I dont get this problem if I load 2 very small test heightfields of only a few shades of grey (say 100pix x 100 pix), BUT even then the two joined heightfields dont have exactly the same length as the two TIFFS if I combine them in Photoshop and load as a single heightfield. I've spent about 3-4 days trying to look at using blend shaders, and fiddling with blend settings to get the edges to match on larger files but I just can't seem to figure them out.
So - what am I doing wrong, or what is a better way of doing it? Am I better to generate the heightfield then load the data into a displacement shader? If so I dont think I can erode it in the same way that I've been doing.
I guess at the end of the day I'd love it if I could :-
(a) load my heightfield in say 4-6 irregularly shaped segments, the final result giving me a neatly stitched together/blended area of 2900sqkm
(b) smooth it so that I get rid of the terracing I get when the TIFF loads the different levels of grey (I'm OK at doing this step),
(c) adjust the height of features in my heightfield (I'm OK at doing this for a single heightfield, and assume I'll have no problem with multipe heightfields)
(d) erode some of the features to give me weathered terrain - I'm OK with this and assume that I can erode only the segments/heightfields that I want to which will be smaller and therefore faster to process/trial and less likely to crash.
(e) apply different colour shaders to the various heightfields (I'm Ok with this)
(f) Displace downwards the river valleys so that they can be below the water table and show up as a lake (there's probably a smarter way of doing this, but I havent got past the terrain bit to be able to experiment with it yet or read up much on the forum...I've tried the river operator and it's just too random - cutting through mountains when there is a lower altitude route. I know there are a number of other applications I can use, but I'm having enough time battling with TG2 to find the time to learn a another new app!
(g) Populate with trees - I can do this using the free sample trees on this first run. When (if!!) I've got it working I'll go to the full TG2+XFrog+Animations option.
(h) Populate with other objects (castles/ruins etc)....should be the same as trees I guess (probably a naive statement!)
(i) Try applying a texture to cliffs etc to get a cool look to it...no idea how to do that yet...way down on the list of priorities.
(j) finally clouds and lighting which I'm pretty comfortable with - but I have no doubt that I'll spend hours/days/weeks reading up on tweaks to get the look "just right"
Apologies for the long post....I'm venting about 2 weeks of frustration here in my cry for help :'(
regards
Todd
That's a long story, and a huge operation. I don't know if this is any help for a start, but this is how I would take a greyscale tiff for eroded terrain. And I wouldn't erode such a huge terrain, but only the closest part, where a detailed render will be done. The rest is distant anyway, and may be 'eroded' with some displaced fractals.
Love your tag-line!
Thanks for taking the time to respond. I think I can follow what you are doing, however I do have a couple of questions :-
1) Why do you use the image map shader rather than a heightfield load - is there any advantage to doing it that way?
2) The settings on the "heightfield shader 01", are they just the defaults? I assume its only there because its the started default and the 'container' (for want of a better term) for the heightfield generate...otherwise we could plug the output of the erode into the input of the compute ??? (I'm guessing - I have no idea if that actually works, but conceptually I would have thought it did).
To respond to your other point, I want to be able to zoom into any bit of the 2900sqkm terrain and see what it looks like rather than craft a specific terrain at a given point. I'm using Terragen to help me write novel and I thought it would be useful to help me visualise (and therefore describe) the terrain at various points as the characters travel through it - also great for providing illustrations to my prospective readers (If I ever get it finished / published). Already in designing the world its given me a few plot ideas about where action (eg battles - its a fantasy) could take place and the escape routes the potagonists could take based on the terrain. This is what makes this project tricky - if I didnt want this level of global detail I'd just start with a random fractal world and scoot over it until I found a bit that looked like what I wanted and tune it from there - believe me, with the faceplants I've had ove the last couple of weeks I would have found life much more easy if I'd opted for that route (and still may do so), but reading snippets from the forumes, what I'm trying to accomplish should be possible - if I develop the skill for it (which is admittedly a big IF ;)
Cheers
Todd.
To give you an idea of my map and the segmentation, the attachments are a much reduced (jpeg compression low quality, size reduced) image of the map and a colour coded view of the masks I'd apply to create each segment/ecosystem....in theory, each mask would give me a segment that I could load/erode/colour independently.
The tag-line is a some story.... based on DandelO's words regarding a thread some time ago, which has now been erased. More fun for insiders who know what it's about, but fun anyway.
Because the tiff is not a terrain, I don't load as heightfield, but as image map. In the shader I just changed the lineair bit, check it out. I made a view of all relevant tabs, the rest is default. You cannot plug the erode into compute, you should use the 'container' indeed.
I think you're in for a lot (a lot!) of work, but I admire your goal. Having written a novel myself and working on a complete (be it small) city now, I know there's a lot of work involved in both.
I like the map, Europe in very early times...
Quote from: Dune on January 12, 2012, 09:28:47 AM
... Having written a novel myself ...
I am curious can you please explain a little Ulco ?
Hmm - I set it up as you explained (though using a 10k x 10k TIF), however I seem to just have a flat projection even skimming the surface I cannot see any height items BUTyou can just see the shape of my map on the mini screen. I've tried fiddling with the amplitude and different plan projections, but with no success .
I have noticed two things (which might be related??) on what you sent :-
1) Your image map shader is called "Image Map Shader 01_1"....dont know how you got that.
2) On Image Map Shader 01_1, you have a setting "Use settings from colour tab...", I dont have that. Is that something in the paid for version, is there a different shader I should have used that has this option. As its unchecked anyway, I'm not sure it would make any difference.
The attached is what I have - I cant spot what I've missed on yours apart from the above.
Thanks
Todd
Just jumping in ... Why is your image map displacement to -30?, actually why is it sat at all?
Try leaving the image map displacement un-checked (off) and set your displacement in the heightfield shader, the third tab (also un-check "Flatten surface first").
or
Plug the image map shader directly into your Compute terrain node and use the image map displacement as you are (although a value of -30 is a little unusual, normally this would be a positive value, white representing the highest value and black the lowest. This would make the white parts of your image 30m deep in your image.
which leads to mentioning ...
Remember that if the image is a normal 8bit image its height values will be interpreted as meters. A white value will be as many meters positive of negative as you type in on your Displacement "Heightfield multiply" value in your heightfeild node. This is NOT the case with GeoTiff's who's white value is represented internally and can be anything (still multiplied by the same Displacement "Heightfield multiply".)
sorry for butting in ... ;)
Richard
Just re-read your post. Pretty sure the reason Terragen keeps crashing on loading a not particularly large file is that although it is a tiff its not a geotiff. Although it will load a normal tiff these are not what its designed for. GeoTiffs can contain a variety of information including high resolution height data. If you plug your image map shader directly into your Compute terrain you should be fine. Just set your displacement to the height on meters of your highest peak and your imagemap size to the size of the area your mapping in METERS.
PS If the original base file was a GeoTiff it "can" be edited but its not easy ... at all ..
Is it safe to assume you are running Win7 x64 and not 32 bit? If it is 32 bit, you could be running into simple memory limitations for a 32 bit app (2GB per app, not the 4GB you might assume from your available memory). Large images like that should, in general, load ok, as long as they're in the right format and there is sufficient system memory.
If you want to go the tiled route the best way would be to get your terrain into GeoTIFF format with some form of at least general "georeferencing" to make sure the tiles align easily. Global Mapper or another GIS app would help a lot with this, though you can do some manual georeferencing in TG as well.
Also consider using a dedicated heightfield modeler/editor like World Machine for your erosion, etc. as not only do they provide more control, but they will be better optimized for handling large heightfields and doing complex operations like erosion. Note however that few applications will really be able to perform operations like erosion on a full heightifield of that size. The memory requirements are large. It is almost certain that, even if not for TG, you will need to upgrade your memory (and hopefully you do indeed have Win7 x64).
- Oshyan
Quote from: cyphyr on January 12, 2012, 05:03:52 PM
Just jumping in ... Why is your image map displacement to -30?, actually why is it sat at all?
Try leaving the image map displacement un-checked (off) and set your displacement in the heightfield shader, the third tab (also un-check "Flatten surface first").
If you're using an Image Map Shader to generate displacement, then you need to set the displacement parameters. Todd is following Dune's suggestion to generate a terrain from the Image Map Shader, so he would need to use the displacement parameters. However, I'm not sure why he's suggesting that, because images can be loaded directly into the Heightfield Load node.
Matt
Quote from: Oshyan on January 13, 2012, 01:23:48 AM
If you want to go the tiled route the best way would be to get your terrain into GeoTIFF format with some form of at least general "georeferencing" to make sure the tiles align easily. Global Mapper or another GIS app would help a lot with this, though you can do some manual georeferencing in TG as well.
Not necessary. You can specify your own georeference coordinates for any terrain you load, just by turning OFF "auto georeference from file", turning ON "georeference" and filling in your own corner lat-long values. GeoTIFF (the kind that has an associated .tfw file) is only needed if you want to read the coordinates from the file. Even then, technically you only need the associated .tfw, and the tiff itself doesn't need to be GeoTIFF.
Matt
QuoteI cant spot what I've missed on yours apart from the above
Did you hit 'generate'?
QuoteHowever, I'm not sure why he's suggesting that, because images can be loaded directly into the Heightfield Load node.
Todd wants to erode, so I figured this to be the simplest way. I never used the heightfield load, so don't know if you can erode after that.
@Kadri: I started writing a fantasy/SF novel in 1986 (400 pages or so), and kept on changing things until a couple of years ago. I never actually finished it, but know how to. No time, however. A pity in a way, it's a nice story, and I thought of some things in there that were later true problems or solutions in real life (like coma drinking, and growing meat in containers). I got three children's books published however, so I cannot complain.
I tried to do something similar with a map even bigger (in kilometers, not necessary in pixels) than yours. My original idea was to use erosion to the original terrain (in WorldMachine II demo version, I think), but it turned out that the scale of my project was way too big for that. Later I decided it was enough to only do the erosion to a part of landscape visible in the camera by exporting part of the terrain as a heightmap. I never did though.
Instead of using a heightfield I used my map as a blending shader for several power fractals (single pixel in my map was roughly a kilometer or so.). I used hugin to make a spherical map out of it (even bigger, as it spanned the whole planet surface). By using several maps (one for mountains, one for land height etc.) I got reasonable control over the terrain. Sea was made by a sphere object of the same radius and location as the planet but no displacement. I never had problems with Terragen crashing but it did take a lot of memory once it loaded the maps.
The biggest problem in the end was the spherical projection. My origo was in the north pole, so interesting parts of the map were tilted some 40 degrees or so. I could tilt the camera to compensate, but not he populations (and the heightfield export acted funny also). This finally made me give up. You will have the same problem with populations pointing towards y axis and the local normal to another direction. (In latest version you can use the transform shader to rotate your map though... You could center your map to your camera at the origo.)
I wish you luck with your project! You can work wonders with Terragen if you just have the patience of learning how. Now I just might go and pick up the files of my old project...
Quote from: Dune on January 13, 2012, 03:17:46 AM
...
@Kadri: I started writing a fantasy/SF novel in 1986 (400 pages or so), and kept on changing things until a couple of years ago. I never actually finished it, but know how to. No time, however. A pity in a way, it's a nice story, and I thought of some things in there that were later true problems or solutions in real life (like coma drinking, and growing meat in containers). I got three children's books published however, so I cannot complain.
Thanks and nice to hear . I hope you will finish your fantasy/SF novel , Ulco :)
Quote from: Dune on January 13, 2012, 03:17:46 AM
Todd wants to erode, so I figured this to be the simplest way. I never used the heightfield load, so don't know if you can erode after that.
Heightfield Erode is a heightfield operator which can operate on any other heightfield node (green nodes), whether that's a Heightfield Load, Heightfield Generate or any other heightfield operator.
Matt
Sorry guys, I was away from my PC yesterday, so only picking things up this morning (Australia):
@ cypher - the -30 displacement was set as this was the value in Dunes example (I did wonder about it, but thought maybe -30 did some undocumented magic/trick to a shader :-[... I assume it sunk blacks below 0m height to ensure my sea was at sea level. I did try alternative displacements (positive, to see if I could lift the terrain). Also see below
@Oshyan - I have 2.3.22.1(Free) running on a Win7 32 bit. My laptop is Win7 64 bit (U7300 processor at 1.3GHz with 4GB RAM)...do you think I'll have better luck running this on the laptop even though the processor speed is much slower? I'm reluctant to look at using another application, as I'm having trouble enough learning this....but I do appreciate the advice (and have seen similar advice elsewhere) so will give it another shot (I had a go a week or so ago, and it wasnt obvious how to load the segments so I meover back to TG2 to see if I could do it here). Thanks for your advice - and its impartiality (and thanks for giving me the reason to justify to my wife why I MUST have a new PC ;))
@ Matt - thanks for the comments. I started with a straight heightfield load, but it seemed to crash my system more often than not.
@ Dune - Yes I did hit generate...thats one trick I learned early (always regenerate after every change). I found the problem....basically at that scale unless I set the amplitude to 1000 the height just doesnt get off the deck, so as soon as I pug the shader into the heightfield generator it flattened it totally out.
@stgermain - I'm interested in your second paragraph as it sounds like what I want to do...are you able to provide a bit more detail about how you did it (Sorry blend shaders are a mystery to me so any pointers will help!!)
So, here's where I'm at - I now have a working, non crashing heightfield loaded!!!! See the next post (just to keep the size of each post small(er). I'll post details which I'm sure most of you all know, but will state it just in case a newbie like me reads this post....
Per my previous post I now seem to be able to reliably load my data and add oceans.
This morning started with me following Cyphyr's advice of a load directly from the shader into the compute terrain node. I started with a small file covering an island (1000x1000pixels) to test it and it worked perfectly in that it gave me a clear image of the island BUT it only gave me some small bumps where it existed.
I adjusted the "Displacement Amplitude" up and the terrain popped out nicely. I then rescaled the map from my 1000 x 1000 to 2000 x 2000 and found that I needed to increase the amplitude again to keep the heights. By the time I increased the scale to 10k x 10k the amplitude needed to be >1000 to show any meaningful height...and 2000 was better. This indicated what I'd been doing wrong previously when I only set amplitude up by a few hunderd on a 10kx10k map.
At this point I tried loading my original TIF (10k square) and set amplitude to 2000 - it showed up OK as long as I had all other seetings as per dunes screenshots.
Subsequently I found some limitations to Cyphers approach for what I wanted as it (obviously in retrospect) does not give me access to the heightfield operators such as erode, resize and adjust vertical which I'd learned and knew how to operate to give me the look of the terrain I wanted.
I then followed the approach oultined by Dune and pointed my Shader into the Heightfield Generate node, shader input and after hitting "generate" ( ;)) I had the terrain loaded as a 10k heightfield - and no crashes at all thus far!!! Anyone new reading this, make sure you ensure the dimensions in the shader are exactly the same as the dimensions in the generate...otherwise you may not see the terrain you're looking for (it being offset from the bounding box)...and dont forget to hit "Generate Now" after each change. Also, un-check the "Flatten Surface first" option on the Displacement tab of the "Heightfield shader 01" as shown
Next I decided to increase the size to 2900km sq...and hit my first crash. To be fair, I'd probably run 10-20 variations, loads, resizes etc, so I restarted the application and loaded the last set of settings and it loaded OK.
Next I wanted to load the oceans. Before doing so I looked at the height of the black areas of my map - which should always be below sea level, however (I assume due to the spherical nature of the planet) I noted that from the centre point, the height of the lowest point varied the further I went from that centre-point (for newbies, the problem is worse if you load the image from the "Lower Left" as you now have to deal with the curvature of the earth over 2900km rather than half that distance). To counter the problem I changed the radius of the planet (Objects>Planet 01) from the default 6.378e+006 to 6.378e+009 to effectively make the surface 'flat' over a 2900km distance. Not sure what impact this will have on the atmosphere/sunset etc later,...but I'll sort that out later. Would love to hear if there's some smarter (easy) solution...I did read on the forum, someone projecting the image spherically from the centre of the planet, but the description of how that was actually done was pretty sparse and I couldnt follow it.
Now that I had my sea level relatively flat, I played safe by loading in 4 x lakes of 500k-700k radius just in case this put less load on the memory/app. That seemed to work OK. . I've now saved my map, with all relevant settings as shown in the attached (those NOT new to this will find it mundane, but anyone new and trying to do the same thing may be interested to see my settings).
Now to try some erodes (may go to another app based on other recommendations), adjust the heights and do some smoothing before I start colouring it in....oh yeah, and try to define the rivers (currently a 1 pixel black trench drawn in my TIF).
Quote from: Todd on January 14, 2012, 05:23:23 AM
@stgermain - I'm interested in your second paragraph as it sounds like what I want to do...are you able to provide a bit more detail about how you did it (Sorry blend shaders are a mystery to me so any pointers will help!!)
I attached a picture of a simple node setup here. The basic idea here is that i have a camera high up over the terrain (200 km in this case) looking down on the planet. This camera is connected to an Image map shader that has a black and white map loaded and projection set to camera. This is a blending shader with white parts of the loaded image blending 100% and black part 0%. This is connected to a blending shader input of a power fractal that has small amplitude but large positive displacement. Now the fractal rises from the ground wherever the map is white. The other fractal is just to give some variation to the ground.
Advantage of this method is that you have the image mapped on the planet without any problems from the curvature. You can use as low res maps as you dare because all the detail comes from fractals. You can use other maps projected through the same camera blending other aspects of your terrain.
I made a sea from another planet in the same coordinates as the original, but with 200 m larger radius. Water shader is connected to its surface shader input. (If you try this, don't forget to remove the atmosphere shader from it or you will have very strange haze...)
Thanks for that!
I could see what you're suggesting and it looks such a simple and elegant solution. I would have said foolproof if I hadnt spent the last 4 hours trying to get it to work...and I really cant see what or how I went wrong. I've fiddled with just about every combination of variables I could think of (hence the last 4 hours). The attached chronicles my frustrations up to the time I threw the keyboard through the screen...
Hi, Todd. I have been intrigued by this post but I'm kind of struggling to understand.
Is it absolutely necessary to have this .tiff run through a heightfield shader? Do you desperately need the data to be loaded as a geotiff heightfield? I've steered away from posting here because I'm really uneducated about using geotiff data in TG, never needed to use it before and so I'm not the best qualified to post here, as I know many of these guys have much greater knowledge on such things.
What I'm stuck on is, you seem to be facing multiple problems and discrepancies using heightfield generate nodes, I've read all your uploaded notes and I think you might be making things much more complicated than they need to be by even using any heightfield operators at all.
Using just the small preview sample uploaded on p.1, I can load, map and locate accurately the areas of interest into TG without distortion. Could you get away with simply loading an image map shader of your greyscale terrain, plugging it into 'compute terrain' and then using different mask maps of each area you want to mask, as masks 1 through 6(top to bottom in your colour chart, for easiness sake) Like the following .tgd...
Replace your own 10k image map into the terrain map shader and your own 10k masks in each of the 6 mask shaders(white=yes/black=no cover).
Then apply each set of shaders you require to each region, using the correct mask as blend shader to those particular areas. As long as your image maps are all made the same size in the image map 'size'(29,000m/plan Y/centre) parameters then, you should be easily able to single out individual areas to apply the appropriate shaders to by assigning each mask as their blender.
If I'm way off the mark and this must be done through the geotiff heightfield method then, please just ignore this post, as I said, I really am not qualified to advise on those methods. It just seems like you could create this setup with much less hassle than you're facing so far.
*EDIT*
There's also a sea object in the .tgd, enable it and then open the node 'water level - offset' and use the 'colour offset' parameter in the colour tab to control how high you want your sea level in metres.
In each of the 'areas' shaders, colour is just applied as an example guide, according to your mask image. To use each surface layer to apply appropriate shaders to each area, just uncheck 'apply colour' and plug in the new shaders you need to each surface layer's 'child layer' input.
* Actually, this is pretty much exactly what stgermain just wrote before me, use your image map simply as a blend shader to the following shaders. Sorry, I wasn't paying attention, typical me. :/ *
Hi Dandel0
Thanks for taking the time to read/model and reply...are you able to send over the tgd file for the above images, I'd love to see the inner workings of how you got there. I absolutely follow what you've done, but I have had no end of problems trying to get a similar result - probably just missing one setting.
What happens if that map is stretched over 2900km?
It seems (to me at least - though I'm sure Ive missed a magic setting somewhere...) that over a 2900km scale TG2 just doesnt wrap the image around the surface.
I tried to load separate heightfields using individual masks as you've shown there, but kept on hitting a wall - the masks didn't appear to work as each time I loaded a new heightfield it seemed to ignore the mask and overwrite whatever terrain was already there, so effectively all I got was the last terrain loaded. I read extensively on the forums - there being no great documenation that I could find - but I never seemed to get it to work. Regardless, as this was also loaded as a 2900km scale I still had the curvature problems i.e. black at the centre was 0km above the ground, whilst black (and most heights) at the edges were at -16km, white at the origin would be +12km, whilst the same white at a point 1450km away would be -3km. I then tried loading individual maps of a small scale with the thought that I could stitch them together, but I always had a massive drop off at the edge of each map (eg at the colour boundary), so I could never put them together without a canyon being present.
The only solution I could figure out was to increase the radius of the planet so that a 2900km segment was effectively flat, this works but leaves me with a flat horizon (which I can live with as I'm a bit fed up with curving earths anyway!)....
Oh, and I am using Black+White masks, not colour....the colour was just for explanatory purposes.
All the files I used are in the archive I attached to my first post above the preview image(just download, unrar/zip to find the project folder containing it all). It should load every image automatically when you open the .tgd.
The images are all loaded at 29,000m, you'll want to change those to 29,00000m, sorry, my mistake in translation but the end result should be the same, just raise the camera to compensate and fit everything into view.
As for canyons appearing at each blend shader border, you might try to blur the edges of each mask by a few pixels in an image editor before loading your masks. That should take away the sharp cut-offs. :)
Maybe you can adjust your image map so that it can be projected spherically to the earth.... Ration 2:1, but how to adjust a square map, I don't know. No merely stretching I presume. There must be a way, or there wouldn't be such nice planet maps.
Quote from: Dune on January 17, 2012, 02:33:26 AM
Maybe you can adjust your image map so that it can be projected spherically to the earth.... Ration 2:1, but how to adjust a square map, I don't know. No merely stretching I presume. There must be a way, or there wouldn't be such nice planet maps.
I used Hugin to make a spherically projected map. I needed to calculate the horizontal field of view of my map (it was nearly 90 degrees) and Hugin did the rest, but i still got some distortion. The problem was that my map was not originally made in any real projection so directions and distances got warped a bit.
I think you could put a projection camera to the center of your planet, adjust the fov to what your map represents and have the map mirrored in x-axis. This way terragen would do the projection by itself. (directions would be totally off near the poles of your hypothetical planet, but if you only want something in the scale of few thousand kilometers somewhere below 60 degrees it should work fine.) I got to try this...
In this setup it would be very easy to adjust the rotation of your camera to center your scene location in the map to the origo and you could have nice upright populations wherever you want. Then you need a transform shader to rotate your terrain with the same numbers and the terrain would stay the same too.
Quote from: Todd on January 16, 2012, 10:57:59 PM
Hi Dandel0
Thanks for taking the time to read/model and reply...are you able to send over the tgd file for the above images, I'd love to see the inner workings of how you got there. I absolutely follow what you've done, but I have had no end of problems trying to get a similar result - probably just missing one setting.
What happens if that map is stretched over 2900km?
It seems (to me at least - though I'm sure Ive missed a magic setting somewhere...) that over a 2900km scale TG2 just doesnt wrap the image around the surface.
I tried to load separate heightfields using individual masks as you've shown there, but kept on hitting a wall - the masks didn't appear to work as each time I loaded a new heightfield it seemed to ignore the mask and overwrite whatever terrain was already there, so effectively all I got was the last terrain loaded. I read extensively on the forums - there being no great documenation that I could find - but I never seemed to get it to work. Regardless, as this was also loaded as a 2900km scale I still had the curvature problems i.e. black at the centre was 0km above the ground, whilst black (and most heights) at the edges were at -16km, white at the origin would be +12km, whilst the same white at a point 1450km away would be -3km. I then tried loading individual maps of a small scale with the thought that I could stitch them together, but I always had a massive drop off at the edge of each map (eg at the colour boundary), so I could never put them together without a canyon being present.
The only solution I could figure out was to increase the radius of the planet so that a 2900km segment was effectively flat, this works but leaves me with a flat horizon (which I can live with as I'm a bit fed up with curving earths anyway!)....
Problem with heightfields is that they don't wrap up very well, but a properly projected image will. The strange height readings you get when far off the origo are because your coordinates are straight but your planet is not. Therefore it is easiest to always work near the center of the coordinates.
With a setup like DandelO's or mine you would not need heightfields at all. You would just use blended fractals to build your terrain. (Don't forget to check the box "Blend by shader" in your fractal settings though). If you want to play with erosion for example, you could export few kilometers around your camera as a heightfield (I've never tried this...).
Hi again, Todd. I had to sleep last night but I reopened this today and things scale up fine to 2,900km with no distortion or planning artefacts around the planet.
I would definitely avoid the heightfield operators, if they aren't entirely necessary, saving generation time and other scaling hassles. You'd then obviously need to find another way to erode areas if you need to do that.
As for spherical mapping, your entire area is not a complete globe map so you would be effectively stretching that square of data to cover the entire planet with spherical mapping, I don't think that's the practical or sensible way to go, far easier to just use planned Y projection and have all masks stretched to exactly the same dimensions. And, as stgermain says, keep everything as close to the coordinate origin as possible, that's where the 'position centre' option is handy. Good luck! :)
If you place this edited .tgd in the same folder I uploaded yesterday and then open it up, you'll get the following result(probably requires a bit of displacement/water level tuning to suit your needs but it is all planned correctly to the planet);
[attachimg=#]
.tgd; [attachimg=#]
WOW - Thanks for the work on this...I hope I can repay the favour sometime in the future.
I havent had the time to read this today as I've been helping my dad clear out his house - 30 years of accumulated junk....just switched the PC on for the first time today and its 11:43 PM.
Will try this tomorrow afternoon (after a few more trips to the tip) - can't wait, it looks sensational .
Thanks again.
Todd
PS Also feeling a little but dumb for not spotting the first TGD!
No prob's. I just thought it was being made much more difficult than was necessary with all that green node palaver. Richard and stgermain were on the right track by saying to just plug your image straight into your compute node, it saves loads of hassle over scaling heightfield operators and getting all those distorted, stretched surfaces on your planet.
Of course, you could still always plug them into a HF generate of the same size as your image maps and then, by right-clicking the node, save your terrain as .ter. But that shouldn't really be necessary, unless you desperately require the use of other heightfield operators(erosion etc) to use once you replace your generate with a 'heightfield load' on the saved .ter, instead.