Author Topic: shadow but no shadow  (Read 2062 times)

Offline Dune

  • Member
  • *
  • Posts: 12549
  • Corkscrew Bird
    • www.ulco-art.nl
shadow but no shadow
« 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?
In case you still haven't seen enough of my work: www.ulco-art.nl

Offline René

  • Member
  • *
  • Posts: 280
Re: shadow but no shadow
« Reply #1 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.

Offline N-drju

  • Member
  • *
  • Posts: 809
  • Changes, changes, changes...
Re: shadow but no shadow
« Reply #2 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).
"I don't know what 'pokygon' is but I like it."

Offline René

  • Member
  • *
  • Posts: 280
Re: shadow but no shadow
« Reply #3 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.

Offline N-drju

  • Member
  • *
  • Posts: 809
  • Changes, changes, changes...
Re: shadow but no shadow
« Reply #4 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. ???
"I don't know what 'pokygon' is but I like it."

Offline N-drju

  • Member
  • *
  • Posts: 809
  • Changes, changes, changes...
Re: shadow but no shadow
« Reply #5 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...
"I don't know what 'pokygon' is but I like it."

Online Kadri

  • Member
  • *
  • Posts: 7802
Re: shadow but no shadow
« Reply #6 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 ?
« Last Edit: February 03, 2017, 11:54:47 AM by Kadri »

Offline cyphyr

  • Member
  • *
  • Posts: 3528
    • richardfraser
Re: shadow but no shadow
« Reply #7 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
www.richardfraser.co.uk
/|\

i7 5930 @3.5Ghz, 32Gb
i7 2600k @3.4Ghz, 16Gb
i7 980 @3.33Ghz, 16Gb

Offline Dune

  • Member
  • *
  • Posts: 12549
  • Corkscrew Bird
    • www.ulco-art.nl
Re: shadow but no shadow
« Reply #8 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.....
In case you still haven't seen enough of my work: www.ulco-art.nl

Offline Dune

  • Member
  • *
  • Posts: 12549
  • Corkscrew Bird
    • www.ulco-art.nl
Re: shadow but no shadow
« Reply #9 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."
In case you still haven't seen enough of my work: www.ulco-art.nl

Offline Hannes

  • Member
  • *
  • Posts: 3531
Re: shadow but no shadow
« Reply #10 on: February 03, 2017, 12:58:16 PM »
Sounds interesting! Curious to see what you could achieve.

Online Tangled-Universe

  • Terrevangelist
  • *
  • Posts: 6075
    • CGScenery.com - Terragen Tutorials!
Re: shadow but no shadow
« Reply #11 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...?

Offline Dune

  • Member
  • *
  • Posts: 12549
  • Corkscrew Bird
    • www.ulco-art.nl
Re: shadow but no shadow
« Reply #12 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.
« Last Edit: February 03, 2017, 02:09:47 PM by Dune »
In case you still haven't seen enough of my work: www.ulco-art.nl

Online Tangled-Universe

  • Terrevangelist
  • *
  • Posts: 6075
    • CGScenery.com - Terragen Tutorials!
Re: shadow but no shadow
« Reply #13 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...

Offline Dune

  • Member
  • *
  • Posts: 12549
  • Corkscrew Bird
    • www.ulco-art.nl
Re: shadow but no shadow
« Reply #14 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.
In case you still haven't seen enough of my work: www.ulco-art.nl