From skyBox color to fog color

Hi

I’m using the SkyboxBlended shader from the wiki to ( surprise ) fade from one sky to another.

My problem is, say I fade from a prure red sky to a pure blue, that I would like my fog color to change as well. Making the fog color match the sky color.

I’ve been reading the shaderlab documentation over and over trying to figure it out, but I’m lost.

Does anyone have a clever solution for that problem.

Thanks in advance

This would be very interesting to know for the atmospheric simulator community project, too! Strange how things sometimes find themselves…

Just change RenderSettings.fogColor somehow.

I know how to change the fog from a script. But what I don’t know and can’t figure out is how to get that color from the blended skybox shader.

Im so lost

Thanks Aras… i am really eager to learn coding now… never got the drive to do, but it seems to become more and more fun…

I am far from calling myself a coder, but cant you get Pixel-Infos from a raycast, that hits the skybox?

I was thinking something like that. But getting the color value from the shader just seems more logic to me. But again I have never written a shader before.

I’ll look into that raycast stuff.

The skybox is excluded from lighting, so the result should be very exact, i guess.

Hi Alpha-Loup

I just found your atmospheric simulator post, can’t believe a missed that. It looks really cool. I will look into it later today and report back

If it can´t be done through the shader (I don´t know?), I would think you use a specific fog color for sky1 and for sky2. If you know how much time the blending will take I would probably experiment with Color.Lerp on those 2 colors and see what it looks like.

nice idea raoul, I will add to my list of methods to try out