Planetside Software Forums

General => Terragen Discussion => Topic started by: gasbutan on November 18, 2019, 04:21:08 PM

Title: through the surface
Post by: gasbutan on November 18, 2019, 04:21:08 PM
Has anyone ever tried to produce an image like this in Terragen ?
I tried different techniques using just the lake, a plane or a card, or even a cube with a glass shader for the water.

Thx

vue42_1ck.jpg
Title: Re: through the surface
Post by: Dune on November 19, 2019, 02:17:30 AM
Lake, plane, card sphere would all work, I'd expect (as they could have no shadow), with a glass shader (maybe doublesided?), but you didn't succeed?
Title: Re: through the surface
Post by: WAS on November 19, 2019, 02:54:20 AM
Well you actually reminded me I have a test I wanted to whenever I got ability to animate which is a displaced plane with glass shader for a underwater effect like you got going on here. I never did do anything with it. Did it a long time ago when doing a underwater scene with some fish cards.
Title: Re: through the surface
Post by: gasbutan on November 19, 2019, 04:32:07 PM
Thank you, Dune for your recommendations.

Here are some test renders:

1. Lake
test016d_lake.jpg

2. Plane
test016d_plane.jpg

3. Cube (camera inside the cube)
test016d_cube.jpg


All objects have a glass shader with double sided ON.
Title: Re: through the surface
Post by: WAS on November 19, 2019, 05:16:00 PM
Quote from: gasbutan on November 19, 2019, 04:32:07 PMThank you, Dune for your recommendations.

Here are some test renders:

1. Lake
test016d_lake.jpg

2. Plane
test016d_plane.jpg

3. Cube (camera inside the cube)
test016d_cube.jpg


All objects have a glass shader with double sided ON.

This is quite interesting. Plane seems to provide the best effect though is it me or is the object parts being individually displaced?
Title: Re: through the surface
Post by: Dune on November 20, 2019, 02:37:00 AM
I did a little test yesterday, and found that lake doesn't work properly, but an inverted plane (or sphere) does. I also set glass shader to single-sided and an inverted decay distance. Some reeds in water, some palms on shore, which can both be seen.
I must say, I find the reflection of the trout (courtesy of Doug Campbell) rather vague (though that vagueness was better visible without all the reeds).
Path tracer nicely blurs everything above water, this is a standard render.
Title: Re: through the surface
Post by: gasbutan on November 20, 2019, 03:18:28 AM
@WAS:  yes, the plane shows the strongest effect. Nevertheless it is not what I expected.

@Dune:  Wow, this really looks good. Thank you, I will try this setup.
Title: Re: through the surface
Post by: Hannes on November 20, 2019, 07:40:48 AM
Quote from: Dune on November 20, 2019, 02:37:00 AMI did a little test yesterday, and found that lake doesn't work properly, but an inverted plane (or sphere) does. I also set glass shader to single-sided and an inverted decay distance
Wow, that's smart! Cool, Ulco.
Title: Re: through the surface
Post by: WAS on November 20, 2019, 02:15:49 PM
Quote from: Dune on November 20, 2019, 02:37:00 AMI did a little test yesterday, and found that lake doesn't work properly, but an inverted plane (or sphere) does. I also set glass shader to single-sided and an inverted decay distance. Some reeds in water, some palms on shore, which can both be seen.
I must say, I find the reflection of the trout (courtesy of Doug Campbell) rather vague (though that vagueness was better visible without all the reeds).
Path tracer nicely blurs everything above water, this is a standard render.

Perhaps a secondary reflection surface without heightlights would help bring out the under-side reflections. I seem to recall you suggestion this method before with just the water surface plane to give it a better "watery look". Cool to see it in action. Pretty sure that's where I tried a plane for the camera and warping the whole scene (like underwater stuff in games).
Title: Re: through the surface
Post by: gasbutan on November 20, 2019, 02:54:49 PM
It works, great!
Thanks for the assistance !

Underside reflections are an interesting challenge. It would be interesting how to manage total internal reflection effects.
The surface close to the camera should be transparent, whereas parts of the surface at a greater distance should be reflective.
I think I have to start some research.... ;D

test016e.jpg
Title: Re: through the surface
Post by: Dune on November 21, 2019, 02:42:32 AM
You could use a distance mask to set further away to just reflection and close-by to transparent. That is what I often do in topdown water scenes to decrease rendertime. I don't know if the glass shader would take care of that itself. Water shader might, but I'm not sure actually.
Title: Re: through the surface
Post by: gasbutan on November 21, 2019, 03:32:07 AM
Distance mask is a good idea. I will try that.
On the othe hand it doesn't only depend on the distance but on the angle between lightray and the surface, and this might change with the waves. So you will have a transition between transparency and reflection...
Title: Re: through the surface
Post by: Matt on November 21, 2019, 02:23:32 PM
Proper refraction and internal reflection should work if the surface normal is facing upwards and the camera is below it. Displaceable surfaces like Plane and Lake aren't visible like this because of back-face culling (at the time of writing, v4.4), but the non-displaceable Card should work with a rotation of -90 on X. Then you don't need to fake the reflectivity, it'll be physically correct internal reflection.
Title: Re: through the surface
Post by: WAS on November 21, 2019, 02:55:26 PM
Quote from: Matt on November 21, 2019, 02:23:32 PMProper refraction and internal reflection should work if the surface normal is facing upwards and the camera is below it. Displaceable surfaces like Plane and Lake aren't visible like this because of back-face culling (at the time of writing, v4.4), but the non-displaceable Card should work with a rotation of -90 on X. Then you don't need to fake the reflectivity, it'll be physically correct internal reflection.


Ohh, that means a few of my old underwater scenes should work fine. I was using just a card with water, though would need to disable the secondary card for shadows.
Title: Re: through the surface
Post by: gasbutan on November 21, 2019, 05:27:13 PM
Thank you, Matt for the valuable note. I will experiment with this settings.
Title: Re: through the surface
Post by: Matt on November 21, 2019, 05:43:45 PM
As Dune says, you also need to set the Water Shader's "decay distance" to a negative number (e.g. -1) to disable the effect, otherwise the refracted sky will become black.
Title: Re: through the surface
Post by: gasbutan on November 21, 2019, 05:49:14 PM
ok, thx
Title: Re: through the surface
Post by: gasbutan on November 22, 2019, 01:58:06 AM
Just one question:
What does it mean "non displaceable card"?
Isn't it possible to create waves on the surface with the card object?
Title: Re: through the surface
Post by: Dune on November 22, 2019, 02:20:21 AM
That was just what I was going to remark; a non-displacable object doesn't do waves, so you just have to use a plane or sphere. I did notice that if you lower transparency, reflections are better, but you don't really want that loss of transparency. Also, when increasing reflection color, reflection is intensified, but may get too light.
Title: Re: through the surface
Post by: gasbutan on November 22, 2019, 02:30:22 AM
Thx for clarification.
This means the card will produce a sharp line between reflection and transparency, which will not look very natural.
It should look more like this:
https://photos.com/featured/underwater-view-of-tropical-sea-kim-westerskov.html
Title: Re: through the surface
Post by: Dune on November 22, 2019, 02:42:53 AM
Yes, that was something I've been trying to achieve yesterday too. I hope we'll find something that works.
Title: Re: through the surface
Post by: Matt on November 22, 2019, 01:53:47 PM
The Card is not displaceable but displacement shaders will perturb the surface normal (bump mapping) so you can still get the appearance of waves.

It's UV mapped, so this changes the texture coordinates. If you want your shaders to work the same as they do on the Plane, use a shader to convert to world space texture coordinates. Use a Transform Input Shader after your shaders or a Tex Coords From XYZ before your shaders.
Title: Re: through the surface
Post by: gasbutan on November 22, 2019, 06:26:51 PM
Much better now.
Thank you, Matt!

test023a.jpg
Title: Re: through the surface
Post by: gasbutan on November 22, 2019, 07:19:47 PM
one more test render:

test021h.jpg
Title: Re: through the surface
Post by: Dune on November 23, 2019, 02:34:14 AM
Cool. Glad it works. Never thought that bump would be enough on a card. Reflections look much more defined than with a plane or sphere anyway. I wonder why that is, though.
Title: Re: through the surface
Post by: gasbutan on November 24, 2019, 04:02:13 PM
and now combined with some (fake) caustics:

test021i.jpg
Title: Re: through the surface
Post by: Dune on November 25, 2019, 02:15:22 AM
Great job. Can you explain how you did the caustics? Would it be possible to get light shafts through this fake caustics?
Title: Re: through the surface
Post by: gasbutan on November 25, 2019, 02:41:28 AM
Thank you.
Caustics are made by a second card object slightly above the water surface. The opacity of the card is linked to an imagemap. 
"Visible to camera" and "visible to other rays" should be deactivated, "cast shadows" has to be activated.
I don't know if light shafts are possible in this configuration, I have to try.
Title: Re: through the surface
Post by: Dune on November 25, 2019, 07:41:18 AM
Thank you. The thing with opacity is that it's either black or white, no greys. I used a 2D cloud layer.
Title: Re: through the surface
Post by: WAS on November 25, 2019, 11:43:53 AM
Quote from: Dune on November 25, 2019, 07:41:18 AMThank you. The thing with opacity is that it's either black or white, no greys. I used a 2D cloud layer.

It can have half tones like I argued with Matt having the same issue and my PF caustics and image maps, and fire. It's just very sensitive. Values need to be well above 0.5 where TG makes things straight transparent, so you gotta visualize this higher contrast in your image editor of PFs .
Title: Re: through the surface
Post by: gasbutan on November 25, 2019, 11:53:55 AM
Quote from: WAS on November 25, 2019, 11:43:53 AM
Quote from: undefinedThank you. The thing with opacity is that it's either black or white, no greys. I used a 2D cloud layer.

It can have half tones like I argued with Matt having the same issue and my PF caustics and image maps, and fire. It's just very sensitive. Values need to be well above 0.5 where TG makes things straight transparent, so you gotta visualize this higher contrast in your image editor of PFs .


I also think half tones are possible, if you look at my render above...
Title: Re: through the surface
Post by: Dune on November 25, 2019, 12:11:57 PM
Yes, you're right, and I saw that as well. I had the impression it was still just black until 0.5 and white above (it used to be like that). Have to test that better. Or it's just that it's combined with water/glass that it does have greytones.
Title: Re: through the surface
Post by: WAS on November 25, 2019, 01:31:20 PM
Quote from: Dune on November 25, 2019, 12:11:57 PMYes, you're right, and I saw that as well. I had the impression it was still just black until 0.5 and white above (it used to be like that). Have to test that better. Or it's just that it's combined with water/glass that it does have greytones.

My fire was just PF on a card, and image map caustics were just a card under the water plane.
Title: Re: through the surface
Post by: Dune on November 26, 2019, 01:47:44 AM
Wasn't the fire taken through a glass shader? Just opacity by default shader?
Title: Re: through the surface
Post by: WAS on December 02, 2019, 02:05:36 AM
Anyone having issues with cloud layers creating hard black shadows when it's just a soft haze?

I'm not sure what to do about it. There is a card for the water surface, and a card for the soft water shadow caustic effect form the water shaders displacement. The Water Surface card is using a merge shader and a distance shader to mix two different water surfaces, one transparent, and one opaque on dark colour.

Turned up the cloud density so that the shadow is as prominent as possible.
Title: Re: through the surface
Post by: WAS on December 02, 2019, 02:45:27 PM
Quote from: WAS on December 02, 2019, 02:05:36 AMAnyone having issues with cloud layers creating hard black shadows when it's just a soft haze?

I'm not sure what to do about it. There is a card for the water surface, and a card for the soft water shadow caustic effect form the water shaders displacement. The Water Surface card is using a merge shader and a distance shader to mix two different water surfaces, one transparent, and one opaque on dark colour.

Turned up the cloud density so that the shadow is as prominent as possible.

This seems to be caused by the invisible card shadows interacting with the secondary of the cloud layer (shadows?). I'm not sure how to overcome this without using a cloud layer. I find it interesting because the card invisible, and not visible to other rays.