Hello, I’m trying to create a forest scene with fog, but I want the vertical fog to be thicker than the horizontal fog, so that you can see some distance along the ground but when looking up the tops of the trees are obscured.
Is there any way to adjust the default fog (exponential squared in this case) so that the vertical density is higher than the horizontal density?
If not, can anyone recommend a way to add additional fog that gets thicker the further away it is from the ground?
attach this script to the camera
it increases density when camera looks up , adjust the amplitude by Amplitude variable set minimum fog density by Min Amount variable
using UnityEngine;
using System.Collections;
public class fogcontrol : MonoBehaviour {
public float amplitude = 0.00001f;
public float minAmount = 0.001f;
// Update is called once per frame
void Update () {
if (transform.localRotation.eulerAngles.x > 90f ) {
RenderSettings.fogDensity = (-transform.localRotation.eulerAngles.x + 360) * amplitude + minAmount;
} else
{
RenderSettings.fogDensity = minAmount;
}
}
}