- Home /
Question by
Virus73 · Sep 08, 2021 at 12:54 PM ·
renderinggraphicspost processingfogvolumetric
can't change color of volumetric fog
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.HighDefinition;
public class EnvironmentManager : MonoBehaviour {
[SerializeField] private Volume _volume;
[SerializeField] private Color _green;
[SerializeField] private Color _yellow;
[SerializeField] private Color _white;
[SerializeField] private Color _black;
private Fog _fog;
string _currentBiome;
private void Start()
{
_volume.sharedProfile.TryGet(out _fog);
}
private void OnTriggerEnter(Collider other)
{
_currentBiome = other.tag;
switch (_currentBiome)
{
case "Plains":
_fog.albedo = new ColorParameter(_green, true);
break;
case "Desert":
_fog.albedo = new ColorParameter(_yellow, true);
break;
case "Arctic":
_fog.albedo = new ColorParameter(_white, true);
break;
case "Dungen":
_fog.albedo = new ColorParameter(_black, true);
break;
}
}
I
When I try changing the albedo on the inspector while in playmode, it changes accordingly but when I use this script, it changes in inspector but not in the actual game
capture.png
(36.6 kB)
Comment