using System;
using Cpp2IlInjected;
using UnityEngine;

namespace UnityStandardAssets.ImageEffects
{
	// Token: 0x020005B5 RID: 1461
	[Token(Token = "0x20005B5")]
	[ExecuteInEditMode]
	[AddComponentMenu("Image Effects/Edge Detection/Edge Detection")]
	[RequireComponent(typeof(Camera))]
	public class EdgeDetection : PostEffectsBase
	{
		// Token: 0x06002F05 RID: 12037 RVA: 0x0006461C File Offset: 0x0006281C
		[Token(Token = "0x6002F05")]
		[Address(RVA = "0xA5D1E0", Offset = "0xA5BFE0", VA = "0x180A5D1E0", Slot = "4")]
		public override bool CheckResources()
		{
			do
			{
				bool flag = base.CheckSupport(true);
				Material material = this.edgeDetectMaterial;
				Shader shader = this.edgeDetectShader;
				Material material2 = base.CheckShaderAndCreateMaterial(shader, material);
				this.edgeDetectMaterial = material2;
				EdgeDetection.EdgeDetectMode edgeDetectMode = this.mode;
				if (edgeDetectMode != this.oldMode)
				{
					this.SetCameraFlag();
				}
				this.oldMode = edgeDetectMode;
			}
			while (this.isSupported);
			base.ReportAutoDisable();
			return this.isSupported;
		}

		// Token: 0x06002F06 RID: 12038 RVA: 0x00064684 File Offset: 0x00062884
		[Token(Token = "0x6002F06")]
		[Address(RVA = "0xA5D590", Offset = "0xA5C390", VA = "0x180A5D590")]
		private new void Start()
		{
			EdgeDetection.EdgeDetectMode edgeDetectMode = this.mode;
			this.oldMode = edgeDetectMode;
		}

		// Token: 0x06002F07 RID: 12039 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002F07")]
		[Address(RVA = "0xA5D4E0", Offset = "0xA5C2E0", VA = "0x180A5D4E0")]
		private void SetCameraFlag()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002F08 RID: 12040 RVA: 0x000646A0 File Offset: 0x000628A0
		[Token(Token = "0x6002F08")]
		[Address(RVA = "0xA5D260", Offset = "0xA5C060", VA = "0x180A5D260")]
		private void OnEnable()
		{
			this.SetCameraFlag();
		}

		// Token: 0x06002F09 RID: 12041 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002F09")]
		[Address(RVA = "0xA5D270", Offset = "0xA5C070", VA = "0x180A5D270")]
		[ImageEffectOpaque]
		private void OnRenderImage(RenderTexture source, RenderTexture destination)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002F0A RID: 12042 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002F0A")]
		[Address(RVA = "0xA5D5A0", Offset = "0xA5C3A0", VA = "0x180A5D5A0")]
		public EdgeDetection()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x040038D4 RID: 14548
		[FieldOffset(Offset = "0x28")]
		[Token(Token = "0x40038D4")]
		public EdgeDetection.EdgeDetectMode mode;

		// Token: 0x040038D5 RID: 14549
		[FieldOffset(Offset = "0x2C")]
		[Token(Token = "0x40038D5")]
		public float sensitivityDepth;

		// Token: 0x040038D6 RID: 14550
		[FieldOffset(Offset = "0x30")]
		[Token(Token = "0x40038D6")]
		public float sensitivityNormals;

		// Token: 0x040038D7 RID: 14551
		[FieldOffset(Offset = "0x34")]
		[Token(Token = "0x40038D7")]
		public float lumThreshold;

		// Token: 0x040038D8 RID: 14552
		[FieldOffset(Offset = "0x38")]
		[Token(Token = "0x40038D8")]
		public float edgeExp;

		// Token: 0x040038D9 RID: 14553
		[FieldOffset(Offset = "0x3C")]
		[Token(Token = "0x40038D9")]
		public float sampleDist;

		// Token: 0x040038DA RID: 14554
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x40038DA")]
		public float edgesOnly;

		// Token: 0x040038DB RID: 14555
		[FieldOffset(Offset = "0x44")]
		[Token(Token = "0x40038DB")]
		public Color edgesOnlyBgColor;

		// Token: 0x040038DC RID: 14556
		[FieldOffset(Offset = "0x58")]
		[Token(Token = "0x40038DC")]
		public Shader edgeDetectShader;

		// Token: 0x040038DD RID: 14557
		[FieldOffset(Offset = "0x60")]
		[Token(Token = "0x40038DD")]
		private Material edgeDetectMaterial;

		// Token: 0x040038DE RID: 14558
		[FieldOffset(Offset = "0x68")]
		[Token(Token = "0x40038DE")]
		private EdgeDetection.EdgeDetectMode oldMode;

		// Token: 0x020005B6 RID: 1462
		[Token(Token = "0x20005B6")]
		public enum EdgeDetectMode
		{
			// Token: 0x040038E0 RID: 14560
			[Token(Token = "0x40038E0")]
			TriangleDepthNormals,
			// Token: 0x040038E1 RID: 14561
			[Token(Token = "0x40038E1")]
			RobertsCrossDepthNormals,
			// Token: 0x040038E2 RID: 14562
			[Token(Token = "0x40038E2")]
			SobelDepth,
			// Token: 0x040038E3 RID: 14563
			[Token(Token = "0x40038E3")]
			SobelDepthThin,
			// Token: 0x040038E4 RID: 14564
			[Token(Token = "0x40038E4")]
			TriangleLuminance
		}
	}
}
