Question about creating sea level

Started by monks, April 20, 2011, 09:31:30 PM

Previous topic - Next topic

monks

Hi, I'm importing a terrain and it has the sea level set at 5486m. The sea creates a coastline on 3 sides of the terrain. How do I set up a water body to give me the sea level?

Thanks,
monks

monks

I've tried changing the water level in the transform tab of the lake object, but whatever I set it to, it doesn't alter the hight of the lake. Even powers of ten don't make any difference.

monks

Oshyan

That's certainly odd. It's working here in a simple test scene. Question 1: is your scene being constructed far from the coordinate origin? If you move your cursor over a foreground part of your scene, are the coordinates larger than 100km in either the positive or negative direction? Question 2: have you tried using a Lake object the default scene with a basic Power Fractal terrain, just to verify it works?

- Oshyan

RArcher

If you are working with a really large area where the curvature becomes a major issue for the lake object it is sometimes easier to use a sphere object as the sea level instead of the lake plane.

monks

...ermmm, sorry, it was the atmosphere I was looking at- I thought that was the sea level  ::) Water plane is ok.

I can see potential problems with that Ryan. As far as I know TG doesn't curve large imported flat terrains to the planet curvature right? If I set a plane of water at the seal level with a sphere won't it be off with the flat terrain?

If I used a georeffed terrain would that be properly projected with correct curvature?

monks


RArcher

If you uncheck the "Flatten surface first" checkbox the terrain will go with the curvature. One issue with this though is that there would likely be some distortion near the corners of the terrain.

monks

Ah, that's a cool feature. Luckily my terrain has sea in three of its corners, so I might get away with it.

I've added a sphere in Objects. So the new sphere object is by default the same radius as the original planet?
I'm guessing I need to have the radius set so that the sea surface is correct with the terrain coastline?
Do I assign shaders to this now in order to get an ocean?

monks

Dune

Three times 'yes'. And uncheck 'shadows' in the sphere object. You could make a surface shader, no color, with the water shader as it's child as the replacement for the default shader of the sphere. Feed some extra displacement into the surface shader's input (again no color, just displacement). For foam, attach another surface shader between this one and the sphere, and blend this by a power fractal with a foam like pattern. You can color and displace this surface shader any way you want.

monks

#8
Thanks, I'll give your suggestions a try- my terrain doesn't seem to be curving correctly with the planet- I've unchecked flatten terrain first. In the attach you can see it seems to be aligned in the bottom left corner.

Would manually adding georef points correct the projection of a flat terrain? I do have georef points for the project.

I was reading on the boards and people seem to use lake objects quite a lot for seas. Are there disadvantages in doing that?

monks

Dune

I don't know about georef points, never worked with them. You'll get that answered by someone else, no doubt.
The lake object is a (round) flat area, good for smaller terrains near 0/0/0, but not for whole planets. You could also use a (square) plane object as the basis for a lake, which has advantages (it can be tilted).

monks

Maybe the problem in the pic is the one that Ryan mentioned. I didn't think it'd be that severe, but then this terrain is covering very large real world extents. I 'm considering the goereferenced route. In the long run it'll probably work out better to set up a tgd for my project data.

I set up the sphere as you suggested Dune, but I can't see any evidence of a water shader in the preview.
I opened up the sphere shader, and changed the parent shader from the default to a Surface layer -> input node of water shader -> sphere shader. I changed the sphere radius to 1.2 just in case it was hidden underneath the planet shader.

Ah, looking at the sphere the default created does not share the same radius as the planet by default. It's only a sphere after all, that makes sense. I'm using the centre and radius for the planet now, and I'm seeing water in the preview.

monks

monks

I tried using the georeffed terrain approach following Ryans's excellent tutorial but I don't think it has any real advantages for me, and it also adds a few complications too.
So I'll revert back to a flat heightfield. I don't think the sea as a sphere will work on such a large flat terrain extent. If I set my terrain to smaller real world extents, the curvature vs plane mismatch would be less of a problem but the whole point of this render is to capture the scale, so I think using image map shaders for the water is the simplest way to do it.

monks

monks

I've been doing a bit of reading and experimenting.
I've tried the sphere with a water shader and unfortunately the terrain must be distorted when applied to the planet surface as it does not match the coastline. I've also tried a lake shader but that gives a flat surface so that's not suitable either.
Is it possible to just apply a water shader as a surface using an image shader as a mask?

monks

freelancah

Have you checked this thread: http://forums.planetside.co.uk/index.php?topic=8793.15 ? Basically similar solution but change the paint shader to image map..

monks

I'll take a look at this thanks freelancah. Another thing I could try is setting my terrain size smaller and see if the sphere object matches up better.

monks