using System;
using Cpp2IlInjected;
using UnityEngine;

namespace UnityStandardAssets.ImageEffects
{
	// Token: 0x020005F5 RID: 1525
	[Token(Token = "0x20005F5")]
	[ExecuteInEditMode]
	[AddComponentMenu("Image Effects/Bloom and Glow/BloomAndFlares (3.5, Deprecated)")]
	[RequireComponent(typeof(Camera))]
	public class BloomAndFlares : PostEffectsBase
	{
		// Token: 0x06003170 RID: 12656 RVA: 0x0006AAC0 File Offset: 0x00068CC0
		[Token(Token = "0x6003170")]
		[Address(RVA = "0x7AE380", Offset = "0x7AD380", VA = "0x1807AE380", 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: 0x06003171 RID: 12657 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6003171")]
		[Address(RVA = "0x7AE510", Offset = "0x7AD510", VA = "0x1807AE510")]
		private void OnRenderImage(RenderTexture source, RenderTexture destination)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06003172 RID: 12658 RVA: 0x0006ABE4 File Offset: 0x00068DE4
		[Token(Token = "0x6003172")]
		[Address(RVA = "0x7ADDE0", Offset = "0x7ACDE0", VA = "0x1807ADDE0")]
		private void AddTo(float intensity_, RenderTexture from, RenderTexture to)
		{
			this.addBrightStuffBlendOneOneMaterial.SetFloat("_Intensity", intensity_);
			Material material = this.addBrightStuffBlendOneOneMaterial;
			Graphics.Blit(from, to, material);
		}

		// Token: 0x06003173 RID: 12659 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6003173")]
		[Address(RVA = "0x7ADEA0", Offset = "0x7ACEA0", VA = "0x1807ADEA0")]
		private void BlendFlares(RenderTexture from, RenderTexture to)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06003174 RID: 12660 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6003174")]
		[Address(RVA = "0x7AE210", Offset = "0x7AD210", VA = "0x1807AE210")]
		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: 0x06003175 RID: 12661 RVA: 0x0006AC18 File Offset: 0x00068E18
		[Token(Token = "0x6003175")]
		[Address(RVA = "0x7AF260", Offset = "0x7AE260", VA = "0x1807AF260")]
		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: 0x06003176 RID: 12662 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6003176")]
		[Address(RVA = "0x7AF3E0", Offset = "0x7AE3E0", VA = "0x1807AF3E0")]
		public BloomAndFlares()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x04003AC4 RID: 15044
		[FieldOffset(Offset = "0x28")]
		[Token(Token = "0x4003AC4")]
		public TweakMode34 tweakMode;

		// Token: 0x04003AC5 RID: 15045
		[FieldOffset(Offset = "0x2C")]
		[Token(Token = "0x4003AC5")]
		public BloomScreenBlendMode screenBlendMode;

		// Token: 0x04003AC6 RID: 15046
		[FieldOffset(Offset = "0x30")]
		[Token(Token = "0x4003AC6")]
		public HDRBloomMode hdr;

		// Token: 0x04003AC7 RID: 15047
		[FieldOffset(Offset = "0x34")]
		[Token(Token = "0x4003AC7")]
		private bool doHdr;

		// Token: 0x04003AC8 RID: 15048
		[FieldOffset(Offset = "0x38")]
		[Token(Token = "0x4003AC8")]
		public float sepBlurSpread;

		// Token: 0x04003AC9 RID: 15049
		[FieldOffset(Offset = "0x3C")]
		[Token(Token = "0x4003AC9")]
		public float useSrcAlphaAsMask;

		// Token: 0x04003ACA RID: 15050
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x4003ACA")]
		public float bloomIntensity;

		// Token: 0x04003ACB RID: 15051
		[FieldOffset(Offset = "0x44")]
		[Token(Token = "0x4003ACB")]
		public float bloomThreshold;

		// Token: 0x04003ACC RID: 15052
		[FieldOffset(Offset = "0x48")]
		[Token(Token = "0x4003ACC")]
		public int bloomBlurIterations;

		// Token: 0x04003ACD RID: 15053
		[FieldOffset(Offset = "0x4C")]
		[Token(Token = "0x4003ACD")]
		public bool lensflares;

		// Token: 0x04003ACE RID: 15054
		[FieldOffset(Offset = "0x50")]
		[Token(Token = "0x4003ACE")]
		public int hollywoodFlareBlurIterations;

		// Token: 0x04003ACF RID: 15055
		[FieldOffset(Offset = "0x54")]
		[Token(Token = "0x4003ACF")]
		public LensflareStyle34 lensflareMode;

		// Token: 0x04003AD0 RID: 15056
		[FieldOffset(Offset = "0x58")]
		[Token(Token = "0x4003AD0")]
		public float hollyStretchWidth;

		// Token: 0x04003AD1 RID: 15057
		[FieldOffset(Offset = "0x5C")]
		[Token(Token = "0x4003AD1")]
		public float lensflareIntensity;

		// Token: 0x04003AD2 RID: 15058
		[FieldOffset(Offset = "0x60")]
		[Token(Token = "0x4003AD2")]
		public float lensflareThreshold;

		// Token: 0x04003AD3 RID: 15059
		[FieldOffset(Offset = "0x64")]
		[Token(Token = "0x4003AD3")]
		public Color flareColorA;

		// Token: 0x04003AD4 RID: 15060
		[FieldOffset(Offset = "0x74")]
		[Token(Token = "0x4003AD4")]
		public Color flareColorB;

		// Token: 0x04003AD5 RID: 15061
		[FieldOffset(Offset = "0x84")]
		[Token(Token = "0x4003AD5")]
		public Color flareColorC;

		// Token: 0x04003AD6 RID: 15062
		[FieldOffset(Offset = "0x94")]
		[Token(Token = "0x4003AD6")]
		public Color flareColorD;

		// Token: 0x04003AD7 RID: 15063
		[FieldOffset(Offset = "0xA8")]
		[Token(Token = "0x4003AD7")]
		public Texture2D lensFlareVignetteMask;

		// Token: 0x04003AD8 RID: 15064
		[FieldOffset(Offset = "0xB0")]
		[Token(Token = "0x4003AD8")]
		public Shader lensFlareShader;

		// Token: 0x04003AD9 RID: 15065
		[FieldOffset(Offset = "0xB8")]
		[Token(Token = "0x4003AD9")]
		private Material lensFlareMaterial;

		// Token: 0x04003ADA RID: 15066
		[FieldOffset(Offset = "0xC0")]
		[Token(Token = "0x4003ADA")]
		public Shader vignetteShader;

		// Token: 0x04003ADB RID: 15067
		[FieldOffset(Offset = "0xC8")]
		[Token(Token = "0x4003ADB")]
		private Material vignetteMaterial;

		// Token: 0x04003ADC RID: 15068
		[FieldOffset(Offset = "0xD0")]
		[Token(Token = "0x4003ADC")]
		public Shader separableBlurShader;

		// Token: 0x04003ADD RID: 15069
		[FieldOffset(Offset = "0xD8")]
		[Token(Token = "0x4003ADD")]
		private Material separableBlurMaterial;

		// Token: 0x04003ADE RID: 15070
		[FieldOffset(Offset = "0xE0")]
		[Token(Token = "0x4003ADE")]
		public Shader addBrightStuffOneOneShader;

		// Token: 0x04003ADF RID: 15071
		[FieldOffset(Offset = "0xE8")]
		[Token(Token = "0x4003ADF")]
		private Material addBrightStuffBlendOneOneMaterial;

		// Token: 0x04003AE0 RID: 15072
		[FieldOffset(Offset = "0xF0")]
		[Token(Token = "0x4003AE0")]
		public Shader screenBlendShader;

		// Token: 0x04003AE1 RID: 15073
		[FieldOffset(Offset = "0xF8")]
		[Token(Token = "0x4003AE1")]
		private Material screenBlend;

		// Token: 0x04003AE2 RID: 15074
		[FieldOffset(Offset = "0x100")]
		[Token(Token = "0x4003AE2")]
		public Shader hollywoodFlaresShader;

		// Token: 0x04003AE3 RID: 15075
		[FieldOffset(Offset = "0x108")]
		[Token(Token = "0x4003AE3")]
		private Material hollywoodFlaresMaterial;

		// Token: 0x04003AE4 RID: 15076
		[FieldOffset(Offset = "0x110")]
		[Token(Token = "0x4003AE4")]
		public Shader brightPassFilterShader;

		// Token: 0x04003AE5 RID: 15077
		[FieldOffset(Offset = "0x118")]
		[Token(Token = "0x4003AE5")]
		private Material brightPassFilterMaterial;
	}
}
