using System;
using Cpp2IlInjected;
using UnityEngine;

namespace UnityStandardAssets.ImageEffects
{
	// Token: 0x020005C5 RID: 1477
	[Token(Token = "0x20005C5")]
	[ExecuteInEditMode]
	[RequireComponent(typeof(Camera))]
	[AddComponentMenu("Image Effects/Rendering/Screen Space Ambient Occlusion")]
	public class ScreenSpaceAmbientOcclusion : MonoBehaviour
	{
		// Token: 0x06002F4C RID: 12108 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002F4C")]
		[Address(RVA = "0x43AF20", Offset = "0x439D20", VA = "0x18043AF20")]
		private static Material CreateMaterial(Shader shader)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002F4D RID: 12109 RVA: 0x00064DEC File Offset: 0x00062FEC
		[Token(Token = "0x6002F4D")]
		[Address(RVA = "0x43B140", Offset = "0x439F40", VA = "0x18043B140")]
		private static void DestroyMaterial(Material mat)
		{
			if (mat)
			{
				UnityEngine.Object.DestroyImmediate(mat);
				return;
			}
		}

		// Token: 0x06002F4E RID: 12110 RVA: 0x00064E0C File Offset: 0x0006300C
		[Token(Token = "0x6002F4E")]
		[Address(RVA = "0x43B1D0", Offset = "0x439FD0", VA = "0x18043B1D0")]
		private void OnDisable()
		{
			Material ssaomaterial = this.m_SSAOMaterial;
			if (ssaomaterial)
			{
				UnityEngine.Object.DestroyImmediate(ssaomaterial);
				return;
			}
		}

		// Token: 0x06002F4F RID: 12111 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002F4F")]
		[Address(RVA = "0x43BA70", Offset = "0x43A870", VA = "0x18043BA70")]
		private void Start()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002F50 RID: 12112 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002F50")]
		[Address(RVA = "0x43B260", Offset = "0x43A060", VA = "0x18043B260")]
		private void OnEnable()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002F51 RID: 12113 RVA: 0x00064E30 File Offset: 0x00063030
		[Token(Token = "0x6002F51")]
		[Address(RVA = "0x43AFD0", Offset = "0x439DD0", VA = "0x18043AFD0")]
		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: 0x06002F52 RID: 12114 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002F52")]
		[Address(RVA = "0x43B2D0", Offset = "0x43A0D0", VA = "0x18043B2D0")]
		[ImageEffectOpaque]
		private void OnRenderImage(RenderTexture source, RenderTexture destination)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002F53 RID: 12115 RVA: 0x00064EA0 File Offset: 0x000630A0
		[Token(Token = "0x6002F53")]
		[Address(RVA = "0x43BB30", Offset = "0x43A930", VA = "0x18043BB30")]
		public ScreenSpaceAmbientOcclusion()
		{
		}

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

		// Token: 0x04003937 RID: 14647
		[FieldOffset(Offset = "0x1C")]
		[Token(Token = "0x4003937")]
		public ScreenSpaceAmbientOcclusion.SSAOSamples m_SampleCount = (ScreenSpaceAmbientOcclusion.SSAOSamples)((ulong)1L);

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

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

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

		// Token: 0x0400393B RID: 14651
		[FieldOffset(Offset = "0x2C")]
		[Token(Token = "0x400393B")]
		[Attribute(Name = "RangeAttribute", RVA = "0xE0890", Offset = "0xDFC90")]
		public float m_OcclusionAttenuation = 1f;

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

		// Token: 0x0400393D RID: 14653
		[FieldOffset(Offset = "0x38")]
		[Token(Token = "0x400393D")]
		public Shader m_SSAOShader;

		// Token: 0x0400393E RID: 14654
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x400393E")]
		private Material m_SSAOMaterial;

		// Token: 0x0400393F RID: 14655
		[FieldOffset(Offset = "0x48")]
		[Token(Token = "0x400393F")]
		public Texture2D m_RandomTexture;

		// Token: 0x04003940 RID: 14656
		[FieldOffset(Offset = "0x50")]
		[Token(Token = "0x4003940")]
		private bool m_Supported;

		// Token: 0x020005C6 RID: 1478
		[Token(Token = "0x20005C6")]
		public enum SSAOSamples
		{
			// Token: 0x04003942 RID: 14658
			[Token(Token = "0x4003942")]
			Low,
			// Token: 0x04003943 RID: 14659
			[Token(Token = "0x4003943")]
			Medium,
			// Token: 0x04003944 RID: 14660
			[Token(Token = "0x4003944")]
			High
		}
	}
}
