Created
April 9, 2020 17:30
-
-
Save hvent90/c0c9aca703415d6d60b96b5b886bfcc4 to your computer and use it in GitHub Desktop.
Editing Volumetric Fog during runtime
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.Rendering; | |
using UnityEngine.Rendering.HighDefinition; | |
public class VolumetricController : MonoBehaviour | |
{ | |
[Range(-1f, 1f)] | |
public float anistropy; | |
[Range(0, 1)] | |
public float ambientLightProbedimmer = 1; | |
Volume volume; | |
Fog fog; | |
void Start() | |
{ | |
volume = GetComponent<Volume>(); | |
volume.profile.TryGet<Fog>(out fog); | |
} | |
void Update() | |
{ | |
fog.anisotropy.value = anistropy; | |
fog.globalLightProbeDimmer.value = ambientLightProbedimmer; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment