using System;
using Cpp2IlInjected;
using UnityEngine;

namespace UnityStandardAssets.ImageEffects
{
	// Token: 0x0200061D RID: 1565
	[Token(Token = "0x200061D")]
	[ExecuteInEditMode]
	[RequireComponent(typeof(Camera))]
	[AddComponentMenu("Image Effects/Rendering/Screen Space Ambient Occlusion")]
	public class ScreenSpaceAmbientOcclusion : MonoBehaviour
	{
		// Token: 0x06003215 RID: 12821 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6003215")]
		[Address(RVA = "0x515410", Offset = "0x514410", VA = "0x180515410")]
		private static Material CreateMaterial(Shader shader)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06003216 RID: 12822 RVA: 0x0006C0BC File Offset: 0x0006A2BC
		[Token(Token = "0x6003216")]
		[Address(RVA = "0x515630", Offset = "0x514630", VA = "0x180515630")]
		private static void DestroyMaterial(Material mat)
		{
			if (mat)
			{
				UnityEngine.Object.DestroyImmediate(mat);
				return;
			}
		}

		// Token: 0x06003217 RID: 12823 RVA: 0x0006C0DC File Offset: 0x0006A2DC
		[Token(Token = "0x6003217")]
		[Address(RVA = "0x5156C0", Offset = "0x5146C0", VA = "0x1805156C0")]
		private void OnDisable()
		{
			Material ssaomaterial = this.m_SSAOMaterial;
			if (ssaomaterial)
			{
				UnityEngine.Object.DestroyImmediate(ssaomaterial);
				return;
			}
		}

		// Token: 0x06003218 RID: 12824 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6003218")]
		[Address(RVA = "0x515F60", Offset = "0x514F60", VA = "0x180515F60")]
		private void Start()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06003219 RID: 12825 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6003219")]
		[Address(RVA = "0x515750", Offset = "0x514750", VA = "0x180515750")]
		private void OnEnable()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x0600321A RID: 12826 RVA: 0x0006C100 File Offset: 0x0006A300
		[Token(Token = "0x600321A")]
		[Address(RVA = "0x5154C0", Offset = "0x5144C0", VA = "0x1805154C0")]
		private void CreateMaterials()
		{
			if (!this.m_SSAOMaterial && this.m_SSAOShader.isSupported)
			{
				Shader ssaoshader = this.m_SSAOShader;
				if (ssaoshader)
				{
					new Material(ssaoshader).hideFlags = HideFlags.HideAndDontSave;
				}
				int num = 0;
				this.m_SSAOMaterial = num;
				Material ssaomaterial = this.m_SSAOMaterial;
				Texture2D randomTexture = this.m_RandomTexture;
				ssaomaterial.SetTexture("_RandomTexture", randomTexture);
			}
		}

		// Token: 0x0600321B RID: 12827 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x600321B")]
		[Address(RVA = "0x5157C0", Offset = "0x5147C0", VA = "0x1805157C0")]
		[ImageEffectOpaque]
		private void OnRenderImage(RenderTexture source, RenderTexture destination)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x0600321C RID: 12828 RVA: 0x0006C170 File Offset: 0x0006A370
		[Token(Token = "0x600321C")]
		[Address(RVA = "0x516020", Offset = "0x515020", VA = "0x180516020")]
		public ScreenSpaceAmbientOcclusion()
		{
		}

		// Token: 0x04003C20 RID: 15392
		[FieldOffset(Offset = "0x18")]
		[Token(Token = "0x4003C20")]
		[Range(0.05f, 1f)]
		public float m_Radius = 0.4f;

		// Token: 0x04003C21 RID: 15393
		[FieldOffset(Offset = "0x1C")]
		[Token(Token = "0x4003C21")]
		public ScreenSpaceAmbientOcclusion.SSAOSamples m_SampleCount = (ScreenSpaceAmbientOcclusion.SSAOSamples)((ulong)1L);

		// Token: 0x04003C22 RID: 15394
		[FieldOffset(Offset = "0x20")]
		[Token(Token = "0x4003C22")]
		[Range(0.5f, 4f)]
		public float m_OcclusionIntensity = 1.5f;

		// Token: 0x04003C23 RID: 15395
		[FieldOffset(Offset = "0x24")]
		[Token(Token = "0x4003C23")]
		[Range(0f, 4f)]
		public int m_Blur = (int)((ulong)2L);

		// Token: 0x04003C24 RID: 15396
		[FieldOffset(Offset = "0x28")]
		[Token(Token = "0x4003C24")]
		[Range(1f, 6f)]
		public int m_Downsampling = (int)((ulong)2L);

		// Token: 0x04003C25 RID: 15397
		[FieldOffset(Offset = "0x2C")]
		[Token(Token = "0x4003C25")]
		[Attribute(Name = "RangeAttribute", RVA = "0x267170", Offset = "0x266570")]
		public float m_OcclusionAttenuation = 1f;

		// Token: 0x04003C26 RID: 15398
		[FieldOffset(Offset = "0x30")]
		[Token(Token = "0x4003C26")]
		[Range(1E-05f, 0.5f)]
		public float m_MinZ = 0.01f;

		// Token: 0x04003C27 RID: 15399
		[FieldOffset(Offset = "0x38")]
		[Token(Token = "0x4003C27")]
		public Shader m_SSAOShader;

		// Token: 0x04003C28 RID: 15400
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x4003C28")]
		private Material m_SSAOMaterial;

		// Token: 0x04003C29 RID: 15401
		[FieldOffset(Offset = "0x48")]
		[Token(Token = "0x4003C29")]
		public Texture2D m_RandomTexture;

		// Token: 0x04003C2A RID: 15402
		[FieldOffset(Offset = "0x50")]
		[Token(Token = "0x4003C2A")]
		private bool m_Supported;

		// Token: 0x0200061E RID: 1566
		[Token(Token = "0x200061E")]
		public enum SSAOSamples
		{
			// Token: 0x04003C2C RID: 15404
			[Token(Token = "0x4003C2C")]
			Low,
			// Token: 0x04003C2D RID: 15405
			[Token(Token = "0x4003C2D")]
			Medium,
			// Token: 0x04003C2E RID: 15406
			[Token(Token = "0x4003C2E")]
			High
		}
	}
}
