using System;
using Cpp2IlInjected;
using UnityEngine;

namespace UnityStandardAssets.ImageEffects
{
	// Token: 0x020005F6 RID: 1526
	[Token(Token = "0x20005F6")]
	[ExecuteInEditMode]
	[AddComponentMenu("Image Effects/Bloom and Glow/Bloom (Optimized)")]
	[RequireComponent(typeof(Camera))]
	public class BloomOptimized : PostEffectsBase
	{
		// Token: 0x06003177 RID: 12663 RVA: 0x0006AC84 File Offset: 0x00068E84
		[Token(Token = "0x6003177")]
		[Address(RVA = "0x7B0330", Offset = "0x7AF330", VA = "0x1807B0330", 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: 0x06003178 RID: 12664 RVA: 0x0006ACD0 File Offset: 0x00068ED0
		[Token(Token = "0x6003178")]
		[Address(RVA = "0x7B0390", Offset = "0x7AF390", VA = "0x1807B0390")]
		private void OnDisable()
		{
			if (this.fastBloomMaterial)
			{
				UnityEngine.Object.DestroyImmediate(this.fastBloomMaterial);
			}
		}

		// Token: 0x06003179 RID: 12665 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6003179")]
		[Address(RVA = "0x7B0420", Offset = "0x7AF420", VA = "0x1807B0420")]
		private void OnRenderImage(RenderTexture source, RenderTexture destination)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x0600317A RID: 12666 RVA: 0x0006ACF8 File Offset: 0x00068EF8
		[Token(Token = "0x600317A")]
		[Address(RVA = "0x7B0880", Offset = "0x7AF880", VA = "0x1807B0880")]
		public BloomOptimized()
		{
		}

		// Token: 0x04003AE6 RID: 15078
		[FieldOffset(Offset = "0x28")]
		[Token(Token = "0x4003AE6")]
		[Range(0f, 1.5f)]
		public float threshold = 0.25f;

		// Token: 0x04003AE7 RID: 15079
		[FieldOffset(Offset = "0x2C")]
		[Token(Token = "0x4003AE7")]
		[Range(0f, 2.5f)]
		public float intensity = 0.75f;

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

		// Token: 0x04003AE9 RID: 15081
		[FieldOffset(Offset = "0x34")]
		[Token(Token = "0x4003AE9")]
		private BloomOptimized.Resolution resolution;

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

		// Token: 0x04003AEB RID: 15083
		[FieldOffset(Offset = "0x3C")]
		[Token(Token = "0x4003AEB")]
		public BloomOptimized.BlurType blurType;

		// Token: 0x04003AEC RID: 15084
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x4003AEC")]
		public Shader fastBloomShader;

		// Token: 0x04003AED RID: 15085
		[FieldOffset(Offset = "0x48")]
		[Token(Token = "0x4003AED")]
		private Material fastBloomMaterial;

		// Token: 0x020005F7 RID: 1527
		[Token(Token = "0x20005F7")]
		public enum Resolution
		{
			// Token: 0x04003AEF RID: 15087
			[Token(Token = "0x4003AEF")]
			Low,
			// Token: 0x04003AF0 RID: 15088
			[Token(Token = "0x4003AF0")]
			High
		}

		// Token: 0x020005F8 RID: 1528
		[Token(Token = "0x20005F8")]
		public enum BlurType
		{
			// Token: 0x04003AF2 RID: 15090
			[Token(Token = "0x4003AF2")]
			Standard,
			// Token: 0x04003AF3 RID: 15091
			[Token(Token = "0x4003AF3")]
			Sgx
		}
	}
}
