Global Heightfield Map not working

Started by PabloMack, April 04, 2010, 10:59:26 AM

Previous topic - Next topic

PabloMack

I am trying to use a heightfield to define the rough altitudes for an entire planet (in this case it is Earth).  I created the effect I want in Lightwave and this is what it should look like:

[attach=#]

You should be able to make out Europe on the top with Africa below.  In Terragen, I loaded the same bmp to use as a heightfield in TG2 and checked georeferencing to tie down the corners of the map:  

[attach=#]

But when I render, this is what I get:  

[attach=#]

Whoa!!!  I must agree with the general opinion that Terragen is not very easy to understand.  Can anyone tell me what I am doing wrong?  ???

cyphyr

Dump the Heightfield loader and just use an image map loader (node). Set the projection to Spherical, the size to 1,1 and the position to 0, -6.378e+006 (the centre point of your planet), 0. You can set the height in the displacement tab.
Should work :)
Richard
www.richardfraservfx.com
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 5950X OC@4Ghz, 64Gb (TG4 benchmark 4:13)

TheBlackHole

cyphyr's right. But I have an idea: Instead of a map that defines the continents as plateaus, download a bump map from one of these sources:
http://planetpixelemporium.com/planets.html
http://earthobservatory.nasa.gov/Features/BlueMarble/BlueMarble_monthlies.php
If you want, you could use a color map from the latter site and perhaps a cloud map from:
http://xplanet.sourceforge.net/clouds/clouds_4096.jpg
They just issued a tornado warning and said to stay away from windows. Does that mean I can't use my computer?

PabloMack

Actually, I am using images from one of the resources TheBlackHole mentions.  The height field vs. bump map is an interesting idea.  The problem I have experienced with bump maps is that they have rather essoteric settings that don't readily translate into absolute altitudes (e.g. 100% instead of 5km).  I need to be able to define absolute elevations (or actual and not just apparent displacements) because, I am not just planning to orbit the planet, but I want to (eventually) travel down and visit its surface.  The location(s) I choose for a visit will need some locally enhansed detail to over-ride the orbital low-res view as only seen from a distance.   

So cyphyr, I take that, in TG2, height fields are not properly wrapped to the planet's surface but, rather, they are rectangular surfaces that are intended to be projected to a portion of its surface that must be small enough so that the mis-match between the planet's curved surface and heightfield's planar nature is not noticable.  If the image map loader really is more general (and works in this instance) I will probably just ingore heightfields alltogether.  Thanks.  I'll try it. 

PabloMack

#4
Quote from: cyphyr on April 04, 2010, 11:32:20 AM
Dump the Heightfield loader and just use an image map loader (node). Set the projection to Spherical, the size to 1,1 and the position to 0, -6.378e+006 (the centre point of your planet), 0. You can set the height in the displacement tab.
Should work :)
Richard

Once again.  I am suffering from a severe lack of documentation for how the sofware works.  I tried doing all that you described above and my render looked exactly like the default.  I looked at the Node Reference, and I am aghast at how little is there.  I think I need to start a new thread about the need for documentation.  I feel like I am wasting my life on this blind trial and error stuff.   ???

old_blaggard

You will most likely need to increase the displacement value in the image map shader by quite a lot - try bumping it up to 10,000 or so, at least for test purposes.

I understand about your feelings with the lack of documentation. However, while it does take some trial and error in the beginning, I've found that I have developed an intuitive sense for how the program approaches problems.
http://www.terragen.org - A great Terragen resource with models, contests, galleries, and forums.

TheBlackHole

When I said bump map, I meant it COULD be used as one, but it creates actual displacement in TG2. Get the highest resolution map you can (without having to use BitTorrent) and set the displacement to 8848, the height of Mt. Everest. Then add some power fractal detail and use an image map for the color of the planet. Create a sphere, then set its location to the center of Earth (usually 0, -6.378e+006, 0)and its radius to 6.378e+006. Replace the default shader with a water shader, then tweak the radius to get what you want. For clouds, download a cloud map (or get nvseal's planetary clouds at NWDA) and set an image shader as the density shader. For this image map shader, select the cloud image that you (should have) downloaded, and make sure displacement is off and color is on. Tweak the cloud layer until it looks good.
They just issued a tornado warning and said to stay away from windows. Does that mean I can't use my computer?

Oshyan

Quote from: PabloMack on April 18, 2010, 11:42:48 AM
So cyphyr, I take that, in TG2, height fields are not properly wrapped to the planet's surface but, rather, they are rectangular surfaces that are intended to be projected to a portion of its surface that must be small enough so that the mis-match between the planet's curved surface and heightfield's planar nature is not noticable.  If the image map loader really is more general (and works in this instance) I will probably just ingore heightfields alltogether.  Thanks.  I'll try it. 

The Heightfield base can optionally have curvature, but the heightfield itself is still displaced in one direction, which results in some odd results the further you get from the coordinate origin. Using an Image Map Shader with Displacement and a suitable source displacement map (with proper scaling in the grayscale values) should work just fine. Let's assume you're using a map of Earth. As BlackHole said, set your Displacement value to the height of your max point, Everest, and the rest should be proportionally correct. But remember A: your displacement map needs to be accurate and properly formatted, and B: from orbit, and with the low resolution you're likely to have for a full planetary bump map, you're not necessarily going to see a lot of dimension at realistic scales. Many Earth visualizations exaggerate heights significantly for effect because of this. This is what Mt. Everest actually looks like from space:|
http://pictopia.com/perl/get_image?provider_id=207&size=550x550_mb&ptp_photo_id=146926
Most other areas will look much flatter.

- Oshyan

PabloMack

#8
Progress!  Taking the lead from cyphyr and Oshyan, from the Shaders Tab, I did an Add Layer->Displacement Shader->Image Map Shader.  I renamed the Shader "Altitude", Set the Projection Type to Spherical and set Position's Y to -6.378e+6.  Just to more clearly see the terrain, I disabled the Atmosphere.  To make sure I can see that the displacement is working, I set Displacement Amplitude to 300000.  I also had to uncheck Apply Colour and check Apply Displacement.  This is what I got:  

[attach=#]

So this is the effect that I wanted.  Bravo!  Thanks to all of you. Displacement appears to be in meters just as I intended.  Also, displacement seems to be interpolated between displacement map "pixels", just as I would want. 

It appears that by having to set the displacement of the projection to a hard-coded Position you are not orientationally "childing" it to the planet.  If I were to add an animation path to the planet, then I would have to add the same animation path to the projection position path of the altitude shader that I just created.  If there is a way to subordinate the shader's projection center (as well as its orientation) to the planet's location, it would be highly desirable.  Notice that the orientation of the planet causes the camera to view North America.  I wanted to rotate the planet to bring Europe and African into view and could not find a way to do so.  The Planet Object's parameter page has a Heading slide bar on it but changing this doesn't seem to rotate the planet.  Also I see no indication of how to change the planet's axis of rotation.  

As I have now spent some quality time working with Nodes directly, it appears that the signals going from "Node Output" to "Node Input" (always the left-most triangles?) seem to contain a complex aggregate of information transmitted between nodes including colour, displacement and possibly other information.  In electrical engineering and even music mixing we would call this a "bus".  This would imply to me that only these kinds of signals should be hooked to eachother or that the software has an internal typing mechanism so that it knows to connect colour to colour (even within these; blue-to-blue, red-to-red and green-to-green, alpha-to-alpha), displacement to displacement (X, Y and Z if applicable) etc.  

TheBlackHole

1. Heading changes the LOCATION of the planet. Think of it as similar to the heading of the Sun. Altitude does the same thing, only vertically. Distance changes how far from the origin the planet's center is.
2. To put Europe and Africa into the visible area, offset the height map to put Africa about where South America originally was.
3. You can't change the planet's axis.
They just issued a tornado warning and said to stay away from windows. Does that mean I can't use my computer?

PabloMack

#10
Quote from: TheBlackHole on May 09, 2010, 04:14:14 PM
1. Heading changes the LOCATION of the planet. Think of it as similar to the heading of the Sun. Altitude does the same thing, only vertically. Distance changes how far from the origin the planet's center is.

After playing with it, I have realized that [Heading,Elevation,Distance] are the Polar Coordinate alternative to the Centre [X,Y,Z] Cartesian Coordinates listed above them in the Parameter Page.  When you modify one of the two coordinate sets, the other is updated with its alternate values.  

Quote from: TheBlackHole on May 09, 2010, 04:14:14 PM
2. To put Europe and Africa into the visible area, offset the height map to put Africa about where South America originally was.

I am not using a heightmap.  I dumped it like cyphyr recommended.  Remember my first post on this thread.  A heightmap doesn't wrap properly around a sphere (see uploaded render from trying to do it).  The displacement shader seems to do it properly.  

In the Planet's Parameter Page, there is an "Import chan file" button with a field where you can load a file.  What does this channel file do?  The Node Reference pictures the controls but says nothing about it.

Thank you for your input.  

Tangled-Universe

The chan-file button is for importing .chan-files. These files contain animated parameters.
TG2's animation module does not contain curve-editors, for example, and using a chan-file made in another app gives you this possibility.
For instance you could generate a .chan-file of an animated camera-path in an other 3D app than TG2, and import that into TG2.

PabloMack


TheBlackHole

Offset the displacement image map in Photoshop is what I meant to say. Do I have to spell it out for you? ;D
They just issued a tornado warning and said to stay away from windows. Does that mean I can't use my computer?

Oshyan

Unfortunately you cannot currently rotate planets or change orientation in texture projections (besides flipping). As TheBlackHole said, you have to offset in an image editor. Definitely non-ideal.

- Oshyan