using System;
using Cpp2IlInjected;
using UnityEngine;

namespace UnityStandardAssets.ImageEffects
{
	// Token: 0x020005B0 RID: 1456
	[Token(Token = "0x20005B0")]
	[ExecuteInEditMode]
	[AddComponentMenu("Image Effects/Camera/Depth of Field (deprecated)")]
	[RequireComponent(typeof(Camera))]
	public class DepthOfFieldDeprecated : PostEffectsBase
	{
		// Token: 0x06002EF4 RID: 12020 RVA: 0x000642C4 File Offset: 0x000624C4
		[Token(Token = "0x6002EF4")]
		[Address(RVA = "0x13CBBB0", Offset = "0x13CA9B0", VA = "0x1813CBBB0")]
		private void CreateMaterials()
		{
			Material material = this.dofBlurMaterial;
			Shader shader = this.dofBlurShader;
			Material material2 = base.CheckShaderAndCreateMaterial(shader, material);
			this.dofBlurMaterial = material2;
			Material material3 = this.dofMaterial;
			Shader shader2 = this.dofShader;
			Material material4 = base.CheckShaderAndCreateMaterial(shader2, material3);
			this.dofMaterial = material4;
			bool isSupported = this.bokehShader.isSupported;
			this.bokehSupport = isSupported;
			if (this.bokeh && isSupported && this.bokehShader)
			{
				Material material5 = this.bokehMaterial;
				Shader shader3 = this.bokehShader;
				Material material6 = base.CheckShaderAndCreateMaterial(shader3, material5);
				this.bokehMaterial = material6;
			}
		}

		// Token: 0x06002EF5 RID: 12021 RVA: 0x0006436C File Offset: 0x0006256C
		[Token(Token = "0x6002EF5")]
		[Address(RVA = "0x13CBA70", Offset = "0x13CA870", VA = "0x1813CBA70", Slot = "4")]
		public override bool CheckResources()
		{
			do
			{
				bool flag = base.CheckSupport(true);
				Material material = this.dofBlurMaterial;
				Shader shader = this.dofBlurShader;
				Material material2 = base.CheckShaderAndCreateMaterial(shader, material);
				this.dofBlurMaterial = material2;
				Material material3 = this.dofMaterial;
				Shader shader2 = this.dofShader;
				Material material4 = base.CheckShaderAndCreateMaterial(shader2, material3);
				this.dofMaterial = material4;
				bool isSupported = this.bokehShader.isSupported;
				this.bokehSupport = isSupported;
				if (this.bokeh && isSupported && this.bokehShader)
				{
					Material material5 = this.bokehMaterial;
					Shader shader3 = this.bokehShader;
					Material material6 = base.CheckShaderAndCreateMaterial(shader3, material5);
					this.bokehMaterial = material6;
				}
			}
			while (this.isSupported);
			base.ReportAutoDisable();
			return this.isSupported;
		}

		// Token: 0x06002EF6 RID: 12022 RVA: 0x00064438 File Offset: 0x00062638
		[Token(Token = "0x6002EF6")]
		[Address(RVA = "0x13CC060", Offset = "0x13CAE60", VA = "0x1813CC060")]
		private void OnDisable()
		{
			Quads.Cleanup();
		}

		// Token: 0x06002EF7 RID: 12023 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002EF7")]
		[Address(RVA = "0x13CC0B0", Offset = "0x13CAEB0", VA = "0x1813CC0B0")]
		private void OnEnable()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002EF8 RID: 12024 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002EF8")]
		[Address(RVA = "0x13CBE70", Offset = "0x13CAC70", VA = "0x1813CBE70")]
		private float FocalDistance01(float worldDist)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002EF9 RID: 12025 RVA: 0x0006444C File Offset: 0x0006264C
		[Token(Token = "0x6002EF9")]
		[Address(RVA = "0x13CC020", Offset = "0x13CAE20", VA = "0x1813CC020")]
		private int GetDividerBasedOnQuality()
		{
			DepthOfFieldDeprecated.DofResolution dofResolution = this.resolution;
			if (dofResolution == DepthOfFieldDeprecated.DofResolution.Medium || dofResolution == DepthOfFieldDeprecated.DofResolution.Low)
			{
			}
			return 1;
		}

		// Token: 0x06002EFA RID: 12026 RVA: 0x0006446C File Offset: 0x0006266C
		[Token(Token = "0x6002EFA")]
		[Address(RVA = "0x13CC040", Offset = "0x13CAE40", VA = "0x1813CC040")]
		private int GetLowResolutionDividerBasedOnQuality(int baseDivider)
		{
			DepthOfFieldDeprecated.DofResolution dofResolution = this.resolution;
			return baseDivider;
		}

		// Token: 0x06002EFB RID: 12027 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002EFB")]
		[Address(RVA = "0x13CC130", Offset = "0x13CAF30", VA = "0x1813CC130")]
		private void OnRenderImage(RenderTexture source, RenderTexture destination)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002EFC RID: 12028 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002EFC")]
		[Address(RVA = "0x13CB720", Offset = "0x13CA520", VA = "0x1813CB720")]
		private void Blur(RenderTexture from, RenderTexture to, DepthOfFieldDeprecated.DofBlurriness iterations, int blurPass, float spread)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002EFD RID: 12029 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002EFD")]
		[Address(RVA = "0x13CB0E0", Offset = "0x13C9EE0", VA = "0x1813CB0E0")]
		private void BlurFg(RenderTexture from, RenderTexture to, DepthOfFieldDeprecated.DofBlurriness iterations, int blurPass, float spread)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002EFE RID: 12030 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002EFE")]
		[Address(RVA = "0x13CB460", Offset = "0x13CA260", VA = "0x1813CB460")]
		private void BlurHex(RenderTexture from, RenderTexture to, int blurPass, float spread, RenderTexture tmp)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002EFF RID: 12031 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002EFF")]
		[Address(RVA = "0x13CBCD0", Offset = "0x13CAAD0", VA = "0x1813CBCD0")]
		private void Downsample(RenderTexture from, RenderTexture to)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002F00 RID: 12032 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002F00")]
		[Address(RVA = "0x13CA790", Offset = "0x13C9590", VA = "0x1813CA790")]
		private void AddBokeh(RenderTexture bokehInfo, RenderTexture tempTex, RenderTexture finalTarget)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002F01 RID: 12033 RVA: 0x00064484 File Offset: 0x00062684
		[Token(Token = "0x6002F01")]
		[Address(RVA = "0x13CCD50", Offset = "0x13CBB50", VA = "0x1813CCD50")]
		private void ReleaseTextures()
		{
			if (this.foregroundTexture)
			{
				RenderTexture.ReleaseTemporary(this.foregroundTexture);
			}
			if (this.finalDefocus)
			{
				RenderTexture.ReleaseTemporary(this.finalDefocus);
			}
			if (this.mediumRezWorkTexture)
			{
				RenderTexture.ReleaseTemporary(this.mediumRezWorkTexture);
			}
			if (this.lowRezWorkTexture)
			{
				RenderTexture.ReleaseTemporary(this.lowRezWorkTexture);
			}
			if (this.bokehSource)
			{
				RenderTexture.ReleaseTemporary(this.bokehSource);
			}
			if (this.bokehSource2)
			{
				RenderTexture.ReleaseTemporary(this.bokehSource2);
			}
		}

		// Token: 0x06002F02 RID: 12034 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002F02")]
		[Address(RVA = "0x13CACA0", Offset = "0x13C9AA0", VA = "0x1813CACA0")]
		private void AllocateTextures(bool blurForeground, RenderTexture source, int divider, int lowTexDivider)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002F03 RID: 12035 RVA: 0x00064528 File Offset: 0x00062728
		[Token(Token = "0x6002F03")]
		[Address(RVA = "0x13CCF60", Offset = "0x13CBD60", VA = "0x1813CCF60")]
		public DepthOfFieldDeprecated()
		{
		}

		// Token: 0x06002F04 RID: 12036 RVA: 0x000020D3 File Offset: 0x000002D3
		// Note: this type is marked as 'beforefieldinit'.
		[Token(Token = "0x6002F04")]
		[Address(RVA = "0x13CCF10", Offset = "0x13CBD10", VA = "0x1813CCF10")]
		static DepthOfFieldDeprecated()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x0400389A RID: 14490
		[Token(Token = "0x400389A")]
		private static int SMOOTH_DOWNSAMPLE_PASS;

		// Token: 0x0400389B RID: 14491
		[Token(Token = "0x400389B")]
		private static float BOKEH_EXTRA_BLUR;

		// Token: 0x0400389C RID: 14492
		[FieldOffset(Offset = "0x28")]
		[Token(Token = "0x400389C")]
		public DepthOfFieldDeprecated.Dof34QualitySetting quality = (DepthOfFieldDeprecated.Dof34QualitySetting)((ulong)1L);

		// Token: 0x0400389D RID: 14493
		[FieldOffset(Offset = "0x2C")]
		[Token(Token = "0x400389D")]
		public DepthOfFieldDeprecated.DofResolution resolution = (DepthOfFieldDeprecated.DofResolution)((ulong)4L);

		// Token: 0x0400389E RID: 14494
		[FieldOffset(Offset = "0x30")]
		[Token(Token = "0x400389E")]
		public bool simpleTweakMode = true;

		// Token: 0x0400389F RID: 14495
		[FieldOffset(Offset = "0x34")]
		[Token(Token = "0x400389F")]
		public float focalPoint = 1f;

		// Token: 0x040038A0 RID: 14496
		[FieldOffset(Offset = "0x38")]
		[Token(Token = "0x40038A0")]
		public float smoothness = 0.5f;

		// Token: 0x040038A1 RID: 14497
		[FieldOffset(Offset = "0x3C")]
		[Token(Token = "0x40038A1")]
		public float focalZDistance;

		// Token: 0x040038A2 RID: 14498
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x40038A2")]
		public float focalZStartCurve = 1f;

		// Token: 0x040038A3 RID: 14499
		[FieldOffset(Offset = "0x44")]
		[Token(Token = "0x40038A3")]
		public float focalZEndCurve = 1f;

		// Token: 0x040038A4 RID: 14500
		[FieldOffset(Offset = "0x48")]
		[Token(Token = "0x40038A4")]
		private float focalStartCurve = 2f;

		// Token: 0x040038A5 RID: 14501
		[FieldOffset(Offset = "0x4C")]
		[Token(Token = "0x40038A5")]
		private float focalEndCurve = 2f;

		// Token: 0x040038A6 RID: 14502
		[FieldOffset(Offset = "0x50")]
		[Token(Token = "0x40038A6")]
		private float focalDistance01 = 0.1f;

		// Token: 0x040038A7 RID: 14503
		[FieldOffset(Offset = "0x58")]
		[Token(Token = "0x40038A7")]
		public Transform objectFocus;

		// Token: 0x040038A8 RID: 14504
		[FieldOffset(Offset = "0x60")]
		[Token(Token = "0x40038A8")]
		public float focalSize;

		// Token: 0x040038A9 RID: 14505
		[FieldOffset(Offset = "0x64")]
		[Token(Token = "0x40038A9")]
		public DepthOfFieldDeprecated.DofBlurriness bluriness = (DepthOfFieldDeprecated.DofBlurriness)((ulong)2L);

		// Token: 0x040038AA RID: 14506
		[FieldOffset(Offset = "0x68")]
		[Token(Token = "0x40038AA")]
		public float maxBlurSpread = 1.75f;

		// Token: 0x040038AB RID: 14507
		[FieldOffset(Offset = "0x6C")]
		[Token(Token = "0x40038AB")]
		public float foregroundBlurExtrude = 1.15f;

		// Token: 0x040038AC RID: 14508
		[FieldOffset(Offset = "0x70")]
		[Token(Token = "0x40038AC")]
		public Shader dofBlurShader;

		// Token: 0x040038AD RID: 14509
		[FieldOffset(Offset = "0x78")]
		[Token(Token = "0x40038AD")]
		private Material dofBlurMaterial;

		// Token: 0x040038AE RID: 14510
		[FieldOffset(Offset = "0x80")]
		[Token(Token = "0x40038AE")]
		public Shader dofShader;

		// Token: 0x040038AF RID: 14511
		[FieldOffset(Offset = "0x88")]
		[Token(Token = "0x40038AF")]
		private Material dofMaterial;

		// Token: 0x040038B0 RID: 14512
		[FieldOffset(Offset = "0x90")]
		[Token(Token = "0x40038B0")]
		public bool visualize;

		// Token: 0x040038B1 RID: 14513
		[FieldOffset(Offset = "0x94")]
		[Token(Token = "0x40038B1")]
		public DepthOfFieldDeprecated.BokehDestination bokehDestination = (DepthOfFieldDeprecated.BokehDestination)((ulong)1L);

		// Token: 0x040038B2 RID: 14514
		[FieldOffset(Offset = "0x98")]
		[Token(Token = "0x40038B2")]
		private float widthOverHeight = 1.25f;

		// Token: 0x040038B3 RID: 14515
		[FieldOffset(Offset = "0x9C")]
		[Token(Token = "0x40038B3")]
		private float oneOverBaseSize = 0.001953125f;

		// Token: 0x040038B4 RID: 14516
		[FieldOffset(Offset = "0xA0")]
		[Token(Token = "0x40038B4")]
		public bool bokeh;

		// Token: 0x040038B5 RID: 14517
		[FieldOffset(Offset = "0xA1")]
		[Token(Token = "0x40038B5")]
		public bool bokehSupport = true;

		// Token: 0x040038B6 RID: 14518
		[FieldOffset(Offset = "0xA8")]
		[Token(Token = "0x40038B6")]
		public Shader bokehShader;

		// Token: 0x040038B7 RID: 14519
		[FieldOffset(Offset = "0xB0")]
		[Token(Token = "0x40038B7")]
		public Texture2D bokehTexture;

		// Token: 0x040038B8 RID: 14520
		[FieldOffset(Offset = "0xB8")]
		[Token(Token = "0x40038B8")]
		public float bokehScale = 2.4f;

		// Token: 0x040038B9 RID: 14521
		[FieldOffset(Offset = "0xBC")]
		[Token(Token = "0x40038B9")]
		public float bokehIntensity = 0.15f;

		// Token: 0x040038BA RID: 14522
		[FieldOffset(Offset = "0xC0")]
		[Token(Token = "0x40038BA")]
		public float bokehThresholdContrast = 0.1f;

		// Token: 0x040038BB RID: 14523
		[FieldOffset(Offset = "0xC4")]
		[Token(Token = "0x40038BB")]
		public float bokehThresholdLuminance = 0.55f;

		// Token: 0x040038BC RID: 14524
		[FieldOffset(Offset = "0xC8")]
		[Token(Token = "0x40038BC")]
		public int bokehDownsample = (int)((ulong)1L);

		// Token: 0x040038BD RID: 14525
		[FieldOffset(Offset = "0xD0")]
		[Token(Token = "0x40038BD")]
		private Material bokehMaterial;

		// Token: 0x040038BE RID: 14526
		[FieldOffset(Offset = "0xD8")]
		[Token(Token = "0x40038BE")]
		private Camera _camera;

		// Token: 0x040038BF RID: 14527
		[FieldOffset(Offset = "0xE0")]
		[Token(Token = "0x40038BF")]
		private RenderTexture foregroundTexture;

		// Token: 0x040038C0 RID: 14528
		[FieldOffset(Offset = "0xE8")]
		[Token(Token = "0x40038C0")]
		private RenderTexture mediumRezWorkTexture;

		// Token: 0x040038C1 RID: 14529
		[FieldOffset(Offset = "0xF0")]
		[Token(Token = "0x40038C1")]
		private RenderTexture finalDefocus;

		// Token: 0x040038C2 RID: 14530
		[FieldOffset(Offset = "0xF8")]
		[Token(Token = "0x40038C2")]
		private RenderTexture lowRezWorkTexture;

		// Token: 0x040038C3 RID: 14531
		[FieldOffset(Offset = "0x100")]
		[Token(Token = "0x40038C3")]
		private RenderTexture bokehSource;

		// Token: 0x040038C4 RID: 14532
		[FieldOffset(Offset = "0x108")]
		[Token(Token = "0x40038C4")]
		private RenderTexture bokehSource2;

		// Token: 0x020005B1 RID: 1457
		[Token(Token = "0x20005B1")]
		public enum Dof34QualitySetting
		{
			// Token: 0x040038C6 RID: 14534
			[Token(Token = "0x40038C6")]
			OnlyBackground = 1,
			// Token: 0x040038C7 RID: 14535
			[Token(Token = "0x40038C7")]
			BackgroundAndForeground
		}

		// Token: 0x020005B2 RID: 1458
		[Token(Token = "0x20005B2")]
		public enum DofResolution
		{
			// Token: 0x040038C9 RID: 14537
			[Token(Token = "0x40038C9")]
			High = 2,
			// Token: 0x040038CA RID: 14538
			[Token(Token = "0x40038CA")]
			Medium,
			// Token: 0x040038CB RID: 14539
			[Token(Token = "0x40038CB")]
			Low
		}

		// Token: 0x020005B3 RID: 1459
		[Token(Token = "0x20005B3")]
		public enum DofBlurriness
		{
			// Token: 0x040038CD RID: 14541
			[Token(Token = "0x40038CD")]
			Low = 1,
			// Token: 0x040038CE RID: 14542
			[Token(Token = "0x40038CE")]
			High,
			// Token: 0x040038CF RID: 14543
			[Token(Token = "0x40038CF")]
			VeryHigh = 4
		}

		// Token: 0x020005B4 RID: 1460
		[Token(Token = "0x20005B4")]
		public enum BokehDestination
		{
			// Token: 0x040038D1 RID: 14545
			[Token(Token = "0x40038D1")]
			Background = 1,
			// Token: 0x040038D2 RID: 14546
			[Token(Token = "0x40038D2")]
			Foreground,
			// Token: 0x040038D3 RID: 14547
			[Token(Token = "0x40038D3")]
			BackgroundAndForeground
		}
	}
}
