using System;
using Cpp2IlInjected;
using UnityEngine;

namespace UnityStandardAssets.ImageEffects
{
	// Token: 0x020005FA RID: 1530
	[Token(Token = "0x20005FA")]
	[ExecuteInEditMode]
	[RequireComponent(typeof(Camera))]
	[AddComponentMenu("Image Effects/Blur/Blur (Optimized)")]
	public class BlurOptimized : PostEffectsBase
	{
		// Token: 0x06003183 RID: 12675 RVA: 0x0006AE80 File Offset: 0x00069080
		[Token(Token = "0x6003183")]
		[Address(RVA = "0x513C60", Offset = "0x512C60", VA = "0x180513C60", Slot = "4")]
		public override bool CheckResources()
		{
			int num = 0;
			bool flag = base.CheckSupport(num != 0);
			Material material = this.blurMaterial;
			Shader shader = this.blurShader;
			Material material2 = base.CheckShaderAndCreateMaterial(shader, material);
			this.blurMaterial = material2;
			bool isSupported = this.isSupported;
			if (!isSupported)
			{
				base.ReportAutoDisable();
			}
			return isSupported;
		}

		// Token: 0x06003184 RID: 12676 RVA: 0x0006AECC File Offset: 0x000690CC
		[Token(Token = "0x6003184")]
		[Address(RVA = "0x7B2640", Offset = "0x7B1640", VA = "0x1807B2640")]
		public void OnDisable()
		{
			if (this.blurMaterial)
			{
				UnityEngine.Object.DestroyImmediate(this.blurMaterial);
			}
		}

		// Token: 0x06003185 RID: 12677 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6003185")]
		[Address(RVA = "0x7B26D0", Offset = "0x7B16D0", VA = "0x1807B26D0")]
		public void OnRenderImage(RenderTexture source, RenderTexture destination)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06003186 RID: 12678 RVA: 0x0006AEF4 File Offset: 0x000690F4
		[Token(Token = "0x6003186")]
		[Address(RVA = "0x7B2B40", Offset = "0x7B1B40", VA = "0x1807B2B40")]
		public BlurOptimized()
		{
		}

		// Token: 0x04003AF8 RID: 15096
		[FieldOffset(Offset = "0x28")]
		[Token(Token = "0x4003AF8")]
		[Attribute(Name = "RangeAttribute", RVA = "0x25BBB0", Offset = "0x25AFB0")]
		public int downsample = (int)((ulong)1L);

		// Token: 0x04003AF9 RID: 15097
		[FieldOffset(Offset = "0x2C")]
		[Token(Token = "0x4003AF9")]
		[Range(0f, 10f)]
		public float blurSize = 3f;

		// Token: 0x04003AFA RID: 15098
		[FieldOffset(Offset = "0x30")]
		[Token(Token = "0x4003AFA")]
		[Range(1f, 4f)]
		public int blurIterations = (int)((ulong)2L);

		// Token: 0x04003AFB RID: 15099
		[FieldOffset(Offset = "0x34")]
		[Token(Token = "0x4003AFB")]
		public BlurOptimized.BlurType blurType;

		// Token: 0x04003AFC RID: 15100
		[FieldOffset(Offset = "0x38")]
		[Token(Token = "0x4003AFC")]
		public Shader blurShader;

		// Token: 0x04003AFD RID: 15101
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x4003AFD")]
		private Material blurMaterial;

		// Token: 0x020005FB RID: 1531
		[Token(Token = "0x20005FB")]
		public enum BlurType
		{
			// Token: 0x04003AFF RID: 15103
			[Token(Token = "0x4003AFF")]
			StandardGauss,
			// Token: 0x04003B00 RID: 15104
			[Token(Token = "0x4003B00")]
			SgxGauss
		}
	}
}
