using System;
using Cpp2IlInjected;
using UnityEngine;

namespace UnityStandardAssets.ImageEffects
{
	// Token: 0x0200061C RID: 1564
	[Token(Token = "0x200061C")]
	[ExecuteInEditMode]
	[AddComponentMenu("Image Effects/Rendering/Screen Space Ambient Obscurance")]
	[RequireComponent(typeof(Camera))]
	internal class ScreenSpaceAmbientObscurance : PostEffectsBase
	{
		// Token: 0x06003211 RID: 12817 RVA: 0x0006C004 File Offset: 0x0006A204
		[Token(Token = "0x6003211")]
		[Address(RVA = "0x514920", Offset = "0x513920", VA = "0x180514920", Slot = "4")]
		public override bool CheckResources()
		{
			bool flag = base.CheckSupport(true);
			Material material = this.aoMaterial;
			Shader shader = this.aoShader;
			Material material2 = base.CheckShaderAndCreateMaterial(shader, material);
			this.aoMaterial = material2;
			bool isSupported = this.isSupported;
			if (!isSupported)
			{
				base.ReportAutoDisable();
			}
			return isSupported;
		}

		// Token: 0x06003212 RID: 12818 RVA: 0x0006C04C File Offset: 0x0006A24C
		[Token(Token = "0x6003212")]
		[Address(RVA = "0x514980", Offset = "0x513980", VA = "0x180514980")]
		private void OnDisable()
		{
			/*
An exception occurred when decompiling this method (06003212)

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

 ---> System.Exception: Basic block has to end with unconditional control flow. 
{; 	IL_19:; 	stfld:Material(ScreenSpaceAmbientObscurance::aoMaterial, ldloc:ScreenSpaceAmbientObscurance(this), conv.u8:uint64[exp:Material](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: 0x06003213 RID: 12819 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6003213")]
		[Address(RVA = "0x514A30", Offset = "0x513A30", VA = "0x180514A30")]
		[ImageEffectOpaque]
		private void OnRenderImage(RenderTexture source, RenderTexture destination)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06003214 RID: 12820 RVA: 0x0006C07C File Offset: 0x0006A27C
		[Token(Token = "0x6003214")]
		[Address(RVA = "0x5153E0", Offset = "0x5143E0", VA = "0x1805153E0")]
		public ScreenSpaceAmbientObscurance()
		{
		}

		// Token: 0x04003C18 RID: 15384
		[FieldOffset(Offset = "0x28")]
		[Token(Token = "0x4003C18")]
		[Range(0f, 3f)]
		public float intensity = 0.5f;

		// Token: 0x04003C19 RID: 15385
		[FieldOffset(Offset = "0x2C")]
		[Token(Token = "0x4003C19")]
		[Range(0.1f, 3f)]
		public float radius = 0.2f;

		// Token: 0x04003C1A RID: 15386
		[FieldOffset(Offset = "0x30")]
		[Token(Token = "0x4003C1A")]
		[Range(0f, 3f)]
		public int blurIterations = (int)((ulong)1L);

		// Token: 0x04003C1B RID: 15387
		[FieldOffset(Offset = "0x34")]
		[Token(Token = "0x4003C1B")]
		[Range(0f, 5f)]
		public float blurFilterDistance = 1.25f;

		// Token: 0x04003C1C RID: 15388
		[FieldOffset(Offset = "0x38")]
		[Token(Token = "0x4003C1C")]
		[Range(0f, 1f)]
		public int downsample;

		// Token: 0x04003C1D RID: 15389
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x4003C1D")]
		public Texture2D rand;

		// Token: 0x04003C1E RID: 15390
		[FieldOffset(Offset = "0x48")]
		[Token(Token = "0x4003C1E")]
		public Shader aoShader;

		// Token: 0x04003C1F RID: 15391
		[FieldOffset(Offset = "0x50")]
		[Token(Token = "0x4003C1F")]
		private Material aoMaterial;
	}
}
