using System;
using Cpp2IlInjected;
using UnityEngine;

namespace UnityStandardAssets.ImageEffects
{
	// Token: 0x02000608 RID: 1544
	[Token(Token = "0x2000608")]
	[ExecuteInEditMode]
	[RequireComponent(typeof(Camera))]
	[AddComponentMenu("Image Effects/Camera/Depth of Field (deprecated)")]
	public class DepthOfFieldDeprecated : PostEffectsBase
	{
		// Token: 0x060031BD RID: 12733 RVA: 0x0006B580 File Offset: 0x00069780
		[Token(Token = "0x60031BD")]
		[Address(RVA = "0x17DEEA0", Offset = "0x17DDEA0", VA = "0x1817DEEA0")]
		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: 0x060031BE RID: 12734 RVA: 0x0006B628 File Offset: 0x00069828
		[Token(Token = "0x60031BE")]
		[Address(RVA = "0x17DED60", Offset = "0x17DDD60", VA = "0x1817DED60", 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: 0x060031BF RID: 12735 RVA: 0x0006B6F4 File Offset: 0x000698F4
		[Token(Token = "0x60031BF")]
		[Address(RVA = "0x17DF350", Offset = "0x17DE350", VA = "0x1817DF350")]
		private void OnDisable()
		{
			Quads.Cleanup();
		}

		// Token: 0x060031C0 RID: 12736 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60031C0")]
		[Address(RVA = "0x17DF3A0", Offset = "0x17DE3A0", VA = "0x1817DF3A0")]
		private void OnEnable()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060031C1 RID: 12737 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60031C1")]
		[Address(RVA = "0x17DF160", Offset = "0x17DE160", VA = "0x1817DF160")]
		private float FocalDistance01(float worldDist)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060031C2 RID: 12738 RVA: 0x0006B708 File Offset: 0x00069908
		[Token(Token = "0x60031C2")]
		[Address(RVA = "0x17DF310", Offset = "0x17DE310", VA = "0x1817DF310")]
		private int GetDividerBasedOnQuality()
		{
			DepthOfFieldDeprecated.DofResolution dofResolution = this.resolution;
			if (dofResolution == DepthOfFieldDeprecated.DofResolution.Medium || dofResolution == DepthOfFieldDeprecated.DofResolution.Low)
			{
			}
			return 1;
		}

		// Token: 0x060031C3 RID: 12739 RVA: 0x0006B728 File Offset: 0x00069928
		[Token(Token = "0x60031C3")]
		[Address(RVA = "0x17DF330", Offset = "0x17DE330", VA = "0x1817DF330")]
		private int GetLowResolutionDividerBasedOnQuality(int baseDivider)
		{
			DepthOfFieldDeprecated.DofResolution dofResolution = this.resolution;
			return baseDivider;
		}

		// Token: 0x060031C4 RID: 12740 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60031C4")]
		[Address(RVA = "0x17DF420", Offset = "0x17DE420", VA = "0x1817DF420")]
		private void OnRenderImage(RenderTexture source, RenderTexture destination)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060031C5 RID: 12741 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60031C5")]
		[Address(RVA = "0x17DEA10", Offset = "0x17DDA10", VA = "0x1817DEA10")]
		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: 0x060031C6 RID: 12742 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60031C6")]
		[Address(RVA = "0x17DE3D0", Offset = "0x17DD3D0", VA = "0x1817DE3D0")]
		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: 0x060031C7 RID: 12743 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60031C7")]
		[Address(RVA = "0x17DE750", Offset = "0x17DD750", VA = "0x1817DE750")]
		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: 0x060031C8 RID: 12744 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60031C8")]
		[Address(RVA = "0x17DEFC0", Offset = "0x17DDFC0", VA = "0x1817DEFC0")]
		private void Downsample(RenderTexture from, RenderTexture to)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060031C9 RID: 12745 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60031C9")]
		[Address(RVA = "0x17DDA80", Offset = "0x17DCA80", VA = "0x1817DDA80")]
		private void AddBokeh(RenderTexture bokehInfo, RenderTexture tempTex, RenderTexture finalTarget)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060031CA RID: 12746 RVA: 0x0006B740 File Offset: 0x00069940
		[Token(Token = "0x60031CA")]
		[Address(RVA = "0x17E0040", Offset = "0x17DF040", VA = "0x1817E0040")]
		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: 0x060031CB RID: 12747 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60031CB")]
		[Address(RVA = "0x17DDF90", Offset = "0x17DCF90", VA = "0x1817DDF90")]
		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: 0x060031CC RID: 12748 RVA: 0x0006B7E4 File Offset: 0x000699E4
		[Token(Token = "0x60031CC")]
		[Address(RVA = "0x17E0250", Offset = "0x17DF250", VA = "0x1817E0250")]
		public DepthOfFieldDeprecated()
		{
		}

		// Token: 0x060031CD RID: 12749 RVA: 0x000020D3 File Offset: 0x000002D3
		// Note: this type is marked as 'beforefieldinit'.
		[Token(Token = "0x60031CD")]
		[Address(RVA = "0x17E0200", Offset = "0x17DF200", VA = "0x1817E0200")]
		static DepthOfFieldDeprecated()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x04003B84 RID: 15236
		[Token(Token = "0x4003B84")]
		private static int SMOOTH_DOWNSAMPLE_PASS;

		// Token: 0x04003B85 RID: 15237
		[Token(Token = "0x4003B85")]
		private static float BOKEH_EXTRA_BLUR;

		// Token: 0x04003B86 RID: 15238
		[FieldOffset(Offset = "0x28")]
		[Token(Token = "0x4003B86")]
		public DepthOfFieldDeprecated.Dof34QualitySetting quality = (DepthOfFieldDeprecated.Dof34QualitySetting)((ulong)1L);

		// Token: 0x04003B87 RID: 15239
		[FieldOffset(Offset = "0x2C")]
		[Token(Token = "0x4003B87")]
		public DepthOfFieldDeprecated.DofResolution resolution = (DepthOfFieldDeprecated.DofResolution)((ulong)4L);

		// Token: 0x04003B88 RID: 15240
		[FieldOffset(Offset = "0x30")]
		[Token(Token = "0x4003B88")]
		public bool simpleTweakMode = true;

		// Token: 0x04003B89 RID: 15241
		[FieldOffset(Offset = "0x34")]
		[Token(Token = "0x4003B89")]
		public float focalPoint = 1f;

		// Token: 0x04003B8A RID: 15242
		[FieldOffset(Offset = "0x38")]
		[Token(Token = "0x4003B8A")]
		public float smoothness = 0.5f;

		// Token: 0x04003B8B RID: 15243
		[FieldOffset(Offset = "0x3C")]
		[Token(Token = "0x4003B8B")]
		public float focalZDistance;

		// Token: 0x04003B8C RID: 15244
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x4003B8C")]
		public float focalZStartCurve = 1f;

		// Token: 0x04003B8D RID: 15245
		[FieldOffset(Offset = "0x44")]
		[Token(Token = "0x4003B8D")]
		public float focalZEndCurve = 1f;

		// Token: 0x04003B8E RID: 15246
		[FieldOffset(Offset = "0x48")]
		[Token(Token = "0x4003B8E")]
		private float focalStartCurve = 2f;

		// Token: 0x04003B8F RID: 15247
		[FieldOffset(Offset = "0x4C")]
		[Token(Token = "0x4003B8F")]
		private float focalEndCurve = 2f;

		// Token: 0x04003B90 RID: 15248
		[FieldOffset(Offset = "0x50")]
		[Token(Token = "0x4003B90")]
		private float focalDistance01 = 0.1f;

		// Token: 0x04003B91 RID: 15249
		[FieldOffset(Offset = "0x58")]
		[Token(Token = "0x4003B91")]
		public Transform objectFocus;

		// Token: 0x04003B92 RID: 15250
		[FieldOffset(Offset = "0x60")]
		[Token(Token = "0x4003B92")]
		public float focalSize;

		// Token: 0x04003B93 RID: 15251
		[FieldOffset(Offset = "0x64")]
		[Token(Token = "0x4003B93")]
		public DepthOfFieldDeprecated.DofBlurriness bluriness = (DepthOfFieldDeprecated.DofBlurriness)((ulong)2L);

		// Token: 0x04003B94 RID: 15252
		[FieldOffset(Offset = "0x68")]
		[Token(Token = "0x4003B94")]
		public float maxBlurSpread = 1.75f;

		// Token: 0x04003B95 RID: 15253
		[FieldOffset(Offset = "0x6C")]
		[Token(Token = "0x4003B95")]
		public float foregroundBlurExtrude = 1.15f;

		// Token: 0x04003B96 RID: 15254
		[FieldOffset(Offset = "0x70")]
		[Token(Token = "0x4003B96")]
		public Shader dofBlurShader;

		// Token: 0x04003B97 RID: 15255
		[FieldOffset(Offset = "0x78")]
		[Token(Token = "0x4003B97")]
		private Material dofBlurMaterial;

		// Token: 0x04003B98 RID: 15256
		[FieldOffset(Offset = "0x80")]
		[Token(Token = "0x4003B98")]
		public Shader dofShader;

		// Token: 0x04003B99 RID: 15257
		[FieldOffset(Offset = "0x88")]
		[Token(Token = "0x4003B99")]
		private Material dofMaterial;

		// Token: 0x04003B9A RID: 15258
		[FieldOffset(Offset = "0x90")]
		[Token(Token = "0x4003B9A")]
		public bool visualize;

		// Token: 0x04003B9B RID: 15259
		[FieldOffset(Offset = "0x94")]
		[Token(Token = "0x4003B9B")]
		public DepthOfFieldDeprecated.BokehDestination bokehDestination = (DepthOfFieldDeprecated.BokehDestination)((ulong)1L);

		// Token: 0x04003B9C RID: 15260
		[FieldOffset(Offset = "0x98")]
		[Token(Token = "0x4003B9C")]
		private float widthOverHeight = 1.25f;

		// Token: 0x04003B9D RID: 15261
		[FieldOffset(Offset = "0x9C")]
		[Token(Token = "0x4003B9D")]
		private float oneOverBaseSize = 0.001953125f;

		// Token: 0x04003B9E RID: 15262
		[FieldOffset(Offset = "0xA0")]
		[Token(Token = "0x4003B9E")]
		public bool bokeh;

		// Token: 0x04003B9F RID: 15263
		[FieldOffset(Offset = "0xA1")]
		[Token(Token = "0x4003B9F")]
		public bool bokehSupport = true;

		// Token: 0x04003BA0 RID: 15264
		[FieldOffset(Offset = "0xA8")]
		[Token(Token = "0x4003BA0")]
		public Shader bokehShader;

		// Token: 0x04003BA1 RID: 15265
		[FieldOffset(Offset = "0xB0")]
		[Token(Token = "0x4003BA1")]
		public Texture2D bokehTexture;

		// Token: 0x04003BA2 RID: 15266
		[FieldOffset(Offset = "0xB8")]
		[Token(Token = "0x4003BA2")]
		public float bokehScale = 2.4f;

		// Token: 0x04003BA3 RID: 15267
		[FieldOffset(Offset = "0xBC")]
		[Token(Token = "0x4003BA3")]
		public float bokehIntensity = 0.15f;

		// Token: 0x04003BA4 RID: 15268
		[FieldOffset(Offset = "0xC0")]
		[Token(Token = "0x4003BA4")]
		public float bokehThresholdContrast = 0.1f;

		// Token: 0x04003BA5 RID: 15269
		[FieldOffset(Offset = "0xC4")]
		[Token(Token = "0x4003BA5")]
		public float bokehThresholdLuminance = 0.55f;

		// Token: 0x04003BA6 RID: 15270
		[FieldOffset(Offset = "0xC8")]
		[Token(Token = "0x4003BA6")]
		public int bokehDownsample = (int)((ulong)1L);

		// Token: 0x04003BA7 RID: 15271
		[FieldOffset(Offset = "0xD0")]
		[Token(Token = "0x4003BA7")]
		private Material bokehMaterial;

		// Token: 0x04003BA8 RID: 15272
		[FieldOffset(Offset = "0xD8")]
		[Token(Token = "0x4003BA8")]
		private Camera _camera;

		// Token: 0x04003BA9 RID: 15273
		[FieldOffset(Offset = "0xE0")]
		[Token(Token = "0x4003BA9")]
		private RenderTexture foregroundTexture;

		// Token: 0x04003BAA RID: 15274
		[FieldOffset(Offset = "0xE8")]
		[Token(Token = "0x4003BAA")]
		private RenderTexture mediumRezWorkTexture;

		// Token: 0x04003BAB RID: 15275
		[FieldOffset(Offset = "0xF0")]
		[Token(Token = "0x4003BAB")]
		private RenderTexture finalDefocus;

		// Token: 0x04003BAC RID: 15276
		[FieldOffset(Offset = "0xF8")]
		[Token(Token = "0x4003BAC")]
		private RenderTexture lowRezWorkTexture;

		// Token: 0x04003BAD RID: 15277
		[FieldOffset(Offset = "0x100")]
		[Token(Token = "0x4003BAD")]
		private RenderTexture bokehSource;

		// Token: 0x04003BAE RID: 15278
		[FieldOffset(Offset = "0x108")]
		[Token(Token = "0x4003BAE")]
		private RenderTexture bokehSource2;

		// Token: 0x02000609 RID: 1545
		[Token(Token = "0x2000609")]
		public enum Dof34QualitySetting
		{
			// Token: 0x04003BB0 RID: 15280
			[Token(Token = "0x4003BB0")]
			OnlyBackground = 1,
			// Token: 0x04003BB1 RID: 15281
			[Token(Token = "0x4003BB1")]
			BackgroundAndForeground
		}

		// Token: 0x0200060A RID: 1546
		[Token(Token = "0x200060A")]
		public enum DofResolution
		{
			// Token: 0x04003BB3 RID: 15283
			[Token(Token = "0x4003BB3")]
			High = 2,
			// Token: 0x04003BB4 RID: 15284
			[Token(Token = "0x4003BB4")]
			Medium,
			// Token: 0x04003BB5 RID: 15285
			[Token(Token = "0x4003BB5")]
			Low
		}

		// Token: 0x0200060B RID: 1547
		[Token(Token = "0x200060B")]
		public enum DofBlurriness
		{
			// Token: 0x04003BB7 RID: 15287
			[Token(Token = "0x4003BB7")]
			Low = 1,
			// Token: 0x04003BB8 RID: 15288
			[Token(Token = "0x4003BB8")]
			High,
			// Token: 0x04003BB9 RID: 15289
			[Token(Token = "0x4003BB9")]
			VeryHigh = 4
		}

		// Token: 0x0200060C RID: 1548
		[Token(Token = "0x200060C")]
		public enum BokehDestination
		{
			// Token: 0x04003BBB RID: 15291
			[Token(Token = "0x4003BBB")]
			Background = 1,
			// Token: 0x04003BBC RID: 15292
			[Token(Token = "0x4003BBC")]
			Foreground,
			// Token: 0x04003BBD RID: 15293
			[Token(Token = "0x4003BBD")]
			BackgroundAndForeground
		}
	}
}
