Distance Shader to control clouds fading in then back out

Started by D.A. Bentley (SuddenPlanet), August 22, 2018, 01:18:43 PM

Previous topic - Next topic

D.A. Bentley (SuddenPlanet)

I have been trying to figure out how the distance shader works as seen here:
https://planetside.co.uk/wiki/index.php?title=Distance_Shader

I think I am finally starting to understand how to use it connected to a Density fractal and a Camera, but at times I have had it disconnected from any cameras, and it still seemed to have some affect on the clouds (I discovered this because I deleted the distance shader and the clouds changed).  I would have thought that if the distance shader wasn't connected up to a camera, that it wouldn't do anything.

A second problem I had/have is with only two colors (Black/White) to use in the distance shader there doesn't seem to be a way to have the clouds fade out near the camera as well as far away from the camera.  The distance shader is used like a mask (alpha channel) so setting the near color to white, and the far color to black can be used to have the clouds fade in the far distance, which is good for keeping the clouds from going to far back into the horizon.  The problem is I want to also have the clouds fade out near the camera, so essentially I could have a section of clouds fading in and then back out, but to do this I would need a distance shader with a near, middle, and far color like a gradient.  Right?

If so, would it be possible to expand the functionality of the distance shader to have more than 2 colors (Matt)?  Or is there another way to do this that is simple?

Derek

cyphyr

Couldn't you use a circular Simple Shape Shader instead. You could stack several on top of each other and have clouds fading in and out as many times as you need.
Add a bit of fractal warp for variation.
www.richardfraservfx.com
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 5950X OC@4Ghz, 64Gb (TG4 benchmark 4:13)

D.A. Bentley (SuddenPlanet)

Not sure how I would use a simple shape circle, since the planet is spherical and I am rendering with a spherical camera (Skybox renderings).
I see what you are getting at though.  I guess I could localize all my clouds and just place them around where I need to fill in the entire 360 space which would give me the ability to set a Radius and Falloff.  I was just looking for a simple solution to affect all clouds in my scene though.

Any other ideas?

Thanks,

Derek



WAS

#3
Additionally you can just use two distance shaders. Also on top of adjusting the fading slider values, you can go above white (>1) to brighten the mask. As well as going below black (<0) for near colour.

D.A. Bentley (SuddenPlanet)

Oh, that's perfect WAS!  Exactly what I was looking for. Thanks!

Derek


bobbystahr

Really hope you post the results here, I'd never considered this.
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

D.A. Bentley (SuddenPlanet)

#7
Quote from: bobbystahr on August 23, 2018, 10:00:50 AM
Really hope you post the results here, I'd never considered this.

My Distance Shader Doughnut!  Thanks WAS!!!
[attachimg=1]
[attachimg=2]

bobbystahr

something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist