using System;
using Cpp2IlInjected;
using UnityEngine;

namespace UnityStandardAssets.ImageEffects
{
	// Token: 0x020005A4 RID: 1444
	[Token(Token = "0x20005A4")]
	[ExecuteInEditMode]
	[RequireComponent(typeof(Camera))]
	[AddComponentMenu("Image Effects/Camera/Camera Motion Blur")]
	public class CameraMotionBlur : PostEffectsBase
	{
		// Token: 0x06002EBE RID: 11966 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002EBE")]
		[Address(RVA = "0xE7DFE0", Offset = "0xE7CDE0", VA = "0x180E7DFE0")]
		private void CalculateViewProjection()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002EBF RID: 11967 RVA: 0x00063C68 File Offset: 0x00061E68
		[Token(Token = "0x6002EBF")]
		[Address(RVA = "0xE809A0", Offset = "0xE7F7A0", VA = "0x180E809A0")]
		private new void Start()
		{
			bool flag = this.CheckResources();
			Camera camera = this._camera;
			int num = 0;
			if (camera == num)
			{
				Camera component = base.GetComponent<Camera>();
				this._camera = component;
			}
			bool activeInHierarchy = base.gameObject.activeInHierarchy;
			this.wasActive = activeInHierarchy;
			Matrix4x4[] array = new Matrix4x4[2];
			this.currentStereoViewProjMat = array;
			Matrix4x4[] array2 = new Matrix4x4[2];
			this.prevStereoViewProjMat = array2;
			this.CalculateViewProjection();
			this.Remember();
			this.wasActive = false;
		}

		// Token: 0x06002EC0 RID: 11968 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002EC0")]
		[Address(RVA = "0xE7E970", Offset = "0xE7D770", VA = "0x180E7E970")]
		private void OnEnable()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002EC1 RID: 11969 RVA: 0x00063CEC File Offset: 0x00061EEC
		[Token(Token = "0x6002EC1")]
		[Address(RVA = "0xE7E7C0", Offset = "0xE7D5C0", VA = "0x180E7E7C0")]
		private void OnDisable()
		{
			Material material = this.motionBlurMaterial;
			if (0 != material)
			{
				UnityEngine.Object.DestroyImmediate(this.motionBlurMaterial);
				this.motionBlurMaterial = (ulong)0L;
			}
			Material material2 = this.dx11MotionBlurMaterial;
			if (0 != material2)
			{
				UnityEngine.Object.DestroyImmediate(this.dx11MotionBlurMaterial);
				this.dx11MotionBlurMaterial = (ulong)0L;
			}
			GameObject gameObject = this.tmpCam;
			if (0 != gameObject)
			{
				UnityEngine.Object.DestroyImmediate(gameObject);
			}
		}

		// Token: 0x06002EC2 RID: 11970 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002EC2")]
		[Address(RVA = "0xE7E2B0", Offset = "0xE7D0B0", VA = "0x180E7E2B0", Slot = "4")]
		public override bool CheckResources()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002EC3 RID: 11971 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002EC3")]
		[Address(RVA = "0xE7EA40", Offset = "0xE7D840", VA = "0x180E7EA40")]
		private void OnRenderImage(RenderTexture source, RenderTexture destination)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002EC4 RID: 11972 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002EC4")]
		[Address(RVA = "0xE80710", Offset = "0xE7F510", VA = "0x180E80710")]
		private void Remember()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002EC5 RID: 11973 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002EC5")]
		[Address(RVA = "0xE7E360", Offset = "0xE7D160", VA = "0x180E7E360")]
		private Camera GetTmpCam()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002EC6 RID: 11974 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002EC6")]
		[Address(RVA = "0xE808F0", Offset = "0xE7F6F0", VA = "0x180E808F0")]
		private void StartFrame()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002EC7 RID: 11975 RVA: 0x00063D5C File Offset: 0x00061F5C
		[Token(Token = "0x6002EC7")]
		[Address(RVA = "0xE80C20", Offset = "0xE7FA20", VA = "0x180E80C20")]
		private static int divRoundUp(int x, int d)
		{
			int num = d - 1;
			return num + x;
		}

		// Token: 0x06002EC8 RID: 11976 RVA: 0x00063D74 File Offset: 0x00061F74
		[Token(Token = "0x6002EC8")]
		[Address(RVA = "0xE80B30", Offset = "0xE7F930", VA = "0x180E80B30")]
		public CameraMotionBlur()
		{
			Vector3 one = Vector3.one;
			int num = 0;
			float z = one.z;
			this.previewScale.z = z;
			this.rotationScale = 1f;
			this.maxVelocity = 8f;
			this.minVelocity = 0.1f;
			this.velocityScale = 0.375f;
			this.softZDistance = 0.005f;
			this.velocityDownsample = (int)((ulong)1L);
			int num2 = num;
			this.excludeLayers = num2;
			this.jitter = 0.05f;
			this.showVelocityScale = 1f;
			float z2 = Vector3.forward.z;
			this.prevFrameForward.z = z2;
			float z3 = Vector3.up.z;
			this.prevFrameUp.z = z3;
			float z4 = Vector3.zero.z;
			this.prevFramePos.z = z4;
			base..ctor();
		}

		// Token: 0x04003817 RID: 14359
		[Token(Token = "0x4003817")]
		private static float MAX_RADIUS;

		// Token: 0x04003818 RID: 14360
		[FieldOffset(Offset = "0x28")]
		[Token(Token = "0x4003818")]
		public CameraMotionBlur.MotionBlurFilter filterType = (CameraMotionBlur.MotionBlurFilter)((ulong)2L);

		// Token: 0x04003819 RID: 14361
		[FieldOffset(Offset = "0x2C")]
		[Token(Token = "0x4003819")]
		public bool preview;

		// Token: 0x0400381A RID: 14362
		[FieldOffset(Offset = "0x30")]
		[Token(Token = "0x400381A")]
		public Vector3 previewScale;

		// Token: 0x0400381B RID: 14363
		[FieldOffset(Offset = "0x3C")]
		[Token(Token = "0x400381B")]
		public float movementScale;

		// Token: 0x0400381C RID: 14364
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x400381C")]
		public float rotationScale;

		// Token: 0x0400381D RID: 14365
		[FieldOffset(Offset = "0x44")]
		[Token(Token = "0x400381D")]
		public float maxVelocity;

		// Token: 0x0400381E RID: 14366
		[FieldOffset(Offset = "0x48")]
		[Token(Token = "0x400381E")]
		public float minVelocity;

		// Token: 0x0400381F RID: 14367
		[FieldOffset(Offset = "0x4C")]
		[Token(Token = "0x400381F")]
		public float velocityScale;

		// Token: 0x04003820 RID: 14368
		[FieldOffset(Offset = "0x50")]
		[Token(Token = "0x4003820")]
		public float softZDistance;

		// Token: 0x04003821 RID: 14369
		[FieldOffset(Offset = "0x54")]
		[Token(Token = "0x4003821")]
		public int velocityDownsample;

		// Token: 0x04003822 RID: 14370
		[FieldOffset(Offset = "0x58")]
		[Token(Token = "0x4003822")]
		public LayerMask excludeLayers;

		// Token: 0x04003823 RID: 14371
		[FieldOffset(Offset = "0x60")]
		[Token(Token = "0x4003823")]
		private GameObject tmpCam;

		// Token: 0x04003824 RID: 14372
		[FieldOffset(Offset = "0x68")]
		[Token(Token = "0x4003824")]
		public Shader shader;

		// Token: 0x04003825 RID: 14373
		[FieldOffset(Offset = "0x70")]
		[Token(Token = "0x4003825")]
		public Shader dx11MotionBlurShader;

		// Token: 0x04003826 RID: 14374
		[FieldOffset(Offset = "0x78")]
		[Token(Token = "0x4003826")]
		public Shader replacementClear;

		// Token: 0x04003827 RID: 14375
		[FieldOffset(Offset = "0x80")]
		[Token(Token = "0x4003827")]
		private Material motionBlurMaterial;

		// Token: 0x04003828 RID: 14376
		[FieldOffset(Offset = "0x88")]
		[Token(Token = "0x4003828")]
		private Material dx11MotionBlurMaterial;

		// Token: 0x04003829 RID: 14377
		[FieldOffset(Offset = "0x90")]
		[Token(Token = "0x4003829")]
		public Texture2D noiseTexture;

		// Token: 0x0400382A RID: 14378
		[FieldOffset(Offset = "0x98")]
		[Token(Token = "0x400382A")]
		public float jitter;

		// Token: 0x0400382B RID: 14379
		[FieldOffset(Offset = "0x9C")]
		[Token(Token = "0x400382B")]
		public bool showVelocity;

		// Token: 0x0400382C RID: 14380
		[FieldOffset(Offset = "0xA0")]
		[Token(Token = "0x400382C")]
		public float showVelocityScale;

		// Token: 0x0400382D RID: 14381
		[FieldOffset(Offset = "0xA4")]
		[Token(Token = "0x400382D")]
		private Matrix4x4 currentViewProjMat;

		// Token: 0x0400382E RID: 14382
		[FieldOffset(Offset = "0xE8")]
		[Token(Token = "0x400382E")]
		private Matrix4x4[] currentStereoViewProjMat;

		// Token: 0x0400382F RID: 14383
		[FieldOffset(Offset = "0xF0")]
		[Token(Token = "0x400382F")]
		private Matrix4x4 prevViewProjMat;

		// Token: 0x04003830 RID: 14384
		[FieldOffset(Offset = "0x130")]
		[Token(Token = "0x4003830")]
		private Matrix4x4[] prevStereoViewProjMat;

		// Token: 0x04003831 RID: 14385
		[FieldOffset(Offset = "0x138")]
		[Token(Token = "0x4003831")]
		private int prevFrameCount;

		// Token: 0x04003832 RID: 14386
		[FieldOffset(Offset = "0x13C")]
		[Token(Token = "0x4003832")]
		private bool wasActive;

		// Token: 0x04003833 RID: 14387
		[FieldOffset(Offset = "0x140")]
		[Token(Token = "0x4003833")]
		private Vector3 prevFrameForward;

		// Token: 0x04003834 RID: 14388
		[FieldOffset(Offset = "0x14C")]
		[Token(Token = "0x4003834")]
		private Vector3 prevFrameUp;

		// Token: 0x04003835 RID: 14389
		[FieldOffset(Offset = "0x158")]
		[Token(Token = "0x4003835")]
		private Vector3 prevFramePos;

		// Token: 0x04003836 RID: 14390
		[FieldOffset(Offset = "0x168")]
		[Token(Token = "0x4003836")]
		private Camera _camera;

		// Token: 0x020005A5 RID: 1445
		[Token(Token = "0x20005A5")]
		public enum MotionBlurFilter
		{
			// Token: 0x04003838 RID: 14392
			[Token(Token = "0x4003838")]
			CameraMotion,
			// Token: 0x04003839 RID: 14393
			[Token(Token = "0x4003839")]
			LocalBlur,
			// Token: 0x0400383A RID: 14394
			[Token(Token = "0x400383A")]
			Reconstruction,
			// Token: 0x0400383B RID: 14395
			[Token(Token = "0x400383B")]
			ReconstructionDX11,
			// Token: 0x0400383C RID: 14396
			[Token(Token = "0x400383C")]
			ReconstructionDisc
		}
	}
}
