using System;
using Cpp2IlInjected;
using UnityEngine;

namespace UnityStandardAssets.ImageEffects
{
	// Token: 0x02000605 RID: 1541
	[Token(Token = "0x2000605")]
	[ExecuteInEditMode]
	[RequireComponent(typeof(Camera))]
	[AddComponentMenu("Image Effects/Camera/Depth of Field (Lens Blur, Scatter, DX11)")]
	public class DepthOfField : PostEffectsBase
	{
		// Token: 0x060031B4 RID: 12724 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60031B4")]
		[Address(RVA = "0x12FCAC0", Offset = "0x12FBAC0", VA = "0x1812FCAC0", Slot = "4")]
		public override bool CheckResources()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060031B5 RID: 12725 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60031B5")]
		[Address(RVA = "0x12FD1A0", Offset = "0x12FC1A0", VA = "0x1812FD1A0")]
		private void OnEnable()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060031B6 RID: 12726 RVA: 0x0006B42C File Offset: 0x0006962C
		[Token(Token = "0x60031B6")]
		[Address(RVA = "0x12FD030", Offset = "0x12FC030", VA = "0x1812FD030")]
		private void OnDisable()
		{
			/*
An exception occurred when decompiling this method (060031B6)

ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void UnityStandardAssets.ImageEffects.DepthOfField::OnDisable()

 ---> System.Exception: Basic block has to end with unconditional control flow. 
{; 	IL_68:; 	stfld:Material(DepthOfField::dx11bokehMaterial, ldloc:DepthOfField(this), ldloc:int32[exp:Material](var_1_12)); }; 
   at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1810
   at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 344
   at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
   at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
   --- End of inner exception stack trace ---
   at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
   at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1618
*/;
		}

		// Token: 0x060031B7 RID: 12727 RVA: 0x0006B4A8 File Offset: 0x000696A8
		[Token(Token = "0x60031B7")]
		[Address(RVA = "0x12FEDE0", Offset = "0x12FDDE0", VA = "0x1812FEDE0")]
		private void ReleaseComputeResources()
		{
			/*
An exception occurred when decompiling this method (060031B7)

ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void UnityStandardAssets.ImageEffects.DepthOfField::ReleaseComputeResources()

 ---> System.Exception: Basic block has to end with unconditional control flow. 
{; 	IL_2B:; 	stfld:ComputeBuffer(DepthOfField::cbPoints, ldloc:DepthOfField(this), conv.u8:uint64[exp:ComputeBuffer](ldc.i8:int64[exp:uint64](0))); }; 
   at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1810
   at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 344
   at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
   at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
   --- End of inner exception stack trace ---
   at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
   at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1618
*/;
		}

		// Token: 0x060031B8 RID: 12728 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60031B8")]
		[Address(RVA = "0x12FCCE0", Offset = "0x12FBCE0", VA = "0x1812FCCE0")]
		private void CreateComputeResources()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060031B9 RID: 12729 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60031B9")]
		[Address(RVA = "0x12FCE80", Offset = "0x12FBE80", VA = "0x1812FCE80")]
		private float FocalDistance01(float worldDist)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060031BA RID: 12730 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60031BA")]
		[Address(RVA = "0x12FEE50", Offset = "0x12FDE50", VA = "0x1812FEE50")]
		private void WriteCoc(RenderTexture fromTo, bool fgDilate)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060031BB RID: 12731 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60031BB")]
		[Address(RVA = "0x12FD220", Offset = "0x12FC220", VA = "0x1812FD220")]
		private void OnRenderImage(RenderTexture source, RenderTexture destination)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060031BC RID: 12732 RVA: 0x0006B4E8 File Offset: 0x000696E8
		[Token(Token = "0x60031BC")]
		[Address(RVA = "0x12FF1B0", Offset = "0x12FE1B0", VA = "0x1812FF1B0")]
		public DepthOfField()
		{
		}

		// Token: 0x04003B64 RID: 15204
		[FieldOffset(Offset = "0x28")]
		[Token(Token = "0x4003B64")]
		public bool visualizeFocus;

		// Token: 0x04003B65 RID: 15205
		[FieldOffset(Offset = "0x2C")]
		[Token(Token = "0x4003B65")]
		public float focalLength = 10f;

		// Token: 0x04003B66 RID: 15206
		[FieldOffset(Offset = "0x30")]
		[Token(Token = "0x4003B66")]
		public float focalSize = 0.05f;

		// Token: 0x04003B67 RID: 15207
		[FieldOffset(Offset = "0x34")]
		[Token(Token = "0x4003B67")]
		public float aperture = 0.5f;

		// Token: 0x04003B68 RID: 15208
		[FieldOffset(Offset = "0x38")]
		[Token(Token = "0x4003B68")]
		public Transform focalTransform;

		// Token: 0x04003B69 RID: 15209
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x4003B69")]
		public float maxBlurSize = 2f;

		// Token: 0x04003B6A RID: 15210
		[FieldOffset(Offset = "0x44")]
		[Token(Token = "0x4003B6A")]
		public bool highResolution;

		// Token: 0x04003B6B RID: 15211
		[FieldOffset(Offset = "0x48")]
		[Token(Token = "0x4003B6B")]
		public DepthOfField.BlurType blurType;

		// Token: 0x04003B6C RID: 15212
		[FieldOffset(Offset = "0x4C")]
		[Token(Token = "0x4003B6C")]
		public DepthOfField.BlurSampleCount blurSampleCount = (DepthOfField.BlurSampleCount)((ulong)2L);

		// Token: 0x04003B6D RID: 15213
		[FieldOffset(Offset = "0x50")]
		[Token(Token = "0x4003B6D")]
		public bool nearBlur;

		// Token: 0x04003B6E RID: 15214
		[FieldOffset(Offset = "0x54")]
		[Token(Token = "0x4003B6E")]
		public float foregroundOverlap = 1f;

		// Token: 0x04003B6F RID: 15215
		[FieldOffset(Offset = "0x58")]
		[Token(Token = "0x4003B6F")]
		public Shader dofHdrShader;

		// Token: 0x04003B70 RID: 15216
		[FieldOffset(Offset = "0x60")]
		[Token(Token = "0x4003B70")]
		private Material dofHdrMaterial;

		// Token: 0x04003B71 RID: 15217
		[FieldOffset(Offset = "0x68")]
		[Token(Token = "0x4003B71")]
		public Shader dx11BokehShader;

		// Token: 0x04003B72 RID: 15218
		[FieldOffset(Offset = "0x70")]
		[Token(Token = "0x4003B72")]
		private Material dx11bokehMaterial;

		// Token: 0x04003B73 RID: 15219
		[FieldOffset(Offset = "0x78")]
		[Token(Token = "0x4003B73")]
		public float dx11BokehThreshold = 0.5f;

		// Token: 0x04003B74 RID: 15220
		[FieldOffset(Offset = "0x7C")]
		[Token(Token = "0x4003B74")]
		public float dx11SpawnHeuristic = 0.0875f;

		// Token: 0x04003B75 RID: 15221
		[FieldOffset(Offset = "0x80")]
		[Token(Token = "0x4003B75")]
		public Texture2D dx11BokehTexture;

		// Token: 0x04003B76 RID: 15222
		[FieldOffset(Offset = "0x88")]
		[Token(Token = "0x4003B76")]
		public float dx11BokehScale = 1.2f;

		// Token: 0x04003B77 RID: 15223
		[FieldOffset(Offset = "0x8C")]
		[Token(Token = "0x4003B77")]
		public float dx11BokehIntensity = 2.5f;

		// Token: 0x04003B78 RID: 15224
		[FieldOffset(Offset = "0x90")]
		[Token(Token = "0x4003B78")]
		private float focalDistance01 = 10f;

		// Token: 0x04003B79 RID: 15225
		[FieldOffset(Offset = "0x98")]
		[Token(Token = "0x4003B79")]
		private ComputeBuffer cbDrawArgs;

		// Token: 0x04003B7A RID: 15226
		[FieldOffset(Offset = "0xA0")]
		[Token(Token = "0x4003B7A")]
		private ComputeBuffer cbPoints;

		// Token: 0x04003B7B RID: 15227
		[FieldOffset(Offset = "0xA8")]
		[Token(Token = "0x4003B7B")]
		private float internalBlurWidth = 1f;

		// Token: 0x04003B7C RID: 15228
		[FieldOffset(Offset = "0xB0")]
		[Token(Token = "0x4003B7C")]
		private Camera cachedCamera;

		// Token: 0x02000606 RID: 1542
		[Token(Token = "0x2000606")]
		public enum BlurType
		{
			// Token: 0x04003B7E RID: 15230
			[Token(Token = "0x4003B7E")]
			DiscBlur,
			// Token: 0x04003B7F RID: 15231
			[Token(Token = "0x4003B7F")]
			DX11
		}

		// Token: 0x02000607 RID: 1543
		[Token(Token = "0x2000607")]
		public enum BlurSampleCount
		{
			// Token: 0x04003B81 RID: 15233
			[Token(Token = "0x4003B81")]
			Low,
			// Token: 0x04003B82 RID: 15234
			[Token(Token = "0x4003B82")]
			Medium,
			// Token: 0x04003B83 RID: 15235
			[Token(Token = "0x4003B83")]
			High
		}
	}
}
