using System; using System.Collections.Generic; using UnityEngine; using UnityEngine.Rendering.HighDefinition; using UnityEngine.Rendering; using UnityEditor.ShaderGraph; using System.Linq; using UnityEditor.Rendering.HighDefinition.ShaderGraph; // Include material common properties names using static UnityEngine.Rendering.HighDefinition.HDMaterialProperties; namespace UnityEditor.Rendering.HighDefinition { /// /// The UI block that represents fog volume option for materials. /// public class FogVolumeUIBlock : MaterialUIBlock { static class Styles { public static GUIContent FogVolumeHeader = new GUIContent("Fog Volume Options", "Controls the settings of the fog."); } MaterialProperty blendMode; MaterialProperty singleScatteringAlbedo; MaterialProperty fogDistance; /// /// Create the UI block for the fog volume material type. /// /// public FogVolumeUIBlock(ExpandableBit expandableBit) : base(expandableBit, Styles.FogVolumeHeader) {} /// /// Loads the material properties for the block. /// public override void LoadMaterialProperties() { blendMode = FindProperty(FogVolumeAPI.k_BlendModeProperty); singleScatteringAlbedo = FindProperty(FogVolumeAPI.k_SingleScatteringAlbedoProperty); fogDistance = FindProperty(FogVolumeAPI.k_FogDistanceProperty); } /// /// GUI callback when the header is open /// protected override void OnGUIOpen() { materialEditor.ShaderProperty(singleScatteringAlbedo, FogVolumePropertyBlock.Styles.singleScatteringAlbedo); materialEditor.ShaderProperty(fogDistance, FogVolumePropertyBlock.Styles.fogDistance); materialEditor.ShaderProperty(blendMode, FogVolumePropertyBlock.Styles.blendMode); } } }