using System;
using Cpp2IlInjected;
using UnityEngine;

namespace UnityStandardAssets.ImageEffects
{
	// Token: 0x0200059E RID: 1438
	[Token(Token = "0x200059E")]
	[ExecuteInEditMode]
	[RequireComponent(typeof(Camera))]
	[AddComponentMenu("Image Effects/Bloom and Glow/Bloom (Optimized)")]
	public class BloomOptimized : PostEffectsBase
	{
		// Token: 0x06002EAE RID: 11950 RVA: 0x000639C8 File Offset: 0x00061BC8
		[Token(Token = "0x6002EAE")]
		[Address(RVA = "0xDE2760", Offset = "0xDE1560", VA = "0x180DE2760", Slot = "4")]
		public override bool CheckResources()
		{
			int num = 0;
			bool flag = base.CheckSupport(num != 0);
			Material material = this.fastBloomMaterial;
			Shader shader = this.fastBloomShader;
			Material material2 = base.CheckShaderAndCreateMaterial(shader, material);
			this.fastBloomMaterial = material2;
			bool isSupported = this.isSupported;
			if (!isSupported)
			{
				base.ReportAutoDisable();
			}
			return isSupported;
		}

		// Token: 0x06002EAF RID: 11951 RVA: 0x00063A14 File Offset: 0x00061C14
		[Token(Token = "0x6002EAF")]
		[Address(RVA = "0xDE27C0", Offset = "0xDE15C0", VA = "0x180DE27C0")]
		private void OnDisable()
		{
			if (this.fastBloomMaterial)
			{
				UnityEngine.Object.DestroyImmediate(this.fastBloomMaterial);
			}
		}

		// Token: 0x06002EB0 RID: 11952 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002EB0")]
		[Address(RVA = "0xDE2850", Offset = "0xDE1650", VA = "0x180DE2850")]
		private void OnRenderImage(RenderTexture source, RenderTexture destination)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002EB1 RID: 11953 RVA: 0x00063A3C File Offset: 0x00061C3C
		[Token(Token = "0x6002EB1")]
		[Address(RVA = "0xDE2CB0", Offset = "0xDE1AB0", VA = "0x180DE2CB0")]
		public BloomOptimized()
		{
		}

		// Token: 0x040037FC RID: 14332
		[FieldOffset(Offset = "0x28")]
		[Token(Token = "0x40037FC")]
		[Range(0f, 1.5f)]
		public float threshold = 0.25f;

		// Token: 0x040037FD RID: 14333
		[FieldOffset(Offset = "0x2C")]
		[Token(Token = "0x40037FD")]
		[Range(0f, 2.5f)]
		public float intensity = 0.75f;

		// Token: 0x040037FE RID: 14334
		[FieldOffset(Offset = "0x30")]
		[Token(Token = "0x40037FE")]
		[Range(0.25f, 5.5f)]
		public float blurSize = 1f;

		// Token: 0x040037FF RID: 14335
		[FieldOffset(Offset = "0x34")]
		[Token(Token = "0x40037FF")]
		private BloomOptimized.Resolution resolution;

		// Token: 0x04003800 RID: 14336
		[FieldOffset(Offset = "0x38")]
		[Token(Token = "0x4003800")]
		[Range(1f, 4f)]
		public int blurIterations = (int)((ulong)1L);

		// Token: 0x04003801 RID: 14337
		[FieldOffset(Offset = "0x3C")]
		[Token(Token = "0x4003801")]
		public BloomOptimized.BlurType blurType;

		// Token: 0x04003802 RID: 14338
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x4003802")]
		public Shader fastBloomShader;

		// Token: 0x04003803 RID: 14339
		[FieldOffset(Offset = "0x48")]
		[Token(Token = "0x4003803")]
		private Material fastBloomMaterial;

		// Token: 0x0200059F RID: 1439
		[Token(Token = "0x200059F")]
		public enum Resolution
		{
			// Token: 0x04003805 RID: 14341
			[Token(Token = "0x4003805")]
			Low,
			// Token: 0x04003806 RID: 14342
			[Token(Token = "0x4003806")]
			High
		}

		// Token: 0x020005A0 RID: 1440
		[Token(Token = "0x20005A0")]
		public enum BlurType
		{
			// Token: 0x04003808 RID: 14344
			[Token(Token = "0x4003808")]
			Standard,
			// Token: 0x04003809 RID: 14345
			[Token(Token = "0x4003809")]
			Sgx
		}
	}
}
