Water level problem

Started by hughbee, February 10, 2009, 07:12:50 PM

Previous topic - Next topic

hughbee

I am trying to redo an image that I did in Terragen.
The first image, "Hite Area 2x2 03-23 1129.6.jpg" is the original
with the water level at 1129.6 meters.

The next image, "Hite Area 2x2 01-06 1151.jpg" is the scene in TG2.
The water level is 1151 meters.

The next image, "Hite Area 2x2 01-07 1155.jpg" is the same scene with
the water level at 1155 meters.

I removed the water in the last image, "Hite Area 2x2 01-09 1129.6.jpg"
and created a surface shader with a altitude limit of 1129.6 meters.

You can see that the altitude is off on the water and the depth is not consistent as
it goes away from the camera.

Has anybody else seen this phenomena? Does anybody have any solutions?
Is this a bug that needs fixed?

PG

Did you use a .ter file from terragen 0.9 or lower? If not then I'd say the problem is caused by the curveture of the planet. Terragen was just a flat square piece. If you are using a .ter then...uh...dunno :)
Figured out how to do clicky signatures

choronr

I don't know if this information would be useful to you which I received from Oshyan some time ago; as follows:

"TG to TG2 CAMERA POV SETTINGS (from TG 0.09)

There are a number of possible explanations for this. Due to some UI issues TG2 and differences between it and TG 0.9, there are some easy to make mistakes that would definitely result in major differences.

First, the use of coordinates in TG2 and TG 0.9 is a bit different, and to add to the confusion in TG2 the coordinates are sometimes not labeled, as in the Camera node. In TG 0.9 Z is "up" (perpendicular to the terrain). In TG2 Y is "up". So you basically just have to switch the Z and Y values when copying between the two. The order they're listed in is the same, X, Y, Z (even though they're not labeled), so just put the Z value into the Y slot. This is the most likely source of your problem.

The scale is another thing that could get confused. If TG 0.9 is set to work in meters, as it is by default, then the scales should match as TG2 respects the scale definitions in .ter files. However if TG 0.9 was set to measure in Terrain Units, then it won't match up. There are radio buttons in the Rendering Control dialog to the right of the "camera" title which control the measurement mode. You can also tell what mode it's in by looking at the numbers for the camera placement - if they end in "m" (e.g. 3900.m) then it's in meters mode (as it needs to be to accurately translate position). Switch to Meters mode if it's in Terrain Units.

Last and least likely is that TG 0.9 wasn't operating on a full globe, it was just a finite, rectangular terrain, so depending on how you're positioning your loaded heightfield (at default 0.0 with left position, or at center position, etc.) the positioning might be offset. What you want is Left Position and 0.0 in the Heightfield Shader.

Also note that the camera in TG2 has no Target, so you'll need to use the Rotation settings. The "Head" coordinate (first on the left in TG 0.9) corresponds to the 2nd Rotation coordinate in TG2. "Pitch" corresponds to the 1st coordinate and so Bank of course corresponds to the last one.

I think one of those should explain and help you resolve your problem.

- Oshyan"

Bob

mr-miley

This is the bane of my life at the moment, and has been a "problem" since the 1st TG2 release. I believe it has something to do with planet curvature or something or nothing  ;D The further the water is away from the camera, the more "out" the water height is. I am working on an image at the moment where the waters edge is right close to the camera. The water level is in at 5m, yet if I place, say, an object, or an altitude constraint on a surface layer, at 5m, its nowhere near the water level. Drives me insane, and isn't helpful when you are doing anything showing a shoreline  >:(

Miles
I love the smell of caffine in the morning

hughbee

Early in the head scratching process I though of the curvature of the planet. I was even thinking that mabe my terain needed tilted a little. But the image with the red shows that TG2 calculates the height properly at least for surface shaders. Maybe there is an invisible moon to the left and behind the camera  :D

Hopfully this issue will be fixed in a upcomming release.

PG

Well a surface shader is applied directly to the terrain so it will follow it up a hill or down a crater. The water body is an object and so it will just cut through the terrain if they conflict in height at any point. Have you tried using the water shader as a surface shader? You'll have to do more tweaking to stop the water looking like it's an inch off the ground unless that's the effect you want, which judging by the TG0.9 image it isn't.
Figured out how to do clicky signatures

rcallicotte

So...it's not just me and my lucid imagination.  Go-o-o-o-o-o-d to know. 

Quote from: mr-miley on February 11, 2009, 07:35:07 AM
The water level is in at 5m, yet if I place, say, an object, or an altitude constraint on a surface layer, at 5m, its nowhere near the water level.
So this is Disney World.  Can we live here?

Seth

no i had the same problem with a previous render !
and i had to put my water to -25 whereas the ground was -68... i don't call it a inch off the ground ;)

Oshyan

Is your water object set to key off the planet for curvature (the Planet tab)? Is your heightfield *also* set to curve, or is "flatten surface first" turned on? You could try turning this off if so. You can also use the trick of creating a 2nd planet with the water shader as the only surface shader, then scale it to just big enough to get the appopriate water level.

- Oshyan

hughbee

The Lake was set to key off the planet. The heightmap was set to flatten surface first. I turned the flatten surface first off and saw a difference in the area covered by the red surface shader in the preview window. I will do some test renderings and post the results.

hughbee

I did some renderings over the weekend. I found that the water level varies based on how far the cameras X-Z value is from the Waters center X-Z. In the 01-17 image I moved the water center to infront of the camera. Setting the water level to 1129.6 give results similar to the TG0.9 image.

I did some other testing with the Alpine shader. I positioned the camera to 50km away in the X and Z axis. I made sure that the water was mapped to planet 01 and that the "flatten surface first" was off.
The first image is the results with the water settings of
Level: 1191.91
Center: 50000 800 50000
I measured the level in the preview, and it was 800

The next image I changed the water settings to
Level: 800
Center: 0 800 0
I measured the level in the preview, and it was 405

Any ideas on this Oshyan?

Oshyan

Yes it will vary, depending on how you have your scene set up. There *may* be accuracy issues in the curvature as well, but theoretically *if* you have Flatten Surface *unchecked* in your heightfield, then it should conform to the curvature of the planet, and your lake object should do likewise. The only other problem I can think of with this is that as you get further from the coordinate origin, because the heightfield is being stretched to conform to a spherical shape, it will distort, and your relative water level will change. The absolute height should remain the same (again, in theory). If that's changing, there may be an accuracy issue in the water curvature functions.

Alternatively if you turn *on* Flatten Surface in the heightfield and remove the planet association from the lake node, you should get a flat lake and flat terrain, and as long as you don't need to see it from global distance it should work fine. As I said before you may also want to consider using a 2nd planet sphere made entirely of water.

- Oshyan

Matt

Don't trust the Y coordinate readout in the preview when you are dealing with large areas on a curved planet. That simply reports the Y coordinate, which is not the same as altitude. For any altitude you choose, the Y value will change as you move away from the origin because of the planet's curvature. At the origin, Y = altitude, but away from the origin Y will be less than the altitude.

The lake object should give you a surface with an *altitude* at the water level you specify in the shader. If you change the centre of the lake object, you should make sure that it hasn't affected your water level parameter. Double check that it is still set to the water level you want.

The water level in a lake object and the altitude constraints of a surface layer shader should operate in a similar coordinate system. If you have a project file that shows a disparity between the two, please send it to us for testing.

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

Matt

Quote from: Seth on February 11, 2009, 04:20:09 PM
no i had the same problem with a previous render !
and i had to put my water to -25 whereas the ground was -68... i don't call it a inch off the ground ;)

This will be due to planet curvature, most likely.
Just because milk is white doesn't mean that clouds are made of milk.

hughbee

Matt;

I did some test renderings based on your explanation and everything makes sense now.

When you create your world, you can take one of two path's that control altitude. A round world or a flat world.

If your world is round then you have to:


  • map the water to the planet
  • turn off "Flatten surface first" on any applicable nodes
  • turn off "Use Y for altitude" on any applicable nodes

If your world is flat then you have to:


  • Remove the mapping of the water to the planet
  • turn on "Flatten surface first" on any applicable nodes
  • turn on "Use Y for altitude" on any applicable nodes

I don't know if there are any other parameters that are dependent on being round or flat, but hopefully my explanation here will help some other people that have been confused by altitude issues.

Matt - Oshyan; If I missed the boat on this or there is anything else you can think of that is affected by the world being round or flat. you can speak up.