using System;
using Cpp2IlInjected;
using UnityEngine;

namespace UnityStandardAssets.ImageEffects
{
	// Token: 0x02000610 RID: 1552
	[Token(Token = "0x2000610")]
	[ExecuteInEditMode]
	[AddComponentMenu("Image Effects/Rendering/Global Fog")]
	[RequireComponent(typeof(Camera))]
	internal class GlobalFog : PostEffectsBase
	{
		// Token: 0x060031D7 RID: 12759 RVA: 0x0006B9E8 File Offset: 0x00069BE8
		[Token(Token = "0x60031D7")]
		[Address(RVA = "0x1641710", Offset = "0x1640710", VA = "0x181641710", 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: 0x060031D8 RID: 12760 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60031D8")]
		[Address(RVA = "0x1641770", Offset = "0x1640770", VA = "0x181641770")]
		[ImageEffectOpaque]
		private void OnRenderImage(RenderTexture source, RenderTexture destination)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060031D9 RID: 12761 RVA: 0x0006BA30 File Offset: 0x00069C30
		[Token(Token = "0x60031D9")]
		[Address(RVA = "0x1641F90", Offset = "0x1640F90", VA = "0x181641F90")]
		public GlobalFog()
		{
		}

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

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

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

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

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

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

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

		// Token: 0x04003BDA RID: 15322
		[FieldOffset(Offset = "0x38")]
		[Token(Token = "0x4003BDA")]
		public Shader fogShader;

		// Token: 0x04003BDB RID: 15323
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x4003BDB")]
		private Material fogMaterial;
	}
}
