using System;
using Cpp2IlInjected;
using UnityEngine;

namespace UnityStandardAssets.ImageEffects
{
	// Token: 0x020005B8 RID: 1464
	[Token(Token = "0x20005B8")]
	[ExecuteInEditMode]
	[AddComponentMenu("Image Effects/Rendering/Global Fog")]
	[RequireComponent(typeof(Camera))]
	internal class GlobalFog : PostEffectsBase
	{
		// Token: 0x06002F0E RID: 12046 RVA: 0x0006472C File Offset: 0x0006292C
		[Token(Token = "0x6002F0E")]
		[Address(RVA = "0x11720D0", Offset = "0x1170ED0", VA = "0x1811720D0", Slot = "4")]
		public override bool CheckResources()
		{
			bool flag = base.CheckSupport(true);
			Material material = this.fogMaterial;
			Shader shader = this.fogShader;
			Material material2 = base.CheckShaderAndCreateMaterial(shader, material);
			this.fogMaterial = material2;
			bool isSupported = this.isSupported;
			if (!isSupported)
			{
				base.ReportAutoDisable();
			}
			return isSupported;
		}

		// Token: 0x06002F0F RID: 12047 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002F0F")]
		[Address(RVA = "0x1172130", Offset = "0x1170F30", VA = "0x181172130")]
		[ImageEffectOpaque]
		private void OnRenderImage(RenderTexture source, RenderTexture destination)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002F10 RID: 12048 RVA: 0x00064774 File Offset: 0x00062974
		[Token(Token = "0x6002F10")]
		[Address(RVA = "0x1172950", Offset = "0x1171750", VA = "0x181172950")]
		public GlobalFog()
		{
		}

		// Token: 0x040038E9 RID: 14569
		[FieldOffset(Offset = "0x28")]
		[Token(Token = "0x40038E9")]
		[Tooltip("Apply distance-based fog?")]
		public bool distanceFog = true;

		// Token: 0x040038EA RID: 14570
		[FieldOffset(Offset = "0x29")]
		[Token(Token = "0x40038EA")]
		[Tooltip("Exclude far plane pixels from distance-based fog? (Skybox or clear color)")]
		public bool excludeFarPixels;

		// Token: 0x040038EB RID: 14571
		[FieldOffset(Offset = "0x2A")]
		[Token(Token = "0x40038EB")]
		[Tooltip("Distance fog is based on radial distance from camera when checked")]
		public bool useRadialDistance;

		// Token: 0x040038EC RID: 14572
		[FieldOffset(Offset = "0x2B")]
		[Token(Token = "0x40038EC")]
		[Tooltip("Apply height-based fog?")]
		public bool heightFog = true;

		// Token: 0x040038ED RID: 14573
		[FieldOffset(Offset = "0x2C")]
		[Token(Token = "0x40038ED")]
		[Tooltip("Fog top Y coordinate")]
		public float height = 1f;

		// Token: 0x040038EE RID: 14574
		[FieldOffset(Offset = "0x30")]
		[Token(Token = "0x40038EE")]
		[Range(0.001f, 10f)]
		public float heightDensity = 2f;

		// Token: 0x040038EF RID: 14575
		[FieldOffset(Offset = "0x34")]
		[Token(Token = "0x40038EF")]
		[Tooltip("Push fog away from the camera by this amount")]
		public float startDistance;

		// Token: 0x040038F0 RID: 14576
		[FieldOffset(Offset = "0x38")]
		[Token(Token = "0x40038F0")]
		public Shader fogShader;

		// Token: 0x040038F1 RID: 14577
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x40038F1")]
		private Material fogMaterial;
	}
}
