using System;
using UnityEngine;

[Serializable]
public class DofDiffusionBloomOverlayParam
{
	public enum DofDiffusionBloomType
	{
		None,
		DofBloom,
		DiffusionDofBloom,
		Bloom,
		DiffusionBloom,
		Dof,
		OldDof,
		OldDofFastBloom,
		OverlayOnly
	}

	public enum BloomScreenBlendMode
	{
		Screen,
		Add
	}

	[SerializeField]
	private DofDiffusionBloomType _useDofDiffusionBloomType;

	[SerializeField]
	private bool _isEnableOldDof;

	[SerializeField]
	private bool _isEnableDof;

	[SerializeField]
	private bool _isEnableDiffusion;

	[SerializeField]
	private bool _isEnableBloom = true;

	[Header("Rich DOF")]
	public DepthBlurAndBloom.DofQuality DofQualityType = DepthBlurAndBloom.DofQuality.OnlyBackground;

	public DepthBlurAndBloom.DofFocalType DofFocalType = DepthBlurAndBloom.DofFocalType.Position;

	[SerializeField]
	private Transform _dofFocalTransfrom;

	[SerializeField]
	private Vector3 _dofFocalPosition = Vector3.zero;

	[SerializeField]
	private float _dofFocalPoint = 1f;

	public float DofSmoothness = 0.5f;

	public float DofFocalSize = 4f;

	public float DofMaxFocalSize;

	public float DofMaxBlurSpread = 1.75f;

	[SerializeField]
	public float DofForegroundSize;

	[SerializeField]
	public DepthBlurAndBloom.DofBlur DofBlurType;

	[Range(0f, 1f)]
	[Header("Rich Bloom")]
	public float BloomDofWeight = 1f;

	[Range(0f, 1.5f)]
	public float BloomThreshold = 0.95f;

	[Range(0f, 15f)]
	public float BloomIntensity = 8f;

	[Range(0f, 10f)]
	public float BloomBlurSize = 2f;

	public BloomScreenBlendMode BloomBlendMode;

	[Range(0.1f, 10f)]
	[Header("Diffusion")]
	public float DiffusionBlurSize = 10f;

	[Range(0f, 2f)]
	public float DiffusionBright = 1f;

	[Range(0f, 1f)]
	public float DiffusionThreshold = 0.4f;

	[SerializeField]
	[Range(0f, 2f)]
	public float DiffusionSaturation = 1.2f;

	[SerializeField]
	[Range(0f, 2f)]
	public float DiffusionContrast = 1f;

	[NonSerialized]
	public float DefaultDiffusionThreshold = 0.4f;

	[Range(0f, 1f)]
	public float EndDiffusionThreshold = 0.8f;

	[Range(0f, 85f)]
	public int FadeOutStartFrame = 82;

	[Range(0f, 85f)]
	public int FadeOutEndFrame = 82;

	[NonSerialized]
	public Camera TargetCamera;

	private float _ballBlurPoewrFactor;

	private float _ballBlurBrightnessThreshhold = 1f;

	private float _ballBlurBrightnessIntensity = -1f;

	private float _ballBlurSpread = 1f;

	private bool _isPointBallBlur;

	[SerializeField]
	[Header("ScreenOverlay")]
	private Class3dScreenOverlay _screenOverlay = new Class3dScreenOverlay();

	public bool IsDOF;

	public bool IsBloom;

	public bool IsDiffution;

	public bool IsScreenOverlay;

	public bool IsEnable => _useDofDiffusionBloomType != DofDiffusionBloomType.None;

	public DofDiffusionBloomType UseDofDiffusionBloomType => _useDofDiffusionBloomType;

	public bool IsEnableOldDof
	{
		get
		{
			return _isEnableOldDof;
		}
		set
		{
			_isEnableOldDof = value;
		}
	}

	public bool IsEnableDof
	{
		get
		{
			return _isEnableDof;
		}
		set
		{
			_isEnableDof = value;
		}
	}

	public bool IsEnableDiffusion
	{
		get
		{
			return _isEnableDiffusion;
		}
		set
		{
			_isEnableDiffusion = value;
		}
	}

	public bool IsEnableBloom
	{
		get
		{
			return _isEnableBloom;
		}
		set
		{
			_isEnableBloom = value;
		}
	}

	public bool IsEnableOverlay => ScreenOverlay.IsEnable;

	public bool IsEnableDofAutoDisable { get; set; } = true;

	public Transform DofFocalTransfrom
	{
		get
		{
			return _dofFocalTransfrom;
		}
		set
		{
			_dofFocalTransfrom = value;
			DofFocalType = DepthBlurAndBloom.DofFocalType.Transform;
		}
	}

	public Vector3 DofFocalPosition
	{
		get
		{
			return _dofFocalPosition;
		}
		set
		{
			_dofFocalPosition = value;
			DofFocalType = DepthBlurAndBloom.DofFocalType.Position;
		}
	}

	public float DofFocalPoint
	{
		get
		{
			return _dofFocalPoint;
		}
		set
		{
			_dofFocalPoint = value;
			DofFocalType = DepthBlurAndBloom.DofFocalType.Point;
		}
	}

	public float BallBlurPowerFactor
	{
		get
		{
			return _ballBlurPoewrFactor;
		}
		set
		{
			_ballBlurPoewrFactor = value;
		}
	}

	public float BallBlurBrightnessThreshhold
	{
		get
		{
			return _ballBlurBrightnessThreshhold;
		}
		set
		{
			_ballBlurBrightnessThreshhold = value;
		}
	}

	public float BallBlurBrightnessIntensity
	{
		get
		{
			return _ballBlurBrightnessIntensity;
		}
		set
		{
			_ballBlurBrightnessIntensity = value;
		}
	}

	public float BallBlurSpread
	{
		get
		{
			return _ballBlurSpread;
		}
		set
		{
			_ballBlurSpread = value;
		}
	}

	public bool IsPointBallBlur
	{
		get
		{
			return _isPointBallBlur;
		}
		set
		{
			_isPointBallBlur = value;
		}
	}

	public Class3dScreenOverlay ScreenOverlay => _screenOverlay;
}
