using System;
using Cpp2IlInjected;
using UnityEngine;

namespace UnityStandardAssets.ImageEffects
{
	// Token: 0x0200060D RID: 1549
	[Token(Token = "0x200060D")]
	[ExecuteInEditMode]
	[RequireComponent(typeof(Camera))]
	[AddComponentMenu("Image Effects/Edge Detection/Edge Detection")]
	public class EdgeDetection : PostEffectsBase
	{
		// Token: 0x060031CE RID: 12750 RVA: 0x0006B8D8 File Offset: 0x00069AD8
		[Token(Token = "0x60031CE")]
		[Address(RVA = "0x1599970", Offset = "0x1598970", VA = "0x181599970", 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: 0x060031CF RID: 12751 RVA: 0x0006B940 File Offset: 0x00069B40
		[Token(Token = "0x60031CF")]
		[Address(RVA = "0x1599D20", Offset = "0x1598D20", VA = "0x181599D20")]
		private new void Start()
		{
			EdgeDetection.EdgeDetectMode edgeDetectMode = this.mode;
			this.oldMode = edgeDetectMode;
		}

		// Token: 0x060031D0 RID: 12752 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60031D0")]
		[Address(RVA = "0x1599C70", Offset = "0x1598C70", VA = "0x181599C70")]
		private void SetCameraFlag()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060031D1 RID: 12753 RVA: 0x0006B95C File Offset: 0x00069B5C
		[Token(Token = "0x60031D1")]
		[Address(RVA = "0x15999F0", Offset = "0x15989F0", VA = "0x1815999F0")]
		private void OnEnable()
		{
			this.SetCameraFlag();
		}

		// Token: 0x060031D2 RID: 12754 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60031D2")]
		[Address(RVA = "0x1599A00", Offset = "0x1598A00", VA = "0x181599A00")]
		[ImageEffectOpaque]
		private void OnRenderImage(RenderTexture source, RenderTexture destination)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060031D3 RID: 12755 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60031D3")]
		[Address(RVA = "0x1599D30", Offset = "0x1598D30", VA = "0x181599D30")]
		public EdgeDetection()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x04003BBE RID: 15294
		[FieldOffset(Offset = "0x28")]
		[Token(Token = "0x4003BBE")]
		public EdgeDetection.EdgeDetectMode mode;

		// Token: 0x04003BBF RID: 15295
		[FieldOffset(Offset = "0x2C")]
		[Token(Token = "0x4003BBF")]
		public float sensitivityDepth;

		// Token: 0x04003BC0 RID: 15296
		[FieldOffset(Offset = "0x30")]
		[Token(Token = "0x4003BC0")]
		public float sensitivityNormals;

		// Token: 0x04003BC1 RID: 15297
		[FieldOffset(Offset = "0x34")]
		[Token(Token = "0x4003BC1")]
		public float lumThreshold;

		// Token: 0x04003BC2 RID: 15298
		[FieldOffset(Offset = "0x38")]
		[Token(Token = "0x4003BC2")]
		public float edgeExp;

		// Token: 0x04003BC3 RID: 15299
		[FieldOffset(Offset = "0x3C")]
		[Token(Token = "0x4003BC3")]
		public float sampleDist;

		// Token: 0x04003BC4 RID: 15300
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x4003BC4")]
		public float edgesOnly;

		// Token: 0x04003BC5 RID: 15301
		[FieldOffset(Offset = "0x44")]
		[Token(Token = "0x4003BC5")]
		public Color edgesOnlyBgColor;

		// Token: 0x04003BC6 RID: 15302
		[FieldOffset(Offset = "0x58")]
		[Token(Token = "0x4003BC6")]
		public Shader edgeDetectShader;

		// Token: 0x04003BC7 RID: 15303
		[FieldOffset(Offset = "0x60")]
		[Token(Token = "0x4003BC7")]
		private Material edgeDetectMaterial;

		// Token: 0x04003BC8 RID: 15304
		[FieldOffset(Offset = "0x68")]
		[Token(Token = "0x4003BC8")]
		private EdgeDetection.EdgeDetectMode oldMode;

		// Token: 0x0200060E RID: 1550
		[Token(Token = "0x200060E")]
		public enum EdgeDetectMode
		{
			// Token: 0x04003BCA RID: 15306
			[Token(Token = "0x4003BCA")]
			TriangleDepthNormals,
			// Token: 0x04003BCB RID: 15307
			[Token(Token = "0x4003BCB")]
			RobertsCrossDepthNormals,
			// Token: 0x04003BCC RID: 15308
			[Token(Token = "0x4003BCC")]
			SobelDepth,
			// Token: 0x04003BCD RID: 15309
			[Token(Token = "0x4003BCD")]
			SobelDepthThin,
			// Token: 0x04003BCE RID: 15310
			[Token(Token = "0x4003BCE")]
			TriangleLuminance
		}
	}
}
