using System;
using Cpp2IlInjected;
using UnityEngine;

namespace UnityStandardAssets.ImageEffects
{
	// Token: 0x0200059D RID: 1437
	[Token(Token = "0x200059D")]
	[ExecuteInEditMode]
	[AddComponentMenu("Image Effects/Bloom and Glow/BloomAndFlares (3.5, Deprecated)")]
	[RequireComponent(typeof(Camera))]
	public class BloomAndFlares : PostEffectsBase
	{
		// Token: 0x06002EA7 RID: 11943 RVA: 0x00063804 File Offset: 0x00061A04
		[Token(Token = "0x6002EA7")]
		[Address(RVA = "0xDE07B0", Offset = "0xDDF5B0", VA = "0x180DE07B0", Slot = "4")]
		public override bool CheckResources()
		{
			int num = 0;
			bool flag = base.CheckSupport(num != 0);
			Material material = this.screenBlend;
			Shader shader = this.screenBlendShader;
			Material material2 = base.CheckShaderAndCreateMaterial(shader, material);
			this.screenBlend = material2;
			Material material3 = this.lensFlareMaterial;
			Shader shader2 = this.lensFlareShader;
			Material material4 = base.CheckShaderAndCreateMaterial(shader2, material3);
			this.lensFlareMaterial = material4;
			Material material5 = this.vignetteMaterial;
			Shader shader3 = this.vignetteShader;
			Material material6 = base.CheckShaderAndCreateMaterial(shader3, material5);
			this.vignetteMaterial = material6;
			Material material7 = this.separableBlurMaterial;
			Shader shader4 = this.separableBlurShader;
			Material material8 = base.CheckShaderAndCreateMaterial(shader4, material7);
			this.separableBlurMaterial = material8;
			Material material9 = this.addBrightStuffBlendOneOneMaterial;
			Shader shader5 = this.addBrightStuffOneOneShader;
			Material material10 = base.CheckShaderAndCreateMaterial(shader5, material9);
			this.addBrightStuffBlendOneOneMaterial = material10;
			Material material11 = this.hollywoodFlaresMaterial;
			Shader shader6 = this.hollywoodFlaresShader;
			Material material12 = base.CheckShaderAndCreateMaterial(shader6, material11);
			this.hollywoodFlaresMaterial = material12;
			Material material13 = this.brightPassFilterMaterial;
			Shader shader7 = this.brightPassFilterShader;
			Material material14 = base.CheckShaderAndCreateMaterial(shader7, material13);
			this.brightPassFilterMaterial = material14;
			bool isSupported = this.isSupported;
			if (!isSupported)
			{
				base.ReportAutoDisable();
			}
			return isSupported;
		}

		// Token: 0x06002EA8 RID: 11944 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002EA8")]
		[Address(RVA = "0xDE0940", Offset = "0xDDF740", VA = "0x180DE0940")]
		private void OnRenderImage(RenderTexture source, RenderTexture destination)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002EA9 RID: 11945 RVA: 0x00063928 File Offset: 0x00061B28
		[Token(Token = "0x6002EA9")]
		[Address(RVA = "0xDE0210", Offset = "0xDDF010", VA = "0x180DE0210")]
		private void AddTo(float intensity_, RenderTexture from, RenderTexture to)
		{
			this.addBrightStuffBlendOneOneMaterial.SetFloat("_Intensity", intensity_);
			Material material = this.addBrightStuffBlendOneOneMaterial;
			Graphics.Blit(from, to, material);
		}

		// Token: 0x06002EAA RID: 11946 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002EAA")]
		[Address(RVA = "0xDE02D0", Offset = "0xDDF0D0", VA = "0x180DE02D0")]
		private void BlendFlares(RenderTexture from, RenderTexture to)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002EAB RID: 11947 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002EAB")]
		[Address(RVA = "0xDE0640", Offset = "0xDDF440", VA = "0x180DE0640")]
		private void BrightFilter(float thresh, float useAlphaAsMask, RenderTexture from, RenderTexture to)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002EAC RID: 11948 RVA: 0x0006395C File Offset: 0x00061B5C
		[Token(Token = "0x6002EAC")]
		[Address(RVA = "0xDE1690", Offset = "0xDE0490", VA = "0x180DE1690")]
		private void Vignette(float amount, RenderTexture from, RenderTexture to)
		{
			if (!this.lensFlareVignetteMask)
			{
				this.vignetteMaterial.SetFloat("vignetteIntensity", amount);
				Material material = this.vignetteMaterial;
				Graphics.Blit(from, to, material);
				return;
			}
			Material material2 = this.screenBlend;
			Texture2D texture2D = this.lensFlareVignetteMask;
			material2.SetTexture("_ColorBuffer", texture2D);
			Material material3 = this.screenBlend;
			Graphics.Blit(from, to, material3, 3);
			throw new NullReferenceException();
		}

		// Token: 0x06002EAD RID: 11949 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002EAD")]
		[Address(RVA = "0xDE1810", Offset = "0xDE0610", VA = "0x180DE1810")]
		public BloomAndFlares()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x040037DA RID: 14298
		[FieldOffset(Offset = "0x28")]
		[Token(Token = "0x40037DA")]
		public TweakMode34 tweakMode;

		// Token: 0x040037DB RID: 14299
		[FieldOffset(Offset = "0x2C")]
		[Token(Token = "0x40037DB")]
		public BloomScreenBlendMode screenBlendMode;

		// Token: 0x040037DC RID: 14300
		[FieldOffset(Offset = "0x30")]
		[Token(Token = "0x40037DC")]
		public HDRBloomMode hdr;

		// Token: 0x040037DD RID: 14301
		[FieldOffset(Offset = "0x34")]
		[Token(Token = "0x40037DD")]
		private bool doHdr;

		// Token: 0x040037DE RID: 14302
		[FieldOffset(Offset = "0x38")]
		[Token(Token = "0x40037DE")]
		public float sepBlurSpread;

		// Token: 0x040037DF RID: 14303
		[FieldOffset(Offset = "0x3C")]
		[Token(Token = "0x40037DF")]
		public float useSrcAlphaAsMask;

		// Token: 0x040037E0 RID: 14304
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x40037E0")]
		public float bloomIntensity;

		// Token: 0x040037E1 RID: 14305
		[FieldOffset(Offset = "0x44")]
		[Token(Token = "0x40037E1")]
		public float bloomThreshold;

		// Token: 0x040037E2 RID: 14306
		[FieldOffset(Offset = "0x48")]
		[Token(Token = "0x40037E2")]
		public int bloomBlurIterations;

		// Token: 0x040037E3 RID: 14307
		[FieldOffset(Offset = "0x4C")]
		[Token(Token = "0x40037E3")]
		public bool lensflares;

		// Token: 0x040037E4 RID: 14308
		[FieldOffset(Offset = "0x50")]
		[Token(Token = "0x40037E4")]
		public int hollywoodFlareBlurIterations;

		// Token: 0x040037E5 RID: 14309
		[FieldOffset(Offset = "0x54")]
		[Token(Token = "0x40037E5")]
		public LensflareStyle34 lensflareMode;

		// Token: 0x040037E6 RID: 14310
		[FieldOffset(Offset = "0x58")]
		[Token(Token = "0x40037E6")]
		public float hollyStretchWidth;

		// Token: 0x040037E7 RID: 14311
		[FieldOffset(Offset = "0x5C")]
		[Token(Token = "0x40037E7")]
		public float lensflareIntensity;

		// Token: 0x040037E8 RID: 14312
		[FieldOffset(Offset = "0x60")]
		[Token(Token = "0x40037E8")]
		public float lensflareThreshold;

		// Token: 0x040037E9 RID: 14313
		[FieldOffset(Offset = "0x64")]
		[Token(Token = "0x40037E9")]
		public Color flareColorA;

		// Token: 0x040037EA RID: 14314
		[FieldOffset(Offset = "0x74")]
		[Token(Token = "0x40037EA")]
		public Color flareColorB;

		// Token: 0x040037EB RID: 14315
		[FieldOffset(Offset = "0x84")]
		[Token(Token = "0x40037EB")]
		public Color flareColorC;

		// Token: 0x040037EC RID: 14316
		[FieldOffset(Offset = "0x94")]
		[Token(Token = "0x40037EC")]
		public Color flareColorD;

		// Token: 0x040037ED RID: 14317
		[FieldOffset(Offset = "0xA8")]
		[Token(Token = "0x40037ED")]
		public Texture2D lensFlareVignetteMask;

		// Token: 0x040037EE RID: 14318
		[FieldOffset(Offset = "0xB0")]
		[Token(Token = "0x40037EE")]
		public Shader lensFlareShader;

		// Token: 0x040037EF RID: 14319
		[FieldOffset(Offset = "0xB8")]
		[Token(Token = "0x40037EF")]
		private Material lensFlareMaterial;

		// Token: 0x040037F0 RID: 14320
		[FieldOffset(Offset = "0xC0")]
		[Token(Token = "0x40037F0")]
		public Shader vignetteShader;

		// Token: 0x040037F1 RID: 14321
		[FieldOffset(Offset = "0xC8")]
		[Token(Token = "0x40037F1")]
		private Material vignetteMaterial;

		// Token: 0x040037F2 RID: 14322
		[FieldOffset(Offset = "0xD0")]
		[Token(Token = "0x40037F2")]
		public Shader separableBlurShader;

		// Token: 0x040037F3 RID: 14323
		[FieldOffset(Offset = "0xD8")]
		[Token(Token = "0x40037F3")]
		private Material separableBlurMaterial;

		// Token: 0x040037F4 RID: 14324
		[FieldOffset(Offset = "0xE0")]
		[Token(Token = "0x40037F4")]
		public Shader addBrightStuffOneOneShader;

		// Token: 0x040037F5 RID: 14325
		[FieldOffset(Offset = "0xE8")]
		[Token(Token = "0x40037F5")]
		private Material addBrightStuffBlendOneOneMaterial;

		// Token: 0x040037F6 RID: 14326
		[FieldOffset(Offset = "0xF0")]
		[Token(Token = "0x40037F6")]
		public Shader screenBlendShader;

		// Token: 0x040037F7 RID: 14327
		[FieldOffset(Offset = "0xF8")]
		[Token(Token = "0x40037F7")]
		private Material screenBlend;

		// Token: 0x040037F8 RID: 14328
		[FieldOffset(Offset = "0x100")]
		[Token(Token = "0x40037F8")]
		public Shader hollywoodFlaresShader;

		// Token: 0x040037F9 RID: 14329
		[FieldOffset(Offset = "0x108")]
		[Token(Token = "0x40037F9")]
		private Material hollywoodFlaresMaterial;

		// Token: 0x040037FA RID: 14330
		[FieldOffset(Offset = "0x110")]
		[Token(Token = "0x40037FA")]
		public Shader brightPassFilterShader;

		// Token: 0x040037FB RID: 14331
		[FieldOffset(Offset = "0x118")]
		[Token(Token = "0x40037FB")]
		private Material brightPassFilterMaterial;
	}
}
