using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Rendering; namespace UnityEngine.Experimental.Rendering.HDPipeline { // Keep this class first in the file. Otherwise it seems that the script type is not registered properly. [Serializable] public sealed class VisualEnvironment : VolumeComponent { public SkyTypeParameter skyType = new SkyTypeParameter(SkyType.None); public FogTypeParameter fogType = new FogTypeParameter(FogType.None); public void PushFogShaderParameters(CommandBuffer cmd, FrameSettings frameSettings) { switch (fogType.value) { case FogType.None: { AtmosphericScattering.PushNeutralShaderParameters(cmd); break; } case FogType.Linear: { var fogSettings = VolumeManager.instance.stack.GetComponent(); fogSettings.PushShaderParameters(cmd, frameSettings); break; } case FogType.Exponential: { var fogSettings = VolumeManager.instance.stack.GetComponent(); fogSettings.PushShaderParameters(cmd, frameSettings); break; } } } } // TODO instead of hardcoding this, we need to generate the information from the existing sky currently implemented. public enum SkyType { None, HDRISky, ProceduralSky } [Serializable] public sealed class SkyTypeParameter : VolumeParameter { public SkyTypeParameter(SkyType value, bool overrideState = false) : base(value, overrideState) { } } }