Planetside Software Forums

General => Terragen Discussion => Topic started by: ackdoh on February 10, 2020, 05:42:55 PM

Title: Clipping Easy Clouds, artifacts in the back
Post by: ackdoh on February 10, 2020, 05:42:55 PM
Heyo All,

Trying to clip a cloud based on camera distance in Z. I'm getting the effect I want in the foreground, but I'm also getting artifacts of distant clouds that should be clipped (in red) showing up in the render that look like small 'ungrown' cloud distant formations. Any other way to get a cleaner clipping to get just what you want of a portion of clouds? Attached image.

cloud-clip.jpg
Title: Re: Clipping Easy Clouds, artifacts in the back
Post by: Matt on February 10, 2020, 06:40:24 PM
What are your clipping settings on the Distance Shader? I'm not sure if changing those will fix it, but give it a try. I'd also like to see the setup, even if you solve the problem, to see if there's some way I can make the masking feature work better.
Title: Re: Clipping Easy Clouds, artifacts in the back
Post by: Matt on February 10, 2020, 06:42:31 PM
Another way to clip clouds is using Render Layers. They have options to set clipping distances (but bear in mind that they don't work with terrains at the moment).
Title: Re: Clipping Easy Clouds, artifacts in the back
Post by: ackdoh on February 10, 2020, 06:58:10 PM
Sure, here you go Matt! This is what it looks like on the side camera, where you can see on the left has some remnants of clouds bits on the floor, while the right is behind camera. I have one shot camera for the animation, and a static camera for the distance shader clipping.

The default near/far clips the foreground to far distance, but I wanted to keep foreground, and clip distance. I ended up inverting the Near/Far to achieve that idea. Stuck with Planar mode rather than spherical (both images attached) since planar was keeping more of the original result which I wanted.


I'll try the render layers method as well.  Could I also use a piece of geometry, such as a sphere, to contain the clouds to where I want to see it too?

David

cloud-planar.jpg

cloud-spherical.jpg
Title: Re: Clipping Easy Clouds, artifacts in the back
Post by: ackdoh on February 10, 2020, 07:00:01 PM
Quote from: Matt on February 10, 2020, 06:42:31 PMAnother way to clip clouds is using Render Layers. They have options to set clipping distances (but bear in mind that they don't work with terrains at the moment).

Ah also regarding this, not sure if it'll work since the camera is animating forward, so the clipping would also be animated in the Render Layers since I can't attach a static camera?
Title: Re: Clipping Easy Clouds, artifacts in the back
Post by: WAS on February 10, 2020, 07:05:10 PM
Is your Distance Camera clamped or not? I've had issues with unclamped noise and masking other noise.
Title: Re: Clipping Easy Clouds, artifacts in the back
Post by: Matt on February 10, 2020, 07:07:04 PM
Thanks for the screenshots. I suspect that black doesn't properly clip every cloud, maybe just 99.9% of them. It doesn't catch all of them because of the extreme values generated by the clouds in some places, and due to the way the mask feature is implemented in the Easy Cloud.

Try unchecking "Clip near colour". Normally I'd say to uncheck clipping on the far colour, but in your case it's the opposite because you swapped the near and far distances. You don't need to swap the distances, you can swap the colours instead, i.e. make the far colour black and the near colour white.

Turning off the clipping allows the black colour to continue into negative values beyond the distance where the black occurs, and this should remove even the most persistent clouds in the distance.
Title: Re: Clipping Easy Clouds, artifacts in the back
Post by: Matt on February 10, 2020, 07:12:41 PM
Quote from: ackdoh on February 10, 2020, 06:58:10 PMCould I also use a piece of geometry, such as a sphere, to contain the clouds to where I want to see it too?

Yes. If you want to try that I would suggest using a Card object (because it's super fast to render) and I'd set its visibility to "Holdout" on the Card's "Rendering" tab. Holdout is better than a black shader because it also sets the alpha channel to 0, which you need for compositing with other renders.
Title: Re: Clipping Easy Clouds, artifacts in the back
Post by: WAS on February 10, 2020, 07:15:15 PM
I can't seem to even reproduce this. The coverage here is pretty high, and depth is high to allow for plenty to show through.
Title: Re: Clipping Easy Clouds, artifacts in the back
Post by: WAS on February 10, 2020, 07:17:16 PM
Perhaps some of your easy cloud settings have blown-out the internal function. I've seen it happen like weird disc shapes.
Title: Re: Clipping Easy Clouds, artifacts in the back
Post by: Matt on February 10, 2020, 07:18:12 PM
It doesn't happen very often; it depends the cloud settings.
Title: Re: Clipping Easy Clouds, artifacts in the back
Post by: ackdoh on February 10, 2020, 07:33:28 PM
Tried unchecking Clamp far/near both didn't change anything in this case. Attached are screenshots of Distance cam and Easy Clouds...didn't do anything too much from default on Easy Clouds.

Combining with Card holdout may work in this case though since most of it is covered with the Mask shader/Distance shader setup and I won't see a cut off cloud place in Z since it's just some small remaining bits on the floor. But I'm still curious to see how we can get a clean shape there. Anything out of the ordinary from your setup WAS vs my settings?


Thank you both for checking this out so far!

cloud-cam.jpg

cloud-easy.jpg
Title: Re: Clipping Easy Clouds, artifacts in the back
Post by: WAS on February 10, 2020, 07:34:49 PM
No nothing seems out of the ordinary. I didn't save my attempt but let me try again (heck maybe I'll encounter it).
Title: Re: Clipping Easy Clouds, artifacts in the back
Post by: WAS on February 10, 2020, 07:38:41 PM
So I did some testing, it's the "Cumulus" function that suffers this problem only. The other two function types don't have the mask issue.
Title: Re: Clipping Easy Clouds, artifacts in the back
Post by: ackdoh on February 10, 2020, 07:47:24 PM
Quote from: WAS on February 10, 2020, 07:38:41 PMSo I did some testing, it's the "Cumulus" function that suffers this problem only. The other two function types don't have the mask issue.
Ahh! I can half confirm that lol...for me the Altocumulus also had some bits left, but the Stratocumulus didn't have anything.

Also, changed the Model from TG 3.9.07 to 3.9.04 and they didn't exhibit any remaining bits either in any Cloud Types.
Title: Re: Clipping Easy Clouds, artifacts in the back
Post by: WAS on February 10, 2020, 11:13:48 PM
Quote from: ackdoh on February 10, 2020, 07:47:24 PM
Quote from: WAS on February 10, 2020, 07:38:41 PMSo I did some testing, it's the "Cumulus" function that suffers this problem only. The other two function types don't have the mask issue.
Ahh! I can half confirm that lol...for me the Altocumulus also had some bits left, but the Stratocumulus didn't have anything.

Also, changed the Model from TG 3.9.07 to 3.9.04 and they didn't exhibit any remaining bits either in any Cloud Types.
Good digging. Matt should be able to fix it it I'm sure.