Planetside Software Forums

General => Terragen Discussion => Topic started by: Dune on February 03, 2017, 06:47:18 AM

Title: shadow but no shadow
Post by: Dune on February 03, 2017, 06:47:18 AM
Ok, guys, I've got something to solve. Trying out something with Doug's wonderful trout (thanks again, Doug), but I can't get what I want. That is some nice rays in the water. If I put a shallow but dense patchy cloud layer just above the water level I can get some rays and nice patchy (caustic) light on the bottom. But also these nasty shadows on the water (which is a glass shader masked by distance shader, btw, glass, which I thought would be more appropriate for looking from water to air; distance, because the further away lengthy computations made me stop it halfway).
If I put that cloud just beneath the water plane, there's no rays anymore.
It would of course be easier without or with a much higher water plane, but this is what I like to perfect. How to solve this? Any ideas are very welcome?
Title: Re: shadow but no shadow
Post by: René on February 03, 2017, 10:57:15 AM
That's tough one, and a Catch-22 because you need the shadows to make beams but don't want them on the water. If I'm not mistaken those beams you often see underwater are a result of caustics and not of shadow casting.
The only thing that comes to mind at the moment is an array of spotlights to create the beams.
Underwater scenes are pretty much uncharted territory in Terragen, I hope you'll succeed.
Title: Re: shadow but no shadow
Post by: N-drju on February 03, 2017, 11:20:09 AM
The only idea that comes to my mind is making the cloud invisible somehow and using the "visible to other rays" option on at the same time. In other objects at least this allows for interaction between physical attributes of the object and environment, while the original object may be invisible. So in that case you'll get shadows and all other properties of the overhead cloud without even seeing its source. I don't know if it applies to clouds though... :-\

Alternatively, try to put patchy cloud layer 10 to 20 units higher. Then, mask it in order to cast shadows only in the area that exactly affects your render. I believe this area is over the camera so you don't even see the clouds up there. The rest will be cut and you should get clear view of the sky without loosing caustic shadows (or whatever their name is).
Title: Re: shadow but no shadow
Post by: René on February 03, 2017, 11:22:56 AM
Another crazy idea: get rid of the water plane and create a cloud layer that 'looks' like a water plane. There will be no reflection and you won't be able to look trough it of course but you might be able to retrieve shadows(beams) from it.
Title: Re: shadow but no shadow
Post by: N-drju on February 03, 2017, 11:30:17 AM
Also, isn't it the case that in-built plane object has invisible surface from the bottom...? ???

If it does, you can shove it underneath the cloud layer and make sure the plane itself doesn't cast any shadows. In that case, you should have a clear, transparent plane in place of clouds, but the cloud will still "do their job"...

But I have no TG on me right now, so I'm relying on memory only. ???
Title: Re: shadow but no shadow
Post by: N-drju on February 03, 2017, 11:41:09 AM
Wait... I think I got it.

Why don't you just create a free-floating dense population of small sized objects and make them invisible in the render? THEN put "visible to other rays" on and you should get shadows from these cast into water. :) Delete the clouds of course too...
Title: Re: shadow but no shadow
Post by: Kadri on February 03, 2017, 11:41:28 AM
Yeah many ways to test.
You could try something like this too:
http://www.planetside.co.uk/forums/index.php/topic,12040.msg121402.html#msg121402
But make the clouds more like a water surface and restrict them for where you want them to.

Comping, cheating is the easiest but you don't want this of course :)

Edit: Ulco from Martin's (Danelo) post there...have you tried the "'enable primary" options ?
Title: Re: shadow but no shadow
Post by: cyphyr on February 03, 2017, 12:08:47 PM
Have you looked at the caustic generator program, there's a paid for version (€55) and a free one (with typical limitations)
You could use this to control the volume of a cloud layer. Micht do the trick with some fiddling ...

Paid version
https://www.dualheights.se/caustics/

free version
http://www.softpedia.com/get/Multimedia/Graphic/Graphic-Others/Caustics-Generator.shtml
Title: Re: shadow but no shadow
Post by: Dune on February 03, 2017, 12:44:47 PM
Thanks for all your input, guys. It's a catch-22 indeed. If I place the cloud layer just above the water I get the shadows on the water (but I need them underwater). If I put it underneath, I get the reflections in the water, even if I just use the enable secondary (as that does shadows ánd reflections). I haven't used only primary, as I just want the shadows. And I know it shouldn't be a shadow but an enhanced light effect, like a glow in the cloudwaterhaze and on the stream bottom, but that would even be more difficult I think.
I know the caustics generator, I have it. But I used a warped voronoi to make the cloud, which has kind of the same effect.
I also didn't want to make a cloud water surface, because I like the refraction that the waves cause on parts above water.
A dense pop would be another option (it did cross my mind), but the rays and shadows would be very hard. I also tried a default shader with some opacity fractal, but that would have the same effect, hard shadows. And the objects will take all light out, harder to soften it, I guess.
And clouds indeed don't have a 'visible to other rays' option.
The idea of a masked/localized hard patchy cloud layer outside the frustrum is a good one, but that very much depends on where the sun would need to be. Ah, no that wouldn't work as you would still have the hard shadows on the water.
Array of spotlights...mmm, I have to do some more thinking.
What I did now was make a very thin, very dense cloud layer (2D) just 2cm beneath the water surface, and turned the reflection of the glass shader way down (50%). Playing with colors of the cloud also helped to make them hardly visible in the reflections, and that doesn't really alter the shadow/beam effect.
I also multiplied the max height mask by a distance shader to get more bluish light further away in the murk-cloudhaze.
Rendering now.....
Title: Re: shadow but no shadow
Post by: Dune on February 03, 2017, 12:54:11 PM
Just read this:
"In computer graphics, most modern rendering systems support caustics. Some of them even support volumetric caustics. This is accomplished by raytracing the possible paths of a light beam, accounting for the refraction and reflection. Photon mapping is one implementation of this. Volumetric caustics can also be achieved by volumetric path tracing."
Title: Re: shadow but no shadow
Post by: Hannes on February 03, 2017, 12:58:16 PM
Sounds interesting! Curious to see what you could achieve.
Title: Re: shadow but no shadow
Post by: Tangled-Universe on February 03, 2017, 01:22:12 PM
Just read this:
"In computer graphics, most modern rendering systems support caustics. Some of them even support volumetric caustics. This is accomplished by raytracing the possible paths of a light beam, accounting for the refraction and reflection. Photon mapping is one implementation of this. Volumetric caustics can also be achieved by volumetric path tracing."

TG can't do caustics.

Matt once said that TG possibly could do caustics at insane GI settings, but probably impossible:
http://www.planetside.co.uk/forums/index.php/topic,5133.msg53453.html#msg53453
I tried insane settings for GI (32/32/2) at micropoly detail 1 (back in the days GI cache detail was linked to micropoly detail), but I've never been able to get something which looks like caustics.
Conclusion for me: it can't do caustics.

If I understand correctly a thin layer above the water casts shadows/light beams into the cloud layer below the water, right?
What if you create 2 sunlights? 1 to light the surfaces and 1 to light the atmosphere (cast shadows on surfaces disabled).
If you then disable primary rays for the cloud layer above the water you should still get the secondary from those, which are its shadows/light beams.

I suppose you already tried it this way...?
Title: Re: shadow but no shadow
Post by: Dune on February 03, 2017, 02:05:45 PM
You're right about the caustics. Too bad. I did try another thing just now; add another cloudlayer and project some angled 'caustics' in it, and make the cloud quite light. That makes light beams (instead of shadow beams), but I then still need the shadows on the bottom and all objects.

Right. I don't quite understand how you see that happening with 2 suns. Both surfaces and cloud need to be lighted/shadowed, so one would be enough. I did disable the primary already. The problem still is that you get shadows on the water (surface) if you want to shadow the bottom (surface).
It's a nice challenge anyway.

Edit: well, a bit better perhaps, but not good enough. The small dark splotches in the water are some remains of the cloudshadowlayer which just touch the water I guess.
Title: Re: shadow but no shadow
Post by: Tangled-Universe on February 03, 2017, 02:47:48 PM
The idea, not sure if it works, is that the sun for the cloud layer does not cast shadows on surfaces, thus you won't get shadows of your cloud layer onto your water layer, but it will cast shadows into the atmosphere layer below.
I have to think about this...
Title: Re: shadow but no shadow
Post by: Dune on February 03, 2017, 03:33:23 PM
Yes, but I also need the shadow on the stream bottom, that's the point. I sharpened the 'caustics' light on the bottom, after reviewing some reference. Also increased sun strength to make the caustic appear to be lighter, and the shadow areas the 'normal' strength. Rendering again.

There's another problem with the glass; if you have waves and look kind of alongside the water, you get dark bands.
Title: Re: shadow but no shadow
Post by: Tangled-Universe on February 03, 2017, 03:56:44 PM
Could you upload a simplified version of your setup? Just the water, 2 atmospheres and camera?
I think you're right about my mistake, but I'd like to try and see if I can help out somehow.

The dark bands are possibly a meniscus effect or where light is actually being refracted away from the camera, thus causing black bands.
Title: Re: shadow but no shadow
Post by: Dune on February 03, 2017, 04:17:04 PM
I'll do that tomorrow, am just about to quit for dinner. Thanks, Martin.

Last for today (am I sounding familiar?), still no good.

Title: Re: shadow but no shadow
Post by: N-drju on February 03, 2017, 04:38:34 PM
Could you upload a simplified version of your setup? Just the water, 2 atmospheres and camera?

That would be useful no doubt. I think that the last picture for today doesn't quite make the cut indeed. :( All rays are gone. Shadows not very visible either.

_______________________________________

I just realized that you obviously cannot pull off that trick with thick object population... objects do not have the "visible to other rays" option either. Damn!
Title: Re: shadow but no shadow
Post by: zaxxon on February 04, 2017, 05:51:07 AM
Caustics in TG would be wonderful! Or at least some kind of good 'fake'. I think you've covered some of the aspects of the problem, and maybe there is no solution. Nice experiments regardless.

I put the trout model and the maps up in the File Sharing area here for anyone who wants them.
Title: Re: shadow but no shadow
Post by: Dune on February 04, 2017, 06:44:15 AM
That's a cool gesture of you, Doug.

I've just thought of something else, but that wouldn't throw the light on all ground stuff and there's another problem. It's possible to convert the wave displacement to a mask, after stretching it in Y and rotating by the sun's angle, that could work as a mask for additional illuminated cloud, hence 'rays'. But the origin wouldn't stay the same after rotating, so there's a problem.

I don't know how it would work on an exact copy of the water layer (some masking function added of course) with an invisible setting, but visible to other rays. Would that still throw a shadow in the water? Being exactly where the water plane is you wouldn't have reflection or shadows on top. You'd only need to tell the cloud to receive shadows from surfaces. But the water plane has shadows turned off, for obvious reasons, so that may not work.
And increasing lighness of the shadows parts to the needed value for 'normal' light would make the 'beams' and caustics light up, relatively. I'll try something like that later and upload a file.
Title: Re: shadow but no shadow
Post by: bobbystahr on February 04, 2017, 07:37:10 AM
Have you looked at the caustic generator program, there's a paid for version (€55) and a free one (with typical limitations)
You could use this to control the volume of a cloud layer. Micht do the trick with some fiddling ...

Paid version
https://www.dualheights.se/caustics/

free version
http://www.softpedia.com/get/Multimedia/Graphic/Graphic-Others/Caustics-Generator.shtml

whew, if y want the 64 bit  "pro" version it jumps to 180 EUR...think I'll stay amateur
Title: Re: shadow but no shadow
Post by: bobbystahr on February 04, 2017, 07:37:57 AM
Caustics in TG would be wonderful! Or at least some kind of good 'fake'. I think you've covered some of the aspects of the problem, and maybe there is no solution. Nice experiments regardless.

I put the trout model and the maps up in the File Sharing area here for anyone who wants them.

Heading ther now, thanks Doug...
Title: Re: shadow but no shadow
Post by: Dune on February 04, 2017, 07:53:41 AM
Here's a basic working file. The extra plane+shadow idea doesn't work, as far as I can tell.
The idea is of course to have the shadows/lights of the 'caustics' on all surfaces and cloudmurk except the water plane, also have the stuff above water partly visible through the water and the reflections of fish or whatever on the underside of the water plane, like in some of these references. Tough cooky.
Title: Re: shadow but no shadow
Post by: Kadri on February 04, 2017, 11:49:22 AM

Had a look at your file Ulco.
Finding what you want looked harder.
I just saw that you could use the aurora kind of method to the cloud in the underwater and get rid of the shadow file over water.
One bad thing are the angles. But a metacloud approach could be used for that problem.


Title: Re: shadow but no shadow
Post by: Dune on February 05, 2017, 07:42:10 AM
You can tilt the aurora, but I prefer a method with shadows instead of just lighting the cloud, so it will influence all light underwater, not just the cloud/murk. With a water shader or a single sided glass or even just a reflective shader it's easy to get something nice, but then you don't see anything above water.
Title: Re: shadow but no shadow
Post by: Dune on February 05, 2017, 01:22:55 PM
RDM is at 1, glass shader in front area, reflective more distant. Just the shadow cloud for the 'caustics'.
Title: Re: shadow but no shadow
Post by: zaxxon on February 05, 2017, 02:33:50 PM
They are both brilliant Ulco! The underwater scene works better in my opinion, but the the second definitely shows promise for the technique. The vegetation both under and above is also fantastic!
Title: Re: shadow but no shadow
Post by: Dune on February 05, 2017, 03:17:54 PM
Thanks, Doug. I bent your trout a bit in ZBrush to get another posture, btw. You may have noticed.
Title: Re: shadow but no shadow
Post by: zaxxon on February 05, 2017, 05:28:43 PM
Bend away! I originally had made several 'bent' variations as morph targets as well. I should probably tweak the mouth area of the map a bit as the trout were never meant for some of the close-up poses you've used. It's pretty exciting to see some form of caustics for underwater scenes in TG . Genius use of TG again!
Title: Re: shadow but no shadow
Post by: KyL on February 07, 2017, 05:16:40 AM
very nice render Ulco. I would go a bit more murky but it's quiet nice already.

One cool thing to add could be the chromatic aberration in the caustics to fake the light diffraction. Maybe it's as simple as shifting the r,g and b channel in the map you use!

Cheers!
Title: Re: shadow but no shadow
Post by: Dune on February 07, 2017, 06:28:30 AM
Thanks Kyl. I played with different levels of murkiness, and I wanted to have a quite clear stream. But in a murkier stream you'd see the shafts of light better, so I might do more with it.
The abberation would be interesting to add, but it's not light that's projected on the bottom and fish and veggies, but shadow. Perhaps three differently colored, slightly shifted suns would do the trick  ;)
Title: Re: shadow but no shadow
Post by: bobbystahr on February 07, 2017, 08:43:35 AM
Mind successfully blown...going to bed now.
Title: Re: shadow but no shadow
Post by: Hannes on February 07, 2017, 01:04:00 PM
Perhaps three differently colored, slightly shifted suns would do the trick  ;)

That wouldn't work. It would just mix the colors. I'm pretty sure that you can't create chromatic aberration in TG, which is a bit like looking through a prism. But that would be indeed a postwork effect, that would make it look even more underwaterlike. (Do you say "underwaterlike"?  ???)
Title: Re: shadow but no shadow
Post by: Dune on February 07, 2017, 03:50:04 PM
I wouldn't be so sure about that...... rendering now and I can see some colors in the light appearing.
Title: Re: shadow but no shadow
Post by: Hannes on February 07, 2017, 05:53:38 PM
Curious to see your results. Go for it!!  :)
Title: Re: shadow but no shadow
Post by: Dune on February 08, 2017, 06:11:24 AM
It's not real caustics of course, where the colors would more freely dart around within the lighted areas, but it's a nice effect.
Title: Re: shadow but no shadow
Post by: Hannes on February 08, 2017, 07:34:56 AM
Wow, I didn't expect that! A bit over the top, but cool!
Title: Re: shadow but no shadow
Post by: Dune on February 08, 2017, 12:28:39 PM
Yes, first one was too vague so I shifted the suns a half degree more, perhaps 0.75º will do. Nice method to make a rainbow perhaps.
Title: Re: shadow but no shadow
Post by: Kadri on February 08, 2017, 02:49:44 PM

Interesting indeed.
Title: Re: shadow but no shadow
Post by: fleetwood on February 08, 2017, 03:00:35 PM
Nice experiment.
Title: Re: shadow but no shadow
Post by: j meyer on February 08, 2017, 03:46:15 PM
Cool effect.
Reminds me of our 'stoned glass' experiments from waaay back.
Title: Re: shadow but no shadow
Post by: zaxxon on February 08, 2017, 04:32:31 PM
I think that is fantastic! The prismatic colors are in need of a little taming to be close to natural, but the overall effect is wonderful.
Title: Re: shadow but no shadow
Post by: bobbystahr on February 10, 2017, 08:08:42 AM
Cool effect.
Reminds me of our 'stoned glass' experiments from waaay back.

heh heh heh, yeah a bit...and a brilliant update Ulco!