using System;
using Cpp2IlInjected;
using UnityEngine;

namespace UnityStandardAssets.ImageEffects
{
	// Token: 0x020005A2 RID: 1442
	[Token(Token = "0x20005A2")]
	[ExecuteInEditMode]
	[AddComponentMenu("Image Effects/Blur/Blur (Optimized)")]
	[RequireComponent(typeof(Camera))]
	public class BlurOptimized : PostEffectsBase
	{
		// Token: 0x06002EBA RID: 11962 RVA: 0x00063BC4 File Offset: 0x00061DC4
		[Token(Token = "0x6002EBA")]
		[Address(RVA = "0x439770", Offset = "0x438570", VA = "0x180439770", 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: 0x06002EBB RID: 11963 RVA: 0x00063C10 File Offset: 0x00061E10
		[Token(Token = "0x6002EBB")]
		[Address(RVA = "0xDE2CE0", Offset = "0xDE1AE0", VA = "0x180DE2CE0")]
		public void OnDisable()
		{
			if (this.blurMaterial)
			{
				UnityEngine.Object.DestroyImmediate(this.blurMaterial);
			}
		}

		// Token: 0x06002EBC RID: 11964 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002EBC")]
		[Address(RVA = "0xDE2D70", Offset = "0xDE1B70", VA = "0x180DE2D70")]
		public void OnRenderImage(RenderTexture source, RenderTexture destination)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002EBD RID: 11965 RVA: 0x00063C38 File Offset: 0x00061E38
		[Token(Token = "0x6002EBD")]
		[Address(RVA = "0xDE31E0", Offset = "0xDE1FE0", VA = "0x180DE31E0")]
		public BlurOptimized()
		{
		}

		// Token: 0x0400380E RID: 14350
		[FieldOffset(Offset = "0x28")]
		[Token(Token = "0x400380E")]
		[Attribute(Name = "RangeAttribute", RVA = "0xDF060", Offset = "0xDE460")]
		public int downsample = (int)((ulong)1L);

		// Token: 0x0400380F RID: 14351
		[FieldOffset(Offset = "0x2C")]
		[Token(Token = "0x400380F")]
		[Range(0f, 10f)]
		public float blurSize = 3f;

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

		// Token: 0x04003811 RID: 14353
		[FieldOffset(Offset = "0x34")]
		[Token(Token = "0x4003811")]
		public BlurOptimized.BlurType blurType;

		// Token: 0x04003812 RID: 14354
		[FieldOffset(Offset = "0x38")]
		[Token(Token = "0x4003812")]
		public Shader blurShader;

		// Token: 0x04003813 RID: 14355
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x4003813")]
		private Material blurMaterial;

		// Token: 0x020005A3 RID: 1443
		[Token(Token = "0x20005A3")]
		public enum BlurType
		{
			// Token: 0x04003815 RID: 14357
			[Token(Token = "0x4003815")]
			StandardGauss,
			// Token: 0x04003816 RID: 14358
			[Token(Token = "0x4003816")]
			SgxGauss
		}
	}
}
