Planetside Software Forums

General => Terragen Discussion => Topic started by: Dune on February 18, 2021, 05:13:03 AM

Title: cloud under glass impossible?
Post by: Dune on February 18, 2021, 05:13:03 AM
I can't seem to get clouds to show up under a no shadow plane/sphere with just a glass shader (as seen from above), even with subdiv settings set to 1, and/or refraction set to 1, double sided or single side. Is it impossible, or am I doing something wrong?
Title: Re: cloud under glass impossible?
Post by: KlausK on February 18, 2021, 06:37:37 AM
Hi Ulco,
something like this, perhaps?
I used a Displaceable Plane (don`t know if that makes a difference, just a habit).
Decay Distance is set to a really high value in the Glass shader.

CHeers, Klaus
Title: Re: cloud under glass impossible?
Post by: Dune on February 18, 2021, 06:56:53 AM
I'll have a look, thanks Klaus!
Title: Re: cloud under glass impossible?
Post by: Dune on February 18, 2021, 10:45:05 AM
No, it's not working as expected. What I forgot to mention is that I need just primary cloud. If you turn off secondary, it won't show up at all.

What I'm after is this. But this is tricked by a cloud and a duplicated upside-down heron ;)
Title: Re: cloud under glass impossible?
Post by: WAS on February 18, 2021, 01:41:46 PM
Definitely possible cause I put a whole forest, clouds, mountains, into a snow globe.
Title: Re: cloud under glass impossible?
Post by: Dune on February 19, 2021, 02:38:47 AM
Well if you can come up with a solution, I'd be happy. The cloud method is very handy as stand-in for missing volumetrics in water, but it needs to be viewable through a reflective transparent plane/lake/sphere. And preferably as sharp as if the plane wasn't there.
Title: Re: cloud under glass impossible?
Post by: WAS on February 19, 2021, 01:34:43 PM
I dig out the TGD and see if something is changed
Title: Re: cloud under glass impossible?
Post by: Tangled-Universe on February 19, 2021, 02:12:58 PM
Quote from: Dune on February 18, 2021, 10:45:05 AMIf you turn off secondary, it won't show up at all.

Doesn't that make sense, considering that underneath a refractive surface, the cloud only receives secondary rays?
Title: Re: cloud under glass impossible?
Post by: WAS on February 19, 2021, 02:35:02 PM
Isn't secondary rays shadow rays? If glass/water isn't producing shadows, you'd think it'd have no interaction.

Or is THAT the actual problem. Glass/water culls shadows.
Title: Re: cloud under glass impossible?
Post by: WAS on February 19, 2021, 03:38:51 PM
So it does work, you jut need high quality, and also high jitter (seems counterintuitive) so that the sampler can sample better slices on Y I guess. Though bubbles in ice are often undulating on Y IRL. May be more realistic mixing in a tighter solid high jitter one with a larger low jitter one for the columnar like effect.
Title: Re: cloud under glass impossible?
Post by: Tangled-Universe on February 19, 2021, 04:06:18 PM
Secondary rays are all rays except primary. This may sound cheeky perhaps, don't mean to be cheeky, but as soon as a primary ray hits a volume/surface and bounces it undergoes a change and becomes a secondary ray.
At least, that's what I understood of the concept. Basically primary means visible to camera and secondary visible to other rays.
This was why I thought that disabling secondary in the cloud turns the clouds invisible, because it would make the cloud invisible to the refracted rays from the water plane/object.
Title: Re: cloud under glass impossible?
Post by: WAS on February 19, 2021, 06:11:28 PM
I guess that would make sense, then. Cause you can turn off the primary, and secondary will produce a primary type effect. Interesting.
Title: Re: cloud under glass impossible?
Post by: Dune on February 20, 2021, 02:39:45 AM
It may work that way in TG, but it shouldn't. If you have a sheet of glass in real world and someone is smoking a fat sigar outside your window, you'll see the smoke alright ;)
Too bad if it works that way, so end of experiment.
Title: Re: cloud under glass impossible?
Post by: Tangled-Universe on February 20, 2021, 07:02:55 AM
Yes and no Ulco... In your example and probably in general, the smoke you see at the other side of the window, is also secondary rays and beyond. Sun -> atmosphere -> smoke -> glass window -> eye.
I think it's a computational consideration made by Matt.
Title: Re: cloud under glass impossible?
Post by: Dune on February 20, 2021, 07:45:04 AM
Well, if you look at it that way, even looking through the lens of your eye would mean everything outside the eye is secondary. It might indeed be a computational compromise.
Title: Re: cloud under glass impossible?
Post by: WAS on February 20, 2021, 02:23:21 PM
I jus wish you could turn off the shadows some way. It would work fine if not for streaks of shadows all over.
Title: Re: cloud under glass impossible?
Post by: Dune on February 21, 2021, 01:43:32 AM
I'm still wondering why this works that way. What if one looks out a window in TG; are primary clouds turned into secondary and only then visible? Maybe overriding the shadow by other variables within the cloud node makes it appear sharp and bright enough (in case of airpockets). There must be a way to see sharp (primary) clouds behind glass....
Title: Re: cloud under glass impossible?
Post by: WAS on February 21, 2021, 01:56:19 PM
I agree here definitely. This seems strange from just a head-on non-specialized use scenario.

Btw here is one of the examples I did. Viewed from above the long bubbles seem more stout due to refraction. If you view from the side of the cube you can see they are much more elongated in the volume. Also I cut off the tops pretty hard but still seem to be rounded pointed tops as if un-masked voronoi noise. I don't know.

Then of course, the shadow streaks everywhere.
Title: Re: cloud under glass impossible?
Post by: Dune on February 22, 2021, 02:24:20 AM
I'll have a go at this again, and also see what you've done. Probably the same as I did.
Title: Re: cloud under glass impossible?
Post by: Dune on February 22, 2021, 10:53:19 AM
It only works with secondary cloud on, and it's far from perfect. Very slow too, so I'll abandon this, and wait for real volumetrics!
Title: Re: cloud under glass impossible?
Post by: WAS on February 22, 2021, 02:51:13 PM
Yeah it's a bit slow, slower then you'd expect. I can render the ice in 21 seconds, but with clouds it's 2:27. Oof.
Title: Re: cloud under glass impossible?
Post by: WAS on February 22, 2021, 03:17:25 PM
Interestingly, I it seems the glass shader with double sides, doesn't work when it's horizontal???

I was going to attempt to fake volume with clouds and stuff and try just a glass shader for reflection and stuff, but.... humm. I tried cube, and a plane and gets the same result with a vanilla glass shader with only double sided checked... The plane takes up the whole viewport here, but get this strange blue sky reflection only near the camera in a circle. o.O

Turning off visible rays fixes the blue issue. Strange. Clouds aren't even enabled, just the atmosphere volume present and sun.
Title: Re: cloud under glass impossible?
Post by: WAS on February 22, 2021, 05:20:33 PM
Double sided glass with rays disabled in plane. The clouds follow alt restrictions and appear more deep without the refraction. V2 cloud simulating water depth as that's all really the water depth effect really is (in appearance). Render time is ridiculous though. 10m compared to 2m
Title: Re: cloud under glass impossible?
Post by: Dune on February 23, 2021, 02:08:05 AM
Yes, I got the same strange result with double-sided glass. I quit!
Title: Re: cloud under glass impossible?
Post by: Kadri on February 23, 2021, 09:35:11 AM
Ulco this is not what you are after and you have thought about it probably but using real 3d bubble objects as a population could be another approach. Making them is easy. The look is another thing of course like the masked opacity sliced object.
Title: Re: cloud under glass impossible?
Post by: Dune on February 24, 2021, 02:17:22 AM
Thanks Kadri. Yes, either of that might be the way. But it's not that I really need bubbles, I only wanted to see if it's possible within TG. Torturing out the impossible ::)